forked from p15670423/monkey
Agent: Add _initialize_http_handler() to ExploitClassHTTPServer
This commit is contained in:
parent
176177b8cb
commit
6fa1d20e6a
|
@ -31,13 +31,17 @@ class HTTPHandler(http.server.BaseHTTPRequestHandler):
|
|||
class ExploitClassHTTPServer:
|
||||
def __init__(self, ip: str, port: int, java_class: bytes, poll_interval: float = 0.5):
|
||||
logger.debug(f"The Java Exploit class will be served at {ip}:{port}")
|
||||
self._class_downloaded = threading.Event()
|
||||
|
||||
HTTPHandler.java_class = java_class
|
||||
HTTPHandler.class_downloaded = self._class_downloaded
|
||||
self._class_downloaded = threading.Event()
|
||||
self._poll_interval = poll_interval
|
||||
|
||||
self._initialize_http_handler(java_class)
|
||||
|
||||
self._server = http.server.HTTPServer((ip, port), HTTPHandler)
|
||||
self._poll_interval = poll_interval
|
||||
|
||||
def _initialize_http_handler(self, java_class: bytes):
|
||||
HTTPHandler.java_class = java_class
|
||||
HTTPHandler.class_downloaded = self._class_downloaded
|
||||
|
||||
def run(self):
|
||||
logger.debug("Starting ExploitClassHTTPServer")
|
||||
|
|
Loading…
Reference in New Issue