nccgroup / Winpayloads

Undetectable Windows Payload Generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errors while generating a payload

namesunique opened this issue · comments

Hello - I've been trying to figure out the problem for a long while, but can't seem to make any headway.

I was hoping you could please tell me what the problem is that I see displayed below when trying to generate a reverse HTTPS Meterpreter payload:

Main Menu > 4

[] Press Enter For Default Port(443)
[
] Port>

[] Press Enter To Get Local Ip Automatically(198.199.xxx.xxx)
[
] IP>
[] IP SET AS 198.199.xxx.xxx
[
] PORT SET AS 443

[] Try UAC Bypass(Only Works For Local Admin Account)? y/[n]:n
[
] Invoke Priv Esc Checks? y/[n]:y
Traceback (most recent call last):
File "WinPayloads.py", line 41, in
getAndRunMainMenu()
File "/root/Winpayloads/lib/menu.py", line 61, in getAndRunMainMenu
mainMenu.runmenu()
File "/root/Winpayloads/lib/menu.py", line 115, in runmenu
result = extrawork(payloadchoice,payload)
File "/root/Winpayloads/lib/preparepayload.py", line 91, in httpsPayloadGeneration
GeneratePayload(ez2read_shellcode,payloadname,shellcode)
File "/root/Winpayloads/lib/generatepayload.py", line 60, in GeneratePayload
Filesave.write(do_Encryption(SHELLCODE.injectwindows % (ez2read_shellcode)))
File "/root/Winpayloads/lib/encrypt.py", line 29, in do_Encryption
encrypto = AES.new(key, AES.MODE_CTR, counter=lambda: counter)
File "/usr/local/lib/python2.7/dist-packages/Crypto/Cipher/AES.py", line 264, in new
return _create_cipher(sys.modules[name], key, mode, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/Crypto/Cipher/init.py", line 130, in _create_cipher
return modes[mode](factory, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/Crypto/Cipher/_mode_ctr.py", line 327, in _create_ctr_cipher
raise TypeError("Incorrect counter object"
TypeError: Incorrect counter object (use Crypto.Util.Counter.new)
root@pupyserv:/Winpayloads# nano /usr/local/lib/python2.7/dist-packages/Crypto/Cipher/_mode_ctr.py
root@pupyserv:
/Winpayloads#

Whatever other information you need, I'll be happy to provide. I've rerun "./setup.sh -r" more times than I can found. I've tried uninstalling/reinstalling pip, python, pyinstaller, anything I thought might help, but I'm just spinning my wheels at this point.

Thank you for any help you can provide.

Hi,
I have never seen this issue before. It looks like it could be due to you having multiple crypto modules installed.
Please try the following
rm -r /usr/local/lib/python2.7/dist-packages/Crypto

Thanks

YOU. ARE. THE. MAN!!!!

F****** finally!

Thank you Charliedean!