Hello,
I installed a Linux VM on VirtualBox and the network setting is "NAT". I defined port forwarding and can connect to my VM via the Putty, but I want to scan my VM from Windows via Nmap. Is it possible via "NAT" ?
When I used "127.0.0.1" as target in the Nmap then it scan my host OS and not guest OS.
Thank you.
Network "NAT" mode and connect to the VM.
-
scottgus1
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows, Linux
Re: Network "NAT" mode and connect to the VM.
If you can 'Nmap' one PC from another PC then
if you can Nmap through a router then
open ports in NAT required by Nmap
Nmap-scan other PC via 127.0.0.1:portnumber
end if
end if
Virtualbox Networks: In Pictures: NATRe: Network "NAT" mode and connect to the VM.
I did it too but Nmap can't see my VM: I can ping the VM: But Nmap can scan the VM: What the problem?scottgus1 wrote:If you can 'Nmap' one PC from another PC then if you can Nmap through a router then open ports in NAT required by Nmap Nmap-scan other PC via 127.0.0.1:portnumber end if end ifVirtualbox Networks: In Pictures: NAT
-
scottgus1
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows, Linux
Re: Network "NAT" mode and connect to the VM.
First, if you are using plain NAT, the 'Pictures' tutorial will have informed you that you do not need to put host IP address or guest IP address in a NAT port forward. Added but unnecessary information may cause trouble.
If you can ping either way over a Virtualbox network, then the network is working and other programs' settings are interfering.
You are essentially trying to Nmap a computer behind a router from another computer on the internet, and you have control over the router.
Virtualbox is only providing the router and the target computer. Ask on a Nmap forum how to Nmap a computer behind a router. Apply the same methods to the NAT port forwarding and guest OS.
If you can ping either way over a Virtualbox network, then the network is working and other programs' settings are interfering.
You are essentially trying to Nmap a computer behind a router from another computer on the internet, and you have control over the router.
Virtualbox is only providing the router and the target computer. Ask on a Nmap forum how to Nmap a computer behind a router. Apply the same methods to the NAT port forwarding and guest OS.
Re: Network "NAT" mode and connect to the VM.
Thus, in this situation, the only option is using "Host-only Adapter" ?
-
scottgus1
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows, Linux
Re: Network "NAT" mode and connect to the VM.
Host-Only is a private channel between host and connected guests. There is no 'router' or port forwarding in Host-Only. No internet either. Anything one can do over a regular network one could do with Host-Only.
-
fth0
- Volunteer
- Posts: 5690
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: Network "NAT" mode and connect to the VM.
No, it cannot. (Re-)read the content of the picture you posted.hack3rcon wrote:But Nmap can scan the VM: [...]
That you don't seem to know how to use NMAP.hack3rcon wrote:What the problem?
Try nmap -p 5060 127.0.0.1.