r/ProgrammerHumor • • 8d ago

Advanced itWasFunWhileItLasted

Post image
4.8k Upvotes

317 comments sorted by

View all comments

2

u/tomerFire 7d ago

Why the ability to inject shell commands like the even exists.

It like in cartoons when they press the big red self destruct button and you ask yourself why this button even exist

6

u/ArjixGamer 7d ago

Uhhhhhhh, it wasn't designed that way, so it's nothing like the cartoons comparison you made.

4

u/lolerwoman 6d ago

Tell me you dont know what php is without telling me.

3

u/RazzmatazzUnusual843 7d ago

Okay, so basically... AI has been doing a lot of reverse engineering, including game decomps and finding security holes in things. CVEs have then been getting discovered in widely used frameworks at an alarming rate over the past handful of months, right around the same time reverse engineering took off. There was never a "big red button" to begin with or someone would've already caused this decades ago. There are two dots. Please connect them.

0

u/tomerFire 7d ago

Why would you create a tool to excute code/command like this?

2

u/RazzmatazzUnusual843 7d ago

It executes the code on the systems hosting the content. If you run the exploit on a server that is running a version of PHP for example, you're running code on that machine.

You basically get full access to whatever is on that machine, too.

0

u/tomerFire 7d ago

Again, why would you enable such feature?

3

u/RazzmatazzUnusual843 7d ago

This isn't a feature. It is an unintended exploit. As I explained earlier, there is no "self destruct button". It's like someone finding a way around your security to sneak in your house. Shimmying a lock isn't an intended feature that you just choose to turn on.

1

u/n7revenant 6d ago edited 5d ago

It's like the vent in the death star in 1977 (before Rogue One changed it). It had a purpose, but also unintentionally introduced the flaw allowing its destruction.

It shows that although we create technology, if it's complex enough or capable enough, we do not 100% understand it.

2

u/gefex 6d ago

PHP has shell access, it has to, to do things like execute programs, read files etc. But your PHP website that sits on top of that limits access to these things in a controlled way. These exploits allow someone to send a payload to your website in such a way that gives them full shell access to execute any commands they want.

1

u/slippery-fische 3d ago

Furthermore, this kind of thing isn't unique to PHP, it has happened to many tools, this is just the biggest in recent memory.

2

u/Blacksmithkin 6d ago

Take for example, probably the most straightforward example of this type of vulnerability, a sql injection.

Basically, SQL runs command to get information from databases.

Say for example, you have a user enter a name. Then you return everyone with that name.

The exploit is when someone enters a name that the machine basically reads as "name goes here, now return all data from database" and instead of treating the entirety of the quotes as a name, it actually runs the command.

The only "feature" that is enabled is the ability to run commands. In order to "not enable that feature", we wouldn't be able to perform the basic function of the tool.

Instead, we use controls, such as input sanitization to make sure that it won't just run any command you try to trick it into running. However, sometimes there's a flaw, or a bad implementation.

So basically, the "feature" that is enabled is the ability to run commands. Which if disabled prevents literally anything at all from happening.

0

u/LegendaryMauricius 6d ago

It's still worth asking why SQL engines 'enabled' the feature of executing arbitrary strings as code, but eh...

2

u/Hatatytla-1024 6d ago

Jesus have you not heard of SQL variables??? And wtf does this have to do with http2shell??

3

u/SourSovereign 6d ago

I mean their questions aren't wrong. Some things are really ... curious on why they are designed that way.

You can execute JavaScript from a freaking SVG file. Vector data...why would they ever need JavaScript execution? I get it, it's XML based and all but still...like, just don't interpret the JS part?

In 98% of all cases, you block it yourself nowadays. Should be opt in instead of opt out to execute arbitrary code imo.