Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update unicorn.py: Remove runtime error from obfuscation #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jeffmcjunkin
Copy link
Contributor

Currently, the attempt to replace the wwww variable in the following line results in a runtime error from the PowerShell command (though it does still run the payload):

$wwww=$wwww.replace("$Win32", "%s");

Depending upon variable names, the error looks like the following as the first part of the output of the PowerShell command:

Method invocation failed because [System.RuntimeType] does not contain a method named 'replace'.
At line:1 char:2005
+ ... Yl" -names VJy;$BC=$BC.replace("VJy", "Win32Funct"+"i"+"ons");[byte[] ...
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

This makes sense, as $wwww at that point is a type, not a string, so it doesn't have a .replace() function.

To fix this, I removed the above line entirely from the embedded powershell_code string, along with the ,Win32 in the % (msv,kernel,kernel,[...] end of the line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant