HackproofHacks
Penetration Testing 15 min read

Password Sniffing Explained: How Attackers Steal Credentials on the Wire

A practical, offensive-security look at password sniffing: how credentials get captured in transit, the tools and man-in-the-middle techniques attackers use, and how to defend against them.

Hassan Ansari

Hassan Ansari

· Updated Jul 11, 2026
A terminal card showing captured plaintext credentials flowing across a network

Password Sniffing Explained: How Attackers Steal Credentials on the Wire

Most people picture credential theft as guessing, an attacker hammering a login page with millions of combinations until one finally works. That happens, but there is a quieter and often far more effective technique that involves no guessing at all. Instead of trying to work out your password, the attacker simply reads it as it travels across the network. This is password sniffing, and understanding it teaches one of the most important lessons in all of offensive security. Data in motion needs protecting just as fiercely as data sitting in a database.

I want to walk through how sniffing actually works, the tools and positioning that make it possible, why it was once utterly devastating and still matters today, and how you defend against it. Everything here is written for people learning offensive security so they can test properly and defend better. It is not a licence to point these techniques at networks you do not own.

What sniffing actually is

When your device talks to a server, it does not send one smooth continuous stream. It breaks the conversation into packets and fires them hopping across the network toward their destination. On a shared or poorly segmented network, those packets can pass within reach of machines that were never meant to see them.

A packet sniffer is a tool that captures those packets and lets you inspect them. Wireshark and tcpdump are the two you will meet first, and both are completely legitimate. Network administrators use them every single day to diagnose slow connections and broken applications. That is the uncomfortable duality at the heart of this topic. The exact capability that helps an engineer debug a problem also lets an attacker read whatever those packets contain. If a login was sent over a protocol that does not encrypt its traffic, what those packets contain is your username and your password, sitting there in plain readable text.

That is the whole trick. No exploit, no cracking, no clever payload. Just listening to a conversation that was never protected to begin with.

The real villain is the plaintext protocol

Sniffing only hands over readable credentials when the traffic is unencrypted, so it helps to know which protocols historically leaked everything.

Plain HTTP, the unencrypted web, sends a login form’s contents including the password as readable text. Telnet, an old remote shell protocol, sends every keystroke in the clear, login included. FTP transfers files and authenticates with no encryption. Early email protocols like POP3, IMAP, and SMTP without TLS sent credentials completely unprotected. On any network carrying these, a sniffer is brutal, because there is nothing to break. The password was broadcast in the open and the attacker simply had to be listening.

This is precisely why the industry wide shift to encryption everywhere was not a luxury. It was the direct fix for sniffing. HTTPS replaced HTTP, SSH replaced Telnet, TLS wrapped email. Encryption scrambles the data before it ever leaves your device, so a sniffer captures only meaningless ciphertext. When you learn to sniff in a lab, the single most powerful demonstration is capturing a login over HTTP, seeing the password appear in plain text, then repeating it over HTTPS and watching that same password dissolve into noise. The password did not change. Encryption made it unreadable.

Getting into position, the part that takes real skill

Here is what beginners often miss. To sniff your traffic, an attacker first has to see it, and on modern switched networks traffic is generally delivered only to its intended destination rather than broadcast to everyone. So the interesting work is not the capture itself. It is manoeuvring into a position where the traffic flows past you.

The classic technique on a local network is ARP spoofing, sometimes called ARP poisoning. Address Resolution Protocol is how devices on a local network map an IP address to a hardware address, and it was designed in a more trusting era with no authentication at all. An attacker abuses that trust by sending forged ARP messages that tell the victim’s machine the attacker is the router, and tell the router the attacker is the victim. Both sides believe the lie, and now all of that traffic flows through the attacker’s machine before continuing on. This is a man in the middle position, and it is the foundation of most local sniffing.

The tools that automate this are standard on Kali. Ettercap and Bettercap can perform ARP spoofing and then present the intercepted traffic for inspection. In a lab, a workflow looks like enabling packet forwarding so the victim’s connection keeps working, launching the spoof against the target and the gateway, then opening Wireshark to watch the conversation. On an internal Windows network, Responder takes a different route, answering broadcast name resolution requests to trick machines into sending their authentication material, which testers then take away to crack offline. If you are getting comfortable with how internal networks expose themselves, my guide to enumerating network services pairs naturally with this, because you cannot attack what you have not mapped.

Beyond the local wire, attackers also get into position with rogue access points, fake Wi-Fi hotspots that victims connect to, routing all of their traffic through attacker controlled hardware. On wireless networks, tools in the aircrack suite can capture traffic out of the air. And a compromised router or switch sitting on the path gives an attacker a permanent listening post. What every one of these has in common is the same goal, to sit somewhere the traffic must pass.

The point that keeps defenders sane is that even a perfect man in the middle position yields nothing usable if the traffic is properly encrypted. The attacker sees that a connection is happening. They do not see what is inside it.

Wireshark, where the captured traffic becomes readable

Once traffic is flowing past your machine, Wireshark is where you turn raw packets into understanding. It captures everything and lets you filter down to what matters. A filter for HTTP traffic strips away the noise and shows you web requests. Following a stream reassembles a scattered conversation into readable form, so instead of staring at individual packets you see the full exchange, including any login that was submitted in the clear.

Learning to read this is a genuine skill and it is worth building carefully in your lab. Set up two virtual machines, capture a login to a deliberately vulnerable application over plain HTTP, and find the credentials in the packet detail. Then do it again over HTTPS. That before and after, done with your own hands against your own machines, teaches the lesson in a way no article can. The best way to reach that lab is the setup I walk through in building your first hacking lab with Kali and DVWA, which gives you both an attacker and a target to practise against legally.

Why sniffing still matters in an HTTPS world

If encryption defeats sniffing, you might wonder why it is still worth studying. The answer is that the gaps are real and more common than people assume.

Legacy systems are everywhere. Internal networks are full of old devices and applications that still speak plaintext protocols nobody ever migrated. Misconfiguration creeps in constantly, an application that falls back to HTTP without anyone noticing, an email client set up without TLS, an administrator who uses Telnet just this once. Downgrade and interception tricks still get attempted, where an attacker tries to strip an HTTPS connection down to HTTP or presents a fake certificate hoping the victim clicks past the warning. And internal traffic is a persistent blind spot, because organisations often encrypt their connections to the outside world while leaving machine to machine communication inside the network unencrypted, assuming the internal network is safe. An attacker who gains a foothold inside then sniffs freely.

So sniffing has not disappeared. It retreated to the places where encryption was never applied, and those places are exactly the ones a thorough tester goes looking for.

The wireless angle and captured hashes

Sniffing does not stop at the wired network, and two wireless scenarios are worth understanding because they show up constantly in real testing.

On Wi-Fi, traffic travels through the air, which removes the need to poison a switch at all. With a wireless adapter that supports monitor mode, tools in the aircrack suite let an authorised tester capture frames directly. On older or badly configured networks this can expose traffic, and even on modern WPA2 networks a tester can capture the four way handshake that happens when a device joins, then take that handshake away and attempt to recover the passphrase offline. Notice the pattern, because it repeats everywhere in this discipline. The capture happens on the network, but the actual credential recovery happens later, offline, at the attacker’s leisure.

That same idea drives one of the most productive techniques on internal Windows networks. Rather than reading plaintext passwords, an attacker captures the authentication material that machines exchange automatically. Tools like Responder answer the broadcast name resolution requests that Windows machines send when they cannot find a resource, tricking them into authenticating to the attacker instead. What comes back is not a plaintext password but a hashed challenge and response, which the tester then feeds into a cracking tool such as Hashcat or John the Ripper to recover offline. This is where sniffing and cracking meet in the middle, and it is why the two skills are worth learning together rather than in isolation. If you want to see the offline half of that workflow in detail, my password cracking with Hydra walkthrough covers the mechanics of turning captured material back into working credentials.

The takeaway from both scenarios is the same. The moment you are in a position to see the traffic, whether over the air or on a switch, anything unencrypted is readable immediately and anything hashed becomes a problem you solve later. Encryption in transit is what removes the first option, and strong, unique passwords plus MFA are what blunt the second.

How to defend against it

The defences are well understood, and they layer on top of each other rather than relying on any single control.

Encrypt everything in transit. HTTPS for the web, SSH instead of Telnet, SFTP or FTPS instead of FTP, TLS for email. This is the single most important measure, because it makes captured traffic useless. On the server side, HTTP Strict Transport Security tells browsers never to fall back to plain HTTP in the first place, and Mozilla’s SSL Configuration Generator will produce a sane TLS config for your web server. Turn on HTTPS only mode in your browser so it refuses to load pages over plain HTTP. Respect certificate warnings rather than clicking through them, because a sudden certificate error on a site you use daily can be an interception attempt in progress. Use a VPN on untrusted networks so all of your traffic travels inside an encrypted tunnel, leaving a local sniffer with nothing but the tunnel to look at.

Turn on multi factor authentication everywhere it is offered. This is the safety net that matters most, because even if a password is somehow captured, MFA means that password alone is not enough to log in. And if you run the network rather than just use it, segment it so sensitive traffic is isolated, encrypt internal traffic as well as external, and monitor for the fingerprints of a man in the middle, such as unexpected changes in ARP tables or devices that suddenly appear where they should not be. A stolen password is a far smaller problem when it is only one factor of several, which is exactly why credential based attacks like the ones in my password cracking with Hydra walkthrough rely on that final control being absent.

The lesson worth carrying

Password sniffing is a reminder that a credential is vulnerable not only where it is stored, but at every single step of its journey across a network. The attack itself is almost trivial once you are in position. The defence is encryption applied everywhere, without exceptions and without the quiet legacy gaps that testers love to find. Every time you see that padlock in your browser, that is the anti sniffing measure doing its job.

Carry this forward as a working assumption. Treat any unencrypted network path as though someone is listening to it, because on a real engagement someone often is, and never send anything across it that you would mind a stranger reading. That mindset makes you both a sharper attacker in authorised testing and a far more careful defender everywhere else.

This article is for education and defensive purposes. Capturing network traffic that is not yours, without explicit authorisation, is illegal in most places. Only ever sniff networks you own or have written permission to test.

#password sniffing #network security #wireshark #man in the middle #arp spoofing #offensive security #ethical hacking
Free newsletter

Liked this? I write one like it every week.

One practical security lesson in your inbox each week, explained the same simple way. Join 10,000+ readers. Unsubscribe anytime.

From the article

Need a security assessment?

HackproofHacks provides web application and API penetration testing — using the same techniques covered in this article, with your explicit authorisation.

Book a free scoping call

More on Penetration Testing.

All articles →
FAQ

Questions about this topic.

What is password sniffing?

Password sniffing is capturing network traffic and reading credentials straight out of it as they move between a device and a server. If the connection is not encrypted, the username and password sit inside the packets in plain text, and anyone positioned to see that traffic can simply read them. It is passive interception rather than active guessing, so the attacker is listening rather than brute forcing anything.

How is sniffing different from password cracking?

Cracking tries to work out a password by guessing, running through wordlists or brute forcing hashes until one matches. Sniffing never guesses. It captures the password directly as it crosses the network. Cracking attacks stored or hashed passwords, while sniffing attacks passwords in transit. They are separate techniques that happen to share the same goal, and skilled testers use both depending on where the credential lives.

Can passwords be sniffed over HTTPS?

Not in readable form. HTTPS, along with other properly encrypted protocols like SSH and TLS secured email, encrypts your data before it leaves your device, so a sniffer only sees scrambled ciphertext rather than your password. This is exactly why encryption everywhere matters. Sniffing only yields usable credentials when traffic is unencrypted, or when an attacker manages to trick you into a downgraded or intercepted connection.

Is public Wi-Fi actually dangerous for password sniffing?

It can be, because on an open network an attacker sitting on the same access point is well placed to capture traffic. In practice most modern sites use HTTPS, which protects your credentials even on a hostile network. The genuine risk comes from unencrypted connections, misconfigured apps, or being fooled into accepting a fake certificate. Turning on HTTPS only mode and using a trustworthy VPN on untrusted networks closes most of the gap.

What tools do penetration testers use for sniffing?

Wireshark and tcpdump for capturing and inspecting traffic, Ettercap and Bettercap for putting themselves in the middle of a conversation, and Responder for harvesting authentication material on Windows networks. These are standard, legitimate tools that network engineers and authorised testers rely on daily. What makes their use legal is authorisation and scope, never the tool itself.