Questions tagged [tcpdump]

a command line packet analyzer

Filter by
Sorted by
Tagged with
53
votes
6answers
107k views

Why would the kernel drop packets?

I interrupted tcpdump with Ctrl+C and got this total summary: 579204 packets captured 579346 packets received by filter 142 packets dropped by kernel What are the "packets dropped by kernel"? Why ...
29
votes
5answers
51k views

How to process/pipe TCPDUMPs output in realtime

If I want to tcpdump DNS requests by clients (on an OpenWrt 10.04 router), then I root@ROUTER:/etc# tcpdump -n -i br-lan dst port 53 2>&1 tcpdump: verbose output suppressed, use -v or -...
19
votes
4answers
35k views

How to trace networking activity of a command?

I want to trace the networking activity of a command, I tried tcpdump and strace without success. For an example, If I am installing a package or using any command that tries to reach some site, I ...
17
votes
1answer
22k views

Buffer size for capturing packets in kernel space?

Going through the man page of tcpdump, it seems kernel can drop the packets if the buffer is full. I was wondering if: that size is configurable and/or where can I see the size for my distro? From ...
16
votes
2answers
47k views

How to gather DNS A record requests?

I need to record all outgoing A records on a RedHat PC. I tried using tcpdump: tcpdumpdns=OUTPUT-FILENAME-HERE nohup tcpdump -K dst port 53 -w $tcpdumpdns > /dev/null 2>&1 & It makes ...
16
votes
2answers
469 views

Ghost NTP server on Debian 8.6

So the university IT security team and I have been going around and around on this with no breaks... anyone have any thoughts on this: I recently set up a small file server for my lab running Debian ...
13
votes
1answer
16k views

what level of the network stack does tcpdump get its info from?

As I was trying in vain to fix a faulty ethernet controller here, one thing I tried was running tcpdump on the machine. I found it interesting that tcpdump was able to detect that some of the ICMP ...
13
votes
1answer
30k views

Creating multicast join for tcpdump captures

I want to write a linux shell script which will capture specific multicast traffic. Specific as in, I want to create a pcap file that has all the traffic for one specific multicast group/port. Here ...
12
votes
4answers
35k views

how to capture and see packet contents with tcpdump

I am trying to HTTP traffic to port 8007 in a file and then view them later. # tcpdump -i eth0 -s0 -n -w /tmp/capture port 8007 & # tcpdump -r /tmp/capture -A | grep '10.2.1.50' I expected to ...
12
votes
1answer
45k views

tcpdump: “packets captured” vs “packets received by filter”

We have a script which calls tcpdump -v src host <IP address> and port <port number> >>out.txt 2>>err.txt -w capture.cap on multiple IP-s while the other parts of the script ...
12
votes
3answers
19k views

How does one capture traffic on virtual interfaces?

I would like to capture traffic on Linux virtual interfaces, for debugging purposes. I have been experimenting with veth, tun and dummy interface types; on all three, I am having trouble getting ...
11
votes
2answers
15k views

what is “rfc3442-classless-static-routes” in /etc/dhcp/dhclient.conf

I am trying to debug DHCP on my laptop (I am using dhcping and dhcdump to see what the DHCP server sends back). Following is my /etc/dhcp/dhclient.conf. option rfc3442-classless-static-routes code ...
10
votes
1answer
3k views

How to investigate a random reset on TCP client port connected via loopback interface to a server

I have a test suite which initializes a server on the localhost and then runs thousands of stress tests which include starting and stopping clients connecting to this local server on same machine. I ...
9
votes
3answers
29k views

Ping and tcpdump at the same time

The situation is this - There is one script on the server which make ping to somewhere and I don't know to where. I want to see to which machine is this ping make and why is returning FAILED. What I ...
9
votes
2answers
51k views

tcp dump outgoing connection packets

What is the command syntax to log all tcp connection packets? I am trying to see what address and ports my computer is trying to connect to outgoing so that I may config my firewall.
8
votes
1answer
13k views

tcpdump time based circular rotation

Despite reading the man page and searching StackExchange and the wider internet, I have failed to figure out a way to make a time based, rotating, limited count, tcpdump. I want for example to have ...
7
votes
1answer
940 views

MTU (IPv4) tests in Linux

I noticed I have several networks with all ICMP messages blocked at the firewall level, except for ICMP echo and reply. I know that there is a need at least ICMP messages type 3 in IPv4 have to be ...
7
votes
1answer
23k views

tcpdump won't capture entire packet

I'm using sudo tcpdump -A -s0 -ien0 port 80 | grep schemas-microsoft >> ~/Downloads/convert.txt to capture microsoft-schema xmls being sent throught the internet, when tcpdump is supposed to ...
7
votes
1answer
11k views

What does 'TS val' mean in tcpdump's output?

I'm monitoring the network activities between two processes on compute:42967 and controller:5672(controller.amqp). It captured compute.42967 with three SYN(they have the same seq number) while the ...
7
votes
1answer
16k views

Dumping multicast UDP stream with socat

I am setting up video streaming. In local network, there are two devices streaming video over UDP multicast. One is regular computer with Linux (streaming to 239.220.221.10, port 9200), second one is ...
6
votes
3answers
11k views

How to record an interactice socat TCP/TLS session?

Socat is great for interactively testing line based human readable protocols like HTTP or IMAP. For example: $ socat -d -d READLINE,history=$HOME/s.hist openssl:host:port,crnl,cafile=some.ca For ...
6
votes
3answers
4k views

Do not display ACK packets

I have the following tcpdump -i eth0 -n tcp port 5000 to filter every packet flowing between 2 hosts. However, one of the hosts always sends an ACK. How do I hide this ACK?
6
votes
1answer
5k views

Iptables FORWARD chain traffic not seen by tcpdump

I have a bare metal running Ubuntu server 16.04 with KVM and 3 NIC's that are connected by bridges br1, br2 and br3 to a guest VM running also Ubuntu server 16.04. The first NIC - br1 - is connected ...
5
votes
2answers
1k views

'ping' uses localhost instead of public IP address

Let's say my server has IP address 11.22.33.44 and hostname server1.mydomain.com. When I ping server1.mydomain.com, it looks as if ping is actually using the public IP address: # ping server1....
5
votes
1answer
4k views

Is it possible to capture all network traffic using tcpdump?

I have 3 computers on the same sub-net. Computer A and B are communicating with each other (ping, telnet, etc.). I'd like to see the packets between A and B on computer C. Is it possible to do this ...
5
votes
1answer
969 views

What does this tcpdump line means?

Reading the manpage of tcpdump I found this example tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net localnet' but I don't understand it, especially the last part. The ...
5
votes
1answer
673 views

Can kernel drop an outgoing packet which has been captured by tcpdump?

When an outgoing packet is captured by tcpdump, will it 100% be sent out, and not be dropped by kernel? Does tcpdump intercept on packet delivering path before or after kernel does any/all filtering ...
5
votes
1answer
3k views

How to recover a file from a tcpdump?

I use tcpdump -i wlan0 -s 0 dst 192.168.1.200 or src 192.168.1.200 -w output.pcap to monitor for ex.: my HTTP traffic. I upload a .zip file through HTTP. How can I retrieve the .zip file from the ...
4
votes
1answer
5k views

tcpdump and https

Why following command doesn't grab the packets to the Facebook site sudo tcpdump host facebook.com and dst port 443 but next grabs sudo tcpdump host java.com
4
votes
1answer
5k views

“tail -f” using “tcpdump -r”

To display content of pcap file , we use : tcpdump -r /Path/to/syscontection.pcap; However, this command line does not follow the pcap file on realtime , like tail -f which follows a plain text . ...
4
votes
2answers
8k views

Piping tcpdump traffic via SSH - but no root ssh access

The situation I would like to use Wireshark to analyze traffic on one of our servers, but I don't want to install Wireshark on the server itself. I understand that I can pipe tcpdump traffic via SSH ...
4
votes
1answer
5k views

tcpdump/tshark: view only outgoing TCP connections requests

I would like to view TCP requests (syn packets) initiated by my PC/server to other hosts. More specifically, I would like to view the outgoing connection requests. How can I accomplish this? Also, I ...
4
votes
3answers
23k views

Using tcpdump to extract NFS RPC contents

Fairly simple question... I'm running tcpdump and trying to analyze the contents of the TCP packets between server/client. I see the "GETATTR" RPC being received, which is great! However, I want to ...
4
votes
2answers
12k views

Why are tcpdump packets being dropped by interface?

I'm using Ubuntu 14.04 via Virtual Box on a Windows 7 host. The NIC is a USB to Ethernet adapter. The man for tcpdump states what can cause "packets dropped by kernel" but it doesn't state what ...
4
votes
1answer
855 views

tcpdump don't show src and dst address

I'm having a problem with a tcpdump. The output is: 21:53:53.877873 MPLS (label 266837, exp 0, [S], ttl 255), IP, length: 193 21:53:53.878037 MPLS (label 326819, exp 0, [S], ttl 255), IP, length: ...
4
votes
4answers
4k views

How to capture images transferred via HTTP?

I have multiple browsers and I want save all images with size more than 30KB and save to specified address. What is best way? listen to tcpdump and read the content, and then save to a file, or use ...
4
votes
1answer
6k views

Sniffing VirtualBox machine behind NAT

I have a VirtualBox machine with a single interface connected to VB's NAT mode. What I would like to do is sniff all traffic coming from/to any machine behind that NAT. (I don't think I will need to ...
4
votes
1answer
2k views

Is it possible to view unicode text in tcpdump capture output?

Unfortunately seems like tcpdump is not capable of detecting and displaying Unicode-encoded text (specifically utf-8) in captures. It treats unicode text like regular binary data and displays it in ...
4
votes
1answer
2k views

Tell tcpdump to skip custom header

I have an IP packet with x bytes of custom header coming in on an interface. Is there a way to tell tcpdump or tshark to ignore the first x bytes and decode and display the IP packet? Any pointers ...
4
votes
1answer
5k views

How can I run tcpdump from a Python script without AppArmor complaining?

For inconvenient reasons going beyond the scope of this question, I have to run tcpdump from within a Python script. I currently just call subprocess.Popen(['tcpdump', ...) and everything works just ...
4
votes
3answers
3k views

tcpdump -i any doesn't work on FreeBSD

How to listen all interfaces on FreeBSD with tcpdump > tcpdump -i any tcpdump: any: No such device exists (BIOCSETIF failed: Device not configured) (I would like to listen ICMP)
3
votes
3answers
5k views

Running tcpdump, tee and scp

I'm trying to run the following: $ tcpdump -l -X -i eth1 -n tcp port <port> | tee capture.txt | \ scp capture.txt root@10.3.3.227:/home/checker/ tcpdump -l -X -i eth1 -n tcp port <...
3
votes
1answer
21k views

How can I capture all the UDP packets using tcpdump?

I have to capture all the UDP packets sent from host A to any UDP port of host B. The following, if run on host B, doesn't work. $ sudo tcpdump -i eth0 -SX udp src <hostA> tcpdump: 'udp' ...
3
votes
2answers
8k views

tcpdump : lost packets

Running, either in promiscuous mode or not : tcpdump -i "$INTERFACE" -vvv -n -XX -S -s0 -e I got a bunch of lines and this conclusion when I stopped it : 601 packets captured 938 packets received ...
3
votes
1answer
5k views

record contents of packets dropped in iptables

I'm trying to find a way to record the entire contents of packets (possibly with tcpdump) that have been dropped according to rules in iptables. At present, I have a rule to log these packets (with a ...
3
votes
5answers
28k views

tcpdump doesn't appear to be capturing any data, why?

I'm trying to capture data with tcpdump like so: $ sudo tcpdump -Xi eth0 I have the device and the PC connected to each other. On both sides I launch a simple test application that sends a message ...
3
votes
3answers
4k views

tcpdump syntax error when specifying portrange as documented

I am using tcpdump on OpenBSD and trying to learn it from a primer on it. I want to capture a range of ports, but it seems how this is done has changed. I can't even find portrange as a keyword in ...
3
votes
1answer
14k views

How to capture src and dst traffic (both directions) with tcpdump, with one command?

I am using RedHat (6.5) bonding and my active interface is eth5. Running the following command, I'm not able to see the traffic originated by my NIC IP address: tcpdump -i eth5 src host ...
3
votes
1answer
1k views

tcpdump command works only on local ip

I am trying to capture some IP packets in my personal LAN with tcpdump, through the command tcpdump -A -i eth0 'tcp and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0) ...
3
votes
2answers
851 views

Tc qdisc delay not seen in tcpdump recording

I have two linux containers connected with a veth-pair. At veth-interface of one container I set up tc qdisc netem delay and send traffic from it to the other container. If I watch traffic on both ...

1
2 3 4 5