Re:I got hacked: My Hetzner server started mining Monero
by marwamc on Wednesday December 17, 2025 @06:07PM
(#46306855)
Another example is they would enumerate your directories and find the names of common scripts and then overwrite your script. Or to be even sneakier, they can append their malicious code to an existing script in your filesystem. Now each time you run your script, their code piggybacks.
OTH if I had written such a script for linux I'd be looking to grab the contents of $(hist) $(env) $(cat /etc/{group,passwd})... then enumerate /usr/bin/ /usr/local/bin/ and the XDG_{CACHE,CONFIG} dirs - some plaintext credentials are usually here.
The $HOME/.{aws,docker,claude,ssh}
Basically the attacker just needs to know their way around your OS. The script enumerating these directories is the 0777 script they were able to write from inside the root access container.
Re:I got hacked: My Hetzner server started mining Monero
by tracker1 on Wednesday December 17, 2025 @06:20PM
(#46306997)
If your chosen development environment supports it, look into distroless or empty base containers, and run as --read-only if you can.
Go and Rust tend to lend themselves to these more restrictive environments a bit better than other options.
Imagine naming this executable "ls" or "echo" and someone having "." in their path (which is why you shouldn't): as long as you do "ls" in this directory, you've ran compromised code.
There are obviously other ways to get that executable to be run on the host, this just a simple example.