文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 互联网 > stack overflaw
侵权投诉

stack overflaw

基本溢出分析

stack overflaw

stack overflaw

stack overflaw

stack overflaw

doc.guandang.net - Page 1 / 12

Corelan Team

:: Knowledge is not an object, it's a flow ::

Exploit writing tutorial part 1 : Stack Based Overflows

Corelan Team (corelanc0d3r) · Sunday, July 19th, 2009

Last friday (july 17th 2009), somebody (nick)named ‘Crazy_Hacker’ has reported a vulnerability in Easy RM to MP3 Conversion Utility (on XP SP2 En),via packetstormsecurity.org. (see doc.guandang.net). The vulnerability report included a proof of concept exploit (which, bythe way, failed to work on my MS Virtual PC based XP SP3 En). Another exploit was released just a little bit later.

Nice work. You can copy the PoC exploit code, run it, see that it doesn’t work (or if you are lucky, conclude that it works), or… you can try tounderstand the process of building the exploit so you can correct broken exploits, or just build your own exploits from scratch.

(By the way : unless you can disassemble, read and comprehend shellcode real fast, I would never advise you to just take an exploit (especially if it’s aprecompiled executable) and run it. What if it’s just built to open a backdoor on your own computer ?

The question is : How do exploit writers build their exploits ? What does the process of going from detecting a possible issue to building an actualworking exploit look like ? How can you use vulnerability information to build your own exploit ?

Ever since I’ve started this blog, writing a basic tutorial about writing buffer overflows has been on my “to do” list… but I never really took the time todo so (or simply forgot about it).

When I saw the vulnerability report today, and had a look at the exploit, I figured this vulnerability report could acts as a perfect example to explainthe basics about writing exploits… It’s clean, simple and allows me to demonstrate some of the techniques that are used to write working and stablestack based buffer overflows.

So perhaps this is a good time… Despite the fact that the forementioned vulnerability report already includes an exploit (working or not), I’ll still usethe vulnerability in “Easy RM to MP3 conversion utility” as an example and we’ll go through the steps of building a working exploit, without copyinganything from the original exploit. We’ll just build it from scratch (and make it work on XP SP3 this time :) )

Before we continue, let me get one thing straight. This document is purely intended for educational purposes. I do not want anyone to use thisinformation (or any information on this blog) to actually hack into computers or do other illegal things. So I cannot be held responsible for the acts ofother people who took parts of this document and used it for illegal purposes. If you don’t agree, then you are not allowed to continue to access thiswebsite… so leave this website immediately.

Anyways, that having said, the kind of information that you get from vulnerability reports usually contains information on the basics of thevulnerability. In this case, the vulnerability report states “Easy RM to MP3 Converter version 2.7.3.700 universal buffer overflow exploit that creates amalicious .m3u file”. In other words, you can create a malicious .m3u file, feed it into the utility and trigger the exploit. These reports may not be veryspecific every time, but in most cases you can get an idea of how you can simulate a crash or make the application behave weird. If not, then thesecurity researcher probably wanted to disclose his/her findings first to the vendor, give them the opportunity to fix things… or just wants to keep theintel for him/herself…

Before starting with the first part of (hopefully) a series of tutorials about exploit writing, allow me to mention thatI have set up a discussion forum (logged in members only) where you can discuss exploit writing issues/postquestions/tips&tricks… etc . You can access the forum at /index.php/forum/writing-exploits/

Verify the bug

First of all, let’s verify that the application does indeed crash when opening a malformatted m3u file. (or find yourself an application that crashes whenyou feed specifically crafted data to it).

Get yourself a copy of the vulnerable version of Easy RM to MP3 and install it on a computer running Windows XP. The vulnerability report states thatthe exploit works on XP SP2 (English), but I’ll use XP SP3 (English).Local copy of the vulnerable application can be downloaded here :

Easy RM to MP3 Conversion Utility

stack overflaw

stack overflaw

(2.8 MiB, 6,422 hits)

Quick sidenote : you can find older versions of applications at oldapps.com and oldversion.com, or by looking at exploits on exploit-db.com (whichoften have a local copy of the vulnerable application as wlel)

We’ll use the following simple perl script to create a .m3u file that may help us to discover more information about the vulnerability :

Run the perl script to create the m3u file. The fill will be filled with 10000 A’s (\x41 is the hexadecimal representation of A) and open this m3u file withEasy RM to MP3…. The application throws an error, but it looks like the error is handled correctly and the application does not crash. Modify the scriptto write a file with 20000 A’s and try again. Same behaviour. (exception is handled correctly, so we still could not overwrite anything usefull). Nowchange the script to write 30000 A’s, create the m3u file and open it in the utility.Boom – application dies.

Ok, so the application crashes if we feed it a file that contains between 20000 and 30000 A’s. But what can we do with this ?

Corelan Team - Copyright - All rights reserved. Terms Of Use are applicable to this pdf file and its contents. See doc.guandang.net

15/04/2014 - 1 / 12

doc.guandang.net

第1页

你可能喜欢

热门文档

相关文档

  • 提示stack_overflow_at_line:0解决方法[1]

    提示stack_overflow_at_line:0解决方法[1]_其它_高等教育_教育专区。计算机由于大家经常乱装软件,导致有时候注册表混乱,使基于 IE 内核的浏览器无法 正常显示...

  • 说说Stack Overflow和Quora

    说说Stack Overflow和Quora_IT/计算机_专业资料。说说Stack Overflow和Quora说说Stack Overflow 和 Quora 作者: robbin 的自言自语 来源: robbin 的自言自语 时间:...

  • 解决浏览器出现stack overflow at line 0

    解决浏览器出现stack overflow at line 0_IT/计算机_专业资料。解决浏览器出现stack overflow at line 0stack overflow at line:0 一打开网页或者打开百度地图等...

  • 如何解决C、C++中stack overflow问题

    如何解决 C/C++中 stack overflow 问题 一般遇到这个问题,有两个常见的情况,一个是存在函数的递归调用,另一个是函数 中定义了一个较大的数组或者别的变量。 1...

  • 我是如何在Stack Overflow找到工作的

    我是如何在Stack Overflow找到工作的_求职/面试_求职/职场_应用文书。资料来源:中国教育在线 http://www.eol.cn/ 我刚刚在 Stack Exchange 找到了工作。应聘的...

  • 运行时错误:Stack Overflow的解决办法

    运行时错误:Stack Overflow的解决办法_PPT制作技巧_实用文档。运行时错误:Stack Overflow的解决办法运行时错误: Stack Overflow 的解决办法.txt 这世界上除了我谁...

  • 关于如何解决浏览器出现“stack overflow at line0”,...

    关于如何解决浏览器出现“stack overflow at line:0”, 且有些图片不能 显示的问题计算机 2010-10-07 18:05:45 阅读 1139 评论 17 字号:大中小 订阅 浏览器...

  • 解决浏览器出现stack_overflow_at_line

    解决浏览器出现stack_overflow_at_line_互联网_IT/计算机_专业资料。然后进入 IE 的“工具”→“Internet 选项”→ “高级” , 单击“重置”按纽就行啦 有人...

  • 提示stack overflow at line:0解决方法

    提示stack overflow at line:0解决方法_电脑基础知识_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档 提示stack overflow at line:0解决方法_电脑基础...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email