Demo URL (GitHub Pages): https://imharshitaa.github.io/API_Pentest/demo/
API security testing toolkit with category-based scripts:
*_discovery.py*_test.py*_exploit.py
Use only on APIs you own or are explicitly authorized to test.
- Load shell wrappers:
source /Users/harshitaaa/Projects/API_Pentest/shell/api_pentest.shor for fish:
source /Users/harshitaaa/Projects/API_Pentest/shell/api_pentest.fish- Run commands:
discover <test_case> <api_url>
test <test_case> <api_url>
exploit <test_case> <api_url>- Example:
discover sqli http://crapi.apisec.ai/identity/api/
test nosqli http://vampi.vulnweb.com/users/v1/
exploit xxe https://juice-shop.herokuapp.com/rest/git clone <your-repo-url>
cd API_Pentest
python3 -m venv .venv
source .venv/bin/activate
python -m pip install requestsFor fish shell:
python3 -m venv .venv
source .venv/bin/activate.fish
python -m pip install requestsFor bash/zsh:
source /Users/harshitaaa/Projects/API_Pentest/shell/api_pentest.shFor fish:
source /Users/harshitaaa/Projects/API_Pentest/shell/api_pentest.fishNotes:
- These wrappers support
discover,test, andexploitin this format:<function> <test_case> <api_url>. - In fish,
testis a reserved keyword. The fish loader definesapi_testand adds an interactive abbreviation so typingtest ...expands toapi_test .... - To auto-load on shell startup, add the
source .../shell/api_pentest.<sh|fish>line to your shell config (~/.zshrc,~/.bashrc, or~/.config/fish/config.fish).
Format:
discover <test_case> <api>
test <test_case> <api>
exploit <test_case> <api>Examples:
discover sqli https://api.dev.levo.ai
test sqli https://api.dev.levo.ai
exploit sqli https://api.dev.levo.ai
discover nosqli https://api.dev.levo.ai
test xxe https://api.dev.levo.ai- All
*_test.pyscripts now ask for base URL and optional token. - If you press Enter for token and API returns
401/403, script asks token again. - Token format expected: raw token value. Script adds
Bearerautomatically.
bolabflabuabusinesslogiccorsgraphqlinformationdisclosureorinfodisclosuredeserializationorinsecuredeserializationinventoryorinventorymanagementjwtmassassignmentratelimitmisconfigorsecuritymisconfigsqlinosqlissrfunsafeconsumptionxxepathtraversalcommandinjectionorcmdi
- Start with
discover, thentest, thenexploit. - Use exploit scripts only in isolated labs or authorized targets.
- If needed, deactivate env with
deactivate.
A project-specific demo page is included at:
/Users/harshitaaa/Projects/API_Pentest/demo/index.html/Users/harshitaaa/Projects/API_Pentest/demo/terminal-config.json
It provides:
- sample API targets
- command simulator using your format:
discover <test_case> <api>test <test_case> <api>exploit <test_case> <api>
- generated local command output like:
API_BASE_URL=\"<api>\" python SQLi/sqli_test.py
- Push this repo to GitHub.
- Open repository
Settings->Pages. - Under
Build and deployment, set:Source:Deploy from a branchBranch:mainFolder:/demo
- Save. GitHub will publish your demo URL.
Edit /Users/harshitaaa/Projects/API_Pentest/demo/terminal-config.json:
sampleApisfor the API targets shown on the pagecasesfor command-to-script mapping