The short story of this is: - Gain access to the database itself - And the Postgres database should be vulnerable to various remote code execution - Once they're able to execute code remotely, they then download an image which has binary data tacked onto it - They then parse out the executable part of the image using dd - Then they're able to execute and mine away While an interesting read the shortest takeaway is: 1…
The real problem is that Postgres will let you load C functions to run in the server context. That's inherently a bad idea. Your databases should have multiple users configured with limited roles. Nothing web-facing should have a user with the ability to create a function. A SELECT-only user is a good start.
A picture got my PostgreSQL database to start mining Monero
61–70 of 99 posts
Re: A picture got my PostgreSQL database to start mining Monero
#62It's amazing that in 2018 people leave databases publicly exposed.
It’s really hard to move fast and stay secure. You have to nail so many things and you’re either running out of money or running out of time 99% of the time.
Re: A picture got my PostgreSQL database to start mining Monero
#63It takes someone with astute observation skills to see this.
Re: A picture got my PostgreSQL database to start mining Monero
#64That hasn't changed, folks. If someone on the Internet can talk to your Postgres database, you are Doing It Wrong.
Re: A picture got my PostgreSQL database to start mining Monero
#65Re: A picture got my PostgreSQL database to start mining Monero
#66Do you see the binary code? It’s right below her left elbow! It takes someone with astute observation skills to see this.
Re: A picture got my PostgreSQL database to start mining Monero
#67The short story of this is: - Gain access to the database itself - And the Postgres database should be vulnerable to various remote code execution - Once they're able to execute code remotely, they then download an image which has binary data tacked onto it - They then parse out the executable part of the image using dd - Then they're able to execute and mine away While an interesting read the shortest takeaway is: 1…
The real problem is that Postgres will let you load C functions to run in the server context. That's inherently a bad idea. Your databases should have multiple users configured with limited roles. Nothing web-facing should have a user with the ability to create a function. A SELECT-only user is a good start.
Re: A picture got my PostgreSQL database to start mining Monero
#68I thought this was one of those files that are an image and an executable AT THE SAME TIME. Slightly disappointed that it's just catted together
Totally unrelated, but I'm always reminded of Spore's (the videogame) save files. Creatures, buildings and such would be saved as .png and you'd get a nice preview screenshot of the creation, but the same file also contained the information for the game to actually load the thing. It was pretty cool
Re: A picture got my PostgreSQL database to start mining Monero
#69So how can one protect against an image with a payload? Would the payload still be there if the image was rebuilt with Imagemagick?
For image hosting services it is required to process images anyway - for example to strip EXIF GPS data. It looks like imagemagick can't really do it for JPEGs: https://stackoverflow.com/questions/2654281/how-to-remove-ex...
Re: A picture got my PostgreSQL database to start mining Monero
#70The short story of this is: - Gain access to the database itself - And the Postgres database should be vulnerable to various remote code execution - Once they're able to execute code remotely, they then download an image which has binary data tacked onto it - They then parse out the executable part of the image using dd - Then they're able to execute and mine away While an interesting read the shortest takeaway is: 1…
you need to do better than that, since attacks within the firewall can occur as well, and this is probably a more common vector for corporate espionage these days. A compromised laptop can get a wide open remote exploit onto a companies' production environment if the database itself is open within the firewall.