Created
July 24, 2022 12:23
-
-
Save joswr1ght/fcc955bcf63bf54d7e4324f1cfd82dc4 to your computer and use it in GitHub Desktop.
Create a list of top Nmap TCP ports, converted to comma-separated format
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
grep -v '^#' /usr/local/Cellar/nmap/7.92/share/nmap/nmap-services | grep '/tcp' | sort -r -k3 | awk '{print $2}' | sed 's,/tcp,,' | head -40 | sort -n | gsed -z 's/\n/,/g;s/,$/\n/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
gsed
part might be fine assed
; I did this on a mac and I wasn't sure if the non-GNUsed
that comes with macOS would match on\n
.