Skip to content

Instantly share code, notes, and snippets.

@komodoooo
Last active July 3, 2025 10:44
Show Gist options
  • Save komodoooo/38e1c1fc32e38eb3f0990f052538c708 to your computer and use it in GitHub Desktop.
Save komodoooo/38e1c1fc32e38eb3f0990f052538c708 to your computer and use it in GitHub Desktop.
One-liner script to get shodan's top 1000 ports in a parsable way
shodan stats --facets port:1000 net:0.0.0.0/0 > tmp.txt && python3 -c 'open("ports.txt", "w").write("\n".join([i.split()[0] for i in open("tmp.txt", "r").read().strip().splitlines()[1:]]))' && rm tmp.txt
# these ports are probably all TCP due to its popularity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment