From 743fe02b44bd5b26933f868fd5bcc43856c1443c Mon Sep 17 00:00:00 2001 From: Harmj0y Date: Sat, 28 Nov 2015 20:24:45 -0500 Subject: [PATCH] Removed non-ascii character from Get-FoxDump.ps1 Added ascii check before module tasking --- data/module_source/collection/Get-FoxDump.ps1 | 2 +- lib/common/empire.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/data/module_source/collection/Get-FoxDump.ps1 b/data/module_source/collection/Get-FoxDump.ps1 index 5bb80c9..edf22f1 100644 --- a/data/module_source/collection/Get-FoxDump.ps1 +++ b/data/module_source/collection/Get-FoxDump.ps1 @@ -1,4 +1,4 @@ -Function Get-FoxDump +Function Get-FoxDump { <# .SYNOPSIS diff --git a/lib/common/empire.py b/lib/common/empire.py index 09151a0..dc09862 100644 --- a/lib/common/empire.py +++ b/lib/common/empire.py @@ -2414,6 +2414,12 @@ class ModuleMenu(cmd.Cmd): dispatcher.send("[!] Error: module produced an empty script", sender="Empire") return + try: + moduleData.decode('ascii') + except UnicodeDecodeError: + print helpers.color("[!] Error: module source contains non-ascii characters") + return + # strip all comments from the module moduleData = helpers.strip_powershell_comments(moduleData)