Tcpdump examples to capture passwords

By | November 8, 2010

I used to use this on my system to diagnose issues with ftp. To check if users are typing
in the usernames correctly or not. You can use this for fun as long as it is Legal.
1. Install tcpdump
Ubuntu
sudo apt-get install tcpdump

Fedora/Centos/Red hat
sudo yum install tcpdump

2. TCPDUMP Examples
- To display the Standard TCPdump output:
tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode

- Network interfaces available for the capture:
tcpdump -D

1.eth1
2.any (Pseudo-device that captures on all interfaces)
3.lo

- Capture the traffic of a particular interface:
tcpdump -i eth0

- To capture the UDP traffic:
tcpdump udp

- To capture the TCP port 80 traffic:
tcpdump port http

- To capture the traffic from a filter stored in a file:
tcpdump -F file_name

To create a file where the filter is configured (here the TCP 80 port)
vim file_name
port 80

- To send the capture output in a file instead of directly on the screen:
tcpdump -w capture.log

- To read a capture file:
tcpdump -r capture.log

- To display the packets having “tcpdumpexamples.com” as their source or destination address:
tcpdump host tcpdumpexamples.com

- To display the FTP packets coming from 192.168.1.100 to 192.168.1.2:
tcpdump src 192.168.1.100 and dst 192.168.1.2 and port ftp

- To display the packets content i.e capture the passwords:
tcpdump -A port ftp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ath0, link-type EN10MB (Ethernet), capture size 96 bytes
20:53:24.872785 IP local.40205 > 192.168.1.2.ftp: S 4155598838:4155598838(0) win 5840
….g………………..
…………
20:53:24.879473 IP local.40205 > 192.168.1.2.ftp: . ack 1228937421 win 183
….g.I@………….
……..
20:53:24.881654 IP local.40205 > 192.168.1.2.ftp: . ack 43 win 183
….g.I@…….8…..
……EN
20:53:26.402046 IP local.40205 > 192.168.1.2.ftp: P 0:10(10) ack 43 win 183
….g.I@……`$…..
…=..ENUSER amateur

20:53:26.403802 IP local.40205 > 192.168.1.2.ftp: . ack 76 win 183
….h.I@………….
…>..E^
20:53:29.169036 IP local.40205 > 192.168.1.2.ftp: P 10:25(15) ack 76 win 183
….h.I@……#c…..
……E^PASS test123

20:53:29.171553 IP local.40205 > 192.168.1.2.ftp: . ack 96 win 183
….h.I@.,………..
……Ez
20:53:29.171649 IP local.40205 > 192.168.1.2.ftp: P 25:31(6) ack 96 win 183
….h.I@.,………..
……EzSYST

20:53:29.211607 IP local.40205 > 192.168.1.2.ftp: . ack 115 win 183
….h.I@.?…..j…..
……Ez
20:53:31.367619 IP local.40205 > 192.168.1.2.ftp: P 31:37(6) ack 115 win 183
….h.I@.?………..
……EzQUIT

20:53:31.369316 IP local.40205 > 192.168.1.2.ftp: . ack 155 win 183
….h.I@.g………..
……E.
20:53:31.369759 IP local.40205 > 192.168.1.2.ftp: F 37:37(0) ack 156 win 183
….h.I@.h…..e…..
……E.

Packets capture during a FTP connection. The FTP password can be easily intercepted because it is sent in clear text to the server.
We see in this capture the FTP username (amateur) and password (hosting).
You can use this incase you forget your ftp password and have stored it in your ftp client.

If you like this article, you should also read how to make a website for free with Google

Please note that this should not be used for any illegal and this blog will not be responsible for any actions that lead to illegal use

3 thoughts on “Tcpdump examples to capture passwords

  1. Andy

    How are password transmitted over HTTP ? Are they secure ?

    If I want to be safe, is there need to use HTTPS or Digest access authentication ?

    Reply
    1. Leo G Post author

      Passwords over http is not encrypted, https is the best way to secure password transmission

      Reply
  2. Pingback: Tcpdump to capture passwords | Web Hosting and Online marketing on a Budget

Leave a Reply

Your email address will not be published. Required fields are marked *