Skip to content

Commit

Permalink
added color to inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Cx01N committed Oct 9, 2020
1 parent d3c48a9 commit fd7e2a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
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.

Expand Down
17 changes: 8 additions & 9 deletions SocksServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ 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'
}
}
self.proxy = SocksProxy()

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
Expand All @@ -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(' ')
Expand All @@ -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!"))


class SocksProxy(object):
Expand Down Expand Up @@ -80,7 +79,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()
Expand Down Expand Up @@ -159,7 +158,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"
Expand Down

0 comments on commit fd7e2a9

Please sign in to comment.