<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Abysssec Security Researches &#187; reversing</title>
	<atom:link href="http://www.abysssec.com/blog/category/reversing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.abysssec.com/blog</link>
	<description>Security Researches , Advisories , Coding , Projects , Reversing , Exploitation , Fuzzing</description>
	<lastBuildDate>Fri, 14 May 2010 19:22:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Immunity Debugger PeDetect and the art of signature generation</title>
		<link>http://www.abysssec.com/blog/2010/01/immunity-debugger-pedetect-and-the-art-of-signature-generation/</link>
		<comments>http://www.abysssec.com/blog/2010/01/immunity-debugger-pedetect-and-the-art-of-signature-generation/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 10:55:38 +0000</pubDate>
		<dc:creator>shahin</dc:creator>
				<category><![CDATA[reversing]]></category>
		<category><![CDATA[Anti virus]]></category>
		<category><![CDATA[AV]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Immunity Debugger]]></category>
		<category><![CDATA[PE]]></category>
		<category><![CDATA[PeDetect]]></category>
		<category><![CDATA[PyCommand]]></category>
		<category><![CDATA[reverse engineering]]></category>
		<category><![CDATA[signature]]></category>

		<guid isPermaLink="false">http://www.abysssec.com/blog/?p=415</guid>
		<description><![CDATA[hello to you all i,m really sorry for our late  in posting we really working on lots of things &#8230; before starting about our subject i should  tell you about our advisories and exploits we are not  really full-disclosure believers but still we will post some more exploits and advisories at  : http://www.exploit-db.com/author/abysssec so stay [...]]]></description>
			<content:encoded><![CDATA[<p>hello to you all</p>
<p>i,m really sorry for our late  in posting we really working on lots of things &#8230; before starting about our subject i should  tell you about our advisories and exploits we are not  really full-disclosure believers but still we will post some more exploits and advisories at  :</p>
<p><a title="http://www.exploit-db.com/author/abysssec " href="http://www.exploit-db.com/author/abysssec " target="_blank"> http://www.exploit-db.com/author/abysssec </a></p>
<p>so stay tuned.</p>
<p>OK let&#8217;s start  &#8230;.</p>
<p>=========================================</p>
<p>before start if you are not familiar with PE  : The <strong>Portable Executable</strong> (PE) format is a <a title="File format" href="http://en.wikipedia.org/wiki/File_format">file format</a> for <a title="Executable" href="http://en.wikipedia.org/wiki/Executable">executables</a>, <a title="Object file" href="http://en.wikipedia.org/wiki/Object_file">object code</a>, and <a title="Dynamic-link library" href="http://en.wikipedia.org/wiki/Dynamic-link_library">DLLs</a>, used in 32-bit and 64-bit versions of <a title="Microsoft Windows" href="http://en.wikipedia.org/wiki/Microsoft_Windows">Windows</a> <a title="Operating system" href="http://en.wikipedia.org/wiki/Operating_system">operating systems</a>. The term &#8220;portable&#8221; refers to the format&#8217;s versatility in numerous environments of operating system software architecture.</p>
<p style="text-align: left;">for more information  :  http://en.wikipedia.org/wiki/Portable_Executable</p>
<p>- now the first question is what is a signature ?</p>
<p>a signature actually  is what that means but in computer world and more specific in reverse engineering and binary auditing  world a signature is a sequence of  unique instructions (actually their representation op-codes) in target binary.</p>
<p>for better understanding please watch figure 1</p>
<p style="text-align: center;"><img class="aligncenter" title="figure-1" src="http://i46.tinypic.com/2ak9soj.png" alt="" width="402" height="194" /></p>
<p style="text-align: center;">figure 1 &#8211; a c++ compiled binary opened in immunity debugger</p>
<p style="text-align: left;">reminiscence : an <strong>opcode</strong> (<strong>op</strong>eration <strong>code</strong>) is the portion of a <a title="Machine language" href="http://en.wikipedia.org/wiki/Machine_language">machine language</a> <a title="Instruction (computer science)" href="http://en.wikipedia.org/wiki/Instruction_%28computer_science%29">instruction</a> that specifies the operation to be performed.</p>
<p style="text-align: left;">in above figure it have tree red rectangular :</p>
<ul>
<li>first rectangular are RVA (relative virtual address) of instructions</li>
<li>second rectangular are OP-Codes (will be execute)</li>
<li>third rectangular are  readable assembly instructions</li>
</ul>
<p>so we will search for a sequence of unique op-codes (so sequence of instructions)  in our target binary and those byte will be signature of our binary. simple enough eh ?</p>
<p>- what and who need to use a signature ?</p>
<ul>
<li>most of anti-virus (and other anti-things)</li>
<li>and almost all of PE Detection tools</li>
</ul>
<p>so now you can imagine how  an anti-virus company can detect a malware and how  PE-Detection tools  (witch areused for detecting signature in compiled binary and determine compiler / packer / compressor and &#8230; )  works .</p>
<p>- next question is why we need care about signatures:</p>
<ul>
<li> before starting any fuzzing / reversing / auditing project we need to about our target binary</li>
<li> identify binaries those have not any signatures</li>
<li>with them we can speed up our reversing and we can find available tools against our target binary</li>
</ul>
<p>-how we can find signatures in binaries ?</p>
<p>we should search for static and constant location (static instructions) in our file but how we can find them? for answer to this question please watch PE file layout again :</p>
<p style="text-align: center;"><img class="aligncenter" title="PE File" src="http://i49.tinypic.com/iydh1d.gif" alt="" width="153" height="487" /></p>
<p style="text-align: center;">figure 2 &#8211; PE file layout</p>
<p style="text-align: left;">we can search for signatures in a few areas :</p>
<ul>
<li>around program entry point (where program instructions will start execution &#8230;)</li>
<li>from offset (from top to bottom)</li>
</ul>
<p>each executable file have some other locations can be good for generating signature those are :</p>
<ul>
<li>around import table (where functions will be import)</li>
<li>start and end of sections (optional section specially)</li>
<li>name of optional / static sections</li>
<li>&#8230;.</li>
</ul>
<p>so we can just open the executable  under debugger and copy a few OP-Codes from entry point and we are done ? of course not ! because in lots of situations entry point could be change  refer to various factors like :</p>
<ul>
<li>initializing addresses / variables with state of program</li>
<li>if we are in fighting against a packer / compressor / cryptor / there are several technologies they can use for hiding / changing instructions &#8230;</li>
</ul>
<p>note : these changes are more on not &#8220;just compiled binaries&#8221; it means those have a packer / protector and &#8230;.</p>
<p>so how we can find reliable signatures ?</p>
<p>we need to research about variant program situations  and then we can understand which bytes/instructions are constant and which are not then we  can ignore dynamic bytes and rely to static bytes.</p>
<p>before a  real case study i just want explain how packer/protectors works :</p>
<p>a packer will do what it sounds : packing a program. think  about winzip it will comperes the program and actually will decrease size of program .</p>
<p>elementary packers just will compress the portable executable and will change entry point to decompression section for better understanding just watch below figure.</p>
<p style="text-align: center;"><img class="aligncenter" title="packer" src="http://i48.tinypic.com/v58lj6.png" alt="" width="490" height="175" />figure 3 How typical packer runtime works</p>
<p style="text-align: left;">1. Original data is located somewhere in the packer code data section<br />
2. Original data is uncompressed to the originally linked location<br />
3. Control is transferred to original code entry point (OEP)</p>
<p style="text-align: left;">Ok now you know how a basic packer works but today modern packers are not just compressor they will use a lots of anti-debugging  technologies against debugger / disassembler to make reverser life harder. this technologies are out of scope of  this post.</p>
<p style="text-align: left;">Ok for example if we want to make  a signature for a new packer / protector we need to pack / protect variant  executable (it&#8217;s better  to test on different compiler / size)  and then watch which byte of files are changed and which one are static !</p>
<p style="text-align: left;">you can use binary copy option in immunity debugger for starting our test</p>
<p style="text-align: center;"><img class="aligncenter" title="binary copy" src="http://i48.tinypic.com/t0nms2.png" alt="" width="504" height="267" />figure 4 binary copy</p>
<p style="text-align: left;">this program is  packed with a really simple and good packer named FSG.</p>
<p style="text-align: left;">and my first signature will be :</p>
<p style="text-align: left;">87 25 5C AD 41 00 61 94 55 A4 B6 80 FF 13 73 F9 33 C9 FF 13 73 16 33</p>
<p style="text-align: left;">so now i need to pack more files and check my selected Op-codes to know which one are changed and then we will replace changed op codes with ?? .  after a few try we will get a signature like  :</p>
<p style="text-align: left;">87 25 ?? ?? ?? ?? 61 94 55 A4 B6 80 FF 13 73 F9 33 C9 FF 13 73 16 33</p>
<p style="text-align: left;">so if i search for these bytes i can find i can find them in any program those are packed with FSG v2 !</p>
<p style="text-align: left;">this example is really really simple for advanced packer we need really test more bytes to be sure our signature is good enough but from my experience  length between 30-70 byte  from entry point are good enough.</p>
<p style="text-align: left;">if you be smart you will select good instructions like sections those have 16-bit registers and instructions those are not used all times. so an example of really good signature can be below figure (taken from symantec slides) :</p>
<p style="text-align: center;"><img class="aligncenter" title="good signature" src="http://i49.tinypic.com/2vlu168.png" alt="" width="328" height="338" />figure 5 ( a really good signature )</p>
<p style="text-align: left;">OK. now you can make you own signatures just by spending a few time on each target . there are several tools can be use for detecting  signatures if executable most popular of them are :</p>
<ul>
<li>PEiD</li>
<li>RDG Packer Detector</li>
<li>PE Detective</li>
</ul>
<p>but all of them have a same problem not so update signatures ! so if you have a program that is packed by a really new packer or just a few byte take changed from their signature  most of them will fail (intelligent signature detection is out of scope of this post) . so what we can do ? we should have our own database for our job .</p>
<p>so i collect all of existing signature database (those i found) in internet and i removed stupid and duplicated signature from the list those are :</p>
<ul>
<li>BoB at Team PEiD signature database</li>
<li>Panda Security customized signature database</li>
<li>Diablo2002 signature database</li>
<li>ARteam members signature database</li>
<li>SnD members signature database</li>
<li>Fly signature database</li>
<li>and &#8230;</li>
</ul>
<p>after i combined all of their signature databases i changed a few of important signature to be more general and i added some new signature to my list  and my final list right now have around 5064 unique and 4268 from entry point signature.</p>
<p>PEiD can parse external signatures and it&#8217;s nice but i liked to have detection in my debugger so i searched for a signature detection library in python (i like python) and with a quick search i found nice Pefile coded by Ero Carrera can handle all of our requirement in working with PE file not only handling signatures you can download it at :</p>
<p>http://code.google.com/p/pefile/</p>
<p>so i decide to use this library to write a pycommand for immunity debugger fortunately i found a copy of a pefile in immunity debugger lib ! so all i have to do is writing a few line of code that can read my database and test it against my binary and tell me the output .<br />
so here is my complete script also have a option for auto-update  .</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #483d8b;">''</span><span style="color: #483d8b;">'
 This script is for identify packer/protector and compiler used in your target binary
 the first version have more than about 5000 signatures ... we will try to updates signatures monthly
 and for now it will use entry point scaning method ...
&nbsp;
 Tree Important Notes :
 First  the database signatures are reaped by lots of people we should thanks them : BoBSoft at Team PEID  , fly , diablo2oo2 and others you can find their name in list ...
 Second A big thanks to Ero Carrera for his nice python pefile lib the hard part of processing singanutes is done by his library .
 Third  we updated some of signatures and will keep update them monthly  for detection newer version of packers / comprassion algorithm (hopefully) 
&nbsp;
 thanks to nicolas waisman / Muts (offsec) and all of abysssec memebers ...
&nbsp;
 Feel free to contact me with admin [at] abysssec.com
'</span><span style="color: #483d8b;">''</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#import python libraries</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">getopt</span>
<span style="color: #ff7700;font-weight:bold;">import</span> pefile
<span style="color: #ff7700;font-weight:bold;">import</span> immlib
<span style="color: #ff7700;font-weight:bold;">import</span> peutils
<span style="color: #ff7700;font-weight:bold;">import</span> hashlib
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">shutil</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">urllib</span>
&nbsp;
__VERSION__ = <span style="color: #483d8b;">'0.2'</span>
&nbsp;
DESC= <span style="color: #483d8b;">&quot;Immunity PyCommand PeDectect will help you to identfy packer / protection used in target binary&quot;</span>
USAGE = <span style="color: #483d8b;">&quot;!PeDetect&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#global</span>
downloaded = <span style="color: #ff4500;">0</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#Using debugger functionality</span>
imm = immlib.<span style="color: black;">Debugger</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># pedram's urllib_hook</span>
<span style="color: #ff7700;font-weight:bold;">def</span> urllib_hook <span style="color: black;">&#40;</span>idx, <span style="color: #008000;">slice</span>, total<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">global</span> downloaded
&nbsp;
    downloaded += <span style="color: #008000;">slice</span>
&nbsp;
    completed = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #008000;">float</span><span style="color: black;">&#40;</span>downloaded<span style="color: black;">&#41;</span> / <span style="color: #008000;">float</span><span style="color: black;">&#40;</span>total<span style="color: black;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">100</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> completed <span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;</span> <span style="color: #ff4500;">100</span>:
        completed = <span style="color: #ff4500;">100</span>
&nbsp;
    imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;   [+] Downloading new signatures ... %d%%&quot;</span> <span style="color: #66cc66;">%</span> completed<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Downloader function</span>
<span style="color: #ff7700;font-weight:bold;">def</span> get_it <span style="color: black;">&#40;</span>url, file_name<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">global</span> downloaded
&nbsp;
    downloaded = <span style="color: #ff4500;">0</span>
    u = <span style="color: #dc143c;">urllib</span>.<span style="color: black;">urlretrieve</span><span style="color: black;">&#40;</span>url, reporthook=urllib_hook<span style="color: black;">&#41;</span>
    <span style="color: #808080; font-style: italic;">#imm.Log(&quot;&quot;)</span>
    <span style="color: #dc143c;">shutil</span>.<span style="color: black;">move</span><span style="color: black;">&#40;</span>u<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>, file_name<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Calculate MD5Checksum for specific file</span>
<span style="color: #ff7700;font-weight:bold;">def</span> md5checksum<span style="color: black;">&#40;</span>fileName, excludeLine=<span style="color: #483d8b;">&quot;&quot;</span>, includeLine=<span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>:
    m = hashlib.<span style="color: #dc143c;">md5</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        fd = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>fileName,<span style="color: #483d8b;">&quot;rb&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">IOError</span>:
        imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Unable to open the file in readmode:&quot;</span>, filename<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span>
    content = fd.<span style="color: black;">readlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    fd.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> eachLine <span style="color: #ff7700;font-weight:bold;">in</span> content:
        <span style="color: #ff7700;font-weight:bold;">if</span> excludeLine <span style="color: #ff7700;font-weight:bold;">and</span> eachLine.<span style="color: black;">startswith</span><span style="color: black;">&#40;</span>excludeLine<span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">continue</span>
        m.<span style="color: black;">update</span><span style="color: black;">&#40;</span>eachLine<span style="color: black;">&#41;</span>
    m.<span style="color: black;">update</span><span style="color: black;">&#40;</span>includeLine<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> m.<span style="color: black;">hexdigest</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Simple Usage Function</span>
<span style="color: #ff7700;font-weight:bold;">def</span> usage<span style="color: black;">&#40;</span>imm<span style="color: black;">&#41;</span>:
    imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;!PeDetect -u (for updating signature ... )&quot;</span> <span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Auto-Update function</span>
<span style="color: #ff7700;font-weight:bold;">def</span> update<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
&nbsp;
    <span style="color: #808080; font-style: italic;"># Using urlretrieve won't overwrite anything</span>
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        download = <span style="color: #dc143c;">urllib</span>.<span style="color: black;">urlretrieve</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'http://abysssec.com/AbyssDB/Database.TXT'</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">Exception</span> , problem:
        imm.<span style="color: black;">Log</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Error : %s&quot;</span><span style="color: #66cc66;">%</span> problem<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># Computation MD5 cheksum for both existing and our current database</span>
    AbyssDB = md5checksum<span style="color: black;">&#40;</span>download<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    ExistDB = md5checksum<span style="color: black;">&#40;</span><span style="color: #483d8b;">'Data/Database.TXT'</span><span style="color: black;">&#41;</span>
&nbsp;
    imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot; [!] Checking for updates ...&quot;</span> , focus=<span style="color: #ff4500;">1</span>, highlight=<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
    imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>
    imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot; [*] Our  database checksum : %s &quot;</span><span style="color: #66cc66;">%</span>AbyssDB<span style="color: black;">&#41;</span>
    imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot; [*] Your database checksum : %s &quot;</span><span style="color: #66cc66;">%</span>ExistDB<span style="color: black;">&#41;</span>
    imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> AbyssDB <span style="color: #66cc66;">!</span>= ExistDB:
&nbsp;
        imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[!] Some update founds updating ....&quot;</span><span style="color: black;">&#41;</span>        
&nbsp;
        <span style="color: #808080; font-style: italic;"># Removing existing one for be sure ...</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">exists</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Data/Database.txt'</span><span style="color: black;">&#41;</span>:
            <span style="color: #dc143c;">os</span>.<span style="color: black;">remove</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Data/Database.txt'</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Download latest database</span>
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            get_it<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;http://abysssec.com/AbyssDB/Database.TXT&quot;</span>, <span style="color: #483d8b;">&quot;Data/Database.txt&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">Exception</span>,mgs:
            <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">&quot; [-] Problem in downloading new database ...&quot;</span> <span style="color: #66cc66;">%</span> mgs
&nbsp;
        imm.<span style="color: black;">log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;   [+] Update Comepelete !&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot; [!] You have our latest database ...&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Main Fuction</span>
<span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span>args<span style="color: black;">&#41;</span>:
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> args:
        <span style="color: #ff7700;font-weight:bold;">if</span> args<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>.<span style="color: black;">lower</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> == <span style="color: #483d8b;">'-u'</span>:
            update<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[-] Bad argumant use -u for update ...&quot;</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">return</span>  <span style="color: #483d8b;">&quot;[-] Bad argumant use -u for update ...&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            <span style="color: #808080; font-style: italic;"># Getting loded exe path</span>
            path = imm.<span style="color: black;">getModule</span><span style="color: black;">&#40;</span>imm.<span style="color: black;">getDebuggedName</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>.<span style="color: black;">getPath</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">Exception</span>, msg:
            <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">&quot;Error: %s&quot;</span> <span style="color: #66cc66;">%</span> msg
&nbsp;
        <span style="color: #808080; font-style: italic;"># Debugged Name</span>
        name = imm.<span style="color: black;">getDebuggedName</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Loading loaded pe !</span>
        pe = pefile.<span style="color: black;">PE</span><span style="color: black;">&#40;</span>path<span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Loading signatures Database</span>
        signatures = peutils.<span style="color: black;">SignatureDatabase</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Data/Database.TXT'</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Mach the signature using scaning entry point only !</span>
        matched = signatures.<span style="color: black;">match</span><span style="color: black;">&#40;</span>pe , ep_only=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>        
&nbsp;
        imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;===================  WwW.Abysssec.com  =======================&quot;</span><span style="color: black;">&#41;</span>
        imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>
        imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[*] PeDetect By Shahin Ramezany&quot;</span> , focus=<span style="color: #ff4500;">1</span>, highlight=<span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;">#imm.Log(&quot;=============================================================&quot;)</span>
        imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[*] Total loaded  signatures : %d&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>signatures.<span style="color: black;">signature_count_eponly_true</span> + signatures.<span style="color: black;">signature_count_eponly_false</span> + signatures.<span style="color: black;">signature_count_section_start</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[*] Total ep_only signatures : %d&quot;</span> <span style="color: #66cc66;">%</span> signatures.<span style="color: black;">signature_count_eponly_true</span><span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;">#imm.Log(&quot;=============================================================&quot;)</span>
        imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Signature found or not found !</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> matched:
            imm.<span style="color: black;">log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[*] Processing : %s &quot;</span> <span style="color: #66cc66;">%</span> name<span style="color: black;">&#41;</span>
            imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[+] Signature Found  : %s &quot;</span>   <span style="color: #66cc66;">%</span> matched , focus=<span style="color: #ff4500;">1</span>, highlight=<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
            imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            imm.<span style="color: black;">log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[*] Processing   %s !&quot;</span> <span style="color: #66cc66;">%</span> name<span style="color: black;">&#41;</span>
            imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;   [-] Signatue Not Found !&quot;</span> , focus=<span style="color: #ff4500;">1</span>, highlight=<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
            imm.<span style="color: black;">Log</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># Checking for arguements !</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> args:
            usage<span style="color: black;">&#40;</span>imm<span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">&quot;[+] See log window (Alt-L) for output / result ...&quot;</span></pre></div></div>

<p>for using this script you just need copy PeDetect.py in you PyCommand directory in immunity debugger python then copy Database.TXT in DATA folder in immunity debugger. after this you just need run it from immunity debugger command bar using  !PeDetect  you can see the output of this script against some files&#8230;</p>
<p><img class="aligncenter" title="output1" src="http://i48.tinypic.com/9fuu00.png" alt="" width="432" height="171" /><br />
figure 6 &#8211; output of PeDetect against not packed file</p>
<p style="text-align: center;"><img class="aligncenter" title="packed" src="http://i48.tinypic.com/11l2zk6.png" alt="" width="441" height="168" /><br />
figure 7 &#8211; output against  packed file</p>
<p style="text-align: left;">also this have an argument !PeDetect -u for updating your signature to our latest database. notice that my script will use md5checksum so your changes meaning it won&#8217;t be same as my database and your database will be update automatically.</p>
<p style="text-align: center;"><img class="aligncenter" title="update" src="http://i48.tinypic.com/15nt0ts.png" alt="" width="450" height="122" /></p>
<p style="text-align: center;">figure 8 &#8211; update command</p>
<p>PS : after i wrote this i saw another PyCommand named scanpe wrote by BoB at PeiD it&#8217;s really good and have PE scan option but have not update update so no more new signatures &#8230;</p>
<p style="text-align: left;">references :</p>
<ul>
<li> Automatic Generation of String Signatures for Malware Detection</li>
<li>Signature Generation by korupt (http://korupt.co.uk)</li>
<li>Team PEiD forums</li>
<li>Immunity Debugger online documentation</li>
<li>FSecure &#8211; reverse engineering slides</li>
<li>My time</li>
</ul>
<p style="text-align: left;">download PeDetect (database + pycommand) from : (please read the ReadMe.txt for installation guide)</p>
<p><a title="http://www.abysssec.com/files/PeDetect.zip" href="http://www.abysssec.com/files/PeDetect.zip" target="_blank">http://www.abysssec.com/files/PeDetect.zip</a></p>
<p style="text-align: left;">
<p>happy new years !</p>
<p style="text-align: left;">cheers</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 111px; width: 1px; height: 1px;"><a href="http://www.abysssec.com/files/PeDetect.zip">The <strong>Portable Executable</strong> (PE) format is a </a><a title="File format" href="http://en.wikipedia.org/wiki/File_format">file format</a> for <a title="Executable" href="http://en.wikipedia.org/wiki/Executable">executables</a>, <a title="Object file" href="http://en.wikipedia.org/wiki/Object_file">object code</a>, and <a title="Dynamic-link library" href="http://en.wikipedia.org/wiki/Dynamic-link_library">DLLs</a>, used in 32-bit and 64-bit versions of <a title="Microsoft Windows" href="http://en.wikipedia.org/wiki/Microsoft_Windows">Windows</a> <a title="Operating system" href="http://en.wikipedia.org/wiki/Operating_system">operating systems</a>. The term &#8220;portable&#8221; refers to the format&#8217;s versatility in numerous environments of operating system software architecture.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.abysssec.com/blog/2010/01/immunity-debugger-pedetect-and-the-art-of-signature-generation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Format string exploitation on windows</title>
		<link>http://www.abysssec.com/blog/2009/02/format-string-exploitation-on-windows/</link>
		<comments>http://www.abysssec.com/blog/2009/02/format-string-exploitation-on-windows/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 13:28:21 +0000</pubDate>
		<dc:creator>shahin</dc:creator>
				<category><![CDATA[Exploits / BUG Decryption]]></category>
		<category><![CDATA[reversing]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[exploitation]]></category>
		<category><![CDATA[Format string]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[reverse engineering]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://abysssec.com/blog/?p=278</guid>
		<description><![CDATA[Hello i know , i know i have a big absence about 2 month . but i,m back with a big update for you . a step by step article about exploiting format string vulnerabilities on windows platform. here is download link for this article : http://abysssec.com/blog/wp-content/uploads/2009/02/fstring-exploit.pdf feel free to send your questions to admin@abysssec.com&#124;NoSpam [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Hello</p>
<p style="text-align: left;">i know , i know i have a big absence about 2 month . but i,m back with a big update for you .</p>
<p style="text-align: left;">a step by step article about exploiting format string vulnerabilities on windows platform.</p>
<p><img class="alignnone" title="Format String" src="http://i44.tinypic.com/33w1ag8.jpg" alt="" width="560" height="320" /></p>
<p style="text-align: center;">
<p style="text-align: center;"><!--[if !mso]> <mce :style>< !  v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} --> <!--[endif]--><!--[if gte mso 9]><xml> <w :WordDocument> </w><w :View>Normal</w> <w :Zoom>0</w> <w :TrackMoves /> <w :TrackFormatting /> <w :PunctuationKerning /> <w :ValidateAgainstSchemas /> <w :SaveIfXMLInvalid>false</w> <w :IgnoreMixedContent>false</w> <w :AlwaysShowPlaceholderText>false</w> <w :DoNotPromoteQF /> <w :LidThemeOther>EN-US</w> <w :LidThemeAsian>X-NONE</w> <w :LidThemeComplexScript>AR-SA</w> <w :Compatibility> <w :BreakWrappedTables /> <w :SnapToGridInCell /> <w :WrapTextWithPunct /> <w :UseAsianBreakRules /> <w :DontGrowAutofit /> <w :SplitPgBreakAndParaMark /> <w :DontVertAlignCellWithSp /> <w :DontBreakConstrainedForcedTables /> <w :DontVertAlignInTxbx /> <w :Word11KerningPairs /> <w :CachedColBalance /> </w> <w :BrowserLevel>MicrosoftInternetExplorer4</w> <m :mathPr> <m :mathFont m:val="Cambria Math" /> <m :brkBin m:val="before" /> <m :brkBinSub m:val=" " /> <m :smallFrac m:val="off" /> <m :dispDef /> <m :lMargin m:val="0" /> <m :rMargin m:val="0" /> <m :defJc m:val="centerGroup" /> <m :wrapIndent m:val="1440" /> <m :intLim m:val="subSup" /> <m :naryLim m:val="undOvr" /> </m> </xml>< ![endif]--><!--[if gte mso 9]><xml> <w :LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267"> <w :LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w :LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w :LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /> <w :LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w :LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w :LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w :LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w :LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w :LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w :LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w :LsdException Locked="false" Priority="39" Name="toc 1" /> <w :LsdException Locked="false" Priority="39" Name="toc 2" /> <w :LsdException Locked="false" Priority="39" Name="toc 3" /> <w :LsdException Locked="false" Priority="39" Name="toc 4" /> <w :LsdException Locked="false" Priority="39" Name="toc 5" /> <w :LsdException Locked="false" Priority="39" Name="toc 6" /> <w :LsdException Locked="false" Priority="39" Name="toc 7" /> <w :LsdException Locked="false" Priority="39" Name="toc 8" /> <w :LsdException Locked="false" Priority="39" Name="toc 9" /> <w :LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w :LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w :LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w :LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w :LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w :LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w :LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid" /> <w :LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w :LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w :LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading" /> <w :LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List" /> <w :LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid" /> <w :LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1" /> <w :LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2" /> <w :LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1" /> <w :LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2" /> <w :LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1" /> <w :LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2" /> <w :LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3" /> <w :LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List" /> <w :LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading" /> <w :LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List" /> <w :LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid" /> <w :LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w :LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1" /> <w :LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w :LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w :LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w :LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w :LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w :LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w :LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w :LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w :LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w :LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w :LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w :LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w :LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w :LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w :LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w :LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w :LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w :LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2" /> <w :LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w :LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false"<br />
Name="Medium Shading 1 Accent 2" /> <w :LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /> <w :LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w :LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w :LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w :LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w :LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w :LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w :LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w :LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w :LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w :LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w :LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3" /> <w :LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w :LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w :LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w :LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w :LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w :LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w :LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w :LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w :LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w :LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w :LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w :LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w :LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w :LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4" /> <w :LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w :LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w :LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w :LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w :LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w :LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w :LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w :LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w :LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w :LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w :LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w :LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w :LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w :LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5" /> <w :LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w :LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w :LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w :LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w :LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w :LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w :LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w :LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w :LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w :LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w :LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w :LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w :LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w :LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6" /> <w :LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w :LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w :LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w :LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w :LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w :LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w :LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w :LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w :LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w :LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w :LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w :LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name=<br />
"Colorful Grid Accent 6" /> <w :LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w :LsdException Locked="false" Priority="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w :LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w :LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w :LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w :LsdException Locked="false" Priority="37" Name="Bibliography" /> <w :LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w> </xml>< ![endif]--><!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face 	{font-family:Tahoma; 	panose-1:2 11 6 4 3 5 4 4 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-520082689 -1073717157 41 0 66047 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-fareast-font-family:Calibri; 	mso-bidi-font-family:Arial;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt; 	mso-ascii-font-family:Calibri; 	mso-fareast-font-family:Calibri; 	mso-hansi-font-family:Calibri; 	mso-bidi-font-family:Arial;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]> </mce><mce :style>< !   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:Arial; 	mso-bidi-theme-font:minor-bidi;} --> <!--[endif]--><span style="font-size: 14pt; line-height: 115%; font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"><!--[if gte vml 1]><v :shapetype  id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t"  path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v :stroke joinstyle="miter" /> </v><v :formulas> <v :f eqn="if lineDrawn pixelLineWidth 0" /> <v :f eqn="sum @0 1 0" /> <v :f eqn="sum 0 0 @1" /> <v :f eqn="prod @2 1 2" /> <v :f eqn="prod @3 21600 pixelWidth" /> <v :f eqn="prod @3 21600 pixelHeight" /> <v :f eqn="sum @0 0 1" /> <v :f eqn="prod @6 1 2" /> <v :f eqn="prod @7 21600 pixelWidth" /> <v :f eqn="sum @8 21600 0" /> <v :f eqn="prod @7 21600 pixelHeight" /> <v :f eqn="sum @10 21600 0" /> </v> <v :path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect" /> <o :lock v:ext="edit" aspectratio="t" /> <v :shape id="_x0000_i1025" type="#_x0000_t75" style='width:6in;  height:298.5pt'> <v :imagedata src="file:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png" mce_src="file:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png"   o:title="" /> </v>< ![endif]--><!--[if !vml]--></span></p>
<p style="text-align: left;">here is download link for this article :</p>
<p style="text-align: left;"><a title="Download Here" href="http://abysssec.com/blog/wp-content/uploads/2009/02/fstring-exploit.pdf" target="_blank">http://abysssec.com/blog/wp-content/uploads/2009/02/fstring-exploit.pdf</a></p>
<p style="text-align: left;">feel free to send your questions to admin@abysssec.com|NoSpam</p>
<p style="text-align: left;">Good Luck and Have Fun !</p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: center;"><span style="font-size: 14pt; line-height: 115%; font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.abysssec.com/blog/2009/02/format-string-exploitation-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SerialME !!</title>
		<link>http://www.abysssec.com/blog/2008/11/serialme/</link>
		<comments>http://www.abysssec.com/blog/2008/11/serialme/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 10:19:54 +0000</pubDate>
		<dc:creator>MrXX</dc:creator>
				<category><![CDATA[reversing]]></category>

		<guid isPermaLink="false">http://abysssec.com/blog/?p=143</guid>
		<description><![CDATA[hello to all our readers In the past time of cracking many of the programs include the serial routine in the main EXE and u with the name of the cracker, able to find the routine and the valid serial in the main PE But some of the big and pros team include the serial [...]]]></description>
			<content:encoded><![CDATA[<p>hello to all our readers</p>
<p>In the past time of cracking many of the programs include the serial routine in the main EXE and u with the name of the cracker, able to find the routine and the valid serial in the main PE</p>
<p>But some of the big and pros team include the serial routine in the dll beside the main exe<br />
And u with the name of cracker can fish and find the serial’s in the dlls of the products</p>
<p>In this new generation of software development this point change to the habit and many product use the dlls to check the serial ( online check or etc .., )  or make the serial ( serial Function … )</p>
<p>The nice friend from SND makes the little serial ME to guide the crackers how to fishing the serial from dlls and here the MrXX will teach the noob crackers</p>
<p><a href="http://rapidshare.com/files/168166567/SerialME.rar.html" target="_blank">Get the serialME</a></p>
<p>Ok execute the exe and enter this information<br />
NAME: MrXX<br />
Serial: 123<br />
“Invalid information, Please try again” what the &#8212;&#8212;&#8212;&#8212;&#8211; :(</p>
<p>Ok fire up the olly and load the target, run the target [F9] and in the main olly open the View &gt; Executable modules and take look at the executed m<br />
You will see the Prog.dll is in the use ok DClick to load the dll in olly</p>
<p style="TEXT-ALIGN: center"><a href="http://i34.tinypic.com/2wgru6o.jpg"><img class="aligncenter" title="ExecutedM" src="http://i34.tinypic.com/2wgru6o.jpg" alt="" width="315" height="181" /></a></p>
<p>Oki daki the dll loaded into olly, in the CPU view right click under the Search for &gt; All intermodular Calls<br />
Scroll done, remember when u wrote the wrong serial the PE popup the Message box ok</p>
<p style="TEXT-ALIGN: center"><a href="http://i34.tinypic.com/2v33p15.jpg"><img class="aligncenter" title="IMCalls" src="http://i34.tinypic.com/2v33p15.jpg" alt="" width="587" height="138" /></a></p>
<p>DClick on the MessageBoxA and u going to the refer of message box<br />
Do nothing</p>
<p style="TEXT-ALIGN: center"><a href="http://i34.tinypic.com/f41iiq.jpg"><img class="aligncenter" title="Ninter" src="http://i34.tinypic.com/f41iiq.jpg" alt="" width="468" height="332" /></a></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="font-size: small; font-family: Times New Roman;">There is nothing interesting, not good??</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt">Make olly minimize and u able to see the serialME, input the wrong name and serial again , the message box popup again click on the ok and back to olly</p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt">
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt">O some line was append, I think those are interesting :) , u can see the wrong serial 123 and right serial beside each other</p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt">
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt">
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: center"><a href="http://i33.tinypic.com/28ujj9h.jpg"><img class="aligncenter" title="Inter" src="http://i33.tinypic.com/28ujj9h.jpg" alt="" width="512" height="228" /></a></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;">right click on the serial in olly under copy &gt; to clipboard and paste the code into serialME</span></p>
<p><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;">and see the right message</span></p>
<p style="text-align: center;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;"><a href="http://i35.tinypic.com/2csjvbo.jpg"><img class="aligncenter" title="RM" src="http://i35.tinypic.com/2csjvbo.jpg" alt="" width="359" height="177" /></a></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;">that’s it , u fish the serial </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;"><a href="http://rapidshare.com/files/168173055/SerialME__Source_.rar.html" target="_blank">see the source of serialME</a></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<p class="MsoNormal" style="margin: 0in 0in 0pt;">and the author write his own keygen</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><a href="http://rapidshare.com/files/168173419/SerialME__keygen_.rar.html" target="_blank">see the source of keygen</a></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<p class="MsoNormal" style="margin: 0in 0in 0pt;">u need the RadASM to use the source</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">lets going to the next step</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">I really enjoy to make the PE work with my serial</p>
<p style="text-align: center;"><a href="http://i36.tinypic.com/5nirkk.jpg"><img class="aligncenter" title="Patched" src="http://i36.tinypic.com/5nirkk.jpg" alt="" width="337" height="183" /></a></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;">In the world of cracking we call this byte patching </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;">Ok lets patch the EXE </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;">Load the dll again into olly like as I say in up</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;">Going to the message lines</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;">And look carefully you will see 1 old friend into the strange PE </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;">That’s right </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 1;"> </span>JNZ</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: center;"><img class="aligncenter" title="Byte" src="http://i37.tinypic.com/f3yvy8.jpg" alt="" width="411" height="168" /></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;">very easy , change the JNZ to JE and u able to register the PE with any serial that u like</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;">I hope u will enjoy it , wait for more</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;">And excuse us for our limit time </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small; font-family: Times New Roman;">MrXX</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.abysssec.com/blog/2008/11/serialme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Patch Analysis (binary diffing)</title>
		<link>http://www.abysssec.com/blog/2008/11/microsoft-patch-analysis-binary-diffing/</link>
		<comments>http://www.abysssec.com/blog/2008/11/microsoft-patch-analysis-binary-diffing/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 12:36:26 +0000</pubDate>
		<dc:creator>shahin</dc:creator>
				<category><![CDATA[reversing]]></category>
		<category><![CDATA[binary]]></category>
		<category><![CDATA[Bindiff]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[exploiting]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[MS]]></category>
		<category><![CDATA[Patchdiff]]></category>
		<category><![CDATA[path analysis]]></category>

		<guid isPermaLink="false">http://abysssec.com/blog/?p=113</guid>
		<description><![CDATA[hello again to all our patient readers it&#8217;s been a long time since we wrote our last post&#8217;s ?! first of all i should say sorry for late in blog updates but the first reason is  we are really busy in these days with accomplish our projects . the second reason was changing our server [...]]]></description>
			<content:encoded><![CDATA[<p>hello again to all our patient readers</p>
<p>it&#8217;s been a long time since we wrote our last post&#8217;s ?! first of all i should say sorry for late in blog updates but the first reason is  we are really busy in these days with accomplish our projects . the second reason was changing our server . and finally the third reason is starting <a title="http://abysssec.com" href="http://abysssec.com"><strong>abysssec inc</strong></a> with a professional team for accomplish new projects and services . in soon future we have lots of good news may that&#8217;s interest you . so please be patient to see our news on our new index (that come soon as soon possible)</p>
<p>===================================================================</p>
<p>today i wanna talk about Microsoft security patch&#8217;s analysis  . as you know this year and specially last month&#8217;s of this year was a nightmare for M$ windows because we saw MS08-067 &#8211; MS08-068 &#8211; MS08-006 and MS08-001 and etc . and as you know too publishing real and working exploits is going to die and just you can see commercial exploits on time .</p>
<p>i saw this picture in one of Mr Nicolas Waisman  presentation and i believe to mind of this picture :</p>
<p style="text-align: center;"><img class="aligncenter" title="commercial vs public" src="http://i37.tinypic.com/rbwhw7.jpg" alt="" width="529" height="383" /></p>
<p style="text-align: left;">my goal from this introduction is if you want an exploit on publishing time you just have two chose :</p>
<p style="text-align: left;">1- write your own exploit</p>
<p style="text-align: left;">2- buy commercial exploit for your requirement vulnerability</p>
<p style="text-align: left;">- if you are a super millionaire you can buy all commercial exploits from variant security research teams and we are one of them ;)</p>
<p style="text-align: left;">- and if you are not you and you like and you need an exploit on time you should write your own exploit . and writing exploit for modern operation system&#8217;s is not easy because you need bypass a dozen of memory protections (such as DEP / ASLR / SAFSEH / Safe unlinking   and etc &#8230;  (from OS to commercial target software) also i believe this Mr Dave Aitel sentence : Not only are bugs expensive but the techniques for reliably exploiting bugs becomes expensive .</p>
<p style="text-align: left;">anyway becoming a real exploit coder is not easy but it&#8217;s possible and i should quote and notice another sentence that is : <span id="post-1010" class="single-title">Modern Exploits &#8211; Do You Still Need To Learn Assembly Language (ASM) ( you can read full post here : (http://www.darknet.org.uk/2008/09/modern-exploits-do-you-still-need-to-learn-assembly-language-asm/)</span></p>
<p style="text-align: left;">i,m fully sure learning assembly language will help you in all of exploit development levels from reversing and understanding vulnerability to writing reliable exploit code for modern operation system&#8217;s .</p>
<p style="text-align: left;">after you can understand assembly code you can supposition high level code and thereupon you can identify vulnerability from discrepancy between patched and unpatched binaries (however advanced tools and IDA plugin&#8217;s make your life easier and you can identify vulnerable code / function if a few minutes)  this technic is called binary diffing. in future i,ll discuss a few advanced trick and methods , that&#8217;s improve your speed and analysis but for now i just talk about main of binary diffing on Microsoft security patch&#8217;s .</p>
<p style="text-align: left;">first step is downloading patch from Microsoft . the best way is searching on Microsoft site for your target bulletin . for example see MS08-067 (my favorite bug in this year :D )</p>
<p style="text-align: left;">just you need click on your target os and download the path.</p>
<p style="text-align: left;">
<p style="text-align: left;">after you downloaded the patch as you know you should not install the patch and you need extract patch data</p>
<p style="text-align: left;">with /x command .for example extracting ms08-067 patch :</p>
<p style="text-align: center;"><img class="aligncenter" title="Extract Patch" src="http://i33.tinypic.com/rqwzgj.jpg" alt="" width="398" height="203" /></p>
<p style="text-align: left;">the output of executing atop command is extract all date inside the patch . and in this example result is :</p>
<p style="text-align: center;"><img class="aligncenter" title="Extracted" src="http://i35.tinypic.com/2ryrryc.jpg" alt="" width="478" height="367" /></p>
<p style="text-align: center;">
<p style="text-align: left;">as you can see in this patch we have just one file and that is a dll named netapi32.dll so we can understand vulnerable function is in this dll .</p>
<p style="text-align: left;">next step is find vulnerable (unpatched) file (or files) on your system and then you can rename patched file to filename_patched.XXX and then you can analysis and notice changes in patched and unpatched files.</p>
<p style="text-align: left;">for accomplish this procedure you can use different tools and ways . but using IDA Pro is one of best and logical ways you can use for this procedure . you can understand changes without any plugins and auxiliary tools but for imporving speed and getting better result you have tree choice .</p>
<p style="text-align: left;">1- using bindiff (exclusive commercial IDA plugin and best auxiliary too analysis</p>
<p style="text-align: left;">for example you can see patch analysis video for MS08-001 (TCP/IP Kernel Pool Overflow)  here :</p>
<p style="text-align: left;"><a title="http://www.zynamics.com/files/ms08001.swf" href="http://www.zynamics.com/files/ms08001.swf">http://www.zynamics.com/files/ms08001.swf</a></p>
<p style="text-align: left;">2- using Eeye DiffingSuite  i like this tools because it&#8217;s really easy to use and effective .</p>
<p style="text-align: left;">you can download this tools from following link :</p>
<p style="text-align: left;"><a title="http://research.eeye.com/html/Tools/download/DiffingSuiteSetup.exe" href="http://research.eeye.com/html/Tools/download/DiffingSuiteSetup.exe">http://research.eeye.com/html/Tools/download/DiffingSuiteSetup.exe</a></p>
<p style="text-align: left;">and also you see tree good video about analysis different patched with this tools</p>
<p style="text-align: left;">- analysing MS06-033 : <a title="http://research.eeye.com/html/tools/tutorials/BDS_v_MS06-033.htm" href="http://research.eeye.com/html/tools/tutorials/BDS_v_MS06-033.htm">http://research.eeye.com/html/tools/tutorials/BDS_v_MS06-033.htm</a></p>
<p style="text-align: left;">- analysing MS06-007 : <a title="http://research.eeye.com/html/tools/tutorials/MS06-007.htm" href="http://research.eeye.com/html/tools/tutorials/MS06-007.htm">http://research.eeye.com/html/tools/tutorials/MS06-007.htm</a></p>
<p style="text-align: left;">- analysing MS06-036 : <a title="http://research.eeye.com/html/tools/tutorials/MS06-036%20Analysis.htm" href="http://research.eeye.com/html/tools/tutorials/MS06-036%20Analysis.htm">http://research.eeye.com/html/tools/tutorials/MS06-036%20Analysis.htm</a></p>
<p style="text-align: left;">after videos please read following link (a good work from Mr <a href="http://milw0rm.com/author/1665">stephen lawler</a>) about full reverse of MS08-067 patch using DiffingSuite and IDA pro cheerfully because it contain divisor of work :</p>
<p style="text-align: left;"><a title="http://www.dontstuffbeansupyournose.com/?p=35" href="http://www.dontstuffbeansupyournose.com/?p=35">http://www.dontstuffbeansupyournose.com/?p=35</a></p>
<p style="text-align: left;">3- using tenable security PatchDiff . PatchDiff is another IDA Pro Plugin (like bindiff) but have a big difference with Bindiff this plugin is free !</p>
<p style="text-align: left;">you can see a video about this plugin here :</p>
<p style="text-align: left;"><a title="http://cgi.tenablesecurity.com/tenable/pdiff2.swf.html" href="http://cgi.tenablesecurity.com/tenable/pdiff2.swf.html">http://cgi.tenablesecurity.com/tenable/pdiff2.swf.html</a></p>
<p style="text-align: left;">and you can download this plugin from following link :</p>
<p style="text-align: left;"><a title="http://cgi.tenablesecurity.com/tenable/dl.php?p=patchdiff2-2.0.5.zip" href="http://cgi.tenablesecurity.com/tenable/dl.php?p=patchdiff2-2.0.5.zip">http://cgi.tenablesecurity.com/tenable/dl.php?p=patchdiff2-2.0.5.zip</a></p>
<p style="text-align: left;">using this plugin is so easy but i discuss a few about this plugin  . frist of all you need patched and unpatched binaries after this you just first need open unpatched binary IDA and save disassembly in idb file after that you should open patched binary and save disassembly result to another idb file :</p>
<p style="text-align: left;"><img class="aligncenter" title="IDB" src="http://i34.tinypic.com/1ewbqe.jpg" alt="" width="572" height="394" /></p>
<p style="text-align: left;">since  this you just need open unpatched IDB using plugin to understating discrepancy . after this step as Mr Nicolas Pouvesle (pathdiff plugin author) discussed graph nodes can be synchronized by double clicking on a given node. Graphs use the following colors:</p>
<ul>
<li>white: identical nodes</li>
<li>grey: unmatched nodes</li>
<li>red: matched nodes</li>
<li>tan: identical nodes (different crc)</li>
</ul>
<p style="text-align: left;">for example you see patchdiff result for MS08-067 patch :</p>
<p style="text-align: center;"><img class="aligncenter" title="patchdiff" src="http://i36.tinypic.com/apbivp.jpg" alt="" width="600" height="600" /></p>
<p style="text-align: left;">and :</p>
<p style="text-align: center;"><img class="aligncenter" title="ms08-067" src="http://i36.tinypic.com/2qj95pl.jpg" alt="" width="600" height="600" /></p>
<p style="text-align: left;">
<p>if you be smart you can write a high level simulator code for vulnerable function . for example Mr Alexander Sotirov wrote a simulator of vulnerable function :</p>
<blockquote><p><code><br />
#include </code></p>
<p>// This is the decompiled function sub_5B86A51B in netapi32.dll on XP SP3<br />
// and sub_6EA11D4D on Vista SP1</p>
<p>int ms08_067(wchar_t* path)<br />
{<br />
wchar_t* p;<br />
wchar_t* q;<br />
wchar_t* previous_slash = NULL;<br />
wchar_t* current_slash  = NULL;<br />
wchar_t  ch;</p>
<p>#ifdef VISTA<br />
int len = wcslen(path);<br />
wchar_t* end_of_path = path + len;<br />
#endif</p>
<p>// If the path starts with a server name, skip it</p>
<p>if ((path[0] == L&#8217;\\&#8217; || path[0] == L&#8217;/') &amp;&amp;<br />
(path[1] == L&#8217;\\&#8217; || path[1] == L&#8217;/'))<br />
{<br />
p = path+2;</p>
<p>while (*p != L&#8217;\\&#8217; &amp;&amp; *p != L&#8217;/') {<br />
if (*p == L&#8217;\0&#8242;)<br />
return 0;<br />
p++;<br />
}</p>
<p>p++;</p>
<p>// make path point after the server name</p>
<p>path = p;</p>
<p>// make sure the server name is followed by a single slash</p>
<p>if (path[0] == L&#8217;\\&#8217; || path[0] == L&#8217;/')<br />
return 0;<br />
}</p>
<p>if (path[0] == L&#8217;\0&#8242;)   // return if the path is empty<br />
return 1;</p>
<p>// Iterate through the path and canonicalize ..\ and .\</p>
<p>p = path;</p>
<p>while (1) {<br />
if (*p == L&#8217;\\&#8217;) {<br />
// we have a slash</p>
<p>if (current_slash == p-1)   // don&#8217;t allow consequtive slashes<br />
return 0;</p>
<p>// store the locations of the current and previous slashes</p>
<p>previous_slash = current_slash;<br />
current_slash = p;<br />
}<br />
else if (*p == L&#8217;.&#8217; &amp;&amp; (current_slash == p-1 || p == path)) {<br />
// we have \. or ^.</p>
<p>if (p[1] == L&#8217;.&#8217; &amp;&amp; (p[2] == L&#8217;\\&#8217; || p[2] == L&#8217;\0&#8242;)) {<br />
// we have a \..\, \..$, ^..\ or ^..$ sequence</p>
<p>if (previous_slash == NULL)<br />
return 0;</p>
<p>// example: aaa\bbb\..\ccc<br />
//             ^   ^  ^<br />
//             |   |  &amp;p[2]<br />
//             |   |<br />
//             |   current_slash<br />
//             |<br />
//             previous_slash</p>
<p>ch = p[2];</p>
<p>#ifdef VISTA<br />
if (previous_slash &gt;= end_of_path)<br />
return 0;</p>
<p>wcscpy_s(previous_slash, (end_of_path-previous_slash)/2, p+2);<br />
#else // XP<br />
wcscpy(previous_slash, &amp;p[2]);<br />
#endif</p>
<p>if (ch == L&#8217;\0&#8242;)<br />
return 1;</p>
<p>current_slash = previous_slash;<br />
p = previous_slash;</p>
<p>// find the slash before p</p>
<p>// BUG: if previous_slash points to the beginning of the<br />
// string, we&#8217;ll go beyond the start of the buffer<br />
//<br />
// example string: \a\..\</p>
<p>q = p-1;</p>
<p>while (*q != L&#8217;\\&#8217; &amp;&amp; q != path)<br />
q&#8211;;</p>
<p>if (*p == L&#8217;\\&#8217;)<br />
previous_slash = q;<br />
else<br />
previous_slash = NULL;<br />
}<br />
else if (p[1] == L&#8217;\\&#8217;) {<br />
// we have \.\ or ^.\</p>
<p>#ifdef VISTA<br />
if (current_slash != NULL) {<br />
if (current_slash &gt;= end_of_path)<br />
return 0;<br />
wcscpy_s(current_slash, (end_of_path-current_slash)/2, p+2);<br />
goto end_of_loop;<br />
}<br />
else {  // current_slash == NULL<br />
if (p &gt;= end_of_path)<br />
return 0;<br />
wcscpy_s(p, (end_of_path-p)/2, p+2);<br />
goto end_of_loop;<br />
}<br />
#else // XP<br />
if (current_slash != NULL) {<br />
wcscpy(current_slash, p+2);<br />
goto end_of_loop;<br />
}<br />
else { // current_slash == NULL<br />
wcscpy(p, p+2);<br />
goto end_of_loop;<br />
}<br />
#endif<br />
}<br />
else if (p[1] != L&#8217;\0&#8242;) {<br />
// we have \. or ^. followed by some other char</p>
<p>if (current_slash != NULL) {<br />
p = current_slash;<br />
}<br />
*p = L&#8217;\0&#8242;;<br />
return 1;<br />
}<br />
}</p>
<p>p++;</p>
<p>end_of_loop:<br />
if (*p == L&#8217;\0&#8242;)<br />
return 1;<br />
}<br />
}</p>
<p>// Run this program to simulate the MS08-067 vulnerability</p>
<p>int main()<br />
{<br />
return ms08_067(L&#8221;\\c\\..\\..\\AAAAAAAAAAAAAAAAAAAAAAAAAAAAA&#8221;);<br />
}</p></blockquote>
<p style="text-align: left;">final steps are identify vulnerable function / understaning function parameters and write a POC code for controlling EIP .</p>
<p style="text-align: left;"><img class="aligncenter" title="Path" src="http://www.dontstuffbeansupyournose.com/wp-content/uploads/2008/10/image020.jpg" alt="" width="575" height="318" /></p>
<p style="text-align: left;">for example Mr <a href="http://milw0rm.com/author/1665">stephen lawler</a> wrote a c program for checking MS08-067 vulnerability by taking the offset between sub_7CDDB23D and the load address of NETAPI32.DLL :</p>
<blockquote><p><code><br />
#include </code></p>
<p>#include</p>
<p>int wmain(int argc, wchar_t **argv)</p>
<p>{</p>
<p>HMODULE netapi32 = LoadLibraryW(argv[1]);</p>
<p>void (__stdcall *foo)(PWCHAR);</p>
<p>WCHAR buf[4096];</p>
<p>*(PVOID*)&amp;foo = (PVOID)(((PUCHAR)netapi32) + 0×1b23d);</p>
<p>//__asm { int 3 }</p>
<p>wcscpy(buf, argv[2]);</p>
<p>foo(buf);</p>
<p>wprintf(L”%s\n”, buf);</p>
<p>}</p></blockquote>
<p style="text-align: left;">and finnaly he got a crash :</p>
<p style="text-align: left;">
<p style="text-align: left;"><img class="aligncenter" title="crash" src="http://www.dontstuffbeansupyournose.com/wp-content/uploads/2008/10/image016.jpg" alt="" width="576" height="337" /></p>
<p style="text-align: left;">after getting first crash you just need getting eip and write exploit for vulnerability .</p>
<p style="text-align: left;">finally i should say sorry for disheveled writing . the reason of this is size of this subject in next post i talk directly about patch analysis tricks and i,ll anlysis another interesting Microsoft Patch step by step .</p>
<p style="text-align: left;">thank you for your time and attention</p>
<p style="text-align: left;">best regards</p>
<p style="text-align: left;">shahin.r</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abysssec.com/blog/2008/11/microsoft-patch-analysis-binary-diffing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unpacking General Lame Packers</title>
		<link>http://www.abysssec.com/blog/2008/11/unpacking-general-lame-packers/</link>
		<comments>http://www.abysssec.com/blog/2008/11/unpacking-general-lame-packers/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 16:21:15 +0000</pubDate>
		<dc:creator>shahin</dc:creator>
				<category><![CDATA[reversing]]></category>

		<guid isPermaLink="false">http://secure-developer.com/blog/?p=98</guid>
		<description><![CDATA[Here we go , another tutorial about unpacking general lame packers hope you enjoy if you are interest you can download full tutorial from following link : http://rapidshare.com/files/162093080/New.rar.html good luck and have fun]]></description>
			<content:encoded><![CDATA[<p>Here we go , another tutorial about unpacking general lame packers</p>
<p>hope you enjoy</p>
<p>if you are interest you can download full tutorial from following link :</p>
<p>http://rapidshare.com/files/162093080/New.rar.html</p>
<p><img class="aligncenter" title="unpacking" src="http://honeynor.no/~mkrakvik/movies/msnbot/msnbot.png" alt="" width="320" height="240" /></p>
<p>good luck and have fun</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abysssec.com/blog/2008/11/unpacking-general-lame-packers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Iranian National Code Algorithm</title>
		<link>http://www.abysssec.com/blog/2008/10/iranian-national-code-algorithm/</link>
		<comments>http://www.abysssec.com/blog/2008/10/iranian-national-code-algorithm/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 21:23:32 +0000</pubDate>
		<dc:creator>shahin</dc:creator>
				<category><![CDATA[reversing]]></category>

		<guid isPermaLink="false">http://secure-developer.com/blog/?p=72</guid>
		<description><![CDATA[hello again . i think this post must be interesting for iranian peoples . this theme is completely ripped from my  friend soroush dalili weblog finally don&#8217;t forgot this post and algorithm was published for educational purposes only so author is not held responsible , used for any other purposes than the one stated above. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">hello again .</p>
<p style="text-align: left;">i think this post must be interesting for iranian peoples . this theme is completely ripped from my  friend soroush dalili weblog finally don&#8217;t forgot this post and algorithm was published for educational purposes only so author is not held responsible , used for any other purposes than the one stated above.</p>
<p style="text-align: left;">
<div class="wp-caption alignnone" style="width: 324px"><img src="http://www.iranpaparazzi.net/images/05-06-04-12-7-IMG_0077.jpg" alt="Melli card &amp; code" width="314" height="187" /><p class="wp-caption-text">Melli card &amp; code</p></div>
<p>Each person in Iran has a national code which is called “Code Melli”. And, its algorithm is very similar to ISBN algorithm:</p>
<p>The rules are:</p>
<p>1-  This number has 10 digits like: C[1] C[2] C[3] C[4] C[5] C[6] C[7] C[8] C[9] C[10]</p>
<p>2-  3 digits of left must not be equal to 000 (c[1]c[2]c[3]000)</p>
<p>3-  C[10] is a control digit (like ISBN algorithm)</p>
<p>The formula to determine C[10] is:</p>
<p>Let A = (C[1]*10)+ (C[2]*9)+ (C[3]*8)+ (C[4]*7)+ (C[5]*6)+ (C[6]*5)+ (C[7]*4)+ (C[8]*3)+ (C[9]*2)</p>
<p>Let B = A MOD 11</p>
<p>If B == 0 Then C[10]=B Else C[10] = 11-B</p>
<p><strong>This JavaScript function is useful to validation:</strong></p>
<blockquote><p>//&#8212;&#8212;&#8212;&#8212;&#8212;Start of Iranian national code checker function&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>True-False</p>
<p>//Written by Soroush Dalili &#8211; October 2008</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>function IsIRNationalCode(theNum)</p>
<p>{</p>
<p>if(theNum.length!=10)</p>
<p>{</p>
<p>return false;</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p>if(theNum.substr(0,3)==&#8217;000&#8242;) return false;</p>
<p>var check = 0;</p>
<p>for(var i=0;i</p>
<p>{</p>
<p>var num = theNum.substr(i,1);</p>
<p>check += num*(10-i)</p>
<p>}</p>
<p>if(check%11)</p>
<p>{</p>
<p>return false;</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p>return true;</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;End of Iranian national code checker function&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>True-False</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p></blockquote>
<p>good luck and have fun</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abysssec.com/blog/2008/10/iranian-national-code-algorithm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ELF Reversing , Beginner</title>
		<link>http://www.abysssec.com/blog/2008/10/elf-reversing-beginner/</link>
		<comments>http://www.abysssec.com/blog/2008/10/elf-reversing-beginner/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 21:01:30 +0000</pubDate>
		<dc:creator>MrXX</dc:creator>
				<category><![CDATA[reversing]]></category>

		<guid isPermaLink="false">http://secure-developer.com/blog/?p=44</guid>
		<description><![CDATA[HeY Again it’s me , MrXX Like what I was to say in this post I going to talk about sample ELF Reversing I don’t know how many people talk about this later but this tut was some of the strange &#38; maybe new to learn ( I was see many of cracking team just [...]]]></description>
			<content:encoded><![CDATA[<div class="mceTemp mceIEcenter" style="text-align: left;">HeY</div>
<p>Again it’s me , MrXX<br />
Like what I was to say in this post I going to talk about sample ELF Reversing</p>
<p>I don’t know how many people talk about this later but this tut was some of the strange &amp; maybe new to learn ( I was see many of cracking team just working on the windows , because Linux is free , he but all the OS need some time’s to do some cracking )</p>
<p>All the words you will read is going from author : MrXX ( like pervious post )<br />
Ok let’s started</p>
<p>First think we need some tools<br />
We use these tools for making are way easier<br />
1-Some Program for Crack<br />
2-the GUI Debugger<br />
3-Hex Editor<br />
4-some knowledge about the ASM , Cracking</p>
<p>Ok the first think : Some PJ for Crack</p>
<p><a href="http://rapidshare.com/files/154833412/CrackME.c.html" target="_blank">Source Code</a></p>
<p><a href="http://rapidshare.com/files/154833372/CrackMe.html" target="_blank">Complied Project </a></p>
<p><a href="http://rapidshare.com/files/154833457/CrackMeC.html" target="_blank">Cracked Pj</a></p>
<p>I was write sample Crack Me for this part<br />
The crack me is open source : he he</p>
<p><strong>#include&lt;stdio.h&gt;</strong></p>
<p><strong>int<br />
main(){<br />
int password=123456;<br />
int inputpass;</p>
<p>printf(&#8220;Please Enter a Password to continue &gt; &#8220;);<br />
scanf(&#8221; %d&#8221;,&amp;inputpass);</strong></p>
<p><strong> if ( inputpass == password ){<br />
printf(&#8220;\nWelcome u will able to access the Tool\n&#8221;);<br />
printf(&#8220;\n======================================\n&#8221;);<br />
printf(&#8220;\nU able Reverse the linux elf file \n&#8221;);<br />
printf(&#8220;\nKeep Good job    \n&#8221;);<br />
printf(&#8220;\n======================================\n&#8221;);<br />
}<br />
else<br />
{<br />
printf(&#8220;\nBAD Password\n&#8221;);<br />
}</strong></p>
<p><strong> return(0);<br />
}</strong></p>
<p>You will available to see in the code , we got the IF statement that was check to value<br />
First the pass is = 123456 ok<br />
If pass = user input show the good message or if not show the bad message<br />
Ok I compile it before and executed and see the message<br />
<strong>Please Enter a Password to continue &gt; 123</strong><br />
I enter a wrong code and see the bad message</p>
<div class="wp-caption aligncenter" style="width: 381px"><a href="http://i38.tinypic.com/2u63ggn.jpg"><img title="Bad Mes" src="http://i38.tinypic.com/2u63ggn.jpg" alt="Bad Message" width="371" height="242" /></a><p class="wp-caption-text">Bad Message</p></div>
<p>Know how can I able to see the Good message<br />
Let’s start some reversing<br />
2 – I need the GUI debugger ( why ? because many time I use the windows debugger like olly or ida and know I addict to use the gui )<br />
Ok it isn’t problem ( but don’t be lazy like me , u must use the command line debugger like : many …. )<br />
I going and get the  Zero Debugger from address<br />
<a href="http://www.zero-bugs.com">http://www.zero-bugs.com</a><br />
( this is one of the Linux app need to be Cracked | and I release the path for this later )<br />
I startup my Ubuntu Linux ( because I use the Ubuntu version of zero debugger )<br />
And after I install Zero Debugger ( need some pack to be installed ) and run the debugger<br />
From zero debugger I go under File &gt; Execute menu and  open my ELF file and I see the disassemble face of the ELF</p>
<div class="wp-caption aligncenter" style="width: 260px"><a href="http://i34.tinypic.com/2cej41g.jpg"><img title="ZeroDB" src="http://i34.tinypic.com/2cej41g.jpg" alt="ZeroDebugger" width="250" height="182" /></a><p class="wp-caption-text">ZeroDebugger</p></div>
<p>I scroll done some line and see the CMP ( Compare ) and in the line under I see the JNZ statement , yeah look good ( 4-this is the way u need some knowledge about the ASM , Cracking )<br />
I wrote done the line , 08048406 75 52   jnz 0x804845a<br />
This is cool for the first Crack me , we don’t need to get to the line and see what’s inside , because the crack me is sample</p>
<p>3- know I need to edit the line and change the 75 52 hex to 74 52<br />
Ok I start the hexedit program</p>
<div class="wp-caption aligncenter" style="width: 365px"><a href="http://i37.tinypic.com/126fe3q.jpg"><img title="hexed" src="http://i37.tinypic.com/126fe3q.jpg" alt="HexEditing" width="355" height="236" /></a><p class="wp-caption-text">HexEditing</p></div>
<p>And go to the 00000400 line , find the 406 hex code ( remember the 08048406 ) and change the 75 to 74<br />
I save the file into crackme cracked and executed again<br />
I enter a wrong code again and see , yeah the good message</p>
<div class="wp-caption aligncenter" style="width: 333px"><a href="http://i37.tinypic.com/2w3njw6.jpg"><img title="GoodMsg" src="http://i37.tinypic.com/2w3njw6.jpg" alt="Good Message" width="323" height="208" /></a><p class="wp-caption-text">Good Message</p></div>
<p>We able to Reverse the ELF file<br />
This is it , all routine was sample<br />
But don’t be happy , because when the code getting bigger you will got the bad problem ( why ? because there is no olly or ida or sample code to reverse )<br />
And u must do with command line and many line of code</p>
<p>In the next step we going to crack be bigger crack me : called CrackMe2 using Function<br />
Good luck</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abysssec.com/blog/2008/10/elf-reversing-beginner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>undetect malwares , virues from anti-virues</title>
		<link>http://www.abysssec.com/blog/2008/10/undetect-malwares-virues-from-anti-virues/</link>
		<comments>http://www.abysssec.com/blog/2008/10/undetect-malwares-virues-from-anti-virues/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 15:41:18 +0000</pubDate>
		<dc:creator>MrXX</dc:creator>
				<category><![CDATA[reversing]]></category>

		<guid isPermaLink="false">http://secure-developer.com/blog/?p=7</guid>
		<description><![CDATA[In the name of god Hi, I’m MrXX and in this blog I want to talk about the some coding, reversing and more… And please don’t post the some shit comment in the index, because we going to delete it And please don’t spam us with Noob question, cause they don’t answer the Noob And [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">In the name of god<br />
Hi, I’m MrXX and in this blog I want to talk about the some coding, reversing and more…</p>
<p>And please don’t post the some shit comment in the index, because we going to delete it<br />
And please don’t spam us with Noob question, cause they don’t answer the Noob<br />
And the last think sorry about the English, cause I can’t even talk in English (I just can read) by the way</p>
<p>In the first, I want to talk about some reversing (I tired and seek and my mind wasn’t work correctly)<br />
This is not my tut by I search over the web 2 or 3 day to find the best way &amp; I think this is best way (original tut by : Kenny)</p>
<p style="text-align: center;"><strong>To undetected the malware from antivirus</strong></p>
<p style="text-align: left;"><strong></strong>First we need tools<br />
1-Hex editor: I use the HIEW (not the 32 bit ver)<br />
2-PE Tools: I use the PE Tools v1.5<br />
3-UPX<br />
4-Cracker call this BRAIN (I think I got it by I can’t give it to u, go find yours)  <img class="wp-smiley" src="../wp-includes/images/smilies/icon_smile.gif" alt=":)" /><br />
If u don’t know what is those tools and how u can use it: I tell u go f.u.c.k yourself and please don’t read this<br />
Ok , I read the magic world and dorooooororooooooo : oh my god magic happen :) , my f.u.c.k.ing malware undetected , ha ha ha ha I’m kidding there is no magic &amp; magic is just some shit , every think in this whole world have the logical reason (I don’t believe magic)<br />
Make malware (Trojan,rootkit,virus,…) undetected just have some little ways and if u like it I tell all the possible way to make our malware tools undetected ,but I tell it 1 by 1 , and if I see some , kididi mididi tnx in the comment I tell the next magic world<br />
Let’s pull the chair close to your PC and get started<br />
I wrote my own keylogger many year ago , but god DAMN antivirus known my own private keylogger as the probably unknown NewHeur_PE virus</p>
<p style="text-align: center;"><a href="http://i33.tinypic.com/eknbr7.jpg"><img class="aligncenter" title="NOD" src="http://i33.tinypic.com/eknbr7.jpg" alt="" width="173" height="132" /></a></p>
<p style="text-align: left;">And nod want to submit this to them Database <img class="wp-smiley" src="../wp-includes/images/smilies/icon_sad.gif" alt=":(" /></p>
<p style="text-align: left;">Oh my god how could this happen :) , don’t worry about that I tell u next time how u can bypass the stupid antivirus with some cryptography<br />
In this time I want to undetected the binary file (u can use this to make all the binary malware u don’t have them source)<br />
See the virustotal result: that’s nasty</p>
<p style="text-align: center;"><a href="http://i34.tinypic.com/2m3pbg5.jpg"><img class="aligncenter" title="VirusTotal" src="http://i34.tinypic.com/2m3pbg5.jpg" alt="" width="192" height="229" /></a></p>
<p style="text-align: left;">And u will see, some of antivirus detect the malware and some of them don’t detected because is this private<br />
Malware detected because of some of the line like:</p>
<p style="text-align: left;"><em>Dim ModuleName As String, FileName As String, hInst As Long<br />
ModuleName = String$(128, Chr$(0))<br />
hInst = GetWindowWord(Me.hwnd, GWW_HINSTANCE)<br />
ModuleName = Left$(ModuleName, GetModuleFileName(hInst, ModuleName, Len(ModuleName)))</em></p>
<p style="text-align: left;"><em>If CheckPath(SystemDir + “svchost.exe”) = False Then<br />
FileCopy ModuleName, SystemDir + “svchost.exe”<br />
ShellExecute Me.hwnd, “open”, SystemDir + “svchost.exe”, vbNullString, vbNullString, SW_HIDE<br />
End<br />
End If</em></p>
<p style="text-align: left;">Or<br />
Because the uses of those api</p>
<p style="text-align: left;"><em>Private Declare Function SetWindowsHookEx Lib “user32″ Alias “SetWindowsHookExA” (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long<br />
Private Declare Function UnhookWindowsHookEx Lib “user32″ (ByVal hHook As Long) As Long<br />
And…</em></p>
<p style="text-align: left;">Ok later we crypt those command and use the API very cleverly to bypass the Noob antivirus<br />
Oh we talk some much let’s back to the undetected part<br />
First we pack the file with UPX (do something else) and we open our packed file with the PE Tools</p>
<p style="text-align: center;"><a href="http://i38.tinypic.com/28qymv7.jpg"><img class="aligncenter" title="UPX" src="http://i38.tinypic.com/28qymv7.jpg" alt="" width="319" height="72" /></a></p>
<p style="text-align: left;">Open file and get some info about the entrypoint</p>
<p style="text-align: center;"><a href="http://i37.tinypic.com/2q8ao9x.jpg"><img class="aligncenter" title="PETool" src="http://i37.tinypic.com/2q8ao9x.jpg" alt="" width="204" height="135" /></a></p>
<p style="text-align: center;">Entry Point: 0000AD20<br />
Image Base: 00400000</p>
<p style="text-align: left;">Now we open the packed file with HIEW in the disassemble mode we going to entry point<br />
U will see some entry like this</p>
<p style="text-align: center;"><a href="http://i33.tinypic.com/11rpyc9.jpg"><img class="aligncenter" title="EP" src="http://i33.tinypic.com/11rpyc9.jpg" alt="" width="359" height="210" /></a></p>
<p style="text-align: left;">This is the entry that was UPX make<br />
When we scroll done some line we will see zero space, we use this for hexing our tool<br />
Place those codes into the zero space<br />
Use the edit F3/F2 command</p>
<p style="text-align: left;"><em>push        00040AD20   &lt;— push OEP<br />
push        eax<br />
pushfd                   &lt;—for tricking AVP<br />
pushad                    &lt;—for tricking AVP<br />
call       .000025154  &lt;—– call for Ret 28h<br />
retn 00028</em></p>
<p style="text-align: left;">The address depend on your system and those are not the static</p>
<p style="text-align: left;">After that , save the progress<br />
And again add 2 line</p>
<p style="text-align: left;"><em>INC ECX  &lt;— Counter up<br />
Loop 000022D9</em></p>
<p style="text-align: left;">Save them again<br />
Ok our hexing finish , now we must go and change our entry point to the new entry<br />
We open the PE Tools again change the entry point to the new value</p>
<p style="text-align: center;">OEP = entry address &#8211; imagebase(400000)</p>
<p style="text-align: center;">New entry:0040AED9</p>
<p style="text-align: center;"><a href="http://i35.tinypic.com/20r6xdj.jpg"><img class="aligncenter" title="NewEP" src="http://i35.tinypic.com/20r6xdj.jpg" alt="" width="138" height="98" /></a></p>
<p>After that we unpack the file with UPX an it must be undetected from AV<br />
This method called: changing the entry point for undetected the malware<br />
That’s the nice way but we got the easy way to like Pack the file , hexing the Signature of the file and  …</p>
<p>In the next post I talk about ElF File&#8217;s And Reversing<br />
Good Luck<br />
MrXX</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abysssec.com/blog/2008/10/undetect-malwares-virues-from-anti-virues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bypass antivirus with string crypting</title>
		<link>http://www.abysssec.com/blog/2008/10/bypass-antivirus-with-string-crypting/</link>
		<comments>http://www.abysssec.com/blog/2008/10/bypass-antivirus-with-string-crypting/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 15:39:54 +0000</pubDate>
		<dc:creator>MrXX</dc:creator>
				<category><![CDATA[reversing]]></category>

		<guid isPermaLink="false">http://secure-developer.com/blog/?p=5</guid>
		<description><![CDATA[yeah , as i say in the last post in this tut you will learn to bypass some of the sutpid god DAMN antivirus with string Encrypt/Decrypt trick DL Link the next post will be : Undetect the malware from AV]]></description>
			<content:encoded><![CDATA[<p>yeah , as i say in the last post</p>
<p>in this tut you will learn to bypass some of the sutpid god DAMN antivirus with string Encrypt/Decrypt trick</p>
<p style="text-align: center;"><img class="aligncenter" title="crypt" src="http://i34.tinypic.com/25eyywj.jpg" alt="" width="400" height="400" /></p>
<p><a class="aligncenter" title="Post2" href="http://rapidshare.com/files/150495806/Post2.rar.html" target="_blank">DL Link</a></p>
<p>the next post will be : Undetect the malware from AV</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abysssec.com/blog/2008/10/bypass-antivirus-with-string-crypting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
