def postHost(request): ip = request.POST.get('ip', '') uname = request.POST.get('username', '') pwd = request.POST.get('password', '') Client(ip=ip, uname=uname, pwd=pwd) session = Session(ip=ip) session.setHost() return HttpResponse(json.dumps({"info": "success"}))
def add_bot(self, target, sshuser, passwd): client = Client(target, sshuser, passwd) if client.session != False: self.BotNet.append(client) dt = time.ctime() self.log.log_append('\n[+] Successful connection with ' + client.target + '\n-> OS Specs: ' + self.ver.LinVer(client) + '\n-> Date and time: ' + dt)
def start_proc(self): cnt = 0 for guest in self.unit_case.guests: client = Client() client.ai_action = self.unit_case.build_ai(client) client.guest_info = guest cnt += 1 if cnt < 30: time.sleep(10) else: time.sleep(1)
class Application(object): app_thread = None start_thread = None is_running = False unit_case = None def run_case(self, case): if len(case.guests) <= 0: return self.unit_case = case for guest in case.guests: client = Client() client.ai_action = case.build_ai(client) client.guest_info = guest
def get_github_client(args: Namespace) -> Client: api_key = args.token or os.getenv(args.token_var, default=None) return Client(api_key)