Capturing TCPDUMP


 
Thread Tools Search this Thread
Operating Systems Linux Capturing TCPDUMP
# 1  
Old 07-31-2008
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.
# 2  
Old 07-31-2008
appears tcpdump is not installed or not in the path.

try: /usr/sbin/tcpdump

or install it.
# 3  
Old 07-31-2008
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  
Old 08-01-2008
Do you have permissions to use it? (execute)

Also, why not try the full path in your command?
# 5  
Old 08-04-2008
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

That would only work if you had "." in your environment variable PATH. Anyway, sbin is not in your PATH and it should be. Anyway, try doing ./tcpdump in your sbin directory, or use the full path /usr/sbin/tcpdump.
# 6  
Old 08-07-2008
There's another issue with your dump command
I would guess by merely looking at it.
Quote:
tcpdump -s0 -vv -w /home/osuresh/test_tcp_dump host 10.12.10.22 && port 161
If you insist on using && I would think you will have to escape each ampersand,
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:
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
Please no, (I'm not even sure if tcpdump would allow such stupid abuse)
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

Given the difficulties you already encounter properly executing the command
I am afraid I am a bit suspicious if you know what to do with the dump in the end?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

TCPdump

I've recently started learning to use TCPdump, and I find it pretty interesting. There's one thing I don't understand. When I tell it to capture packets on, say, the WiFi interface en1, it often captures packets sent or received by other hosts on the network. How can it do this? My... (3 Replies)
Discussion started by: Ultrix
3 Replies

2. UNIX for Dummies Questions & Answers

How to update tcpdump?

I would like to update tcpdump on my computer (CentOS 6.5) which is currently old. I download the zip file from TCPDUMP/LIBPCAP public repository already but I don't know how to update with this file. I have to delete tcpdump on my computer first? Would you please provide the step for me? (0 Replies)
Discussion started by: thsecmaniac
0 Replies

3. Cybersecurity

Need Help with this TCPDUMP output...

Hello everyone, so I'm getting this tcpdump, and it looks like..quite a mess... Can anyone decipher this? I can tell that one IP is requesting DNS info? but I'm having trouble finding out what some of the fields actually mean.. 19:44:50.707637 IP 66.81.1.252.53 > 64.147.113.139.28638: 52313... (4 Replies)
Discussion started by: Lost in Cyberia
4 Replies

4. Debian

Tcpdump Help !

Hi. Need Help with TcpDump Trying to sniff associatio-request with tcpdump but when i run this tcpdump -i eth0 wlan subtype assoc-req i get this error can anyone help me with this error ? Thanks alot !!:) (1 Reply)
Discussion started by: SoulZB
1 Replies

5. Shell Programming and Scripting

TCPdump script

I'm new to the Unix/Linux world. I have taken classes and played with a few simple scripts but never had a real world application. Here is my problem. What I need to do is every 15min between 8am and 5pm, run tcpdump -s 2000 -w flowroute-0000.pcap where the "0000" is the current time. ... (4 Replies)
Discussion started by: Nasasdge
4 Replies

6. IP Networking

tcpdump -w file is not capturing all the packets

I am trying to capture tcpdump for traffic to a port in a file but this does not seem to capture all the packets. Command I use is : tcpdump -w tdump.dat port 22 Why is it not capturing all the packets ? Here is my experiment: root@pmode-client6 adc-demo]# tcpdump port 22 tcpdump:... (5 Replies)
Discussion started by: radiatejava
5 Replies

7. IP Networking

i would like to know about tcpdump

i would like to know about tcpdump i would like to use tcpdump to get information about these - Date - time - source hostname - source mac address - source ip address - destination ip address - see outbound only then i use command like this tcpdump -i le0 -n -q -tttt -e src net... (2 Replies)
Discussion started by: chamnanpol
2 Replies

8. Cybersecurity

i would like to know about tcpdump

i would like to know about tcpdump i would like to use tcpdump to get information about these - Date - time - source hostname - source mac address - source ip address - destination ip address - see outbound only then i use command like this tcpdump -i le0 -n -q -tttt -e src net... (0 Replies)
Discussion started by: chamnanpol
0 Replies

9. UNIX for Dummies Questions & Answers

tcpdump

does anybody know what the -d -dd and -ddd options are used for ? thanks (2 Replies)
Discussion started by: ant04
2 Replies

10. Programming

How To Use tcpdump

I have two net-card. one is 172.16.24.99(ENG) ,another is 172.16.25.99(ENG-B). Both masks is 255.255.255.0. I will monitor data on the tcp port 8055 in ENG, How do I set option of tcpdump command (2 Replies)
Discussion started by: chenhao_no1
2 Replies
Login or Register to Ask a Question