Jump to Navigation

150 - Check a specific port number in Linux

Checking port number has a lot of methods.

1. /etc/services

# cat /etc/services | grep xxx (xxx = port number)

2. Use netstat command

# netstat -anp | grep 1521

3. Use lsof command

# lsof -i -n -P | grep 1521

4. Use nmap command

  • Local Host
# nmap -sT -O localhost
  • Remote Host
# nmap -A -T4 <target machine>
# nmap -sS -P0 -T4 -p 1-65535 -oN result.txt -r -v -A <target machine>

-sS  :  TCP SYN/Connect
-P0  :  Treat all hosts as online
-T4  :  timing to scan, parameter to be efficient
1-65535 : the range of port number
-oN result.txt : Output scan in normal
-r : Scan ports consecutively
-v : Increase verbosity level (use twice for more effect)
-A : Enables OS detection and Version detection

5. telnet command

# telnet 192.168.10.60 22

 

Linux:


Main menu 2

Story | by Dr. Radut