operatorequals / covertutils

A framework for Backdoor development!
http://covertutils.readthedocs.io
437 stars 69 forks source link

Issue running your HTTP example listener on CentOS #15

Open aidden-laoch opened 6 years ago

aidden-laoch commented 6 years ago

There appears to be some syntax issues effecting usability on python 2.7.5 in CentOS and python 2.7.12 in Ubuntu 16.04 Server. I get this on CentOS:

Traceback (most recent call last): File "native.py", line 19, in from covertutils.shells.impl import StandardShell, ExtendableShell File "build/bdist.linux-x86_64/egg/covertutils/shells/impl/init.py", line 2, in

File "build/bdist.linux-x86_64/egg/covertutils/shells/impl/standardshell.py", line 2, in File "build/bdist.linux-x86_64/egg/covertutils/shells/subshells/init.py", line 16, in

File "build/bdist.linux-x86_64/egg/covertutils/shells/subshells/stagesubshell.py", line 9, in File "build/bdist.linux-x86_64/egg/covertutils/payloads/init.py", line 102, in

File "build/bdist.linux-x86_64/egg/covertutils/payloads/init.py", line 90, in generatePayloads

File "/usr/lib/python2.7/site-packages/covertutils-0.3.4-py2.7.egg/covertutils/payloads/generic/meterpreter.py", line 111 SyntaxError: unqualified exec is not allowed in function 'meterpreter_stage' it is a nested function

and I get this on Ubuntu 16.04 Server with python 2.7.12 when the agent connects: root@ubuntu16:~/sabre/Sabre-TOC/SASCore/Listeners# python native.py 88 [Sabre] > Available Streams: [ 0] - control [ 1] - python [ 2] - os-shell [ 3] - file [ 4] - stage [99] - Back Select stream: 2 [os-shell]> ls [os-shell]> [Sabre] > exit [!] Quit shell? [y/N] y Aborted by the user... root@ubuntu16:~/sabre/Sabre-TOC/SASCore/Listeners# ufw allow 88 Rule added Rule added (v6) root@ubuntu16:~/sabre/Sabre-TOC/SASCore/Listeners# python native.py 88 [Sabre] > Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.target(*self.args, **self.kwargs) File "/usr/local/lib/python2.7/dist-packages/covertutils/handlers/basehandler.py", line 168, in protocolThreadFunction stream, message = self.orchestrator.depositChunk( raw_data ) File "/usr/local/lib/python2.7/dist-packages/covertutils/orchestration/stegoorchestrator.py", line 111, in depositChunk templ = self.stego_injector.guessTemplate( chunk ) File "/usr/local/lib/python2.7/dist-packages/covertutils/datamanipulation/stegoinjector.py", line 473, in guessTemplate pkt_test = self.inject( payload, template ) File "/usr/local/lib/python2.7/dist-packages/covertutils/datamanipulation/stegoinjector.py", line 300, in inject injection_dict = self.createInjectionDict( hex_pkt, data, sample_capacity ) File "/usr/local/lib/python2.7/dist-packages/covertutils/datamanipulation/stegoinjector.py", line 354, in createInjectionDict half_byte_hex = data_hex[0] # pop(0) for strings IndexError: string index out of range

I would like to use this module you have built but it appears to suffer from some python version support problems. I would write some patches but this is a little more complex then most modules and the documentation has some differences from both what is PIP installable and GIT clone installable. For example you talk about covertpreter but that doesnt seem to exist in the repo or module code. I may just be blind though. Thank you for your hard work. I just dont want it to go to waste when I see such potential to better the infosec industry. Thanks again in advance.