this may be kind of an odd question. My friend has challenged me. So somehow, he change the "port" of his site to 31337. If you just go to domain.com, you get redirected to google, to access the real site you go to domain.com:31337. He is going to change it again and he is challenging me to find out which port it is. Is this possible without guessing? Hopefully someone can help! Thanks. Oh, and is this the right stack exchange site to post this on...
closed as not a real question by Su', John Conde♦ Sep 27 '12 at 1:08
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.
Use nmap to port scan you can perform all types of scans some without being detected. If the port is open you'll find it there's no way to hide an open port.
This is such a vast topic (yes, for doing a simple task, many many methods). It would be impossible for me to say anything but this: You are looking for a port scanner. It can be written in any language under the sun, from PHP to C to Perl, Delphi, Python, whatever. You can run it from your local computer (executable) or from a website (remotely).
Now be warned: some firewalls will detect your scans, and maybe blacklist your IP for (example, Project Honeypot). This could land you in some nasty places. So use this only for your friend's game.
Basically how it works though, is your script or program will send a few packets (of varying species) to essentially every port from 0-65535 on the remote host. A stealth scan only sends partial packets, just enough to register that the host is 'listening' on that port, so that it can evade some firewalls or be (less) traceable.
I advise you take a read: http://en.wikipedia.org/wiki/Port_scanner
You can use any port scanner - nmap being one of the most common.
Since this is your friend's machine and its a challenge, a full connect scan should not be a problem. A full connect will not only find the ports that are open but will also find the services/applications listening on it.
I just did a quick nmap scan from on my own linux box and in the output below you can see it detects the open ports, the service they are running and the application behind it. It shows that I am running webservers (http service) on 80 and 3000 which should be accessible on http://localhost:80 (same as http://localhost) and http://localhost:3000
The command I used is :
If you are on windows and want a nice GUI version of nmap, install zenmap