diff --git a/README.md b/README.md index 15edb89..07d408a 100644 --- a/README.md +++ b/README.md @@ -1 +1,24 @@ -# SocksProxyServer-Plugin \ No newline at end of file +# SocksProxyServer-Plugin +The SocksProxy Plugin runs a SocksProxy server for [Invoke-SocksProxy](https://github.com/BC-SECURITY/Invoke-SocksProxy) +entirely contained in [Empire](https://github.com/BC-SECURITY/Empire/). + +![image](https://user-images.githubusercontent.com/20302208/95637897-d8221480-0a47-11eb-8a69-3f132fe5d079.png) + +## Getting Started +* To run the plugin, you can download it fom the releases [Releases](https://github.com/BC-SECURITY/Invoke-SocksProxy/releases) page. + +## Install +Prerequisites: +- Empire 3.5.0+ + +1. Add SocksServer.py to the plugins folder of Empire. + +![image](https://user-images.githubusercontent.com/20302208/95636534-49f85f00-0a44-11eb-87c1-754a2368febb.png) + + +2. Plugins are automatically loaded into Empire as of 3.4.0, otherwise run ```plugin attack``` + +![image](https://user-images.githubusercontent.com/20302208/95636737-b5dac780-0a44-11eb-9f82-34dcb66c24fe.png) + +## Future Features +- List of active servers (similar to agents and listeners) diff --git a/SocksServer.py b/SocksServer.py index 22f18d1..9ceea30 100644 --- a/SocksServer.py +++ b/SocksServer.py @@ -15,7 +15,7 @@ class Plugin(Plugin): description = "Launches a SocksProxy Server to run in the background of Empire" def onLoad(self): - self.commands = {'do_socksproxy': {'Description': 'Launch a Socks Proxy Server', + self.commands = {'do_socksproxyserver': {'Description': 'Launch a Socks Proxy Server', 'arg': 'the argument required and it''s description' } } @@ -23,8 +23,8 @@ def onLoad(self): def execute(self, dict): try: - if dict['command'] == 'do_socksproxy': - results = self.do_socksproxy(dict['arguments']['arg']) + if dict['command'] == 'do_socksproxyserver': + results = self.do_socksproxyserver(dict['arguments']['arg']) return results except: return False @@ -35,9 +35,9 @@ def get_commands(self): def register(self, mainMenu): """ any modifications to the mainMenu go here - e.g. registering functions to be run by user commands """ - mainMenu.__class__.do_socksproxy = self.do_socksproxy + mainMenu.__class__.do_socksproxyserver = self.do_socksproxyserver - def do_socksproxy(self, line): + def do_socksproxyserver(self, line): "Launches a SocksProxy Server to run in the background of Empire" parts = line.split(' ') @@ -46,10 +46,9 @@ def do_socksproxy(self, line): if self.proxy.running: self.proxy.end() elif not self.proxy.running: - self.proxy.start() else: - print(helpers.color("[!] SocksProxy Already Running!")) + print(helpers.color("[!] SocksProxy Server Already Running!")) def shutdown(self): """if the plugin spawns a process provide a shutdown method for when Empire exits else leave it as pass""" @@ -83,7 +82,7 @@ def handlerServer(self, q, handler_port, certificate, private_key): dock_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) dock_socket.bind(('', int(handler_port))) dock_socket.listen(5) - print(helpers.color("\n[+] Handler listening on: " + handler_port)) + print(helpers.color("\r[+] Handler listening on: " + handler_port)) while True: try: clear_socket, address = dock_socket.accept() @@ -162,7 +161,7 @@ def forward(self, source, destination): pass def start(self): - print("Starting Socks Proxy") + print(helpers.color("[*] Starting Socks Proxy")) handler_port = input(helpers.color("[>] Enter Handler Port [443]: ")) if handler_port == "": self.handler_port = "443"