Agent: Make do_GET() and inner function of _get_new_http_handler_class
This commit is contained in:
parent
95be74ed81
commit
0e01264bb6
|
@ -97,17 +97,6 @@ def _get_new_http_handler_class(
|
|||
stored as class variables. Creating the request handler classes dynamically at runtime allows
|
||||
multiple ExploitClassHTTPServers, each with it's own unique state, to run concurrently.
|
||||
"""
|
||||
return type(
|
||||
"HTTPHandler",
|
||||
(http.server.BaseHTTPRequestHandler,),
|
||||
{
|
||||
"java_class": java_class,
|
||||
"class_downloaded": class_downloaded,
|
||||
"download_lock": threading.Lock(),
|
||||
"do_GET": do_GET,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def do_GET(self):
|
||||
with self.download_lock:
|
||||
|
@ -126,3 +115,14 @@ def do_GET(self):
|
|||
self.end_headers()
|
||||
logger.info("Sending the payload class!")
|
||||
self.wfile.write(self.java_class)
|
||||
|
||||
return type(
|
||||
"HTTPHandler",
|
||||
(http.server.BaseHTTPRequestHandler,),
|
||||
{
|
||||
"java_class": java_class,
|
||||
"class_downloaded": class_downloaded,
|
||||
"download_lock": threading.Lock(),
|
||||
"do_GET": do_GET,
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue