![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| i would like to know about tcpdump | chamnanpol | Security | 0 | 07-03-2008 05:17 AM |
| tcpdump on AIX | nymus7 | AIX | 4 | 01-16-2008 08:51 PM |
| R-326: tcpdump | iBot | Security Advisories (RSS) | 0 | 01-08-2008 12:50 PM |
| tcpdump | ant04 | UNIX for Dummies Questions & Answers | 2 | 09-07-2004 06:36 PM |
| How To Use tcpdump | chenhao_no1 | High Level Programming | 2 | 04-01-2003 08:15 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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. |
|
||||
|
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 |
|
||||
|
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 |
|
||||
|
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? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|