| 1 |
netfilter_summary.stp - System-Wide Count of Network Packets by IPs |
| 2 |
|
| 3 |
The script watches all IPv4 network traffic on the system. On exit |
| 4 |
the script prints a list showing the number of packets sent along |
| 5 |
source IP address / destination IP address pair encountered, and the |
| 6 |
total number of bytes sent among the pair. The list is ordered from |
| 7 |
greatest to least number of packets seen among the source/destination |
| 8 |
pairs. |
| 9 |
|
| 10 |
$ stap netfilter_summary.stp -T 10 |
| 11 |
|
| 12 |
Collecting data... Type Ctrl-C to exit and display results. |
| 13 |
205.251.249.28 --> 10.15.16.105 : 122 packets, 259403 total bytes |
| 14 |
54.218.38.124 --> 10.15.16.105 : 6 packets, 3694 total bytes |
| 15 |
10.15.16.136 --> 10.15.16.255 : 3 packets, 108 total bytes |
| 16 |
10.11.5.19 --> 10.15.16.105 : 3 packets, 408 total bytes |
| 17 |
173.194.121.14 --> 10.15.16.105 : 2 packets, 104 total bytes |
| 18 |
10.15.16.206 --> 255.255.255.255 : 2 packets, 280 total bytes |
| 19 |
194.68.29.18 --> 10.15.16.105 : 2 packets, 242 total bytes |
| 20 |
10.15.16.138 --> 255.255.255.255 : 2 packets, 280 total bytes |
| 21 |
205.251.242.58 --> 10.15.16.105 : 1 packets, 40 total bytes |
| 22 |
50.58.123.35 --> 10.15.16.105 : 1 packets, 52 total bytes |
| 23 |
10.15.16.114 --> 10.15.16.255 : 1 packets, 228 total bytes |
| 24 |
10.15.16.114 --> 255.255.255.255 : 1 packets, 228 total bytes |
| 25 |
54.230.195.233 --> 10.15.16.105 : 1 packets, 52 total bytes |
| 26 |
54.230.192.90 --> 10.15.16.105 : 1 packets, 52 total bytes |
| 27 |
|
| 28 |
The output above was from when the system was doing nothing interesting. |
| 29 |
|
| 30 |
Rerunning the script opening numerous tabs to google.com. |
| 31 |
|
| 32 |
$ stap netfilter_summary.stp -T 10 |
| 33 |
|
| 34 |
Collecting data... Type Ctrl-C to exit and display results. |
| 35 |
173.194.37.87 --> 10.15.16.105 : 547 packets, 700864 total bytes |
| 36 |
173.194.121.15 --> 10.15.16.105 : 214 packets, 240447 total bytes |
| 37 |
173.194.37.79 --> 10.15.16.105 : 213 packets, 222228 total bytes |
| 38 |
173.194.121.3 --> 10.15.16.105 : 136 packets, 162753 total bytes |
| 39 |
205.251.249.28 --> 10.15.16.105 : 115 packets, 215980 total bytes |
| 40 |
10.11.5.19 --> 10.15.16.105 : 71 packets, 8894 total bytes |
| 41 |
173.194.121.9 --> 10.15.16.105 : 66 packets, 58162 total bytes |
| 42 |
173.194.37.81 --> 10.15.16.105 : 52 packets, 11046 total bytes |
| 43 |
54.213.74.85 --> 10.15.16.105 : 4 packets, 908 total bytes |
| 44 |
127.0.0.1 --> 127.0.0.1 : 2 packets, 104 total bytes |
| 45 |
10.10.161.32 --> 10.15.16.105 : 1 packets, 122 total bytes |
| 46 |
173.252.100.27 --> 10.15.16.105 : 1 packets, 93 total bytes |
| 47 |
64.32.24.176 --> 10.15.16.105 : 1 packets, 149 total bytes |
| 48 |
10.15.16.136 --> 10.15.16.255 : 1 packets, 36 total bytes |
| 49 |
198.58.96.245 --> 10.15.16.105 : 1 packets, 112 total bytes |
| 50 |
|
| 51 |
Heavily used connections will rise to the top of the list. |
| 52 |
|
| 53 |
The script's output gives a basic understanding of where packets are |
| 54 |
being sent to and received from. Other scripts can be used to supplement |
| 55 |
the gathered information. |