How to use Sqlmap to bypass WAF

Source: Internet
Author: User
Tags svn

WAF (Web application firewall) is becoming one of the standard security solutions. Because of it, many companies don't even care about vulnerabilities in Web applications. Unfortunately, not all WAF are non-circumvention! This article will tell you how to use the injection artifact Sqlmap to bypass Wafs/idss.

SVN download the latest version of Sqlmap
SVN checkout Https://svn.sqlmap.org/sqlmap/trunk/sqlmap Sqlmap-dev

Our focus is on using the tamper script to modify the request to evade the WAF's rule detection. Many times, you need to use multiple tamper scripts together.
For all tamper scripts please refer to: https://svn.sqlmap.org/sqlmap/trunk/sqlmap/tamper/

Here, we take the example of space2hash.py and space2morehash.py for MySQL. Both scripts will automatically convert all spaces to random comments, and the extended version of this script (space2morehash.py) will also help you to "disrupt" the method function to bypass the WAF detection.

Example: * Input:1 and 9227=9227
* output:1%23pttmjopxdwj%0aand%23cwfcvrpv%0a9227=9227

Well, let's talk about the point.

You can use the command –tamper to invoke the script as follows:

./sqlmap.py-u http://127.0.0.1/test.php?id=1-v 3–dbms "MySQL" –technique u-p id–batch–tamper "space2morehash.py"

As we can see, the space in the request is replaced with the URL-encoded %23randomtext%0a
and CHAR(), USER (),CONCAT ( ) This function is replaced with function%23randomtext%0a ()

There are also two spaces to replace the script: space2mssqlblank.py and space2mysqlblank.py, as

charencode.py andchardoubleencode.py is a two-tamper script used to disrupt coding, which is useful when bypassing different keyword filters.

If web apps are developed using Asp/asp.net, charunicodeencode.py and percentage.py can help you evade the detection of WAF.

Interestingly, ASP allows to use multiple% number intervals between characters, such as and 1=%%%%%%%%1 are legal!

Summarize:

Here are a few of the representative tamper scripts to help us get around the WAF, each with its own usage scenario, or it needs to be used flexibly.

Reference article: "Cookie injection using Sqlmap", bypassing WAF interception via HTTP parameter contamination

How to use Sqlmap to bypass WAF

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.