mdsecactivebreach / SharpShooter

Payload Generation Framework
BSD 3-Clause "New" or "Revised" License
1.79k stars 348 forks source link

Encoding issue with Python3 #29

Open henshin opened 4 years ago

henshin commented 4 years ago

Using Python3 causes an UTF-8 encoding error when generating the payload while Python2 works fine. Example:

root@kali:~/tools/SharpShooter# python3 ./SharpShooter.py --stageless --payload hta --rawscfile ./msf_shellcode.bin --dotnetver 4 --output poc

       _____ __                    _____ __                __           
      / ___// /_  ____ __________ / ___// /_  ____  ____  / /____  _____
      \__ \/ __ \/ __ `/ ___/ __ \__ \/ __ \/ __ \/ __ \/ __/ _ \/ ___/
     ___/ / / / / /_/ / /  / /_/ /__/ / / / / /_/ / /_/ / /_/  __/ /    
    /____/_/ /_/\__,_/_/  / .___/____/_/ /_/\____/\____/\__/\___/_/     
                         /_/                                            

     Dominic Chell, @domchell, MDSec ActiveBreach, v2.0

'utf-8' codec can't decode byte 0xda in position 0: invalid continuation byte

[!] Incorrect choice
root@kali:~/tools/SharpShooter# 
root@kali:~/tools/SharpShooter# python2 ./SharpShooter.py --stageless --payload hta --rawscfile ./msf_shellcode.bin --dotnetver 4 --output poc 

       _____ __                    _____ __                __           
      / ___// /_  ____ __________ / ___// /_  ____  ____  / /____  _____
      \__ \/ __ \/ __ `/ ___/ __ \__ \/ __ \/ __ \/ __ \/ __/ _ \/ ___/
     ___/ / / / / /_/ / /  / /_/ /__/ / / / / /_/ / /_/ / /_/  __/ /    
    /____/_/ /_/\__,_/_/  / .___/____/_/ /_/\____/\____/\__/\___/_/     
                         /_/                                            

     Dominic Chell, @domchell, MDSec ActiveBreach, v2.0

[*] Written delivery payload to output/poc.hta
root@kali:~/tools/SharpShooter# 
changheluor007 commented 3 years ago

I've also come across, and I've just solved it, the recommendation is to use python2

Marshall-Hallenbeck commented 3 years ago

I still get encoding errors with Python 2 unfortunately.

nowakowsky commented 11 months ago

For anyone having this problem, just use jsmin==2.2.2