Skip to content

Instantly share code, notes, and snippets.

@jimdiroffii
Last active July 10, 2024 19:25
Show Gist options
  • Save jimdiroffii/23027c0e654b844cd47022fa06c86072 to your computer and use it in GitHub Desktop.
Save jimdiroffii/23027c0e654b844cd47022fa06c86072 to your computer and use it in GitHub Desktop.
inline bash cli command for running nmap, just update host IP
host=10.10.11.224 && ports=$(sudo nmap -p- --min-rate=1000 -T4 $host -Pn | grep ^[0-9] | cut -d '/' -f 1 | tr '\n' ',' | sed s/,$//) && sudo nmap -p $ports -sV -sC $host -Pn -oN 'nmap_tcp.txt'
@jimdiroffii
Copy link
Author

jimdiroffii commented Jul 3, 2024

If using tmux, update all panes with the environment variable, then just use the command from ports= onward.

host=10.10.11.224 && tmux setenv host $host && tmux set-option -g update-environment host
ports=$(sudo nmap -p- --min-rate=1000 -T4 $host -Pn | grep ^[0-9] | cut -d '/' -f 1 | tr '\n' ',' | sed s/,$//) && sudo nmap -p $ports -sV -sC $host -Pn -oN 'nmap_tcp.txt'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment