News for hackers. Stuff that matters.
Re:Lockdown.exe: Block unknown apps via Windows software res... by ClumsyPilot on Wednesday June 09, 2021 @05:58AM (#27446149)
Eh, half the time I watch people use linux, they google "how to XYZ" and then copy paste all sudo commands in the guide.
Re:Lockdown.exe: Block unknown apps via Windows software res... by EvanAnderson on Wednesday June 09, 2021 @06:19AM (#27446258)
Or they just pipe the output of curl to bash running as root.
Re:Lockdown.exe: Block unknown apps via Windows software res... by dpwm on Wednesday June 09, 2021 @06:30AM (#27446325)
There’s an awful lot of companies that use this as their deployment method.

People of requisite cautiousness will vet the shell script – but I suspect most will not.

Re:Lockdown.exe: Block unknown apps via Windows software res... by Dah00n on Wednesday June 09, 2021 @06:40AM (#27446379)
But malware makers of requisite cautiousness will serve a different script to those that look at the source with a browser.
Re:Lockdown.exe: Block unknown apps via Windows software res... by squiggleblaz on Wednesday June 09, 2021 @07:21AM (#27446616)
Any user who intends to review a script they intend to run on the computer will do something like this:

    curl https://potentially-malicious.com/get-infected.sh > get-infected.sh
    $EDITOR get-infected.sh
    [[ $POST_REVIEW_OPINION -eq happy ]] && bash ./get-infected.sh || rm ./get-infected.sh
The reasons for this are at least twofold:

   (1) $EDITOR probably has syntax highlighting, which will help you understand the text better. Always do your code reviews with the supportive assistance of tools. 

   (2) If you intend to review a script before you run it on your computer, it is intrinsic to the task that you review the script you are about to run on the computer. As you observe, a malicious user might detect the User-Agent and give a different script. But completely non-malicious changes could happen too: for instance, there could be an update or you could type in the command wrongly and accidentally review one script but run another.
In any case, it's worth noting that the user who wants to review the install script before they run a potentially malicious installer needs to consider whether they actually trust the software they're about to install. A malware author could easily install a binary of potentially-malicious in a perfectly benign way, and it happens that once it's been running for three hours it reads exfiltrates your aws keys on apparently ordinary API requests it makes.

If you don't trust author/distributors (whether it is ad hoc distribution or appstore distribution), it is probably better to rely on third party distributors as found in traditional GNU/Linux distributions. They aren't flawless, but the delays are there partly to help making trusting a random group of independent developers more trustworthy.

If you don't trust first party author/distributors or third party distributors, I guess you have a sufficiently sandboxed setup that means `curl | sh` is actually safe, or else you download the source code, review the whole package, and build it or don't, so you don't want to `curl | sh` anyway.

Re:Lockdown.exe: Block unknown apps via Windows software res... by Dah00n on Wednesday June 09, 2021 @08:16AM (#27447010)
I'm not sure "Any user who intends to review a script" would do this. I'd bet that most would at most open it, take a quick look and run it. But good advice!