Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import time
- import re
- from bs4 import BeautifulSoup
- import random
- from random import choice
- from string import ascii_uppercase
- import string
- import time
- import secret
- global s
- global GID
- GID = ''
- s = requests.Session()
- s.headers.update({"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefaox/52.0"})
- def login():
- username = "HungryEmu"
- password = secret.password()
- API_KEY = secret.apikey()
- site_key = '6Ld1KwITAAAAAB1taFKufv4_Tu5x_TEblkzWNDt8'
- url = 'http://legacy.hackerexperience.com/'
- s.get(url)
- url = 'http://legacy.hackerexperience.com/'
- captcha_id = s.post("http://2captcha.com/in.php?key={}&method=userrecaptcha&googlekey={}&pageurl={}".format(API_KEY, site_key, url)).text.split('|')[1]
- if(captcha_id == 'ERROR_ZERO_BALANCE'):
- print("No balance")
- recaptcha_answer = s.get("http://2captcha.com/res.php?key={}&action=get&id={}".format(API_KEY, captcha_id)).text
- start = time.time()
- print("Solving Captcha...")
- while 'CAPCHA_NOT_READY' in recaptcha_answer:
- time.sleep(5)
- recaptcha_answer = s.get("http://2captcha.com/res.php?key={}&action=get&id={}".format(API_KEY, captcha_id)).text
- if(recaptcha_answer == 'ERROR_CAPTCHA_UNSOLVABLE'):
- print("Captcha failed")
- else:
- end = time.time()
- print("Time Elapsed: ",end - start)
- recaptcha_answer = recaptcha_answer.split('|')[1]
- payload = {
- 'action':'login',
- 'username':username,
- 'password':password,
- 'g-recaptcha-response':recaptcha_answer,
- 'terms':1
- }
- url = 'https://legacy.hackerexperience.com/login'
- test = s.post(url,payload)
- return test
- def findID():
- valueRegex = 'value=\"[0-9]+\"'
- idRegex = "[0-9]+"
- url = "https://legacy.hackerexperience.com/university"
- result = s.get(url).text
- if "Hacker Experience is a browser-based hacking simulation game" not in result:
- p = re.findall(valueRegex, result)
- for match in p:
- ids = re.findall(idRegex, match)
- return ids[0]
- else:
- print ("Error: Account not logged in")
- def findPID():
- valueRegex = 'complete[0-9]+'
- idRegex = "[0-9]+"
- url = "https://legacy.hackerexperience.com/processes"
- result = s.get(url).text
- if "Hacker Experience is a browser-based hacking simulation game" not in result:
- p = re.findall(valueRegex, result)
- for match in p:
- ids = re.findall(idRegex, match)
- return ids[0]
- else:
- print ("Error: Account not logged in")
- def startResearch(softID):
- API_KEY = secret.apikey()
- site_key = '6LfCtBETAAAAAEJNqkKIAfLbH4mNx38wxGJV_ZUK'
- url = "https://legacy.hackerexperience.com/university?id=" + str(softID)
- get = requests.get(url).text
- captcha_id = s.post("http://2captcha.com/in.php?key={}&method=userrecaptcha&googlekey={}&pageurl={}".format(API_KEY, site_key, url)).text.split('|')[1]
- recaptcha_answer = s.get("http://2captcha.com/res.php?key={}&action=get&id={}".format(API_KEY, captcha_id)).text
- print ("Solving Captcha..")
- while 'CAPCHA_NOT_READY' in recaptcha_answer:
- time.sleep(5)
- recaptcha_answer = s.get("http://2captcha.com/res.php?key={}&action=get&id={}".format(API_KEY, captcha_id)).text
- recaptcha_answer = recaptcha_answer.split('|')[1]
- postData = {
- 'id': softID,
- 'act': 'research',
- 'name': 'DELETED',
- 'delete': '1',
- 'acc': '964796715008',
- 'g-recaptcha-response': recaptcha_answer
- }
- post = s.post(url, data=postData)
- print("Research Started @ "+str(softID))
- return post
- def finishResearch(PID):
- url = ('https://legacy.hackerexperience.com/processes')
- req = s.get(url)
- proc = req.text
- params = {
- ('pid', PID),
- }
- post = s.post('https://legacy.hackerexperience.com/processes', params=params)
- if "Task manager - Hacker Experience" in proc:
- if "Research file" in proc:
- time.sleep(30)
- ID = findID()
- PID = findPID()
- finishResearch(PID)
- else:
- print("Proccess Completed")
- return post
- def research():
- url = ('https://legacy.hackerexperience.com/processes')
- req = s.get(url)
- proc = req.text
- if "Hacker Experience is a browser-based hacking simulation" in proc:
- login()
- print("Logging into account...")
- elif "Task manager - Hacker Experience" in proc:
- print("Researching SSH...")
- PID = findPID()
- finishResearch(PID)
- time.sleep(2)
- ID = findID()
- startResearch(ID)
- else:
- print("Possible 502... Restarting")
- time.sleep(5)
- research()
- while True:
- try:
- research()
- except:
- research()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement