

that’s the part that can keep malicious stuff out because it doesn’t have permission.
All a malicious script has to do is alias sudo in your .bashrc, and you’re fucked. The script can do that without privileges. It takes surprisingly little to go from “I’m only running this script without privileges” to getting totally owned immediately after.
Yes, every distro requires a password for sudo. That’s the whole point of it. But editing .bashrc does not require sudo. You can add aliases and functions to .bashrc. A malicious script can append to .bashrc, and by doing so, it can alias sudo to be whatever command it wants. For instance, a malicious function. So the next time you run sudo it runs the malicious command, instead, which itself can act just like sudo and prompt you for your password. So now you just entered your password into a malicious function. Do you see the problem with this?