Categories
Cyber Security How-To Guides

Simple Netcat Port Scanner

TL;DR

for i in {1..1024}; do nc localhost $i -zv; done 2>&1 | grep Connected | sed 's/.:(.)./\1/g'

Example

$ for i in {1..1024}; do nc localhost $i -zv; done 2>&1 | grep Connected | sed 's/.:(.)./\1/g'
22
80
443

Leave a Reply

Your email address will not be published. Required fields are marked *