Created
December 9, 2020 13:29
-
-
Save 3isenHeiM/f6865424187c0d7fba0bc2e57db84fef to your computer and use it in GitHub Desktop.
Build Nmap top port list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# This snippet will output a comma-separated list of the top XXX most used ports (according to Nmap), | |
# given XXX a number (eg 20, 1000) passed as argument. | |
# Usage (to output the top 10 most common ports) : | |
# root@localhost # ./Nmap_top_port_list.sh 10 | |
# 21-23,25,80,110,139,443,445,3389 | |
top=$1 | |
nmap --top-ports $top localhost -v -oG - | grep TCP | cut -d ";" -f 2 | cut -d ")" -f 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment