Skip to content

Commit

Permalink
update and fix decode options and escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
HackingDave committed Mar 30, 2020
1 parent b21d0da commit 1e8897b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
~~~~~~~~~~~~~~~~
version 3.8.6
~~~~~~~~~~~~~~~~

* fix escaping issue
* fix decode python3 error

~~~~~~~~~~~~~~~~
version 3.8.5
~~~~~~~~~~~~~~~~
Expand Down
12 changes: 6 additions & 6 deletions unicorn.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
#
# Magic Unicorn - PowerShell downgrade attack and exploitation tool
#
Expand Down Expand Up @@ -495,7 +495,7 @@ def settings_ms():

# usage banner
def gen_usage():
print("-------------------- Magic Unicorn Attack Vector v3.8.4 -----------------------------")
print("-------------------- Magic Unicorn Attack Vector v3.8.6 -----------------------------")
print("\nNative x86 powershell injection attacks on any Windows platform.")
print("Written by: Dave Kennedy at TrustedSec (https://www.trustedsec.com)")
print("Twitter: @TrustedSec, @HackingDave")
Expand Down Expand Up @@ -722,7 +722,7 @@ def gen_hta_attack(command):
def format_metasploit(data):
# start to format this a bit to get it ready
repls = {';': '', ' ': '', '+': '', '"': '', '\n': '', 'buf=': '', 'Found 0 compatible encoders': '','unsignedcharbuf[]=': ''}
data = data.decode()
#data = data.decode()
data = reduce(lambda a, kv: a.replace(*kv),iter(repls.items()), data).rstrip()
if len(data) < 1:
print("[!] Critical: It does not appear that your shellcode is formatted properly. Shellcode should be in a 0x00,0x01 format or a Metasploit format.")
Expand Down Expand Up @@ -1351,6 +1351,6 @@ def ms_voodoo_stuff():
print("\nExiting Unicorn... May the magical unicorn force flow through you.\n")
sys.exit()

except Exception as e:
if "list index" in str(e): print("[!] It appears you did not follow the right syntax for Unicorn. Try again, run python unicorn.py for all usage.")
else: print("[!] Something went wrong, printing the error: " + str(e))
#except Exception as e:
# if "list index" in str(e): print("[!] It appears you did not follow the right syntax for Unicorn. Try again, run python unicorn.py for all usage.")
# else: print("[!] Something went wrong, printing the error: " + str(e))

0 comments on commit 1e8897b

Please sign in to comment.