Advertisement
Guest User

Untitled

a guest
Dec 27th, 2016
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.28 KB | None | 0 0
  1. import mechanize
  2. import time
  3.  
  4. br = mechanize.Browser()
  5. br.set_handle_robots(False)
  6. br.addheaders = [('user-agent', '  Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3'),
  7. ('accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')]
  8.  
  9.  
  10. def login():
  11.     print "Knock knock mQ"
  12.     time.sleep(3)
  13.     print "\nThe Matrix has you..."
  14.     time.sleep(3)
  15.    
  16.     username = raw_input("Please enter your username: ")
  17.     password = raw_input("Please enter your password: ")
  18.  
  19.     print "[+]Logging in."
  20.    
  21.     try:
  22.         br.open("http://niggasin.space")
  23.     except Exception as e:
  24.         print "\nCould not open target URL, please reference the error message below: "
  25.         print
  26.         print e
  27.            
  28.    
  29.     br.form = list(br.forms())[0]
  30.     br["username"] = username
  31.     br["password"] = password
  32.    
  33.     # Submit values for username and password fields
  34.     response = br.submit()
  35.  
  36.     print "\n[+]Response:"
  37.     print
  38.     print response
  39.    
  40.     post()
  41.  
  42.    
  43. def post():
  44.     while True:
  45.         br.open("http://niggasin.space/thread/206")
  46.    
  47.         br.form = list(br.forms())[21]
  48.         br["content"] = "tendies"
  49.    
  50.         response = br.submit()
  51.    
  52.         print "\n[+]Response:"
  53.         print
  54.         print response
  55.         print
  56.         print "[+]One hour until your next post"
  57.        
  58.         time.sleep(3600)
  59.            
  60.        
  61. login()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement