New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] how to do traffic analysis on fritzbox #3232
Comments
@joerg-wille where do you see "some traffic" in the web interface? Are you checking traffic stats from the Interface page? Could you provide some more detail? Thank you. |
are you able to provide a small pcap, by replacing ntopng with tcpdump (e.g. | tcpdump -i - -w dump.pcap) |
I have tried: Then I replaced -I with -r and this time I got following error: I have no experience with tcpdump... |
as you are on OS X, it seems this is the reason why you get the unrecognized output error: please follow the link to solve and generate the pcap. Thank you |
thanks, for this tip. But I am still not able to log any data. But, when I call the script after I exchanged the line to: sudo ./fritzdump.sh dslf-config "password" Did not find any solution to this. and started logging in FritzPox on "lan" interface. |
I have tried this already. |
@joerg-wille you should be able to go to an hidden page in your fritzbox which is fritz.box/html/capture.html and download a pcap directly from there, could you try that? |
@cardigliano yes, this works. I have done this couple of times. I can download the file and then inspect this with Wireshark. Capturing with fritzbox gives the expected result.
And this is the output in terminal: So, there is an Error reported. How can I fix that? Why gets polling terminated? |
@joerg-wille it is likely polling terminates because of a truncated/unrecognzed pcap stream from the fritzbox (same as tcpdump). We need to figure out why the pcap you download from the fritzbox gui is well formed, while the one downloaded with wget is not recognized by tcpdump/ntopng.. |
This make sense - how can I help? |
still open this issue? If that works, you can use wget ... | /path/to/ntopng -i - .. I also have a monitor script which (hopefully) restarts the capture if it fails. Another way, that I tested was to output wget using -O into a FIFO (mkfifo /run/ntopfb.pcap) and use nprobe to read out the fifo and forward it via zmq to Ntopng. But it missed some traffic and had no pcap download in ntopng. |
@th0u thank you (we do not have an active fritzbox router atm for testing, thus your help is really useful) |
For me, it fails rather regularly. Would you mind sharing the script (maybe even via a PR)? Regards, |
Hi Hendrik the main script is in this repository (ntopng/tools/fritzdump.sh). and line 47 The actual monitoring script is test-fritzdump.sh:
test-fritzdump.sh is run by cron every minute. Hope it helps. |
Hello @th0u , thank you! Or do I miss something? Greetings, |
yes, in that case, it would unfortunately not help. |
Here my example:
and in case of failure
A pidfile for wget would be needed. |
Hello Hendrik, |
Hello, not knowingly. Maybe it was started at install... Although it should then not run due to port 3000 used already by grafana on my computer. Greetings, |
I'd disable ntopng service then. |
Thanks. I have edited the script now like this:
|
Testing the script gives me regular restarts -more regular than wget was failing previously.
Hmmm |
I can confirm as well, it is not working. |
Please open a separate issue for this and report the output of |
Closing for inactivity. Please reopen if necessary. |
Hi,
I want to log and visualize my private fritz!box router and found following script:
https://github.com/ntop/ntopng/blob/dev/tools/fritzdump.sh
Since I am on a Mac I installed ntopng with brew and started redis and followed this blog:
https://www.ntop.org/ntopng/how-to-use-ntopng-for-realtime-traffic-analysis-on-fritzbox-routers/
For some reason I then "should" start logging "lan" in the URL:
http://fritz.box/html/capture.html
Then I start the script and the WebUI.
As I understand, the script captures traffic on the Fritz!Box WWAN Interface "2-0" and forwards this to stdout where ntopng is reading it.
Trying to login into http://fritz.box as user dslf-config
Capturing traffic on Fritz!Box interface 2-0 ...
13/Jan/2020 18:26:28 [Ntop.cpp:1902] Setting local networks to 127.0.0.0/8
13/Jan/2020 18:26:28 [Redis.cpp:132] Successfully connected to redis 127.0.0.1@0
13/Jan/2020 18:26:28 [Redis.cpp:132] Successfully connected to redis 127.0.0.1@0
13/Jan/2020 18:26:28 [NetworkInterface.cpp:125] WARNING: Unable to read IPv4 address of stdin: SIOCGIFADDR: stdin: Device not configured
13/Jan/2020 18:26:29 [Ntop.cpp:1994] Registered interface stdin [id: 0]
13/Jan/2020 18:26:29 [main.cpp:302] PID stored in file /var/run/ntopng.pid
13/Jan/2020 18:26:29 [HTTPserver.cpp:1030] HTTPS Disabled: missing SSL certificate /usr/local/Cellar/ntopng/3.8.1/share/ntopng/httpdocs/ssl/ntopng-cert.pem
13/Jan/2020 18:26:29 [HTTPserver.cpp:1032] Please read https://github.com/ntop/ntopng/blob/dev/doc/README.SSL if you want to enable SSL.
13/Jan/2020 18:26:29 [Utils.cpp:592] User changed to nobody
13/Jan/2020 18:26:29 [HTTPserver.cpp:1199] Web server dirs [/usr/local/Cellar/ntopng/3.8.1/share/ntopng/httpdocs][/usr/local/Cellar/ntopng/3.8.1/share/ntopng/scripts]
13/Jan/2020 18:26:29 [HTTPserver.cpp:1202] HTTP server listening on 3000
13/Jan/2020 18:26:29 [main.cpp:399] Working directory: /var/tmp/ntopng
13/Jan/2020 18:26:29 [main.cpp:401] Scripts/HTML pages directory: /usr/local/Cellar/ntopng/3.8.1/share/ntopng
13/Jan/2020 18:26:29 [Ntop.cpp:403] Welcome to ntopng x86_64 v.3.8.191231 - (C) 1998-18 ntop.org
13/Jan/2020 18:26:29 [Ntop.cpp:413] Built on MacOSX 10.14.6
13/Jan/2020 18:26:29 [PeriodicActivities.cpp:72] Started periodic activities loop...
13/Jan/2020 18:26:29 [PeriodicActivities.cpp:113] Each periodic activity script will use 2 threads
13/Jan/2020 18:26:29 [NetworkInterface.cpp:2597] Started packet polling on interface stdin [id: 0]...
I do see "some" traffic in the WebUI but nothing useful e.g.: no active flows...
(I have asked the same question on Telegram ntop_community and will mark this "issue" solved if I do get support there.)
The text was updated successfully, but these errors were encountered: