CVE-2021-3156 icon indicating copy to clipboard operation
CVE-2021-3156 copied to clipboard

more targets

Open ctfpwner opened this issue 4 years ago • 3 comments

Do you mind sharing your approach to find the target? Or let me know how do you set the env with all the multiple backslashes before calling sudoedit? I understand the exploit, but I don't know how to set the env for multiple \ (I mean from C yes, but for manual gdb invocation not really). Thank you.

ctfpwner avatar Jan 31 '21 01:01 ctfpwner

Finding target can't be trivially explained in a comment. I suggest reading this excellent writeup https://www.kalmarunionen.dk/writeups/sudo/ as it covers the same exploitation strategy as this exploit. As far as setting environment variables in gdb goes, you can use set env NAME VALUE in gdb. To set a env var FOO with a backslash in it you could do: set env FOO '\'. Also, you can start gdb with env -i gdb.. to start with an empty environment)

blasty avatar Jan 31 '21 14:01 blasty

I have been using set exec-wrapper env -i 'K=V' so that I can have different env vars for gdb/target.

(I have been pondering the libnss overwrite for a while now, the writeup is exactly what I was looking for thx:)

wereii avatar Jan 31 '21 20:01 wereii

Finding target can't be trivially explained in a comment. I suggest reading this excellent writeup https://www.kalmarunionen.dk/writeups/sudo/ as it covers the same exploitation strategy as this exploit. As far as setting environment variables in gdb goes, you can use set env NAME VALUE in gdb. To set a env var FOO with a backslash in it you could do: set env FOO '\'. Also, you can start gdb with env -i gdb.. to start with an empty environment)

Not so easy...especially if tcache is not supported by the glibc version in use. Introduce fastbins abuse will be valuable and appreciated. Thanks in advance

bl4ckh0l3z avatar Feb 19 '21 21:02 bl4ckh0l3z