News for hackers. Stuff that matters.
Re:Hacking with environment variables by lunixbochs on Tuesday July 14, 2020 @01:39AM (#23828869)
This was a huge component of a 2020 DEFCON CTF qualifier challenge that only Samurai and PPP solved, where you had to get code execution or arbitrary file read out of as many setuid binaries as possible, after installing basically every cli Debian package and changing them to setuid.

There are some very interesting ways to load shared objects or read files with environment variables, and we even found ways to leverage common libraries like readline and gconv to pop apps that used them.

Re:Hacking with environment variables by pgy on Tuesday July 14, 2020 @07:15AM (#23830559)
More recently at SpamAndFlags CTF there was a similar challenge, where an innocent looking shell script was to be exploited multiple times, each time by a different environment variable. There is a nice writeup at https://github.com/p4-team/ctf/tree/master/2020-05-10-spam-a...
Re:Hacking with environment variables by pentestercrab on Tuesday July 14, 2020 @01:58AM (#23828991)
Sounds very interesting, thanks for sharing. Do you have any more information or perhaps a URL to a write-up for this? Or do you remember the challenge name?
Re:Hacking with environment variables by rwmj on Tuesday July 14, 2020 @03:19AM (#23829378)
Why would you change "every cli Debian package" to setuid and not expect hundreds of exploits? Solution is not to do something so silly.
Re:Hacking with environment variables by dmurray on Tuesday July 14, 2020 @05:01AM (#23829858)
Because in the real world, you might have a vulnerability that lets you run one of those packages as root. The competition is to show how many of those you could exploit.

Of course some of them are trivial, you don't get any props for showing arbitrary file reading when you can run bash or perl as root. But exploiting readline that way is pretty interesting!

Re:Hacking with environment variables by jwilk on Tuesday July 14, 2020 @03:59AM (#23829568)
glibc's gconv?