Skip to content
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

[Spoiler] Unintended PE in practical 0x05 #2

Open
dguerri opened this issue Oct 11, 2024 · 0 comments
Open

[Spoiler] Unintended PE in practical 0x05 #2

dguerri opened this issue Oct 11, 2024 · 0 comments

Comments

@dguerri
Copy link

dguerri commented Oct 11, 2024

Level 2 and 3 of practical 0x05 have an unintended PE, which makes Level 3 super-easy.

I think the track is build around the assumption that useradd cannot add a user with an uid of another, existing, user. The -o can be used to override the default behaviour.

In fact, useradd can be used to create another user with uid = 0.
useradd is immediately available with sudo to lowpriv in level 3.

sudo /usr/sbin/useradd -o -u0 -g0 pippo -p'$6$VvzgBiRBElFtkhuo$qQUqEpRNc52e7UjGvePP2jGyDdkBPqvINkOT2yRdLhfZBGinVi50O2ex0yEYnYpPW/Rj51QIY/uADOcToIDnU0'

A possible solution could be to allow sudo only for a wrapper script, which controls what users can be created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant