-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Implement anti-CSRF protection bypass #2
Comments
Sometimes applications implement CSRF protection in a stronger way: the token is renewed upon a refresh and invalidated server-side once used. sqlmap could handle this case as follows:
|
Good day! sqlmap does not recognize the CSRF token. The parameter name token is not quite standard, I tried to change it to mean 'token' or 'nonce' but that, unfortunately, had no effect! Can I somehow explicitly in sqlmap option to define a token. Thank you! |
Either user explicitly states the anti-CSRF token name (e.g. p.s. case where this all would be problematic is the multi-threaded data retrieval |
New options:
Option |
Example run:
|
I have seen some web sites that store csrf token in cookie. When we make a request to the server, some of them expect token to be at the end of URL or post data, and some of them expect a token in headers like X-CSRF-TOKEN: 14140575295448ce39011c2... what about the last case with token in headers, does sqlmap support that? |
Not (yet). Problem is that in those cases (as I know), necessary changes are being done with the usage of Javascript, which is a huge obstacle. p.s. @stormwin do you have one of those examples around? |
p.s. the whole process is described here: http://tylerfrankenstein.com/code/drupal-services-csrf-token-firefox-poster |
@stormwin Implemented support for Example run:
p.s. basically, in those kind of cases (with |
@stamparm nice... i will test this at the weekend. just to sum up: server can set up csrf token in:
server can expect request from user with csrf token in:
|
@stormwin I am still in need for a page utilizing CSRF tokens through Cookie. sqlmap still doesn't support this. |
The latest CSRF updates break sqlmapapi as sqlmap appears to expect the csrfUrl option to be set. When it isn't set then sqlmapapi errors out with a log that the csrfUrl option is missing (this is one that isn't auto set by the API). It's not a big deal as the work around is to manually set the config option with /option//set. |
@codewatchorg thank you for your report. It should be fixed with the latest revision |
How about CSRF token in either javascript code
or in JSON format
and how about CSRF token which required POST data? |
@pich4ya those would be non-standard (custom) CSRF protection methods. In those kind of cases you would need to run either Burp or similar tool. I can make that "regex", but how to know (as it's non-standard), where the end point expects the token to appear? If the answer is "make the option for that too", I'll need to deny as it would become one of those options/switches that nobody uses |
--csrf-url="https://www.blabal.com/tarator/kokazako/?page=8" --csrf-token="token" ;) |
I think that this can be done taking advantage of the object that handles --forms (forms parsing) switch.
The text was updated successfully, but these errors were encountered: