How to open port 80 on Mac? - tcp

I want to send application logs from mobile device via tcp-socket. I put listener with nc -l -k 80 command in Mac's terminal. But port 80 is closed on Mac. How can I open port 80?
And other question about my IP address:
With web check tool, I receive that my IP is : 89.xxx.xx.196
I think that it should began from 196 and not from 89. Why it is opposite and how can I receive the none-oposite my IP?

Based on your netstat output indicates that the netcat listener is running and the port is open. To perform a local test, on your MBP, run telnet 127.0.0.1 80 and you should be able to connect like so -
$ telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Your mobile device (I'm presuming) is on the same wireless) as the MBP. Therefore, as alluded to by Michael Graczyk, you need to connect to the MBP IP address on the internal network (ifconfig en1), which is the 192.x.x.x IP address. If you can run telnet 192.x.x.x 80 where 192.x.x.x is the IP of the MAC and get a connected prompt, then all is ok. If you get nothing and the simply the CLI is returned, then there's something in between blocking or dropping the port 80 connection attempt. It is possible that your WAN router needs an ACL rule on it to allow the connection.
If the mobile device is on an external network, you'll need to connect to 89.x.x.x (on your WAN router) and enable port forwarding (most likely) on port 80 on the router.

Related

How do I open a port in Windows 10 for use?

I need to open port#42474 on my Windows 10 system for penetration testing purposes.
I added it to the inbound list of my Windows Defender Firewall (both TCP and UDP protocol), and it is enabled.
However, whenever I am trying to ping this port on my machine using telnet it is throwing an error as
Connecting To localhost...Could not open connection to the host, on port 42474: Connect failed
I am able to use telnet to ping other sites such as google.com. But not this port on my machine. Below is the command I am running to test the port and the error:
Port
Telnet error
telnet localhost 42474
Do I need to do anything else to open port#42474?
How do I verify if this port is available for use?
TCP ports are bi-directional, so check these tips:
Verify your service on this port is running: netstat -a
Be sure your firewall isn't blocking (try to deactivate it: if it works well, your rule isn't correct)
Search for your service log: maybe,
it receive information, but it's not able to reply. I recommend you to use PuTTY or Kitty (which is my favorite, because it's portable without registry keys modification), and try to connect on this port.
If you need a tool that able to listen on the port, see this post: Utility to open TCP port to listen state and netcat.
You can use the Python programming language. More specifically, the socket library:
import socket
hote = "localhost"
port = 4444
socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.connect((hote, port))
print "Connection on {}".format(port)
socket.send(u"Hey my name is Abdx!")
print "Close"
socket.close()

accessing my local site from a remote computer

I have IIS 7.5 installed on my computer.
I have one site configured on it.
It has binding on port 80 with IP all unassigned.
I want to reach that site from a remote computer i.e. not inside the LAN.
I also configured port forwarding to my LAN IP but I still can't reach it.
Is there something else I need to do in order to achieve it?
telnet from computer to port 80 succeed but from a remote it doesn't succeed.
These are the configurations in my router:
10.0.0.2
External Port Start
1
External Port End
65000
Internal Port Start
80
Internal Port End
80
Ok - it was a problem with my router configurations:
I set port 80 for both external and internal and no I reached my computer

How to make port number 80 appear in nmap scan?

When I perform an nmap scan on my localhost why doesn't the port number 80 show up as open even though my browser is open, ssh and telnet ports show up though. If there is a rule or a firewall blocking it then how do I temporarily suspend it. I use Ubuntu 14.10.
Port 80 should only appear in a scan if you have a web server running on your local machine, listening on port 80. Port 80 is the server port, not the client port.
Firstly you can use "netstat -nltp" to check whether you have listened on port 80.
Then type command "nmap -P0 -p80 localhost", port number 80 will be showed as open status.

Two computer on a same IP?

I have implement a Client-Server application in java. The server can serve multiple clients, and I want to test that, but my knowledges on Networking is poor, and I need a way to test my application on my home.
I have a rooter, which are connected both of my computers. My "server" class in java uses as host the local host (127.0.0.1) on a given port.
How can I test my program if
The Server.java is running on the Computer A
Server.java is running on 127.0.0.1 on 3943 port
1st Client.java is running on the Computer A
1st Client.java is connected to 3943 port
2nd Client.java is running on the Computer B
2nd Client.java is connected to 3943 port
Any ideas?
Use unique ports for the clients and servers running on the same machine. In addition 127.0.0.1 is localhost (internal to that machine). Computer B cannot communicate with 127.0.0.1 on Computer A. Use 127.0.0.1 if all applications or on the same machine. Use the computers actual IP address if you want external machines to be able to communicate with the server.
When client and server, are on the same computer, what you are doing must be already working.
To connect from a different computer, you need to find the "real" ip address of your server.
If you are on Windows, open a command shell on your computer A, and run ipconfig. On unix/linux/mac, run ifconfig.
Look for a string, looking like an ip address, but not 127.0.0.1, there has to be another one if you are connected to a network, probably looks like 10.0.0. or 192.168.<0 or 1> ..
Use this address everywhere instead of 127.0.0.1
A full TCP connection consists of two different endpoints. The server side of the connection is one endpoint (it will be do a listen on that endpoint). When a client creates it's side of the connection (the client socket), it will do a connect to the server ip:port combo and get a number assigned from a range of so-called "ephemeral" ports.
The fact that both sides of the connection have the same IP address doesn't matter - the full connection is defined by two distinct elements (address:port combinations).
FirstClient's connection to the server will be ServerIP:ServerPort<->Client1_IP:Client1_Port, and SecondClient's connection will be ServerIP:ServerPort<->Client2_IP:Client2_Port. The network layer can differentiate between these (they are two different connection streams) and route traffic to the appropriate sender/receiver for that stream.
If you run the server bound to IP 127.0.0.1 you are not opening it to the network, only your own computer will be able to connect to it, acessing 127.0.0.1 (loopback IP address).
To open this server to the network, you must do one of the two things:
Bind it to the IP 0.0.0.0 so it will be acessible from all networks;
Bind it to a specific network IP address so that it will be available to that network only.
Its common practice to just bind it to 0.0.0.0, its easier.
Once its done, you will be able to connect from other computers to the server running on computer A, however, not through IP 127.0.0.1. Thats the loopback address and can only be used by a computer to connect to itself.
Computer A can use the IP 127.0.0.1 to connect to the server since the server is running on it, but other network computers will have to specify computer A's network IP address.
You can find your IP address on the network adapter details, or running the command ipconfig /all on a command prompt (Windows) or ifconfig (Linux).

port forward http port (80) on virgin super hub

I am currently working on a project to make my apache server live, which is new me so this is the first time I am doing anything like this. basically I have gone in to the router and requested port forwarding on port 80 for my local IP address, but to no effect. when I test it with a web tool which tells you if a port is open or not it says it's closed. More confusingly when I run a netstsat -a command it shows http as listening. I'm not sure if its a firewall issue or I'm going about it all wrong. any Ideas would be much appreciated. Thanks
You need to be testing from outside your local network. If you run netstat on your server, of course it is going to say "listening". Is your web testing tool being run from outside your firewall? You should also be able to turn off wifi on your phone and test hitting your broadband IP address:80. Are you forwarding from port 80 on your router to port 80 on your server? Is it possible that your provider is blocking port 80 for residential accounts?
First google for an online port scanner and ask it to scan port 80.
Second if you're using Ubuntu ufw (firewall) is probably running default deny rules so do this: sudo ufw allow 80
To check it's working just plug your WAN IP into your browser URL bar, it should connect to your test page in /var/www/html/index.html

Resources