Created
August 29, 2022 09:52
-
-
Save TheArchivistsDomain/2b769ee6f20702ced7d29d2afa72cd99 to your computer and use it in GitHub Desktop.
Convert Shodan's json files to a txt list for feeding into other programs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from sys import argv | |
if len(argv) != 2: | |
print("Usage: python3 shodan2list.py <filename>") | |
exit(0) | |
with open(argv[1]) as f: | |
str_list = list(filter(None, f.read().split("\n"))) | |
for host_json in str_list: | |
host = json.loads(host_json) | |
print(f'{host["ip_str"]}:{host["port"]}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment