<?xml version="1.0"?>
<rss version="2.0">
    <channel>
        <title>OpenRCE: Blog</title>
        <link>http://www.openrce.org/rss/feeds/blog</link>
        <description>OpenRCE: The Open Reverse Code Engineering Community</description>
                <item>
            <title>Update IDACompare for IDA Pro 5.4</title>
                            <pubDate>Thu, 05 Mar 2009 11:01:09 -0600</pubDate>
                                        <link>https://www.openrce.org/blog/view/1409/Update_IDACompare_for_IDA_Pro_5.4</link>
                                        <author>apridgen &lt;email-suppressed@example.com&gt;</author>
                                                    <description>Binary Library File, source files and patch file are in the following archive file located here:&lt;br /&gt;
https://www.openrce.org/repositories/users/apridgen/IDACompare5.4_patched.zip</description>
                    </item>
                <item>
            <title>Reassembling Sniffed Firmware or a Binary With Scapy</title>
                            <pubDate>Fri, 06 Jun 2008 03:50:21 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/1146/Reassembling_Sniffed_Firmware_or_a_Binary_With_Scapy</link>
                                        <author>apridgen &lt;email-suppressed@example.com&gt;</author>
                                                    <description>So, I got bored one night (or morning depending on your perspective), and I decided to sniff the firmware upgrade process for my network printer, Fun! :)&amp;nbsp;&amp;nbsp;I used Wireshark (yeah my tcpdump foo is bar) to isolate the TCP stream between the VM upgrading the firmware and the printer and saved the pcap.&lt;br /&gt;
&lt;br /&gt;
I have been meaning to play with Scapy for quite some time, so I fired up ipython and in about 20 minutes I had a quick script to extract the data I needed.&amp;nbsp;&amp;nbsp;The script is pretty basic and may not work in all cases, but I figured I'd document somewhere just in case or someone else might need it in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
# IP Address of the VM sending the upgrade&lt;br /&gt;
src=&amp;quot;192.168.44.128&amp;quot; &lt;br /&gt;
f = &amp;quot;captured_firmware_upgrade.pcap&amp;quot;&lt;br /&gt;
pcap = rdpcap(f)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
data = &amp;quot;&amp;quot;&lt;br /&gt;
for packet in pcap:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;il = packet.getlayer(&amp;quot;IP&amp;quot;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;if il.src != src:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;continue&lt;br /&gt;
&amp;nbsp;&amp;nbsp;tl = packet.getlayer(&amp;quot;TCP&amp;quot;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;# check for data in the payload, if not skip the packet&lt;br /&gt;
&amp;nbsp;&amp;nbsp;if isinstance(tl.payload,scapy.NoPayload):&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;continue&lt;br /&gt;
&amp;nbsp;&amp;nbsp;data += str(tl.payload)&lt;br /&gt;
# write our raw data file&lt;br /&gt;
f = open(&amp;quot;raw_data.dat&amp;quot;, 'w')&lt;br /&gt;
f.write(data)&lt;br /&gt;
f.close()&lt;br /&gt;
&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Hope it helps someone in the future :)&lt;br /&gt;
&lt;br /&gt;
</description>
                    </item>
                <item>
            <title>Basic tutorial about how to dump a process and update the IAT using Immunity Debug, LordPE, and ImpRec</title>
                            <pubDate>Tue, 06 May 2008 16:06:06 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/1135/Basic_tutorial_about_how_to_dump_a_process_and_update_the_IAT_using_Immunity_Debug,_LordPE,_and_ImpRec</link>
                                        <author>apridgen &lt;email-suppressed@example.com&gt;</author>
                                                    <description>Basic tutorial about how to dump a process and update the IAT using Immunity Debug, LordPE, and ImpRec&lt;br /&gt;
AKA: Dumping RBot.clj to a usable binary for analysis&lt;br /&gt;
&lt;br /&gt;
This tutorial is quick and mostly, so I can remember how to use PE Dump, &lt;br /&gt;
LordPE, and then ImpRec.&amp;nbsp;&amp;nbsp;This work is not any type of new hotness.&amp;nbsp;&amp;nbsp;There is &lt;br /&gt;
actually a tutorial similar to this one [1], but it lacked the details I needed&lt;br /&gt;
to dump and convert the file into a usable executable, so I am writing this one.&lt;br /&gt;
&lt;br /&gt;
What you will need:&lt;br /&gt;
1) Immunity Debug:&amp;nbsp;&amp;nbsp;http://debugger.immunityinc.com/register.html&lt;br /&gt;
2) PE Dumper:&amp;nbsp;&amp;nbsp;http://www.woodmann.com/collaborative/tools/index.php/PE_Dumper&lt;br /&gt;
2) LordPE:&amp;nbsp;&amp;nbsp;http://www.woodmann.com/collaborative/tools/index.php/LordPE&lt;br /&gt;
3) ImpRec:&amp;nbsp;&amp;nbsp;http://www.woodmann.com/collaborative/tools/index.php/ImpREC&lt;br /&gt;
4) An account on Offensive Computing to get the sample:&amp;nbsp;&amp;nbsp;http://offensivecomputing.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you get your account to Offensive Computing, perform a search for the following &lt;br /&gt;
malware md5sum:&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
59c661ba0c7c485f4480f7b142a9c084.&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Save the file to disk and unzip the archive, supplying the archive password.&lt;br /&gt;
&lt;br /&gt;
Make sure PE Dumper was installed in the Immunity Debug directory, so start Immunity&lt;br /&gt;
Debug and check the Plugins menu for &amp;quot;OllyDbg PE Dumper&amp;quot;, if its not there, make sure &lt;br /&gt;
the plugin is in the right directory for example:&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
C:\Program Files\Immunity Inc\Immunity Debugger&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 0: Unpack the Malware&lt;br /&gt;
&lt;br /&gt;
Moving forward do File-&amp;gt;Open and select the malware.exe.&amp;nbsp;&amp;nbsp;Now first we need to unpack &lt;br /&gt;
the binary.&amp;nbsp;&amp;nbsp;The Evilcodecave's Blog was helpful here [2].&amp;nbsp;&amp;nbsp;First we will perform a &lt;br /&gt;
search for a sequence of commands:&amp;nbsp;&amp;nbsp;Right Click in the CPU Window,&lt;br /&gt;
&amp;quot;Search for..&amp;quot;-&amp;gt;&amp;quot;Sequence of Commands&amp;quot; or Ctrl+S.&amp;nbsp;&amp;nbsp;Type in &lt;br /&gt;
&lt;br /&gt;
POPAD&amp;lt;enter&amp;gt;&lt;br /&gt;
POPFD&amp;lt;enter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two instructions reverse the PUSHFD, PUSHAD, you should have seen when Immunity Dbg&lt;br /&gt;
first started and attached to the program.&amp;nbsp;&amp;nbsp;Now, hit the down until you get to the 'jmp'&lt;br /&gt;
instruction.&amp;nbsp;&amp;nbsp;Press &amp;lt;F9&amp;gt;, and the program should stop execution on this instruction.&lt;br /&gt;
&lt;br /&gt;
Now, hit &amp;lt;enter&amp;gt; to go to the next instruction, this will not execute the instruction, &lt;br /&gt;
but it will jump the view down to the next instruction.&amp;nbsp;&amp;nbsp;Now hit &amp;lt;Ctrl-A&amp;gt;, which will &lt;br /&gt;
analyze the data and treat is as code.&amp;nbsp;&amp;nbsp;It was not treated as code previously, because before&lt;br /&gt;
this was all data.&amp;nbsp;&amp;nbsp;When the unpacker executed, the code was written to these memory locations.&lt;br /&gt;
&lt;br /&gt;
We still need to let the program execute a little more before we can dump it (Did you notice &lt;br /&gt;
the PUSHAD we landed on?).&amp;nbsp;&amp;nbsp;Scroll down a little bit (Page Down 5 times, and place a break point&lt;br /&gt;
on the 'jmp' instruction (address = 0x004DCA84).&amp;nbsp;&amp;nbsp;If you look up a little bit, youll notice the &lt;br /&gt;
POPAD ;).&amp;nbsp;&amp;nbsp;Press &amp;lt;F9&amp;gt; again, and the execution should stop at the instruction.&amp;nbsp;&amp;nbsp;Hit &amp;lt;F7&amp;gt;, and now&lt;br /&gt;
we are at the OEP of our binary, so now its time to dump it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 2: Dump the Process&lt;br /&gt;
In Immunity Debug goto PE Dumper: Plugins-&amp;gt;&amp;quot;OllyDbg PE Dumper&amp;quot;-&amp;gt;&amp;quot;Make Dump of Process&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1) Make sure your target process is selected.&lt;br /&gt;
2) Click &amp;quot;Get EIP as OEP&amp;quot;&lt;br /&gt;
3) Put a check box in &amp;quot;Fix Raw sizes&amp;quot;&lt;br /&gt;
3) Put a check box in &amp;quot;Fix Raw sizes&amp;quot;&lt;br /&gt;
4) Put a check box in &amp;quot;Make header size 0x1000&amp;quot;&lt;br /&gt;
5) Click the Dump butten and save the file.&lt;br /&gt;
6) Leave the process paused.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 3: Rebuild the PE Image with LordPE&lt;br /&gt;
1) Start LordPE&lt;br /&gt;
2) Click the Options button and put a check mark next to &amp;quot;Full Dump: rebuild image&amp;quot;&lt;br /&gt;
3) Click the &amp;quot;Rebuild PE&amp;quot; Button and select the file that was just save in the previous step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 4: Rebuild the IAT with ImpRec&lt;br /&gt;
Note:&amp;nbsp;&amp;nbsp;Identifying the IAT can be tricky, but in this case, I simply looked at the address of a&lt;br /&gt;
function call for a known Windows API and jumped to that address.&amp;nbsp;&amp;nbsp;Immunity Debug should resolve &lt;br /&gt;
the names to the function call, so it should be pretty easy to spot in the CPU Window.&amp;nbsp;&amp;nbsp;Look for&lt;br /&gt;
&lt;br /&gt;
CALL DWORD PTR DS:[42319C]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&amp;nbsp;&amp;nbsp;kernel32.GetVersion&lt;br /&gt;
&lt;br /&gt;
In the dump window, go to the expression (Ctrl+G) 0x42319C.&amp;nbsp;&amp;nbsp;Make sure the data is being viewed as &lt;br /&gt;
Long-Addresses (Right Click in the Dump Window Long-&amp;gt;Addresses).&amp;nbsp;&amp;nbsp;Scroll up until the first import&lt;br /&gt;
can be seen.&amp;nbsp;&amp;nbsp;Now open ImpRec.&lt;br /&gt;
&lt;br /&gt;
1)&amp;nbsp;&amp;nbsp;Select the target process that is open in the first step.&lt;br /&gt;
2)&amp;nbsp;&amp;nbsp;Click on Options and check the &amp;quot;Import All By Ordinal,&amp;quot; &amp;quot;Rebuild Original FT,&amp;quot; &lt;br /&gt;
	&amp;quot;Fix EP to OEP,&amp;quot; and &amp;quot;Create New IAT&amp;quot; Checkboxes&lt;br /&gt;
3)&amp;nbsp;&amp;nbsp;Under the &amp;quot;RVAS Infos Needed&amp;quot; Section, enter the RVA of the program's IAT and OEP:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Address of the IAT - Image Base, in this case 0x00423000 - 0x00400000 = 0x00023000&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Address of the EIP - Image Base, in this case 0x0041A4E3 - 0x00400000 = 0x0001A4E3	&lt;br /&gt;
4)&amp;nbsp;&amp;nbsp;Hit the Get Imports button.&lt;br /&gt;
5)&amp;nbsp;&amp;nbsp;Click the &amp;quot;Show Invalid,&amp;quot; and remove anthing that is invalid by &lt;br /&gt;
	Right Clicking in the Window -&amp;gt; Cut Thunks.&lt;br /&gt;
6)&amp;nbsp;&amp;nbsp;Check the Add New Section&lt;br /&gt;
7)&amp;nbsp;&amp;nbsp;Click on Fix Dump and select the previously saved file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Final: Test in VMWare.&lt;br /&gt;
If it runs with out an exception, then you are likely now infected, cheers :)&lt;br /&gt;
&lt;br /&gt;
Conclusion&lt;br /&gt;
Like I said, I know this has been done by several folks, but I can never find it when I need it, so &lt;br /&gt;
I figured I'd Document it once more for good measure.&amp;nbsp;&amp;nbsp;I hope someone else finds this useful in the &lt;br /&gt;
future.&amp;nbsp;&amp;nbsp;I know I will ;), Cheers.&lt;br /&gt;
&lt;br /&gt;
1.&amp;nbsp;&amp;nbsp;MUP With OllyDbg for Really Beginner&lt;br /&gt;
http://www.geocities.com/r_etarded/ollydump/ollydump.html&lt;br /&gt;
&lt;br /&gt;
2.&amp;nbsp;&amp;nbsp;[Malware] Backdoor.Win32.Rbot.clj Reversing,&lt;br /&gt;
http://evilcodecave.wordpress.com/2007/12/01/malware-backdoorwin32rbotclj-reversing/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</description>
                    </item>
                <item>
            <title>PyVix, Python Bindings for the VMWare VIX SDK</title>
                            <pubDate>Tue, 22 Apr 2008 20:32:48 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/1124/PyVix,_Python_Bindings_for_the_VMWare_VIX_SDK</link>
                                        <author>apridgen &lt;email-suppressed@example.com&gt;</author>
                                                    <description>I am not sure how many people use PyVix, but I took some time to go through and update the project.&amp;nbsp;&amp;nbsp;The project was originally developed by David S. Rushby, and the project provides Python Bindings for VMWare's VIX SDK.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
It looks like the API has not been updated in a while, so rather than just throwing a patch somewhere on the web just to be lost, I posted my updates on Google Code.&amp;nbsp;&amp;nbsp;The source code can be downloaded from here:&lt;br /&gt;
&lt;br /&gt;
svn checkout http://randomizedcode.googlecode.com/svn/trunk/pyvix-branch pyvix&lt;br /&gt;
&lt;br /&gt;
or in tar ball form here:&lt;br /&gt;
&lt;br /&gt;
http://randomizedcode.googlecode.com/files/latest-pyvix-4.22.2008.tgz&lt;br /&gt;
&lt;br /&gt;
I have only installed this on Linux, but it should install in Windows too.&lt;br /&gt;
&lt;br /&gt;
Prerequisites: &lt;br /&gt;
&lt;br /&gt;
VMWare's VIX SDK&lt;br /&gt;
C/C++ compiler (MinGW/GCC)&lt;br /&gt;
&lt;br /&gt;
To Install, drop prompt:&lt;br /&gt;
&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
Updates:&lt;br /&gt;
&lt;br /&gt;
1) I ran into some problems building on Windows Vista for 6.03 using mingw32, so I am still trying to figure out how to build them at this time,&lt;br /&gt;
&lt;br /&gt;
2) Adam35413 pointed this out, and the path needs to be updated to include the _vixmodule.so's path, or it can simply be added to /lib.&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Sorry if anyone ran into problems.&amp;nbsp;&amp;nbsp;&lt;br /&gt;
</description>
                    </item>
                <item>
            <title>Random Thoughts</title>
                            <pubDate>Tue, 17 Apr 2007 01:50:38 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/695/Random_Thoughts</link>
                                        <author>apridgen &lt;email-suppressed@example.com&gt;</author>
                                                    <description>A new acronym -- ~ RE related but it was on my mind &amp;amp;&amp;amp; I needed to say it somewhere &amp;amp;&amp;amp; I don't have a real blog&lt;br /&gt;
&lt;br /&gt;
I propose the following acronym: HDLD&lt;br /&gt;
&lt;br /&gt;
High Dose [of caffiene], Low Dose [of sleep]:&lt;br /&gt;
&lt;br /&gt;
To be used like this.&lt;br /&gt;
&lt;br /&gt;
I am running on HDLD but I have never felt better.&lt;br /&gt;
&lt;br /&gt;
eh...Maybe not, it sounded cool.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</description>
                    </item>
            </channel>
</rss>
