aboutsummaryrefslogtreecommitdiffstats
path: root/src/fnettrace
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2023-07-23 10:30:50 -0400
committerLibravatar netblue30 <netblue30@protonmail.com>2023-07-23 10:30:50 -0400
commitb093b66047241896330e09ef7faa981a77cf9e1c (patch)
tree7ef4981c748ac07eb7dbfeff107ee62378ba076e /src/fnettrace
parentcontrib/syntax: run make syntax (diff)
downloadfirejail-b093b66047241896330e09ef7faa981a77cf9e1c.tar.gz
firejail-b093b66047241896330e09ef7faa981a77cf9e1c.tar.zst
firejail-b093b66047241896330e09ef7faa981a77cf9e1c.zip
fnettrace: trace ICPM ECHO (ping) traffic
Diffstat (limited to 'src/fnettrace')
-rw-r--r--src/fnettrace/main.c19
-rw-r--r--src/fnettrace/static-ip-map.txt68
2 files changed, 66 insertions, 21 deletions
diff --git a/src/fnettrace/main.c b/src/fnettrace/main.c
index 932afff61..c996adb19 100644
--- a/src/fnettrace/main.c
+++ b/src/fnettrace/main.c
@@ -30,7 +30,7 @@ static int arg_tail = 0;
30static char *arg_log = NULL; 30static char *arg_log = NULL;
31 31
32uint32_t stats_pkts = 0; 32uint32_t stats_pkts = 0;
33uint32_t stats_icmp = 0; 33uint32_t stats_icmp_echo = 0;
34uint32_t stats_dns = 0; 34uint32_t stats_dns = 0;
35 35
36 36
@@ -291,7 +291,7 @@ static inline const char *common_port(uint16_t port) {
291 } 291 }
292 292
293 if (port <= 194) { 293 if (port <= 194) {
294 PortType *ptr =&ports[0]; 294 PortType *ptr = &ports[0];
295 while(ptr->service != NULL) { 295 while(ptr->service != NULL) {
296 if (ptr->port == port) 296 if (ptr->port == port)
297 return ptr->service; 297 return ptr->service;
@@ -440,10 +440,9 @@ static void hnode_print(unsigned bw) {
440 440
441 441
442void print_stats(void) { 442void print_stats(void) {
443 printf("\nIP table: %d entries, %d unknown\n", radix_nodes, geoip_calls); 443 printf("\nIP table: %d entries - address network (packets)\n", radix_nodes);
444 printf(" address network (packets)\n");
445 radix_print(1); 444 radix_print(1);
446 printf("Packets: %u total, ICMP %u, DNS %u\n", stats_pkts, stats_icmp, stats_dns); 445 printf("Packets: %u total, PING %u, DNS %u\n", stats_pkts, stats_icmp_echo, stats_dns);
447} 446}
448 447
449// trace rx traffic coming in 448// trace rx traffic coming in
@@ -557,9 +556,11 @@ static void run_trace(void) {
557 556
558 // stats 557 // stats
559 stats_pkts++; 558 stats_pkts++;
560 if (icmp) 559 if (icmp) {
561 stats_icmp++; 560 if (*(buf + hlen) == 0 || *(buf + hlen) == 8)
562 if (port_src == 53) 561 stats_icmp_echo++;
562 }
563 else if (port_src == 53)
563 stats_dns++; 564 stats_dns++;
564 565
565 } 566 }
@@ -775,7 +776,7 @@ int main(int argc, char **argv) {
775 return 0; 776 return 0;
776 } 777 }
777 else if (strncmp(argv[i], "--squash-map=", 13) == 0) { 778 else if (strncmp(argv[i], "--squash-map=", 13) == 0) {
778 if (i !=(argc - 1)) { 779 if (i != (argc - 1)) {
779 fprintf(stderr, "Error: please provide a map file\n"); 780 fprintf(stderr, "Error: please provide a map file\n");
780 return 1; 781 return 1;
781 } 782 }
diff --git a/src/fnettrace/static-ip-map.txt b/src/fnettrace/static-ip-map.txt
index 756658562..1f799fd2c 100644
--- a/src/fnettrace/static-ip-map.txt
+++ b/src/fnettrace/static-ip-map.txt
@@ -86,15 +86,41 @@
864.2.2.4/32 Level3 DNS 864.2.2.4/32 Level3 DNS
878.8.4.0/24 Google DNS 878.8.4.0/24 Google DNS
888.8.8.0/24 Google DNS 888.8.8.0/24 Google DNS
898.20.247.20 Comodo DNS
908.26.56.26 Comodo DNS
899.9.9.0/24 Quad9 DNS 919.9.9.0/24 Quad9 DNS
9045.90.28.0/22 NextDNS 9245.90.28.0/22 NextDNS
9345.11.45.0/24 DNS-SB
9464.6.64.6/32 Neustar DNS
9564.6.65.6/32 Neustar DNS
9669.197.138.24/29 BitChute
9774.82.42.42/32 Hurricane Electric DNS
9876.76.2.0/24 ControlD DNS
9976.76.10.0/24 ControlD DNS
10076.76.19.0/24 Alternate DNS
10176.223.122.150/32 Alternate DNS
10277.88.8.8/32 Yandex DNS
10377.88.8.1/32 Yandex DNS
10480.80.80.0/24 Freenom DNS Cloud
10580.80.81.0/24 Freenom DNS Cloud
10684.200.69.80/32 DSN Watch
10784.200.70.40/32 DNS Watch
9194.140.14.0/23 Adguard DNS 10894.140.14.0/23 Adguard DNS
92149.112.112.0/24 Quad9 DNS 109149.112.112.0/24 Quad9 DNS
93149.112.120.0/21 CIRA DNS Canada 110149.112.120.0/21 CIRA DNS Canada
94146.255.56.96/29 Applied Privacy 111146.255.56.96/29 Applied Privacy
95176.103.128.0/19 Adguard DNS 112176.103.128.0/19 Adguard DNS
113185.222.222.0/24 DNS-SB
96185.228.168.0/24 Cleanbrowsing DNS 114185.228.168.0/24 Cleanbrowsing DNS
115185.236.104.0/24 FlashStart DNS
116185.236.105.0/24 FlashStart DNS
117185.253.5.0/24 NextDNS
118193.110.81.0/24 NextDNS
119205.171.3.66/32 CentyrLink DNS
120205.171.202.166/32 CentyrLink DNS
97208.67.216.0/21 OpenDNS 121208.67.216.0/21 OpenDNS
122216.146.35.35/32 Dyn DNS
123216.146.36.36/32 Dyn DNS
98 124
99# whois 125# whois
100192.0.32.0/20 ICANN 126192.0.32.0/20 ICANN
@@ -106,6 +132,7 @@
106199.212.0.0/24 whois.arin.net US 132199.212.0.0/24 whois.arin.net US
107200.3.12.0/22 whois.lacnic.net Uruguay 133200.3.12.0/22 whois.lacnic.net Uruguay
108201.159.220.0/22 whois.lacnic.net Ecuador 134201.159.220.0/22 whois.lacnic.net Ecuador
135203.119.100.0/22 apnic.net Australia
109 136
110# some popular websites 137# some popular websites
1115.255.255.0/24 Yandex 1385.255.255.0/24 Yandex
@@ -132,9 +159,14 @@
13266.211.168.0/22 PayPal 15966.211.168.0/22 PayPal
13366.211.172.0/22 eBay 16066.211.172.0/22 eBay
13466.211.176.0/20 eBay 16166.211.176.0/20 eBay
16266.218.64.0/19 Yahoo
13566.220.144.0/20 Facebook 16366.220.144.0/20 Facebook
16469.30.200.200/29 BitChute
13669.53.224.0/19 Netflix 16569.53.224.0/19 Netflix
13769.171.224.0/19 Facebook 16669.171.224.0/19 Facebook
16769.197.182.184/29 BitChute
16874.6.0.0/16 Yahoo
16974.91.29.208/29 BitChute
13887.250.254.0/24 Yandex 17087.250.254.0/24 Yandex
13991.105.192.0/23 Telegram 17191.105.192.0/23 Telegram
14091.108.4.0/22 Telegram 17291.108.4.0/22 Telegram
@@ -147,14 +179,20 @@
14791.189.94.0/24 Ubuntu One 17991.189.94.0/24 Ubuntu One
14895.161.64.0/20 Telegram 18095.161.64.0/20 Telegram
14999.181.64.0/18 Twitch 18199.181.64.0/18 Twitch
150103.53.48.0/23 Twitch
151104.244.40.0/21 Twitter
152103.10.124.0/23 Steam 182103.10.124.0/23 Steam
153103.28.54.0/24 Steam 183103.28.54.0/24 Steam
184103.53.48.0/23 Twitch
185104.244.40.0/21 Twitter
186107.150.32.0/19 BitChute
187107.150.35.192/29 BitChute
188107.150.45.120/29 BitChute
154108.160.160.0/20 Dropbox 189108.160.160.0/20 Dropbox
155108.175.32.0/20 Netflix 190108.175.32.0/20 Netflix
156129.134.0.0/16 Facebook 191129.134.0.0/16 Facebook
157140.82.112.0/20 GitHub 192140.82.112.0/20 GitHub
193142.54.180.104/29 BitChute
194142.54.181.184/29 BitChute
195142.54.189.192/29 BitChute
158143.55.64.0/20 Github 196143.55.64.0/20 Github
159146.66.152.0/24 Steam 197146.66.152.0/24 Steam
160146.66.155.0/24 Steam 198146.66.155.0/24 Steam
@@ -174,6 +212,9 @@
174162.213.32.0/22 Ubuntu One 212162.213.32.0/22 Ubuntu One
175162.254.192.0/21 Steam 213162.254.192.0/21 Steam
176172.98.56.0/22 Rumble 214172.98.56.0/22 Rumble
215173.208.154.8/29 BitChute
216173.208.185.200/29 BitChute
217173.208.219.112/29 BitChute
177178.154.131.0/24 Yandex 218178.154.131.0/24 Yandex
178185.2.220.0/22 Netflix 219185.2.220.0/22 Netflix
179185.9.188.0/22 Netflix 220185.9.188.0/22 Netflix
@@ -195,22 +236,30 @@
195192.69.96.0/22 Steam 236192.69.96.0/22 Steam
196192.108.239.0/24 Twitch 237192.108.239.0/24 Twitch
197192.173.64.0/18 Netflix 238192.173.64.0/18 Netflix
239192.187.97.88/29 BitChute
240192.187.123.112/29 BitChute
198192.189.200.0/23 Dropbox 241192.189.200.0/23 Dropbox
199194.169.254.0/24 Ubuntu One 242194.169.254.0/24 Ubuntu One
200198.38.96.0/19 Netflix 243198.38.96.0/19 Netflix
201198.45.48.0/20 Netflix 244198.45.48.0/20 Netflix
245198.204.226.120/29 BitChute
246198.204.245.88/29 BitChute
247198.252.206.0/24 Stack Exchange
202199.9.248.0/21 Twitch 248199.9.248.0/21 Twitch
203199.16.156.0/22 Twitter 249199.16.156.0/22 Twitter
204199.59.148.0/22 Twitter 250199.59.148.0/22 Twitter
205199.168.96.24/29 BitChute 251199.168.96.24/29 BitChute
252204.12.194.176/29 BitChute
206205.185.194.0/24 Steam 253205.185.194.0/24 Steam
207205.196.6.0/24 Steam 254205.196.6.0/24 Steam
208207.45.72.0/22 Netflix 255207.45.72.0/22 Netflix
209207.241.224.0/20 Internet Archive 256207.241.224.0/20 Internet Archive
257208.82.236.0/22 Creiglist
210208.64.200.0/22 Steam 258208.64.200.0/22 Steam
211208.75.76.0/22 Netflix 259208.75.76.0/22 Netflix
212208.78.164.0/22 Steam 260208.78.164.0/22 Steam
213208.80.152.0/22 Wikipedia 261208.80.152.0/22 Wikipedia
262208.110.68.56/29 BitChute
214209.140.128.0/18 eBay 263209.140.128.0/18 eBay
215 264
216# Imperva 265# Imperva
@@ -261,15 +310,6 @@
261205.224.0.0/14 Level 3 310205.224.0.0/14 Level 3
262209.244.0.0/14 Level 3 311209.244.0.0/14 Level 3
263 312
264# WholeSale Internet
26569.30.192.0/18 WholeSale Internet
26669.197.128.0/18 WholeSale Internet
267173.208.128.0/17 WholeSale Internet
268204.12.192.0/18 WholeSale Internet
269208.67.0.0/21 WholeSale Internet
270208.110.64.0/19 WholeSale Internet
271208.110.91.0/24 WholeSale Internet
272
273# StackPath 313# StackPath
27469.16.173.0/24 StackPath 31469.16.173.0/24 StackPath
27569.16.174.0/23 StackPath 31569.16.174.0/23 StackPath
@@ -299,6 +339,8 @@
299205.185.220.0/24 StackPath 339205.185.220.0/24 StackPath
300 340
301# Linode 341# Linode
34245.79.0.0/16 Linode
34350.116.0.0/18 Linode
30266.175.208.0/20 Linode 34466.175.208.0/20 Linode
303103.29.68.0/22 Linode 345103.29.68.0/22 Linode
304104.200.16.0/21 Linode 346104.200.16.0/21 Linode
@@ -397,6 +439,7 @@
397172.105.0.0/19 Linode 439172.105.0.0/19 Linode
398172.105.112.0/20 Linode 440172.105.112.0/20 Linode
399172.105.128.0/23 Linode 441172.105.128.0/23 Linode
442173.255.192.0/18 Linode
400 443
401# Akamai 444# Akamai
4022.16.0.0/13 Akamai 4452.16.0.0/13 Akamai
@@ -576,7 +619,7 @@
576103.21.244.0/22 Cloudflare 619103.21.244.0/22 Cloudflare
577103.22.200.0/22 Cloudflare 620103.22.200.0/22 Cloudflare
578103.31.4.0/22 Cloudflare 621103.31.4.0/22 Cloudflare
579104.16.0.0/13 Cloudflare 622104.16.0.0/12 Cloudflare
580104.24.0.0/14 Cloudflare 623104.24.0.0/14 Cloudflare
581108.162.192.0/18 Cloudflare 624108.162.192.0/18 Cloudflare
582131.0.72.0/22 Cloudflare 625131.0.72.0/22 Cloudflare
@@ -684,6 +727,7 @@
6843.136.0.0/13 Amazon 7273.136.0.0/13 Amazon
6853.144.0.0/13 Amazon 7283.144.0.0/13 Amazon
6863.152.0.0/13 Amazon 7293.152.0.0/13 Amazon
7303.160.0.0/14 Amazon
6873.208.0.0/12 Amazon 7313.208.0.0/12 Amazon
6883.224.0.0/12 Amazon 7323.224.0.0/12 Amazon
6893.240.0.0/13 Amazon 7333.240.0.0/13 Amazon