Scanning for open ports
webduvet

webduvet @webduvet

About: Software engineer always on the mission to learn something new.

Location:
Dublin, Ireland
Joined:
May 4, 2021

Scanning for open ports

Publish Date: Jan 4 '23
5 0

lsof

list of open files

lsof -i -P -n | grep LISTEN
Enter fullscreen mode Exit fullscreen mode

netstat

Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships

netstat -tulpn | grep LISTEN
Enter fullscreen mode Exit fullscreen mode

ss

utility to investigate sockets

ss -tulpn | grep LISTEN
Enter fullscreen mode Exit fullscreen mode

nmap

network exploration tool, port scanner

nmap -open 192.168.3.34
Enter fullscreen mode Exit fullscreen mode

scanning open ports on remote IP address

nc -zv 192.168.3.34 2>&1 1-1024 | grep -v refused
Enter fullscreen mode Exit fullscreen mode

this scans open ports in the range of 1 to 1024 on the above IP address.
redirects the error output to standard outoput and matches all lines except refused

scanning all open ports on the subnet using nmap

nmap -n 192.168.3.0/24
Enter fullscreen mode Exit fullscreen mode

Sources

Comments 0 total

    Add comment