Skip to content

Instantly share code, notes, and snippets.

@gedsic
Created April 23, 2024 06:19
Show Gist options
  • Select an option

  • Save gedsic/fba2d256be9b7a984e38303fce0cdbfb to your computer and use it in GitHub Desktop.

Select an option

Save gedsic/fba2d256be9b7a984e38303fce0cdbfb to your computer and use it in GitHub Desktop.
Get all open TCP ports from an nmap scan, comma separated (quick and dirty)
cat portscan.nmap | grep "^[0-9]*/tcp" | grep "open" | cut -d '/' -f 1 | sort -h | uniq | tr '\n' ',' | head -c -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment