How To Install and Use Yersinia on Kali Linux
Ever wondered how attackers can mess with your network without even touching the higher layers? Well, a lot of it happens at Layer 2, the part that’s supposed to quietly keep your network running. But when it’s left unchecked, it becomes a juicy target.
That’s where Yersinia comes into play.
It’s like giving yourself a sneak peek into what could go wrong, so you can fix it before someone else finds it.
Today, I’ll walk you through getting Yersinia up and running on Kali Linux, and show you a quick way to test it out for real.
Oh, and if you need a solid Linux VPS to build your lab, Eldernode has some sweet deals you might want to check out.
If you’re planning to set up your own penetration testing environment, our Linux VPS hosting solutions provide the flexibility and power you need.
What is Yersinia Anyway?
Think of Yersinia as your key to unlocking, and sometimes breaking, the hidden world of Layer 2 protocols.
It’s written in C (yeah, super fast) and it’s an open-source project developed for network security testing. Its official GitHub repository provides full access to its source code and documentation.
You can poke at things like:
– Spanning Tree Protocol (STP)
– Cisco Discovery Protocol (CDP)
– Dynamic Trunking Protocol (DTP)
– DHCP
– HSRP
– 802.1Q
– 802.1X
– ISL
– VTP
In other words, if it lives in Layer 2, Yersinia can probably mess with it.
Scary? Maybe. Useful? Definitely.
How to Install Yersinia on Kali Linux
Alright, let’s get it installed.
Make sure your package list is fresh:
sudo apt update
Then pull in Yersinia:
sudo apt install yersinia
Done? Awesome.
Now you’ve got two ways to launch it:
– Graphical Mode (GTK Interface):
yersinia -G
– Terminal Mode (Ncurses Interface):
yersinia -I
Heads up: If you hit dependency issues, a quick sudo apt update usually sorts it out.
Try It Out: Launch a DHCP Starvation Attack
Enough theory — let’s break something (legally, of course).
Here’s a quick test:
1. Fire up the GUI:
yersinia -G
2. Click on DHCP.
3. Pick “Launch Attack” and watch what happens.
What you’re doing here is bombarding the DHCP server with so many fake requests that it runs out of IP addresses.
Real devices can’t get an IP anymore.
The network cries. You smile. (Because you’re doing this in a safe, controlled environment!)
Seriously though: Only test where you have permission. No jokes here, it’s illegal otherwise.
How to Uninstall Yersinia (If You Ever Want To)
Had your fun? Ready to clean up? Easy:
sudo apt remove yersinia
Want to wipe it completely?
sudo apt purge yersinia
sudo apt autoremove --purge yersinia
Wrapping Up
Yersinia is one of those tools that’s easy to forget about, until you realize just how many networks still have wide-open Layer 2 setups.
Setting it up is quick, and once you get comfortable, you can pull off some pretty eye-opening tests.