1

Problem

I have a Kali VM installed in Virtualbox. I need to access a website hosted by a webserver on my VM from the internet. The URL is <"MyPublicIp">/exploitCsrf.html

What I've tried

  • Reaching the webserver from the VM host does not work

By now the network setting in VirtualBox is NAT without port forwarding I've access from my VM to internet

  • Reaching the webserver from the internet does not work

Logic since I can't join my VM even from the lan

  • Reaching the webserver from the VM using the IP's 127.0.0.1, 10.0.2.x (LAN IP) does work, but it does not with the public IP 99.104.x.x

  • I've asked a fixed IP from my ISP. It takes 3 days to be set.

Question

How can I configure access from the internet to my Kali VM?

jayjaypg22
  • 131
  • 6
  • 1
    To allow access to the server from the internet, you need to configure this on your internet gateway - most likely a Router/Modem combo device. In addition to that you need an internet connection, that actually allows that - many residential lines do not. – Eugen Rieck Apr 06 '20 at 12:02
  • Does this answer your question? [Reaching a device in my LAN from the Internet](https://superuser.com/questions/1374979/reaching-a-device-in-my-lan-from-the-internet) – Saaru Lindestøkke Apr 06 '20 at 12:28
  • It's not really on the router/modem side I think it's a setting in virtualbox to allow acces from the internet to the OS in the VM. The VM can access to the internet and the server hosting Virtualbox is reachable form the internet. – jayjaypg22 Apr 06 '20 at 12:34
  • @SaaruLindestøkke : I think there will be an easier setting on VirtualBox but I didn't find it so maybe I'm wrong! – jayjaypg22 Apr 06 '20 at 13:00
  • 1
    I'm confused: you first say `I found that it's not open` and `By now the web server ... just not a machine outside my lan`, but later you say `the server hosting Virtualbox is reachable form the internet`. Could you perhaps explain more what your configuration is? How do you diagnose that the server is reachable from outside, but the VM webserver is not? Also, [did you try this](https://superuser.com/a/245760/141595)? – Saaru Lindestøkke Apr 06 '20 at 13:54
  • Weel maybe my diagnostic was wrong : I don't have a fix ip adress so indeed it may be a configuration issue in my router. I will try it and come back here when my provider gives me a ix ip. Which may takes at worst 3 days. Thx – jayjaypg22 Apr 06 '20 at 15:10
  • While we wait these 3 days, can you perhaps edit your question to include the much needed details + show what you've tried? In that way your question becomes useful information for future visitors and perhaps someone would be able to answer and help you. – Saaru Lindestøkke Apr 06 '20 at 23:22
  • @SaaruLindestøkke , I've added details but it doesn't seem to be enough. What do you need ? – jayjaypg22 Apr 07 '20 at 07:55
  • Well, I don't need anything. I'm trying to help you write a well structured question such that other can help you (I know very little about networks myself). [This site has a help section on how to ask good questions](https://superuser.com/help/how-to-ask). Please take a look there, especially the research part. Furthermore, your setup is still not clear to me. What OS is the host machine? Are you connection to the host machine from another machine in the same LAN? From outside? – Saaru Lindestøkke Apr 07 '20 at 08:40
  • 1
    I've proposed an edit to your question, once it's approved, please fill it in further. – Saaru Lindestøkke Apr 07 '20 at 08:57
  • @SaaruLindestøkke, thanks a lot indeed it's clearer – jayjaypg22 Apr 07 '20 at 09:26
  • @jayjaypg22 Wait. **You** should fill in information there. I just made a start. Did you read the link on how to ask a good question? Can you please, pretty please, include some previous research? – Saaru Lindestøkke Apr 07 '20 at 10:09
  • Thank you for providing some more information. Regarding accessing VM webserver from host: [does this question[(https://superuser.com/q/245156/141595) have helpful answers? – Saaru Lindestøkke Apr 07 '20 at 10:37

1 Answers1

0

The solution that works for me was :

  • In my ISP Box : configure port forwarding on an authorized port, by instance 51000
  • In Virtual box : configure Bridge in Network
  • In my Firewall : authorize virtual box program and port 51000
  • In my "dev" (metasploit / webserver) : specify the port 51000 instead of 80 by instance
jayjaypg22
  • 131
  • 6