PDA

Bekijk de volledige versie : Compiled some tools for x-mas!



Rob ter Veer
22-12-2004, 17:29
Heya,

Compiled some goodies for the WL500g. First is Darkstat, a graphical IP accounting tool:

http://members.chello.nl/~r.terveer/Darkstat.png

http://members.chello.nl/~r.terveer/screen-5.png

http://dmr.ath.cx/net/darkstat/

Second is iplog, which can log portscans smurf attacks and so on:

http://ojnk.sourceforge.net/stuff/iplog.readme

And last but not least ltraf which can show realtime throughput:

http://freshmeat.net/projects/ltraf/

Have fun!

Styno
22-12-2004, 19:50
Gee, thanks! :)

Ho Ho Ho

Rob ter Veer
24-12-2004, 12:04
Also compiled axel which is an wget alternative. Axel tries to accelerate downloads by using multiple connections (possibly to multiple servers) for one download.

http://freshmeat.net/redir/axel/14976/url_homepage/axel.html

And the lutz portscanner with OS identifier:

http://freshmeat.net/redir/lutz/51387/url_homepage/www.codewear.org

chupra
27-12-2004, 00:46
Tnx for the x-mas present :)
Can you tell me how can I use the ltraf tool? It appears to require some bpf something. I need it to show me the realtime throughput. Tnx again.

Rob ter Veer
27-12-2004, 07:52
Tnx for the x-mas present :)
Can you tell me how can I use the ltraf tool? It appears to require some bpf something. I need it to show me the realtime throughput. Tnx again.

What message do you get excactly?

erik_bies
27-12-2004, 12:22
I also have some troubles getting it to work:


[admin@wifi sbin]$ ltraf -s -Dk
Segmentation fault
Using: Oleg 1.9.2.7 CR2

Oleg
27-12-2004, 12:30
Just remove -s or specify valid filter string.


ltraf -I eth1 -Dk

chupra
27-12-2004, 16:39
ltraf -I eth1 -Dk
This does the job, tnx Oleg. I got confused by the options line of ltraf:

ltraf -s bpf|-d bpf [-i interface][-v]
I thought (-s bpf or -d bpf) is mandatory. What is this bpf anyway? Some sort of filter language perhaps? Is there some easy way to learn it?

Viper_Jaro
27-12-2004, 23:53
Hi. Will somebody so good and can post here all steps of instalation the x-mas stuff ;-) pls from plugin the usb key with files into ap plssss. I do that first time. :( :( :( :( :( plsssssss

THNX

chupra
28-12-2004, 07:03
Because you don't say how much you actually know, I'll be generous :) and detailed.

First you plug the USB stick (or disk) into the wl500g. It will automount.
From command prompt type
telnet x.x.x.x (where x.x.x.x is the ip address of the wl500g). Use the same username and password you use to log to the web interface.

When you are in the wl500g
cd /tmp/harddisk , where you should find your files.
mkdir /tmp/xmas
cp ltraf.gz /tmp/xmas
cd /tmp/xmas
gunzip ltraf.gz
chmod 777 ltraf
./ltraf -I eth1 -Dk

If you want to stop the program, Ctrl+C.

Same goes for the other programs. You should get yourself acquainted with the linux shell if you are a completely new to linux though.

chupra
28-12-2004, 08:29
Rob, I use the following syntax that gives me segmentation fault:
./ltraf -d "host 10.0.0.4" or
./ltraf -s "host 10.0.0.4"

Probably it's a pcap issue. How did you compile the programs?

Viper_Jaro
28-12-2004, 10:39
Chupra THNXXX very very mutch it works :D :D

Rob ter Veer
31-12-2004, 08:15
Rob, I use the following syntax that gives me segmentation fault:
./ltraf -d "host 10.0.0.4" or
./ltraf -s "host 10.0.0.4"

Probably it's a pcap issue. How did you compile the programs?

I have my compile environment setup at work ;) I will check out my compile configuration this afternoon.. I first compiled pcap (I think it was with defaults), installed it so that libraries can be found and then compiled ltraf.

Rob ter Veer
31-12-2004, 09:53
Compiled libpcap with:

./configure --host=mips --with-pcap=linux --prefix=/opt/brcm/hndtools-mipsel-uclibc

Edited the Makefile of ltraf and changed the CC:

CC=/opt/brcm/hndtools-mipsel-uclibc-3.2.3/bin/mipsel-uclibc-gcc

I also used this version of the compiled libpcap for darkstat. With darkstat I had no problems at all so far.

Technik
07-01-2005, 03:14
A nice utilities. :) Thanks a lot! I have tested it under 1.7.5.9-2 and 1.7.5.9-5 firmwares. Everything is working fine. Just these libraries needs to be copied to /LIB folder:
libpthread.so.0
libnsl.so.0

Rob ter Veer
07-01-2005, 14:59
A nice utilities. :) Thanks a lot! I have tested it under 1.7.5.6-2 and 1.7.5.6-5 firmwares. Everything is working fine. These libraries needs to be copied to /LIB folder:
libpthread.so.0
libnsl.so.0

Humm... That's strange.. Are these libs default included in the 1.9 firmwares? Gonna check that out at home.

barsju
20-01-2005, 01:18
Hi, I can get darkstat to run fine of my USB pendrive, but I can't seem to get it to run as a daemon using the --detach keyword.

Her is what it prints when i start it:


[admin@myrouter /tmp]$ ./darkstat -d /tmp/harddisk/darkstats/ -p 81 --detach
darkstat v2.6 using libpcap v2.4 (mipsel-unknown-linux-gnu)
Detaching...
[admin@myrouter /tmp]$ Firing up threads...
Sniffing on device br0, local IP is 192.168.100.1
GRAPH: Starting at 5 secs, 55 mins, 1 hrs, 20 days.
Loaded /tmp/harddisk/darkstats/darkstat.db.
ACCT: Capturing traffic...
Point your browser at http://localhost:81/ to see the stats.

And when running ps i get this:


139 admin 636 S ./darkstat -d /tmp/harddisk/darkstats/ -p 81 --detach
140 admin 636 S ./darkstat -d /tmp/harddisk/darkstats/ -p 81 --detach
141 admin 636 S ./darkstat -d /tmp/harddisk/darkstats/ -p 81 --detach
Any ideas?
My firmware is 1.9.2.7-3b.

While I'm here I might as well ask a more general question..
I have a small network setup sharing my Internet connection with 4 neighbors. I want to be able to monitor my network a little, and specifically in two ways:
- Some network statistic over the usage of each neighbor. (What and how much)
- Some realtime information of who is on at the moment, and how much resources are they using (Ie. are they browsing, playing online or downloading (p2p))
Any ideas for the best way of accomplishing this? From this forum I have looked a bit into Iptraf and darkstat, and tried unsuccesfully to get the Graphical IP accounting running. But I am still unsure of the best way of achieving what I want, so all suggestions are welcome.. If you have a tool not mentioned above that I should try out, or if you have some suggestions of how I can use iptraf or darkstat..

Sjur

PS: Didn't need any extra libs to run darkstat.. Could just run it right of my usb pendrive..

Viper_Jaro
19-02-2005, 17:33
hi pls can you help me whit which parameter in command can ai changing switch device. Default is eth0 set and that is by me WLAN i want to mi WiFi site sniffing. Thnx

hugo
19-02-2005, 20:22
use ./darkstat -i br0 or ./darkstat -i eth1 or ./darkstat -i eth2

see which one is working for you. Somebody with wl500g could confirm this.

Viper_Jaro
20-02-2005, 01:49
Thnx br0 has worked ethx not.

gbrancovici
07-04-2005, 23:18
Could somebody how exactly to compile darkstat (and libpcap)? I tried all combinations of parameters for ./configure, environment variables and Makefile editing. No matter what I did, either it didn't work at some point or they compiled for i386 and not mips.

I'm using the tools from GPL_1927 as well as the official sources of darkstat and libpcap.

Thanks a lot!

gbrancovici
08-04-2005, 16:40
Edited: This should have been posted in another thread at first:
http://wl500g.info/showthread.php?p=13490#post13490

Original:
Since nobody answered, I solved the problem myself. I'll give some details here in case somebody wants to do something similar.

I first compiled libcap using the compile-libcap.sh on the original sources.

Then I modified darkstat to include a check in the main accounting cycle. I modified darkstat.c, darkstat.h, bignum.h, acct.c and acct.h. The result is now in darkstat-2.6.tar.gz (updated, not original sources). I used compile-darkstat.sh to cross-compile it. I had to manually insert a new line 2092 (cross_compiling=no) in the configure script, to fool the compiler not to do some impossible tests. The resulting executable darkstat is included with this post.

I added a new cmd parameter to darkstat "-limit trafficLimitInMB" which specifies the traffic volume after which the connection will be terminated (route del default). By default this limit is 3000 MB.

Next I'll try to implement a similar functionality with iptables, scripts and cron as suggested. For now I needed this as an emergency solution.

Have fun!

George

Viper_Jaro
02-05-2005, 19:42
Hi i want to add darkstat to start when i restarting the asus WL500G i have a usb key. On the usb key i have the darkstat, but when i restart the Asus then i mus manualy starting darkstat. How can i do that automaticly ?

barsju
02-05-2005, 20:45
Read up on post-boot, post-mount scripts!
I.e. http://oleg.wl500g.info

S

Viper_Jaro
20-05-2005, 22:53
I tried but nothing works :-( Can you one examle to add me ?

barsju
20-05-2005, 23:39
mkdir -p /usr/local/sbin
echo "#!/bin/sh" > /usr/local/sbin/post-mount
echo "/tmp/harddisk/darkstat" >> /usr/local/sbin/post-mount
chmod +x /usr/local/sbin/post-mount
flashfs save
flashfs commit
flashfs enable
reboot


Edit location and parameters for darkstat.
Flashfs enable can be skipped if flashfs is already enabled.

See how that works.

B.
Edit: Added chmod

Viper_Jaro
22-05-2005, 10:06
I tryed it give to post-boot

barsju
22-05-2005, 10:14
Well post-boot will most likely run before harddisk is mounted. So if darkstat runs from harddisk it won't be found and can't be started. So use post-mount.

S.

Viper_Jaro
22-05-2005, 10:19
hmm nothing :-(

Viper_Jaro
22-05-2005, 10:24
;-) it works thnx
i needed change mod to executable