Skip to content

Fix regex for tamper script greatest - #2690

Closed
aphtrinh wants to merge 1 commit into
sqlmapproject:masterfrom
aphtrinh:tamper-greatest
Closed

aphtrinh wants to merge 1 commit into
sqlmapproject:masterfrom
aphtrinh:tamper-greatest

Conversation

@aphtrinh

@aphtrinh aphtrinh commented Sep 7, 2017 •

Copy link
Copy Markdown

The original regex in greatest.py didn't work in a blind injection case that filters '>'. Payload sample from sqlmap: admin' AND ORD(MID((SELECT DISTINCT(IFNULL(CAST(schema_name AS CHAR),0x20)) FROM INFORMATION_SCHEMA.SCHEMATA LIMIT 0,1),1,1))>64 AND 'XJnE'='XJnE

Also in the formula "tamper('1 AND A > B')", B in most cases is just a number, so rewrite the request using LEAST like LEAST(A,B+1)=B+1 makes it much shorter and easier to read than GREATEST(A,B+1)=A, hence the new least.py

stamparm added a commit that referenced this pull request Sep 8, 2017
stamparm added a commit that referenced this pull request Sep 8, 2017
@stamparm stamparm closed this Sep 8, 2017
@stamparm

stamparm commented Sep 8, 2017

Copy link
Copy Markdown
Member

Grateful for your report and pull request. Though, I had to rewrite regexes :) (to feed my OCD midget)

@aphtrinh

aphtrinh commented Sep 8, 2017

Copy link
Copy Markdown
Author

That's okay, glad to know it's fixed :)

@aphtrinh
aphtrinh deleted the tamper-greatest branch June 29, 2018 09:55
@aphtrinh
aphtrinh restored the tamper-greatest branch June 29, 2018 09:55
@aphtrinh
aphtrinh deleted the tamper-greatest branch June 29, 2018 09:55
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