Saturday, September 1, 2018

What happens when powershell script encounters EOF while a quote is open?

Leave a Comment

Unicorn.py generates a string that looks like

powershell -flag1 -flag2 "something " obfuscation; powershell "more gibbrish

Interestingly, if this command is saved in a file filename.txt Windows executes it before opening the file in notepad.txt (by which time the file is empty).

Why is the file executed despite the extension? What does the script do when it encounters EOF after odd number of quotation marks?


Edited:
Unicorn (https://github.com/trustedsec/unicorn) is a script that "enables privilege elevation and arbitrary code execution". If you know what it means. Of course I did NOT put the actual string, just the key features.

1 Answers

Answers 1

Purely out of IT security interest.

I think that if you read the manual in unicorn.py, at absolutely no time does it say that the script should be left in the txt file.

The PowerShell script is written inside the txt file and called the "payload" (very hacker like). What is left for you is always how to execute this code on the victim's computer.

The manual proposes Word code injection, simply executing the PowerShell in cmd (I quote "Next simply copy the powershell command to something you have the ability for remote command execution."), Excel Auto_Open attack, and so on.

If reading the manual is too much there is always a video. The only time the "hacker" uses a notepad like is on his linux operated system (how ironic)… I watched it because I love this Papa Roach music Last Resort...

For those who are concerned about IT security I recommend this article dosfuscation. This is really instructive about how you have to be extra careful when receiving mails, outside document,... and how humanity can waste so much time spying, deceiving, inventing new twisted strategies... Aren't we great !

Windows like any other system has many system flaw but opening notepad is not one of them. Unless your notepad has been replaced by a hacker using unicorn…

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment