Reversing a malicious VBS file(with python)

Reversing a malicious VBS file(with python)

Today we received a generic phish contained a link to a zip archive.

After extracting the files there was a .vbs script inside with an interesting format. On first glance this looks to be charchode:

No alt text provided for this image

However this is not the case, there is a function for char code but on further examination these are all values to subtract from a main value:

No alt text provided for this image

Function xucb turns the charcode to clear, function fhuba combines all the data for the wscript call for powershell.

At the bottom we can see the charcode 'key' to subtract the above values from to get the true charcode values.

This is simply done in python, take all the values an put them into an array. Then for each value in the array, subtract that from the key(132).

No alt text provided for this image

And it prints out this little gem:

No alt text provided for this image

Replace all newlines/crlf with regex:

No alt text provided for this image

This was a pretty simple one to reverse, but had an interesting format I haven't seen in a bit.

David Williams

Cyber Security Operations Center Manager | Cyber Security Analyst III at ITT Inc.

5y

Nathan Selvaggio

Like
Reply

To view or add a comment, sign in

More articles by David Williams

  • Macro Doc with math obfuscation

    Received another interesting phishing email, this time instead of a link to a rar archive containing a vbs script, the…

    3 Comments
  • Deobfuscating Emotet

    Yesterday while training some new employees on deobfuscating powershell commands we received a phishing report which…

    4 Comments

Insights from the community

Others also viewed

Explore topics