hacker:hacker
and investigate the cookie. The cookie is:"kid"
field in the JWT header without any authentication, what we can do here is generating a RSA public/private key pair in order to forge a new JWT with admin_cap=1
with a valid digital signature. Here is a bash script for generating such RSA key pair for RS256:admin_cap=1
together with the key pair we just generated:auth
cookie and refresh, and we have access to the admin panel:/usr/share/webshells/php/php-reverse-shell.php
.www-data
:/var/backups
, there is a backup file named home.tar.gz
. Download it to our attack machine. In turns out that this backup file contains the backup of the home directory. There is a user noah
and we got the SSH private key. SSH in:sudo -l
:/usr/bin/docker exec -it webapp-dev01*
as root. Spawn a (limited) root shell:/root/root.txt
. Here we are going to use CVE-2019-5736 to escape the Docker contain. HackTricks has a writeup on this CVE:/bin/sh
binary. You have to do this step fast:Caution: This step is tricky. When you see "[+] Overwritten /bin/sh successfully", you should execute the commandsudo /usr/bin/docker exec -it webapp-dev01 /bin/sh
immediately. Otherwise it will be too late and you won't get the reverse shell.