Penetration Testing with Kali Linux
PWK - Copyright © 2023 OffSec Services Limited. All rights reserved.
228
/email (Status: 405) [Size: 142]
/password
(Status: 405) [Size: 142]
===============================================================
2022/04/06 06:40:35
Finished
===============================================================
Listing 109 - Discovering extra APIs
The password API path seems enticing for our testing purposes, so we’ll probe it via curl.
kali@kali:~$
curl -i http://192.168.50.16:5002/users/v1/admin/password
HTTP/1.0 405 METHOD NOT ALLOWED
Content-Type: application/problem+json
Content-Length: 142
Server: Werkzeug/1.0.1 Python/3.7.13
Date: Wed, 06 Apr 2022 10:58:51 GMT
{
"detail": "The method is not allowed for the requested URL.",
"status": 405,
"title": "Method Not Allowed",
"type": "about:blank"
}
Listing 110 - Discovering API unsupported methods
Interestingly, instead of a
404 Not Found
response code,
we received a
405 METHOD NOT
ALLOWED
, implying that the requested URL is present, but that our HTTP method is unsupported.
By default, curl uses the GET method when it performs requests, so we could try interacting with
the password API through a different method, such as POST or PUT.
Both POST and PUT methods, if permitted on this specific API, could allow us to override the user
credentials (in this case, the administrator password).
Before attempting a different method, let’s verify whether or not the overwritten credentials are
accepted. We can check if the
login
method is supported by extending our base URL as follows:
kali@kali:~$
Yüklə
Dostları ilə paylaş: