> For the complete documentation index, see [llms.txt](https://notes.shashwatshah.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.shashwatshah.me/windows/active-directory/weaponizing-windows.md).

# Weaponizing Windows

1\) Install Commando VM\
2\) Connect windows VM with Linux VM.\
3\) Start Attacking

### Connecting Windows VM with Linux VM

On Windows VM, set `Default Gateway` to the `IP` of the Linux VM.<br>

![Setup for Default Gateway](https://3517022440-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7AiL05qubQhf0RoEOXWw%2Fuploads%2F5ckvn0YtRvgdYhZcEA0j%2Fimage.png?alt=media\&token=0a4ce394-40b4-4d45-b76c-a084e6df02ad)

Get the Linux VM `IP` and add to `Default Gateway`.

![Linux VM IP](https://3517022440-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7AiL05qubQhf0RoEOXWw%2Fuploads%2FE2vzxKv0nfFMSSZRmJH5%2Fimage.png?alt=media\&token=ed82cc39-bcbb-4762-b459-fff699a49e10)

After this setup, all Windows traffic will flow from Windows to Linux. \
On the Linux machine start forwarding the traffic.

```
sudo sysctl -w net.ipv4.ip_forward=1
sudo /sbin/iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
sudo /sbin/iptables -A FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo /sbin/iptables -A FORWARD -i eth0 -o tun0 -j ACCEPT
```

Make sure to change the port, here I am connected to a VPN, `tun0` interface. And my local network `eth0`interface.
