How do I determine if a port is open on a Windows server? [closed] - windows-server-2003

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 3 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I'm trying to install a site under an alternative port on a server, but the port may be closed by a firewall. Is there a way to ping out or in, on a specific port, to see if it is open?

Assuming that it's a TCP (rather than UDP) port that you're trying to use:
On the server itself, use netstat -an to check to see which ports are listening.
From outside, just use telnet host port (or telnet host:port on Unix systems) to see if the connection is refused, accepted, or timeouts.
On that latter test, then in general:
connection refused means that nothing is running on that port
accepted means that something is running on that port
timeout means that a firewall is blocking access
On Windows 7 or Windows Vista the default option 'telnet' is not recognized as an internal or external command, operable program or batch file. To solve this, just enable it: Click *Start** → Control Panel → Programs → Turn Windows Features on or off. In the list, scroll down and select Telnet Client and click OK.

On Windows you can use
netstat -na | findstr "your_port"
to narrow down the results. You can also filter for LISTENING, ESTABLISHED, TCP and such. Mind it's case-sensitive though.

If you're checking from the outside, not from the server itself, and you don't want to bother installing telnet (as it doesn't come with the last versions of Windows) or any other software, then you have native PowerShell:
Test-NetConnection -Port 800 -ComputerName 192.168.0.1 -InformationLevel Detailed
(Unfortunately this only works with PowerShell 4.0 or newer. To check your PowerShell version, type $PSVersionTable.)
PS: Note, these days there are some claims on the twittersphere that hint that this answer could be improved by mentioning "Test-Connection" from PowerShell Core, or the shortcut "tnc". See https://twitter.com/david_obrien/status/1214082339203993600 and help me edit this answer to improve it please!
(If you have a PSVersion < 4.0, you're out of luck. Check this table:
Even though you can upgrade your version of PowerShell by installing the Windows Management Framework 4.0, it didn't do the trick for me, Test-NetConnection cmdlet is still not available).

I did like that:
netstat -an | find "8080"
from telnet
telnet 192.168.100.132 8080
And just make sure that the firewall is off on that machine.

On a Windows machine you can use PortQry from Microsoft to check whether an application is already listening on a specific port using the following command:
portqry -n 11.22.33.44 -p tcp -e 80

If telnet is not available, download PuTTY. It is a far superior Telnet, SSH, etc. client and will be useful in many situations, not just this one, especially if you are administering a server.

Use this if you want to see all the used and listening ports on a Windows server:
netstat -an |find /i "listening"
See all open, listening, established ports:
netstat -a

Do you want a tool for doing it? There is a website at http://www.canyouseeme.org/. Otherwise, you need some other server to call you back to see if a port is open...

On Windows Server you can use
netstat -an | where{$_.Contains("Yourport")}

Another option is tcping.
For example:
tcping host port

PsPing from Sysinternals is also very good.

Here is what worked for me:
Open a command prompt
Type telnet
Microsoft Telnet>open <host name or IP address><space><port>
It will confirm whether the port is opened.

Another utility that I found and is good and small as well, is PortQry Command Line Port Scanner version 2.0.
You can ping a server and a port and it will tell you the state of the port. There is a command-line utility and a UI for it.

Related

Can't access localhost in LAMP [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
First of all, I'm beginner at this, so don't be too harsh.
Yesterday, I wanted to make Linux Server. Installed LAMP, PhpMyAdmin. Man the websites IP static. I installed moodle on my website server. Then I closed VirtualBox and went to sleep.
Today when I runned my server and tried to access /phpmyadmin or (ipaddress)/moodle it says that webpage isn't available. Does this mean I have to do everything from the scratch again?
I'd appreciate any help.
I tried command sudo service apache2 start , but nothing changes.
Run this command in Terminal:
sudo service apache2 restart
OR
sudo restart apache2
Try the Answer on this Post
There are a lot of basic troubleshooting steps to take here.
You mentioned "localhost" in your question, but this doesn't sound like the local host; if you're connecting to your guest machine from the host machine then both machines will treat it as a networking connection (because it is networking). How that networking is configured will depend on your VirtualBox configuration.
Are you sure the virtual machine is running, the IP address is assigned, and networking is, well, working? Try pinging the virtual/guest machine from the host machine. After pausing and resuming, one of my Debian machines used to always pick up a DHCP address on the host-networking adapter despite being set to a static address in /etc/network/interfaces. Look at ifconfig to verify the IP address listed is what you expect.
Are you sure Apache is running? Try accessing it from within the guest machine on http://localhost -- by telnet to port 80, command-line tool, or full-on web browser.
Are other services working? Try to connect remotely to whatever you have running: SSH, FTP, IMAP, MySQL, NTP -- try to connect and see if the problem is the network or the service.

What program in Windows 10 uses port 80? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I updated my Windows 7 PC to Windows 10. When I start AMPPS it says port 80 is used by another program. What program uses port 80?
It's probably the W3SVC (World Wide Web Publishing Service) service. See the answer below:
https://stackoverflow.com/a/31229606/1532882
Click the start menu
Type in Services
Sort by Name
Scroll down to World Wide Web Publishing Service (W3SVC) and disable it
Per phpvillian's answer, you can also run the following to help determine the culprit (make sure you open the command line with elevated privileges, e.g. "Run as administrator"):
netstat -a -b
You're likely referring to Skype as it's notorious to using port 80 without consideration. Open the command prompt and type netstat -a -b to get your answer. This question has been answered already and explains how to use netstat.
How can you find out which process is listening on a port on Windows?
I had same problem but already solved. You can find used port from Windows Firewall.
Click Start > Settings > Ethernet >Network and Internet > Windows Firewall
In the left pane, click Advanced Settings
In Windows Firewall with Advanced Security, click Inbound Rules.
Find Local Port 80 with Protocol TCP. in my case is "World Wide Web Services (HTTP Traffic-In)"
Once you find it, stop or disable that rule from Windows Services (World Wide Web Publishing Service).
if needed restart your pc.

Possible Reasons for Linux SSH hang [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
We have Linux server run java application,this morning the server did not response for the ssh connection.when I ssh -v, it shows " connection refused by remote host ".We also have a vnc server run in that Linux and it does not work either.But the ftp server is ok in that server,we can upload file into the server.In the end,we did not found a way to remote connect to the system.
After we reboot the computer on site,the ssh server is working again.But We did not found a clue why ssh is not working? Have someone ever met ssh hang problem like this? Which file should we look into?How to prevent ssh hang? Thanks in advanced.
added:
I check the log from secure.log.it states many failed attemps like following and i check the ipaddress is not ours:
Feb 23 04:13:30 localhost sshd[1276]: Failed password for invalid user mantis from 112.78.127.235 port 57140 ssh2
It seems like the attacker is trying to login into my server all the time until our ssh service is not responding.
SSH probably didn't "hang". The "Connection refused" response implies that no application was listening for incoming connections on the SSH port. It is most likely that the SSH service had died.
Check the log files. There is a good chance that there are clues in the logs (somewhere) to help explain what had happened.
If the logs don't give a definite explanation, I'd be considering the possibility that your server had been hacked ...
This sounds more like a firewall issue, either on the box itself or somewhere else in the network. You can verify that ssh is running and listening with netstat -ta | grep :22. If it is not, it indeed is a problem with SSH itself.

I messed up setting up a ufw firewall on Ubuntu and can no longer log in to my server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
Alright, so I'm not great (or even good) with servers, but have recently been put in charge of the task of setting them up. I have an application sitting on a VPS, here are the specs that may matter for this question...
Ubuntu 10.04
Nginx
ufw
So I was setting up my first firewall and was using UFW. I accidentally only opened up ports 80 and 443 (I was confused about setting up an SSL cert (also a new task)) and got logged out of the server. My ssh is set to try port 22 and so when I try to ssh in, it won't let me, I get this error --
ssh: connect to host xxx.xxx.xxx.xxx port 22: Operation timed out
So I tried to ssh in on one of the open ports by running this command --
ssh deployer#xxx.xxx.xxx.xxx -p443
and received this error --
ssh: connect to host xxx.xxx.xxx.xxx port 443: Connection refused
The same thing happened for trying port 80.
What do I do? I already have a live and very active application on this server. I need to be able to login and reopen port 22 for ssh or switch ssh over to another port.
Side note: sftp did not work either.
Most (if not all) VPS providers have a shell integrated in the control panel of the customer, so even if you have the sshd off you can still run commands on the server.
If not you can still also contact the hosting company and they can run commands on any of the virtual devices they are hosting.
Because your ssh server is running only on port 22 you will not be able to connect to it through port 80 (usually used for http) or port 443 (usually used for https). So there is nothing you can do from remote :(
If somehow you could upload and execute a file in your application, then to get a shell on the server is only a matter of uploading a reverse-shell. Some web applications allow the admins (I suppose you're an admin of the web application) to upload this kind of files (.php, .perl, etc.). Maybe is the case of your application. If you can't upload a file, then you probably are screwed.
Note that this isn't a good security practice. The application shouldn't allow you to upload and execute code, because if somehow an admin account is compromised, then the whole server may be compromised.

How to access my SSH linux server from outside my home network [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
So I've been scouring the internet for days trying to figure this out and can't figure it out.
I know its going to be an easy one.
So I recently took an old desktop and loaded ubuntu server 12.04 on it. My goal with this project is to create an area to host a few git repositories and maybe a simple webpage.
I've installed both the SSH and Apache2 packages and tried to configure them. Right now I can log in from my laptop using ssh greg#0.0.0.0.0 but only while I am on the same network. Once I leave the house I get a timeout error.
So 2 things I would like to get at right now.
How to configure the SSH to allow me to access the server from outside the network.
Get my host name on the server so logins will be greg#hostname instead of greg#0.0.0
(I've done sudo hostname and changed the etc/hostname file and no results)
Thanks guys.
The timeout external to your home network occurs because the IP you specified will be routed elsewhere on external networks.
As others have indicated, you need to configure port forwarding on your router (external interface) to the SSH server. You can either use the standard port (22) or any alternative port (something above 1024). For the webserver you will need to set the port forwarding from port 80 on the external interface to your server and maybe port 443 if you want to include SSL/TLS connections.
I also recommend using the SSH config file (~/.ssh/config) to make it easier when making either an internal or external connection. Add something like this:
Host serverext
Hostname 1.2.3.4
User greg
Port 22
Host serverint
Hostname 192.168.1.10
User greg
Port 22
Change the Hostname for the serverext config to the IP address of your Internet connection. If you use a non-standard port for the external SSH connections then change the port field for serverext to match that.
Change the Hostname for the serverint config to the internal IP address for that server on your network.
Once this is configured, in conjunction with the port forwarding you will be able to use "ssh serverint" to connect to your server when you're at home and "ssh serverext" to connect to it when you're somewhere else.
It is possible to include advanced configuration options through the SSH configuration file, such as port tunneling and websocket connections. In the past I've done things like that and redirecting SSH connections through SOCKS proxy servers. I've even had it run through Tor, but it is very slow.

Resources