Setting up the w4sp-lab in 2020

Vaibhav Raj
3 min readSep 10, 2020

--

Introduction

Hey, welcome! You are probably here because you are following the book Wireshark for Security Professionals: Using Wireshark and the Metasploit Framework and came across the second chapter where you have to set up a lab which contains various practice environments.

If you are nodding your head reading this, you are in the right place. Please read on.

The Problem

The book is a really great one as it is still one of the few Wireshark books which are more security oriented and the highlights of the book are it’s easy explanation and the practice labs. Practice labs now that’s where the problems start. Since the book was published in 2017 all the code for the lab was written in Python 2 and we all know that Python 2 came to its EOL in January 2020, current linux distributions throw a lot of errors when you try to run the lab. Moreover the authors have not updated the repo since 2017.

The Solution

Thankfully some awesome people on the internet ported all the code to Python 3 and here is how to get the lab working on your system.

First things first.

After you have set up the Kali VM. Create a new user as given in the book.

First change to root then

# sudo useradd -m w4sp-lab -s /bin/bash -G sudo -U

Set the password

# passwd w4sp-lab

Log out and change to user w4sp-lab then download the lab from here (this is the python 3 version kudos to it’s creators)

Go to the downloads folder and then in the terminal

# unzip w4sp-lab-master.zip

Go to the unzipped folder. The second command may give a notification telling you to choose which services to restart, no need to restart anything.

# sudo apt install -y python3-docker

# sudo apt install wireshark net-tools ethtool xterm

Now the most important part. This will take a lot of time to get completed and it will look like it’s stuck but don’t kill the process and just wait.

# sudo python3 w4sp_webapp.py

After all the images are loaded a browser may or may not open automatically. Don’t panic. Open a firefox tab and enter this address.

http://127.0.0.1:5000

The lab should appear. Click on the setup button and it will most probably fail again. Sorry but now you just need to enter few more commands to get it working.

Kill the process, close the tab. Then in the terminal

# sudo usermod -aG docker w4sp-lab

# sudo systemctl enable — now docker

Now run the python script again

# sudo python3 w4sp_webapp.py

and in the browser

http://127.0.0.1:5000

Hit the setup button, wait and behold

Your lab is up and running.

I really hope that my article helps you. Keep learning.

Thank you

The resources I used to get it working.

--

--

Vaibhav Raj

I am a DevOps Engineer and Cyber Security enthusiast. I write about DevOps, Security and how to solve some problems you may come across on your learning path.