Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 05-Testing_for_SQL_Injection.md #1123

Merged
merged 2 commits into from
Feb 4, 2024
Merged

Conversation

adenning4
Copy link
Contributor

Fix boolean logic error for inference methods

The current inferential query will only work in cases where the Id value actually equals 1. In blind SQL cases this value is likely not known.
SELECT field1, field2, field3 FROM Users WHERE Id='1' AND I(SUBSTRING(username,1,1))=97 AND '1'='1'

Changing the first AND to an OR will ensure the inferential query executes regardless of the Id value.
SELECT field1, field2, field3 FROM Users WHERE Id='1' OR ASCII(SUBSTRING(username,1,1))=97 AND '1'='1'

Fix boolean logic error for inference methods
The current inferential query will only work in cases where the Id value actually equals 1. In blind SQL cases this value is likely not known.
SELECT field1, field2, field3 FROM Users WHERE Id='1' AND ASCII(SUBSTRING(username,1,1))=97 AND '1'='1'

Changing the first AND to an OR will ensure the inferential query executes regardless of the Id value.
SELECT field1, field2, field3 FROM Users WHERE Id='1' OR ASCII(SUBSTRING(username,1,1))=97 AND '1'='1'
@kingthorin kingthorin force-pushed the patch-2 branch 4 times, most recently from d3a52fd to 1a1e3c3 Compare February 4, 2024 22:15
@OWASP OWASP deleted a comment from github-actions bot Feb 4, 2024
@OWASP OWASP deleted a comment from github-actions bot Feb 4, 2024
@OWASP OWASP deleted a comment from github-actions bot Feb 4, 2024
@OWASP OWASP deleted a comment from github-actions bot Feb 4, 2024
@OWASP OWASP deleted a comment from github-actions bot Feb 4, 2024
@OWASP OWASP deleted a comment from github-actions bot Feb 4, 2024
@OWASP OWASP deleted a comment from github-actions bot Feb 4, 2024
@OWASP OWASP deleted a comment from github-actions bot Feb 4, 2024
@OWASP OWASP deleted a comment from github-actions bot Feb 4, 2024
@OWASP OWASP deleted a comment from github-actions bot Feb 4, 2024
@OWASP OWASP deleted a comment from github-actions bot Feb 4, 2024
@OWASP OWASP deleted a comment from github-actions bot Feb 4, 2024

This comment was marked as resolved.

This comment was marked as resolved.

Signed-off-by: kingthorin <[email protected]>
@OWASP OWASP deleted a comment from github-actions bot Feb 4, 2024

This comment was marked as resolved.

This comment was marked as resolved.

@kingthorin kingthorin merged commit 68f9f13 into OWASP:master Feb 4, 2024
1 of 3 checks passed
@adenning4 adenning4 deleted the patch-2 branch February 5, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants