API Discovery / Reco
Google Dorking
Google Dorksinurl:"/wp-json/wp/v2/users"
intitle:"index.of" intext:"api.txt"
inurl:"/api/v1" intext:"index of /"
ext:php inurl:"api.php?action="
intitle:"index of" api_key OR "api key" OR apiKey -poolGit Dorking
Git Dorksfilename:swagger.json
extension: .jsonSearch GitHub for your target organization’s name paired with potentially sensitive types of information, such as “api key,” "api keys", "apikey", "key", "authorization: Bearer", "access_token", "secret", or “token.”
TruffleHog
TruffleHog can also be used to search for secrets in other sources like Git, Gitlab, Amazon S3, filesystem, and Syslog.
$ sudo docker run -it -v "$PWD:/pwd" trufflesecurity/trufflehog:latest github --org=target-nameWayback Machine
Finding and comparing historical snapshots of API documentation can simplify testing for Improper Assets Management.
Amass
Fuzzing
api-endpoints.txt: https://gist.github.com/spenkk/af31fd6c4ebeaa15cf6996826109334a
Documentation
Swagger/openAPI found - Check REST API part
Docs - subdomains
API Subdomains
API endpoints
Known API
API Detector
Kiterunner
Run with authorization header
GraphQL endpoint
Detect the Programming Language
Header X-Powered-By:
PHP/x.x.x – the API is written in PHP
ASP.NET – the API is written in C#
Express – this API is written in NodeJS
Next.js – this API is written in NodeJS for use with the React framework
PleskLin – this API was written in PHP
Other headers:
Server – this header will occasionally contain information about the server software being used. For example, Microsoft-IIS/x.x or nginx.
X-AspNet-Version – this header will be present if the API is written in ASP.NET and can help you determine which version is being used.
X-AspNetMvc-Version – this header is present when an API is written in ASP.NET MVC.
Set-Cookie – while it’s not a guarantee, some languages have distinct cookie patterns that may give away what technology is in use. For example, ASP.NET_SessionId, JSESSIONID or PHPSESSID
X-Runtime – this header is often used in Ruby on Rails applications and can give you a good indication that the API is written in Ruby.
Generate verbose errors, stack trace
Finding hidden parameters
Fuzzing
Refer to API Endpoints and check Web Enumeration - Parameter Fuzzing (Arjun, etc.)
Burp - Param Miner
Burp - Content Discovery Tool
Run it on /
Interesting Books
Interesting BooksHacking APIs: Breaking Web Application Programming Interfaces A crash course in web API security testing that will prepare you to penetration-test APIs, reap high rewards on bug bounty programs, and make your own APIs more secure.
Black Hat GraphQL: Attacking Next Generation APIs This hands-on book teaches penetration testers how to identify vulnerabilities in apps that use GraphQL, a data query and manipulation language for APIs adopted by major companies like Facebook and GitHub.
Support this Gitbook
I hope it helps you as much as it has helped me. If you can support me in any way, I would deeply appreciate it.
Last updated


