Advertisement
Guest User

Untitled

a guest
Apr 5th, 2017
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.64 KB | None | 0 0
  1. def login(user, password, sess):
  2.  
  3.     sess = requests.Session()
  4.     sess.headers.update({"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefaox/52.0"})
  5.     username = user #input("Username >>") #"Username"
  6.     API_KEY = key.api #input ("KEY >>") #'KEY'
  7.     password = password #input("Password >>")
  8.     site_key = key.login
  9.     url = 'http://legacy.hackerexperience.com/'
  10.     sess.get(url)
  11.     url = 'http://legacy.hackerexperience.com/'
  12.     captcha_id = s.post("http://2captcha.com/in.php?key={}&method=userrecaptcha&googlekey={}&pageurl={}".format(API_KEY, site_key, url)).text.split('|')[1]
  13.     if(captcha_id == 'ERROR_ZERO_BALANCE'):
  14.        print("No balance")
  15.     recaptcha_answer = sess.get("http://2captcha.com/res.php?key={}&action=get&id={}".format(API_KEY, captcha_id)).text
  16.     start = time.time()
  17.     print("Solving Captcha...")
  18.     while 'CAPCHA_NOT_READY' in recaptcha_answer:
  19.         time.sleep(5)
  20.         recaptcha_answer = sess.get("http://2captcha.com/res.php?key={}&action=get&id={}".format(API_KEY, captcha_id)).text
  21.     if(recaptcha_answer == 'ERROR_CAPTCHA_UNSOLVABLE'):
  22.         print("Captcha failed")
  23.     else:
  24.         end = time.time()
  25.         print("Time Elapsed: ",end - start)
  26.         recaptcha_answer = recaptcha_answer.split('|')[1]
  27.         #password = input("Password >>") #'Lemons22'
  28.         payload = {
  29.             'action':'login',
  30.             'username':username,
  31.             'password':password,
  32.             'g-recaptcha-response':recaptcha_answer,
  33.             'terms':1
  34.         }
  35.         url = 'https://legacy.hackerexperience.com/login'
  36.         complete = sess.post(url,payload)
  37.  
  38.  
  39. NEW MODULE:
  40.  
  41. import requests
  42. import sys
  43. import time
  44. import helib
  45.  
  46.  
  47. IP1 = helib.ip.Snowman
  48. IP2 = helib.ip.Genie
  49.  
  50. helib.login(helib.user.Genie, helib.password.Dzd, "s")
  51. s = requests.Session()
  52. s.headers.update({"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefaox/52.0"})
  53. helib.login(helib.user.Snowman, helib.password.Dzd, "f")
  54. f = requests.Session()
  55. s.headers.update({"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefaox/52.0"})
  56. while True:
  57.     ddos = s.post("https://legacy.hackerexperience.com/DDoS", data = {'ip':IP}, headers=headers) # SEND POST REQUEST
  58.     print ("Launching DDoS...")
  59.     if "Hacker Experience is a browser-based hacking simulation game" in ddos.text: # CHECK IF THE SESSION IS VALID
  60.         print ("Error: Invalid PHPSESSID")
  61.         sys.exit()
  62.     elif "Launch DDoS attack" in ddos.text: # CHECK IF THERE WAS AN ERROR
  63.         print ("Error: There was an issue launching the DDoS Attack, please make sure the IP is valid and alive")
  64.         sys.exit()
  65.     else:
  66.         print ("DDoS Attack Launched Against {} | Waiting 5 minutes...".format(IP1))
  67.  
  68.     print ("-------------------------------------")
  69.     time.sleep(10)
  70.     ddos = f.post("https://legacy.hackerexperience.com/DDoS", data = {'ip':IP2}, headers=headers) # SEND POST REQUEST
  71.     print ("Launching DDoS...")
  72.     if "Hacker Experience is a browser-based hacking simulation game" in ddos.text: # CHECK IF THE SESSION IS VALID
  73.         print ("Error: Invalid PHPSESSID")
  74.         sys.exit()
  75.     elif "Launch DDoS attack" in ddos.text: # CHECK IF THERE WAS AN ERROR
  76.         print ("Error: There was an issue launching the DDoS Attack, please make sure the IP is valid and alive")
  77.         sys.exit()
  78.     else:
  79.         print ("DDoS Attack Launched Against {} | Waiting 5 minutes...".format(IP2))
  80.         time.sleep(300)
  81.         completeddos = f.get("https://legacy.hackerexperience.com/list?action=ddos", headers=headers)
  82.         completeddos = s.get("https://legacy.hackerexperience.com/list?action=ddos", headers=headers)
  83.     print ("-------------------------------------")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement