Can't connect despite port forwarding - apache

I have a Ubuntu Server 16.04 running on a machine in my local network.
The machine has static assigned IP and running apache2. There is no problem in connecting to it from my local network.
I have port-forwarding for ports 22 and 80 setup on my router to the IP address of the machine.
When I check the ports with my public IP address on sites like http://www.canyouseeme.org/ the result is that the ports are open. When I try to connect using my public IP address and using those ports the connections are refused.
I tried disabling firewall in the router and also on the machine, no result.
What else should I try? It seems that the server is getting no incoming connection when I check with netstat.

Just for troubleshooting purposes:
Setup port forwarding on port 22 and try to ssh into your server using the public IP? If it works, it means apache is refusing the connections and not your router or ISP
On your router, setup the server on the DMZ temporarily and check if it works
Add another port forwarding rule on your router to redirect all http requests on port 8000,for example, to port 80 internally, then try to access your server with http://[public_ip]:8000
Have you changed anything on the apache2.conf file? Also, explain how you are testing the connection, internally using the public IP or from the Internet?

Related

How to send SQL queries to a computer outside of the network through port?

I have a java program that uses SQL queries. The goal is to send them from my home PC to a workstation on a different network elsewhere.
The SQL server is on Windows Server and I opened port 1433 for inbound connections. From that computer, I can successfully ping the port. However, I can't ping the port from the public ip address, only the local (192.168...), so it doesn't work if I were to try to ping it from my home computer.
Is there a way that I can ping it from my home computer? If so, how would I specify the address for JDBC?
Thanks!
It sounds like your Windows Server is behind an internet gateway/router. You need to configure the gateway to allow and forward inbound connections to TCP port 1433 to the IP of the computer that has SQL Server installed.
Here are some guides that explain how to enable port forwarding on different devices:
How to Forward Ports on Your Router (lifewire.com)
How to Port Forward (No-IP.com)
Also, note that we can ping IP addresses, not ports.

Forward server HTTP traffic to handle in another device via SSH Tunnel

I'm developing some webhook required direct access public domain to internal machine, thinking use SSH tunnel to forward data, or got alternative solution?
Hosting server & development machine are in same network
192.168.1.2/24 (Hosting server)
2nd machine is virtual mapping using forticlient firewall without static or dynamic IP in visible in hosting server, so is 1 way initial communication right now.
In this case possible to setup SSH tunnel forward all traffic from 192.168.1.2:80 to handle in development machine port 8080?
How to ssh syntax look like?
Thanks.
This could be done by setting up an SSH tunnel to the remote machine:
ssh -L localhost:80:localhost:8080 development-system
Every request to port 80 on the hosting-server is now forwarded to port 8080 on the development-system.
Please note, that the port 80 on the hosting-server could only be used, when you start the SSH command as root. Also note that the port 80 is only accessible from the hosting-server. To access the port 80 on the hosting-server from everywhere use the following:
ssh -L 80:localhost:8080 development-system
Be sure that you want that.
A good introduction to the topic could be found at
https://www.ssh.com/ssh/tunneling/example
https://unix.stackexchange.com/questions/115897/whats-ssh-port-forwarding-and-whats-the-difference-between-ssh-local-and-remot

Metasploit handler failed to bind to port 4444

I am running Kali Linux on VMware. The host operating system is windows 7, and I'm using NAT for connectivity.
In my metasploit console, when I typed 'exploit' at the msf prompt,(where I am using windows/meterpreter/reverse_tcp as the payload) it showed me the error
Handler failed to bind to My IP:4444
(My IP is my external IP address.)
So in the VMware virtual network editor, I have port forwarded port 4444 of host PC to port 4444 of the virtual PC. Then I allowed inbound packets in the firewall of the host PC, for port 4444 of the host PC.
To ensure that everything is alright, I set up an apache server on the virtual PC, that serves a webpage when accessed via port 4444. The server served flawlessly when I accessed it with an external browser. Satisfied, I shut down the server.
But guess what? Metasploit console has thrown up the same error when I typed 'exploit' again in the msf prompt.
What to do now?
What did it say the reason for failing was.
I'm assuming the full error was failed to bind to port 4444 port is already in use.
You can not run a server on the same port you are trying to bind to.
The correct way to do this is to port forward through your router. Open your router settings and port forward port 4444 to your machines local ip.

Port 80 can't be opened in my computer

First of all, i configured port 80 in my modem router which is 192.168.1.1 and in windows firewall, but although when i check it in websites that does my port 80 open or not?
I get this result: it is closed, how to solved it, call internet provider or what? does it have any other solution that u can help me
Please Help
Regards
if your web server is installed/setup behind a router(local) you need to configure your router for port forwarding pointing to your server ip and port.. you can also enable DMZ and set to point to your server local ip address.
http://lifehacker.com/127276/geek-to-live--how-to-access-a-home-server-behind-a-routerfirewall

Port forwarding on VirtualBox

I have to set up a Virtual Machine on vBox that works as a server for my app. Now, the app sends data to http://x.y.w.z:4567. I run apache server on host and wireshark confirms that the packet is received. Guest is behind NAT and is set up to forward TCPs from any IP port 4567 to port 443 on guest. I tried various versions of setting and not setting IP. Guest also has apache running, but it receives no packets. What should I do?
Please check the log that your port-forward rule is active. Also that your guest/host firewalls doesn't drop packets.