Skip to content

Instantly share code, notes, and snippets.

@junquera
Last active October 22, 2018 19:50
Show Gist options
  • Select an option

  • Save junquera/5c498c0491edd98f90a0b7a6ff23829f to your computer and use it in GitHub Desktop.

Select an option

Save junquera/5c498c0491edd98f90a0b7a6ff23829f to your computer and use it in GitHub Desktop.
import socket
import sys
socket.setdefaulttimeout(0.1)
for p in sys.argv[2:]:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
print("Connecting to %s:%d" % ((sys.argv[1], int(p))))
s.connect((sys.argv[1], int(p)))
except:
s.close()
domain=$1
shift
# for p in ${@:2}; do
for p in $@; do
nmap -Pn --max-retries 0 -p $p $domain;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment