![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| i would like to know about tcpdump | chamnanpol | Security | 0 | 07-03-2008 02:17 AM |
| tcpdump on AIX | nymus7 | AIX | 4 | 01-16-2008 05:51 PM |
| R-326: tcpdump | iBot | Security Advisories (RSS) | 0 | 01-08-2008 09:50 AM |
| tcpdump | ant04 | UNIX for Dummies Questions & Answers | 2 | 09-07-2004 03:36 PM |
| How To Use tcpdump | chenhao_no1 | High Level Programming | 2 | 04-01-2003 05:15 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Capturing TCPDUMP
Hi,
I want to capture TCPDUMP of traffic, I tried doing this but did not find success..can anyone plz correct it. [root@labdevice1 osuresh]# tcpdump -s0 -vv -w /home/osuresh/test_tcp_dump host 10.12.10.22 && port 161 bash: tcpdump: command not found [root@labdevice1 osuresh]# tcpdump -s0 -vv -w /home/osuresh/test_tcp_dump host 10.12.10.22 bash: tcpdump: command not found [root@labdevice1 osuresh]# tcpdump -s0 -vv -w /home/osuresh/test_tcp_dump port 161 bash: tcpdump: command not found Appreciate all responses. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
appears tcpdump is not installed or not in the path.
try: /usr/sbin/tcpdump or install it. |
|
#3
|
|||
|
|||
|
I could observe tcpdump in /usr/sbin/
but not sure if I need to execute: tcpdump -s0 -vv -w /usr/sbin/tcpdump host 10.12.10.22 && port 161 [root@labdevice1 sbin]# tcpdump -s0 -vv -w /home/osuresh/test_tcp_dump host 10.12.10.22 && port 161 bash: tcpdump: command not found |
|
#4
|
|||
|
|||
|
Do you have permissions to use it? (execute)
Also, why not try the full path in your command? |
|
#5
|
|||
|
|||
|
Code:
[root@labdevice1 sbin]# tcpdump -s0 -vv -w /home/osuresh/test_tcp_dump host 10.12.10.22 && port 161 bash: tcpdump: command not found |
|
#6
|
|||
|
|||
|
There's another issue with your dump command
I would guess by merely looking at it. Quote:
or single quote the entire tcpdump logical expression to prevent the probably non-existing command port 161 from being tried to be executed by the shell after the preceding tcpdump has finished successfully. If you are too lazy to escape you could as well replace && by and. Also, as far as I remember tcpdump will grab the first NIC if you don't explicitly tell it by -i ethN which one to use. You could as well use -i any to let it sniff on every available NIC but then it wouldn't set them into promiscuous mode, which probably anyway would be wiser altogether because you are generally only interested in packets destined for your host. So it's save to add -p. Quote:
but by that you would tell it to overwrite its own executable with the dump it filtered! What the others meant was to give the full path to the command in case your root user hadn't /usr/sbin in his $PATH which seems quite unlikely anyway. e.g. Code:
# /usr/sbin/tcpdump -p -i eth0 -s0 -w /home/osuresh/test_tcp_dump 10.12.10.22 and port 161 I am afraid I am a bit suspicious if you know what to do with the dump in the end? |
|||
| Google The UNIX and Linux Forums |