Penetration Testing with Kali Linux
PWK - Copyright © 2023 OffSec Services Limited. All rights reserved.
226
We can use Gobuster features to brute force the API endpoints.
In this test scenario, our API
gateway web server is listening on port 5001 on 192.168.50.16, so
we can attempt a directory
brute force attack.
API paths are often followed by a version number, resulting in a pattern such as:
/api_name/v1
Listing 105 - API Path Naming Convention
The API name is often quite descriptive about the feature or data it uses to operate, followed
directly by the version number.
With this information, let’s try brute forcing the API paths using a wordlist along with the
pattern
Gobuster feature. We can call this feature by using the -p option and providing a file with patterns.
For our test, we’ll create a simple pattern file on our Kali system containing the following text:
{GOBUSTER}/v1
{GOBUSTER}/v2
Listing 106 - Gobuster pattern
In this example, we are using the “{GOBUSTER}” placeholder to match any word from our wordlist,
which will be appended with the version number. To keep our test simple, we’ll try with only two
versions.
We are now ready to enumerate the API with gobuster using the following command:
kali@kali:~$
Yüklə
Dostları ilə paylaş: