Recon the target, find the whole attack surface by passive or active recon.

hidden and public parameters finding is the goal and other things

browse the application as it was intended and proxy the traffic to burp/zap/swagger/postman

Once you have an idea of how the web app functions, dig deeper by deploying passive and active reconnaissance techniques.

Passive : [obtaining information about a target without directly interacting with the target’s systems]

Active :

Untitled

Endpoint Analysis : Reverse Engineering the APIs, making requests and analyzing responses and look for Excessive Data Exposure.

Excessive Data Exposure :

Vulnerable if -

The API returns sensitive data to the client by design. This data is usually filtered on the client side before being presented to the user. An attacker can easily sniff the traffic and see the sensitive data.

Example Attack Scenarios

Scenario #1

Scenario #2

Security Misconfiguration : Security misconfiguration includes missing system patches, unnecessary features enabled, lack of secure transit encryption, weak security headers, verbose error messages, and Cross-Origin Resource Sharing (CORS) policy misconfigurations.

API Vulnerable if -

Example Attack Scenarios

Scenario #1

An attacker finds the .bash_historyfile under the root directory of the server, which contains commands used by the DevOps team to access the API:

$ curl -X GET '[<https://api.server/endpoint/>](<https://api.server/endpoint/>)' -H 'authorization: Basic Zm9vOmJhcg=='

An attacker could also find new endpoints on the API that are used only by the DevOps team and are not documented.

Scenario #2

To target a specific service, an attacker uses a popular search engine to search for computers directly accessible from the Internet. The attacker found a host running a popular database management system, listening on the default port. The host was using the default configuration, which has authentication disabled by default, and the attacker gained access to millions of records with PII, personal preferences, and authentication data.

Scenario #3

Inspecting traffic of a mobile application an attacker finds out that not all HTTP traffic is performed on a secure protocol (e.g., TLS). The attacker finds this to be true, specifically for the download of profile images. As user interaction is binary, despite the fact that API traffic is performed on a secure protocol, the attacker finds a pattern on API responses size, which he uses to track user preferences over the rendered content (e.g., profile images).

Lack of Resources & Rate Limiting :

API Vulnerable if -

API requests consume resources such as network, CPU, memory, and storage. The amount of resources required to satisfy a request greatly depends on the user input and endpoint business logic. Also, consider the fact that requests from multiple API clients compete for resources. An API is vulnerable if at least one of the following limits is missing or set inappropriately (e.g., too low/high):

Example Attack Scenarios

Scenario #1

Scenario #2

The same scenario might be used to provoke Integer Overflow or Buffer Overflow errors.

Authentication Attacks : Since REST APIs are stateless they do not maintain state and require you to authenticate every time when you make a request. A username and password would have to be issued every time, then upon providing the correct credentials, a token would be issued to be used in subsequent requests.

Is the API Vulnerable?

Example Attack Scenarios

Authorization Attacks : test for authorization vulnerabilities including BOLA - Broken Object Level Authorization and BFLA - Broken Function Level Authorization. authentication process is meant to validate that users are who they claim to be.

Improper Assets Management : discovering unsupported and non-production versions of an API. earlier versions of the API may no longer be patched or updated. Non-production versions of an API include any version of the API that was not meant for end-user consumption

Finding :

Testing :

Mass Assignment : attacker is able to overwrite object properties that they should not be able to. API must have requests that accept user input, these requests must be able to alter values not available to the user, and the API must be missing security controls that would otherwise prevent the user input from altering data objects.

eg: attacker is able to add parameters to the user registration process that escalate their account from a basic user to an administrator’

Finding : (all about binding user input to data objects so find requests that : • Accept user input • Have the potential to modify objects)

SSRF : application retrieves remote resources without validating user input. attacker can supply their own input, in the form of a URL, to control the remote resources that are retrieved by the targeted server. When you have control over what resources a server requests then you can gain access to sensitive data or worse completely compromise a vulnerable host.