Skip to content

Instantly share code, notes, and snippets.

@p0c
Created February 4, 2014 19:52
Show Gist options
  • Save p0c/8811033 to your computer and use it in GitHub Desktop.
Save p0c/8811033 to your computer and use it in GitHub Desktop.
#pentest #recipe: bash commandline portscanner
HOST=192.168.100.254;for((port=1;port<=65535;++port));do echo -en "$port ";if echo -en "open $HOST $port\nlogout\quit" | telnet 2>/dev/null | grep 'Connected to' > /dev/null;then echo -en "\n\nport $port/tcp is open\n\n";fi;done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment