-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maybe not work with some sudo versions? #1
Comments
Also confirming it doesn't work on 1.8.27 and 1.8.29, haven't debugged in depth. I have a separate working PoC; offsets tend to vary across sudo versions. |
It seems pretty likely the offsets differ between versions. To remedy this you'd want to look at the BSS section and see at what data is present between the end of the buffer and the start of the user struct. If someone wants to make this more compatible I'd be willing to accept a PR, but this was intended more as a PoC, not a fully compatible tool. |
That being said, I will probably add some warning about this in the README, as it's certainly a gotcha, and there's probably a more resilient way of doing this. |
The offsets on Ubuntu 18.04 (Sudo 1.8.25p1) and 20.04 (Sudo 1.8.29) are the same, but this PoC will not work unmodified because Sudo introduced special EOF handling. The EOF character, also known as Ctrl-D, is |
Oh interesting. I hadn't looked into it too much. I appreciate the information, and remember seeing some information around EOF handling changes. I will probably take a look at it when I get some more time. Thanks! |
You can take a look at the workaround I used in my exploit, but it unfortunately won't be applicable to your exploit. Though I do know another simple trick that should work for you 😜 |
Cool, appreciate the hints! I'll need to dig into it some more. My first rough guess would be something around changing EOL settings for the tty, but it may be simpler than that. |
Tested successfully on a couple of systems. Linux Mint 19.3 with sudo 1.8.21p2 :
Linux Mint 19.2 with sudo 1.8.21p2 :
|
On ubuntu 18.04, it seems that this exploit is patched with the security fix of sudo version Ubuntu 18.04:
|
Congrats for amazing work :P
However I have tested this script (the latest commit up to now) on Ubuntu 16.04 with sudo 1.8.16 and Kali with sudo 1.8.29, while none succeeded (I see your sudo version in the video within your post is 1.8.25).
Is there any special step to configure to generate&run the exp?
I have read your post but cannot understand it well... Maybe I should learn a lot more.
Anyway, thx :)
The text was updated successfully, but these errors were encountered: