In-depth lesson · SQL injection
Tips for beginners
Every point the SQL injection reports back under this heading, best-backed first, each with the reports it is seen in.
-
Do not stop at the first blocked request. The evidence records WAF bypasses using encoding, case variation, comments, alternative syntax and scientific notation, and reaching services directly by IP or stopping redirects.
Seen in 5 reports
-
Compare true and false conditions in search fields and JSON bodies, watching status codes and response lengths. The evidence shows this working where scanners failed and where the search term was split before reaching the query.
Seen in 4 reports
-
Test headers and less obvious inputs such as the User-Agent, Referer, cookies and custom headers. The evidence records injections in these locations, confirmed with time delays.
Seen in 4 reports
-
Test GraphQL arguments and variables, and NoSQL-backed endpoints, because resolvers and query builders may pass them straight to the database. The evidence shows both SQL and NoSQL injection through these paths.
Seen in 4 reports
-
Remember that ORMs and prepared statements do not cover every path. The evidence shows dynamic fragments, aliases and connectors still being injectable, so review how raw fragments are handled.
Seen in 4 reports
-
Test login username fields, password reset username fields and forgotten password forms. The evidence records injections in these fields, including time-based confirmation in a login request.
Seen in 3 reports
-
Do not ignore sort and order parameters. The evidence shows ORDER BY clauses and ORM ordering methods accepting raw fragments, and conditional delays placed in sort parameters to confirm injection.
Seen in 3 reports
-
When error output is suppressed, use time-based tests and repeat them with shorter delays to rule out network jitter. The evidence describes confirming delays that scale with the supplied value before automating extraction.
Seen in 3 reports
-
If you find an injection, show impact beyond a database error. The evidence shows reports escalating to data extraction, file reads, command execution and chained XSS or deserialisation. A confirmed injection with no demonstrated impact is weaker.
Seen in 3 reports
-
Check scope before testing. The evidence includes many named third-party products and specific programs, and testing a vendor's software outside the program's scope is a common mistake. Confirm the asset and the program rules first.
Seen in 3 reports
-
Review code where you can, such as disclosed repositories or bundled libraries, to find unsafe query construction faster. The evidence shows white-box review and source review from a disclosed .git folder leading to findings.
Seen in 3 reports
-
Start with simple request parameters on a new target, including search boxes, lookup forms and numeric identifiers in the URL path. The evidence shows these are common entry points and are often overlooked in favour of login pages.
Seen in 2 reports
-
Test write paths and not only SELECT queries. The evidence shows UPDATE and INSERT statements being injectable, and injections used to persist data that was later rendered or deserialised.