SQLMap - CheatSheet
即时可用的漏洞评估与渗透测试设置。从任何地方运行完整的渗透测试,提供 20 多种工具和功能,从侦察到报告。我们不替代渗透测试人员 - 我们开发自定义工具、检测和利用模块,以便让他们有更多时间深入挖掘、获取 shell 并享受乐趣。
SQLmap 的基本参数
通用
获取信息
内部
数据库数据
注入位置
从 Burp/ZAP 捕获
捕获请求并创建一个 req.txt 文件
GET 请求注入
POST 请求注入
在头部和其他HTTP方法中的注入
当注入成功时指示字符串
Eval
Sqlmap 允许使用 -e
或 --eval
在发送之前处理每个有效负载,使用一些 python 单行代码。这使得在发送之前以自定义方式处理有效负载变得非常简单和快速。在以下示例中,flask cookie 会话 在发送之前由 flask 使用已知的密钥进行签名:
Shell
读取文件
使用SQLmap爬取网站并自动利用
二次注入
阅读此帖子 关于如何使用 sqlmap 执行简单和复杂的二次注入。
自定义注入
设置后缀
前缀
帮助寻找布尔注入
Tamper
记住,你可以用 Python 创建自己的 tamper,这非常简单。你可以在这里的第二次注入页面找到一个 tamper 示例。
Tamper | Description |
---|---|
apostrophemask.py | 用其 UTF-8 全宽对应字符替换撇号字符 |
apostrophenullencode.py | 用其非法双重 Unicode 对应字符替换撇号字符 |
appendnullbyte.py | 在有效负载末尾附加编码的 NULL 字节字符 |
base64encode.py | 对给定有效负载中的所有字符进行 Base64 编码 |
between.py | 用 'NOT BETWEEN 0 AND #' 替换大于运算符 ('>') |
bluecoat.py | 用有效的随机空白字符替换 SQL 语句后的空格字符。然后用 LIKE 运算符替换字符 = |
chardoubleencode.py | 对给定有效负载中的所有字符进行双重 URL 编码(不处理已经编码的字符) |
commalesslimit.py | 用 'LIMIT N OFFSET M' 替换类似 'LIMIT M, N' 的实例 |
commalessmid.py | 用 'MID(A FROM B FOR C)' 替换类似 'MID(A, B, C)' 的实例 |
concat2concatws.py | 用 'CONCAT_WS(MID(CHAR(0), 0, 0), A, B)' 替换类似 'CONCAT(A, B)' 的实例 |
charencode.py | 对给定有效负载中的所有字符进行 URL 编码(不处理已经编码的字符) |
charunicodeencode.py | 对给定有效负载中未编码的字符进行 Unicode-url 编码(不处理已经编码的字符)。"%u0022" |
charunicodeescape.py | 对给定有效负载中未编码的字符进行 Unicode-url 编码(不处理已经编码的字符)。"\u0022" |
equaltolike.py | 用运算符 'LIKE' 替换所有等于运算符 ('=') |
escapequotes.py | 斜杠转义引号 (' 和 ") |
greatest.py | 用 'GREATEST' 对应字符替换大于运算符 ('>') |
halfversionedmorekeywords.py | 在每个关键字前添加版本化的 MySQL 注释 |
ifnull2ifisnull.py | 用 'IF(ISNULL(A), B, A)' 替换类似 'IFNULL(A, B)' 的实例 |
modsecurityversioned.py | 用版本化注释包裹完整查询 |
modsecurityzeroversioned.py | 用零版本化注释包裹完整查询 |
multiplespaces.py | 在 SQL 关键字周围添加多个空格 |
nonrecursivereplacement.py | 用适合替换的表示法替换预定义的 SQL 关键字(例如 .replace("SELECT", "")过滤器 |
percentage.py | 在每个字符前添加百分号 ('%') |
overlongutf8.py | 转换给定有效负载中的所有字符(不处理已经编码的字符) |
randomcase.py | 用随机大小写值替换每个关键字字符 |
randomcomments.py | 向 SQL 关键字添加随机注释 |
securesphere.py | 附加特殊构造的字符串 |
sp_password.py | 在有效负载末尾附加 'sp_password' 以自动混淆 DBMS 日志 |
space2comment.py | 用注释替换空格字符 (' ') |
space2dash.py | 用破折号注释 ('--') 替换空格字符 (' '),后跟随机字符串和换行符 ('\n') |
space2hash.py | 用井号字符 ('#') 替换空格字符 (' '),后跟随机字符串和换行符 ('\n') |
space2morehash.py | 用井号字符 ('#') 替换空格字符 (' '),后跟随机字符串和换行符 ('\n') |
space2mssqlblank.py | 用有效替代字符集中的随机空白字符替换空格字符 (' ') |
space2mssqlhash.py | 用井号字符 ('#') 替换空格字符 (' '),后跟换行符 ('\n') |
space2mysqlblank.py | 用有效替代字符集中的随机空白字符替换空格字符 (' ') |
space2mysqldash.py | 用破折号注释 ('--') 替换空格字符 (' '),后跟换行符 ('\n') |
space2plus.py | 用加号 ('+') 替换空格字符 (' ') |
space2randomblank.py | 用有效替代字符集中的随机空白字符替换空格字符 (' ') |
symboliclogical.py | 用其符号对应物替换 AND 和 OR 逻辑运算符 (&& 和 |
unionalltounion.py | 用 UNION SELECT 替换 UNION ALL SELECT |
unmagicquotes.py | 用多字节组合 %bf%27 替换引号字符 ('),并在末尾添加通用注释(以使其工作) |
uppercase.py | 用大写值 'INSERT' 替换每个关键字字符 |
varnish.py | 附加 HTTP 头 'X-originating-IP' |
versionedkeywords.py | 用版本化的 MySQL 注释包裹每个非函数关键字 |
versionedmorekeywords.py | 用版本化的 MySQL 注释包裹每个关键字 |
xforwardedfor.py | 附加假 HTTP 头 'X-Forwarded-For' |
即时可用的漏洞评估和渗透测试设置。使用 20 多种工具和功能从任何地方运行完整的渗透测试,从侦察到报告。我们不替代渗透测试人员 - 我们开发自定义工具、检测和利用模块,以便让他们有更多时间深入挖掘、获取 shell 并享受乐趣。
Last updated