Skip to content

VMware Fusion🔗

Port Forwarding for Reverse Shells🔗

If you use your vm as NAT network "Shared with My Mac" You can forward a port to your host macOS machine.

vmware_network

The network configuration files are stored their respective folders within the VMware Fusion preferences folder.

/Library/Preferences/VMware\ Fusion/
vmware networks

In order to find the right network config you can inspect the dhcpd.conf inside of vmnet* folders.

cat dhcpd.conf

After you found the correct network it should contain a nat.conf file Edit the (with sudo privileges) nat.conf, For UDP protocol edit the section [incomingudp] for TCP protocol edit the [incomingtcp]

In the next example we will forward port 4444 from VM to the 4444 port on the host. You can foreword any port to any port as you like.

vmware nat config

After you saved the configuration nat.conf file you must restart VMware's network services

You do NOT need to restart the Virtual Machine

sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start

If you want to test the port forwarding is working as it should here's an example of running simple python webserver on the vm on port 4444 we configured before:

python -m SimpleHTTPServer 4444
python server on port 4444

Now you can test it on the Host machine by browsing to http://localhost:4444 or http://127.0.0.1:4444

localhost forwarding

Comments