Skip to content

php: add posix_setuid(0) SUID bypass for system, passthru, popen - #597

Open
maybenotok wants to merge 1 commit into
GTFOBins:masterfrom
maybenotok:php-suid-posix-setuid
Open

maybenotok wants to merge 1 commit into
GTFOBins:masterfrom
maybenotok:php-suid-posix-setuid

Conversation

@maybenotok

Copy link
Copy Markdown

The SUID entries for system(), passthru(), and popen() are marked shell: true, which displays a warning that they only work on distributions where the default shell doesn't drop SUID privileges. Adding posix_setuid(0) before spawning the shell makes these work regardless since the real UID gets set to match the effective UID, so the shell has no mismatch to act on.

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

Successfully merging this pull request may close these issues.

1 participant