A non-standard port just means a service running on a port other than its default, usually as defined by the IANA port numbers registry.
Running a service on a non-standard port doesn't really mean anything for security. It may reduce the amount of noise that a defender has to deal with in terms of automated scanning on the internet, where bots usually target common standard ports for vulnerabilities. Moving SSH from 22 to, for example, 55522 might reduce the number of drive-by brute-force attempts.
In order to find all services running on a system, one can use nmap or a similar tool. Here's an example command:
nmap -sS -A -Pn -T4 -p1-65535 <host>
Let's break these flags down:
-sS
tells nmap to perform a TCP SYN scan.
-A
enables a range of options related to OS detection, service detection, and script scanning. This is particularly important for identifying services on non-standard ports, as it actually talks to each open port to work out what the service is, rather than guessing based on the port number.
-Pn
tells nmap not to use ICMP ping to check if the host is up. If the target blocks ICMP requests, this will result in nmap assuming that the host is down.
-T4
sets the speed of the scan. Valid arguments are 0 to 5. There's no reason to use anything but 4 here in my experience - anything less is just slower, and 5 reduces the accuracy of the scan because it doesn't wait long enough for TCP ACK replies.
-p1-65535
sets the port range. As we're hunting down both standard and non-standard ports, this is the only way to cover everything. You can also use -p-
as shorthand for this.
The results of this command should show you any ports that are open and what services are running on them. From there it's an open question as to what protocols are considered a potential avenue of attack. SSH or Telnet might be useful, but unless they use a weak username and password it's probably not interesting. They might run a HTTP server on a non-standard port, with a vulnerable web application being served, and that might be of interest too. The possibilities are endless.