Skip to content

Commit

Permalink
Updated readme and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Cx01N committed Oct 11, 2020
1 parent 8bd9fcc commit f1c264d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# 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/).
The Socks Proxy Plugin runs a Socks Proxy Server for [Invoke-SocksProxy](https://github.com/BC-SECURITY/Invoke-SocksProxy)
that supports Socks 4 and 5 protocols. This plugin is entirely contained in [Empire](https://github.com/BC-SECURITY/Empire/)
and runs in the background. Use command `socksproxyserver` to configure and start the Socks Proxy Server. You can shutdown
the socks proxy by running the command `socksproxyserver kill` or by exiting Empire.

![image](https://user-images.githubusercontent.com/20302208/95637897-d8221480-0a47-11eb-8a69-3f132fe5d079.png)

Expand All @@ -16,9 +18,10 @@ Prerequisites:
![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```
2. Plugins are automatically loaded into Empire as of 3.4.0, otherwise run ```plugin SocksServer```

![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)
- Add multiple socks server support (similar to agents and listeners)
- Add UDP and bind request support
13 changes: 5 additions & 8 deletions SocksServer.py → plugins/SocksServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


class Plugin(Plugin):
description = "Launches a SocksProxy Server to run in the background of Empire"
description = "Launches a Socks Proxy Server to run in the background of Empire"

def onLoad(self):
self.commands = {'do_socksproxyserver': {'Description': 'Launch a Socks Proxy Server',
Expand All @@ -39,16 +39,14 @@ def register(self, mainMenu):

def do_socksproxyserver(self, line):
"Launches a SocksProxy Server to run in the background of Empire"

parts = line.split(' ')
if parts[0].lower() == "kill":
print(self.proxy.running)
if self.proxy.running:
self.proxy.end()
elif not self.proxy.running:
self.proxy.start()
else:
print(helpers.color("[!] SocksProxy Server Already Running!"))
print(helpers.color("[!] Socks Proxy 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"""
Expand Down Expand Up @@ -125,7 +123,7 @@ def server(self, handler_port, proxy_port, certificate, private_key):
dock_socket2.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
dock_socket2.bind(('127.0.0.1', int(proxy_port)))
dock_socket2.listen(5)
print(helpers.color("\n[+] Socks Server listening on: " + proxy_port))
print(helpers.color("\n[+] Socks Proxy Server listening on: " + proxy_port))
while True:
try:
client_socket2, address = dock_socket2.accept()
Expand Down Expand Up @@ -161,7 +159,7 @@ def forward(self, source, destination):
pass

def start(self):
print(helpers.color("[*] Starting Socks Proxy"))
print(helpers.color("[*] Starting Socks Proxy Server"))
handler_port = input(helpers.color("[>] Enter Handler Port [443]: "))
if handler_port == "":
self.handler_port = "443"
Expand All @@ -175,7 +173,6 @@ def start(self):
self.process.start()

def end(self):
print(helpers.color("[!] Killing Socks Server"))
print(helpers.color("[!] Killing Socks Proxy Server"))
self.running = False
self.process.terminate()

0 comments on commit f1c264d

Please sign in to comment.