Windows oneliners to download remote payload and execute arbitrary code
arno0x0x.wordpress.com
Windows oneliners to download remote payload and execute arbitrary code
1–10 of 12 posts
Re: Windows oneliners to download remote payload and execute arbitrary code
#2Re: Windows oneliners to download remote payload and execute arbitrary code
#3Re: Windows oneliners to download remote payload and execute arbitrary code
#4Modifying the execution permissions in Powershell requires admin permissions. I'm guessing the author has local admin and does not realize it.
Then again all cool kids now do curl | sh anyway.
Re: Windows oneliners to download remote payload and execute arbitrary code
#5Modifying the execution permissions in Powershell requires admin permissions. I'm guessing the author has local admin and does not realize it.
The only thing you need to be administrator for is to run "Set-ExecutionPolicy -Scope LocalMachine"
Re: Windows oneliners to download remote payload and execute arbitrary code
#6Modifying the execution permissions in Powershell requires admin permissions. I'm guessing the author has local admin and does not realize it.
Exactly, which was done to prevent the old WSH attack vectors. Then again all cool kids now do curl | sh anyway.
Every so often HN rolls their eyes at all these idiots who do "curl | sh". How is doing so any different from downloading an installer over https and running it? Really, if installing software is what we're doing, isn't running it part of the objective?
Or, in short, why is "curl | sh" frowned upon and why are alternatives better?
Re: Windows oneliners to download remote payload and execute arbitrary code
#7Modifying the execution permissions in Powershell requires admin permissions. I'm guessing the author has local admin and does not realize it.
Re: Windows oneliners to download remote payload and execute arbitrary code
#8Earlier quoted context omitted.
Exactly, which was done to prevent the old WSH attack vectors. Then again all cool kids now do curl | sh anyway.
I'm a lifelong Windows user - I usually install software by downloading installers and double clicking them. Every so often HN rolls their eyes at all these idiots who do "curl | sh". How is doing so any different from downloading an installer over https and running it? Really, if installing software is what we're doing, isn't running it part of the objective? Or, in short, why is "curl | sh" frowned upon and why are…
You can also check that an installer isn't corrupted sfter downloading and before running, classically withe the md5 hash.
Re: Windows oneliners to download remote payload and execute arbitrary code
#9Modifying the execution permissions in Powershell requires admin permissions. I'm guessing the author has local admin and does not realize it.
Permanently modifying it (using Set-ExecutionPolicy) requires admin, but from what I remember, setting it on a per-process basis by starting powershell.exe with the -ExecutionPolicy flag does not.
(This can be overridden by policies though.)
Also, in windows 10 the default ExecutionPolicy changed from Windows 7 so by default you can run powershell scripts even without using -executionpolicy bypass.
Re: Windows oneliners to download remote payload and execute arbitrary code
#10Earlier quoted context omitted.
Exactly, which was done to prevent the old WSH attack vectors. Then again all cool kids now do curl | sh anyway.
I'm a lifelong Windows user - I usually install software by downloading installers and double clicking them. Every so often HN rolls their eyes at all these idiots who do "curl | sh". How is doing so any different from downloading an installer over https and running it? Really, if installing software is what we're doing, isn't running it part of the objective? Or, in short, why is "curl | sh" frowned upon and why are…
A lot of things can go wrong with this though, if you pull a script from a github link and run it, the code could have been modified since you last looked at the repo and now you're directly running malicious code.
When you download an msi in Windows and then double click to install, you're also putting your trust in the website, the software author and anyone else in the supply chain.
I think the better option is downloading, manually reviewing the script you downloaded, and then running it.
If you're devops-ing something then you should probably download the script/code and then do some kind of hash or signature check to make sure it's the known good version, then run it.