← Lab Log

Reading a plain-HTTP login in Wireshark

I captured my own DVWA login in Wireshark and used filters to find the username, password and session cookie in plain text.

wiresharknetworkingdvwa

I wanted to see exactly what a login looks like on the wire when a site uses plain HTTP, so I captured my own login to DVWA and traced it through Wireshark.

Setup

  • Capture machine: ThinkPad T14s running Kali (192.168.10.171), capturing on wlan0
  • Target: DVWA in Docker, inside a Proxmox LXC container (192.168.10.113)
  • Traffic: my own login from Firefox on Kali, over plain HTTP

Narrowing it down

I started with the capture filter host 192.168.10.113, which recorded 156 packets. I then used display filters to work down to the login:

  • ip.addr == 192.168.10.113 showed traffic to or from DVWA.
  • http.request.method == "POST" left 3 packets: two to /login.php and one to /setup.php.
  • Follow TCP Stream on the first login gave tcp.stream eq 3, which contains 21 packets.

What the stream showed

The login was readable in plain text:

username=admin&password=password

The same request also exposed the PHPSESSID session cookie and security=low. It included DVWA’s user_token too, but that token doesn’t hide anything from someone capturing the traffic.

The stream also showed the whole connection:

  • Frames 59–61: TCP three-way handshake from client port 45994 to port 80
  • Frame 62: POST /login.php with the credentials
  • Frame 64: 302 Found, redirecting to setup.php
  • Frames 66–89: the setup page and its CSS, JavaScript and image files
  • Frames 93–97: connection closes with FIN

What I learned

  • Capture and display filters do different jobs. A capture filter limits what gets recorded. A display filter only limits what’s shown.
  • HTTP exposes more than the password. Anyone who can capture this traffic can read the credentials and session cookie, which could allow session hijacking. HTTPS encrypts them in transit.
  • Wireshark only sees traffic that reaches the capture interface. This lab captured my own login, not everything on the network.

Fix

Serve the login over HTTPS so credentials and session cookies are encrypted in transit.