Hack Forums
[Legion] How to port-forward to a Windows Virtual Machine [VirtualBox & VMWarePlayer] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Computing (https://hackforums.net/forumdisplay.php?fid=88)
+---- Forum: Computing Lounge (https://hackforums.net/forumdisplay.php?fid=8)
+---- Thread: [Legion] How to port-forward to a Windows Virtual Machine [VirtualBox & VMWarePlayer] (/showthread.php?tid=4010882)



[Legion] How to port-forward to a Windows Virtual Machine [VirtualBox & VMWarePlayer] - Aura - Jan 20, 2014

[img]http://i.minus.com/ieq6viOQ6szdE.gif[/img]


Hey guys, Yoan here AKA Aura for a second tutorial under the Legion banner 🙂

Personally, I don't think this tutorial will help a lot of people, but I would sure have loved to know how to proceed when I was stuck with this problem. In this problem, I'll show you how to port-forward to a Windows Virtual Machine running under VirtualBox and under VMWare Player. It's very simple actually, but I think it's worth writing it down for a quick reference if you ever forget how to do so. You ready ? Let's do this !

[Image: yiYEfJx.png]


VirtualBox

First, let's assume that you have a VM running Windows like me here. Select that VM and click on "Configuration".

- PICTURE -
Spoiler (Click to View)

Then go to the "Network" tab, and change the "Network connection mode" for "Bridged adapter".

- PICTURE -
Spoiler (Click to View)

VMWare Player

First, let's assume that you have a VM running Windows like me here. Select that VM and click on "Edit virtual machine settings".

- PICTURE -
Spoiler (Click to View)

Then go to the "Network Adapter" tab, and under "Network connection", check the "Bridged : Connected directly to the physical network" radio button instead.

- PICTURE -
Spoiler (Click to View)

Port-forwarding and testing

After that, port-forward to your HOST machine private IP address, like I did with my router. You do NOT port-forward to your Virtual Machine private IP address.

- PICTURE -
Spoiler (Click to View)

Now this is where it gets a little tricky. What happens if we can on CanYouSeeMe.org from our VM to check if our port-forwarded port is open or not.

- PICTURE -
Spoiler (Click to View)

CanYouSeeMe.org cannot see that our port if open and therefore we must think that we didn't port-forwarded correctly, right ? No, it's not that. Many people are not aware that in order for CanYouSeeMe.org to be able to see our open port, we have to LISTEN to it. Through a RAT or another utility like Port Listener. Now, let's download this utility on our VM and start listening to our port-forwarded port ! Enter the number of the port you want to listen to and hit "Start".

- PICTURE -
Spoiler (Click to View)

We're now listening our port-forwarded port !

- PICTURE -
Spoiler (Click to View)

Let's see if CanYouSeeMe.org can now see our port as open !

- PICTURE -
Spoiler (Click to View)

Nope, it can't, once again. Why ? Because we're not listening to the port from the right machine. Remember that I told you to port-forward to your host machine private IP address and not your VM private IP address ? Then why are we listening to our port under our VM IP address if the port isn't forwarded to that IP. Now, let's download Port Listener on our host machine and listen to our port-forwarded port here. What does CanYouSeeMe.org returns as a result ?

- PICTURE -
Spoiler (Click to View)

It now sees that our port-forwarded port is open and working !
But, why is it working now ? Simple, when you use a bridge adapter on a VM, your VM will appear like it's directly on the same LAN as your host machine and they'll therefore have the same configuration as your host machine, that's why you're able to see your open port when you listen from your host machine.

And that's it folks. I know this tutorial was short, simple and basic, but like I stated above, I would had love to come across a tutorial like this when I had trouble setting up my VM to port-forward to it. Enjoy !
[Image: yiYEfJx.png]




* - Sicarius - Jan 20, 2014

Thanks, will be needing this no doubt.


* - Terry A. Davis - Jan 20, 2014

Nice tutorial dude. You should do one for VMware


* - Aura - Jan 21, 2014

(Jan 20, 2014 11:44 PM)Perfect Cell Wrote:  Nice tutorial dude. You should do one for VMware

I don't use VMWare but I'll install it in my VM that runs an English version of Windows 7 to take the screenshots. If someone wants to take the same screenshot of VirtualBox as I have but in English, I would really appreciate it !


* - Parsons - Jun 11, 2014

Thanks nice tutorial. But how to route it if you use your windows vm on a linux host with vpn? The network bridge way is the most fastest, but then the noip from your vm will connect to your real home IP. How to mask it behind a vpn if the vpn ports are already forwarded?


* - Aalewis - Jun 11, 2014

forward all the network traffic on port xx to your vm host-only adapter with netcat or something idk


* - Cyber Saint - Jun 11, 2014

Pretty old thread, I guess it got ed. Nice tutorial, didn't know you were previously part of Legion, Yoan.


* - archangel.dmitry - Jun 12, 2014

There is not need to use "Bridged connection" in VMWare because you expose your network to VMs. Virtual Network Editor has portforwarding, it is easy to use as well.


* - Aura - Jun 30, 2014

Sorry I totally missed the last posts in this thread.
This tutorial is currently being rewritten and I'll include Portforwarding with NAT forwarding.

(Jun 12, 2014 01:28 AM)archangel.dmitry Wrote:  There is not need to use "Bridged connection" in VMWare because you expose your network to VMs. Virtual Network Editor has portforwarding, it is easy to use as well.

Does VirtualBox have a such option ?


* - archangel.dmitry - Jun 30, 2014

Yes, it has such option as well.

http://www.howtogeek.com/122641/how-to-forward-ports-to-a-virtual-machine-and-use-it-as-a-server/