Skip to content

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