> For the complete documentation index, see [llms.txt](https://ahmed-tarek.gitbook.io/security-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ahmed-tarek.gitbook.io/security-notes/notes/api-pen/vulnerability-scanning.md).

# Vulnerability Scanning

Most generic scanners struggle to detect vulnerabilities specific to APIs, especially those listed in the OWASP API Security Top 10. However, they can be effective at identifying [Security Misconfigurations ](https://owasp.org/API-Security/editions/2019/en/0xa7-security-misconfiguration/)like:

* Missing patches
* Unnecessary features
* Lack of secure encryption
* Weak security headers
* CORS misconfigurations

#### **Scanning with Nikto**

* To see how a generic scan can fail, try scanning with **Nikto** using this command:

```bash
nikto -h http://example.com
```

While Nikto may reveal server information and some security headers issues, it typically misses a broad range of API vulnerabilities.

#### **Using OWASP ZAP for Better Results**

Switching to **OWASP ZAP** allows for a more customized approach to API scanning. Start with an unauthenticated scan by importing the API specification file (`specs.yml`) for your target, then run an **Active Scan** on the root URL. Check the **Alerts** tab for security misconfiguration findings.

**Performing Authenticated Scans**

To get deeper insights, conduct an **authenticated scan**. Use the **Manual Explore** feature in ZAP to interact with the application as a user, after logging in and performing actions, run another **active scan**. This process often uncovers more vulnerabilities than the initial scan.&#x20;

then Review the scan results to differentiate between actual vulnerabilities and false positives
