Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3 #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions shodankeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@

def test(key):
api = shodan.Shodan(key)
print "{+} Testing Key: %s" %(key)
print("{+} Testing Key: %s" %(key))
try:
info = api.info()
except Exception:
print "{-} Key %s is invalid!" %(key)
print("{-} Key %s is invalid!" %(key))
return False,False
if info['plan'] == 'dev' or info['plan'] == 'edu': #this seems to be how they are categorized
print "{+} Key %s appears to be valid, and bonus, paid!" %(key)
print("{+} Key %s appears to be valid, and bonus, paid!" %(key))
return True,True
elif info['plan'] == 'oss': # however I might be wrong. oh well.
print "{*} Key %s appears to be valid! Not paid for though!" %(key)
print("{*} Key %s appears to be valid! Not paid for though!" %(key))
return True,False


Expand All @@ -49,15 +49,15 @@ def main(args):
comm_keys.append(key)
else:
pass
print "\n\n{+} Acquired %d valid keys" %(len(valid_keys))
print "{+} Acquired %d paid-keys" %(len(paid_keys))
print "{+} Acquired %d community-keys" %(len(comm_keys))
print "\n{+} Paid Keys..."
print("\n\n{+} Acquired %d valid keys" %(len(valid_keys)))
print("{+} Acquired %d paid-keys" %(len(paid_keys)))
print("{+} Acquired %d community-keys" %(len(comm_keys)))
print("\n{+} Paid Keys...")
for key in paid_keys:
print key
print "\n{+}Community Keys..."
print(key)
print("\n{+}Community Keys...")
for key in comm_keys:
print key
print(key)


if __name__ == "__main__":
Expand Down