Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import json
- def for_gay_sh2_json(crapjson, *args):
- args = list(args)
- while args:
- crapjson = crapjson[args.pop(0)]
- if type(crapjson) == str:
- crapjson = json.loads(crapjson)
- return crapjson
- class SH2(object):
- """docstring for ClassName"""
- def __init__(self, email, password):
- super(SH2, self).__init__()
- self.ses = requests.Session()
- self.ses.post("https://www.slavehack2.com/pages/auth.php", data={'email': email, 'password': password}, headers={'x-requested-with':'XMLHttpRequest'})
- self.ses.headers.update({"content-type":"application/x-www-form-urlencoded; charset=UTF-8", 'Server':'Slavehack2'})
- def pulse(self, ip):
- payload = 'action=get&data='+json.dumps({"command":'["pulse", "'+ip+'"]'})
- r = self.ses.post("https://www.slavehack2.com/theme/api/?terminal", data=payload)
- return r.json()
- def rm(self, filename):
- payload = 'action=get&data='+json.dumps({"command":'["rm", "'+filename+'"]'})
- r = self.ses.post("https://www.slavehack2.com/theme/api/?terminal", data=payload)
- return r.json()
- def finishproc(self, id):
- payload = 'action=get&data={"finish":"'+id+'"}'
- r = self.ses.post("https://www.slavehack2.com/theme/api/?processes", data=payload)
- return r.json()
- def checkproc(self, id):
- payload = 'action=get&data={}'
- r = self.ses.post("https://www.slavehack2.com/theme/api/?processes", data=payload)
- timeleft = int(for_gay_sh2_json(r.json(), 'content', 0, 'timeleft'))
- return timeleft < 0
- def resetpulse(self):
- payload = 'action=get&data={"pulse":true}'
- r = self.ses.post("https://www.slavehack2.com/theme/api/?reset", data=payload)
- return r.json()
- bot = SH2("altayakkus1993@googlemail.com","13579altay")
- print(bot.checkproc('78241'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement