Remix.run Logo
▲ Gigachad 8 hours ago

We almost need some bot that logs in to every vulnerable PHP server and turns it off to prevent it being properly exploited before the server admin updates it..

▲lioeters 8 hours ago | parent | next [-]

Kindware instead of malware. Just goes around finding vulnerabilities and using them to patch things and improve security everywhere.

▲voxadam 7 hours ago | parent [-]

Benevolent worms.

https://www.schneier.com/blog/archives/2005/12/benevolent_wo...

▲lioeters 7 hours ago | parent [-]

Heheh that's cute.

▲afdbcreid 5 hours ago | parent | prev | next [-]

Nice idea, but I don't think you would want e.g. your hospital to have their systems suddenly turn off.

▲simondotau 4 hours ago | parent | next [-]

Absolutely they do. Off today is better than a ransomware attack tommorrow.

▲pixl97 5 hours ago | parent | prev [-]

Turning off is better than silent data manipulation by an attacker.

▲afdbcreid 4 hours ago | parent [-]

But not than assessment and controlled shutdown or access minimization. Turning off critical systems can result in deaths.

▲jamesknelson 3 hours ago | parent [-]

This feels like it might be the trolley problem in real life.

Turning it off may cause deaths. Letting it get ransomwared may cause more. Do you pull the lever to turn it off?

▲hparadiz 3 hours ago | parent [-]

I can't believe I have to write this out in this thread of all places but there is a way to do this.

You make sure www-data CANNOT write ANYWHERE on disk. Not /tmp/ Not to /var/www/. No where.

Then make sure your sudoers has nothing weird in it.

Finally disable www-data's ability to run basically anything that isn't required for the operation of your httpd or php-fpm et al.

You then harden it further and further until an RCE does not matter because it's incapable of doing anything.

tldr always treat httpd as untrusted.

▲matja an hour ago | parent | next [-]

Good advice if you're not using the default PHP session settings, but using default settings this means sessions can't be created. At best, that means no-one can log-in. At worst, it completely breaks the site (for those that depend on sessions even for unauthenticated users).

Also: https://stopdisablingselinux.com/ - SELinux can mitigate this.

▲echoangle 43 minutes ago | parent | prev | next [-]

How do you handle file uploads then? Isn’t that handled by the same process writing the uploaded files to disk?

▲trog 2 hours ago | parent | prev | next [-]

But then WordPress stops working :)

▲hparadiz 2 hours ago | parent [-]

They were talking about critical systems :)

▲trog 2 hours ago | parent [-]

Heh, but for better or for worse, a bunch of people have built businesses out of WordPress and its ecosystem. One of them is my aunt, which is why (as a designated family tech support person, though she does have a part time developer) I'm watching this thread closely!

▲bpye 2 hours ago | parent | prev [-]

R/w access to your production database is still a problem, though yes less bad than world read/write.

And also relies on the target being patched against any Linux EoP...

▲S0y 6 hours ago | parent | prev | next [-]

If people wait too long you could even have the bot use the exploit to update the PHP version.

▲stackghost 7 hours ago | parent | prev [-]

I’ve thought about doing this in the past but have no trust in police to see it as a Good Samaritan act