leommxj / prebuilt-multiarch-bin

prebuilt binaries for multiple architeture
https://bin.leommxj.com/
Do What The F*ck You Want To Public License
155 stars 26 forks source link

[bug report] bind_shell/reverse_shell will drop privilege in some cases #5

Closed bash-c closed 3 years ago

bash-c commented 3 years ago

Both bind_shell and reverse_shell will execute /bin/sh for an interactive shell, however, sh in some cases will drop privilege.

Add the following snippet will fix this

if geteuid() == 0:
    setresuid(0, 0, 0);
    setresgid(0, 0, 0);

spawn /bin/sh and others
bash-c commented 3 years ago

BTW, there is a typo. the word spwan should be spawn

leommxj commented 3 years ago

@bash-c Done. Please ddw.