Skip to content

Lua-Nginx WAFs Bypass#3316

Merged
stamparm merged 6 commits into
sqlmapproject:masterfrom
xtormin:lua-nginx-waf-bypass
Oct 26, 2018
Merged

Lua-Nginx WAFs Bypass#3316
stamparm merged 6 commits into
sqlmapproject:masterfrom
xtormin:lua-nginx-waf-bypass

Conversation

@xtormin

@xtormin xtormin commented Oct 25, 2018

Copy link
Copy Markdown
Contributor

Lua-Nginx WAFs doesn't support processing for more than 100 parameters.
https://www.youtube.com/watch?v=JUvro7cqidY

@stamparm

Copy link
Copy Markdown
Member

We don't accept merge requests without standard header that can be found in all sqlmap python files. As a matter of recognition we can add you to the doc/THANKS.md list.

@stamparm

Copy link
Copy Markdown
Member

After a second look:

A) I am a known BOFH and I don't like the quality of this code. There are many things that would require a rewriting (I can do this, but you have to take a look at B).
B) When I said We don't accept merge requests without standard header that also means that no other self-promoting stuff can go inside (e.g. Vulnerability discovered by: Daniel Fariña Hernández). I can do a proper reference to a valid page (to whatever page you want where the vulnerability/bypass is being talked about). Also, I said for matter of recognition we can add you to the doc/THANKS.md list

@xtormin

xtormin commented Oct 26, 2018

Copy link
Copy Markdown
Contributor Author

That's fine, I will change the tamper header and you can modify the code whatever it takes.

This is the page where the vulnerability is being talked about:
https://opendatasecurity.io/cloudflare-vulnerability-allows-waf-be-disabled/

Thank you so much!

@stamparm

Copy link
Copy Markdown
Member

Done the modifications at my side. First I'll merge your version completely into the HEAD and then do the after-commit in a minute

@stamparm stamparm merged commit 4466504 into sqlmapproject:master Oct 26, 2018
stamparm added a commit that referenced this pull request Oct 26, 2018
stamparm added a commit that referenced this pull request Oct 26, 2018
@stamparm

Copy link
Copy Markdown
Member

@j4ckmln please pull the latest revision and try to run it with --tamper=luanginx.py (Note: changed the name to be compliant with other tamper scripts). Also, if you want to change something in https://github.com/sqlmapproject/sqlmap/blob/master/doc/THANKS.md please let me know (grep for Jennifer Torres)

@xtormin

xtormin commented Oct 26, 2018

Copy link
Copy Markdown
Contributor Author

Thank you!
I was testing the modifications made and there's a small error that affects the performance of the tamper.

This is an example about the modifications result:
"GET /vulnerabilities/sqli/1s=&NY=&q4=&e2=&[...]Pf=&Dk=&Tk=&wG=&Vf=&http://cloudflarewafexampleurl.com:80/vulnerabilities/sqli/?id=9195&Submit=Submit HTTP/1.1"

This must be the result:
"GET /vulnerabilities/sqli/?1s=&NY=&q4=&e2=&[...]Pf=&Dk=&Tk=&wG=&Vf=&id=[INJECTION]&Submit=Submit HTTP/1.1"

Example:
"GET /vulnerabilities/sqli/?[100 random parameters here]&id=[INJECTION]&Submit=Submit HTTP/1.1"
Where 'id' is the vulnerable parameter and 'Submit' is an example of another necessary parameter that could be in the request.

@stamparm

Copy link
Copy Markdown
Member

How have you run it? I guess with * where you wanted sqlmap to inject, right?

When I am running with a regular python sqlmap.py -u "..../?id=1" --tamper luanginx.py I get good results

@stamparm

Copy link
Copy Markdown
Member

p.s. I'll fix the URI case (which I guess you've tried), but need to know if that was really the case at your place

stamparm added a commit that referenced this pull request Oct 26, 2018
@stamparm

stamparm commented Oct 26, 2018

Copy link
Copy Markdown
Member

With latest revision your usage case should work too (with custom injection marking inside the URI itself (e.g. <target.com>/?id1=1*&id2=2)

@xtormin

xtormin commented Oct 26, 2018

Copy link
Copy Markdown
Contributor Author

Yes, that was the problem.
Great! Now it works perfectly, thanks for everything! =D

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