<?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>Reverse Engineering Of Strong Crypto Signatures Schemes</title>
                            <pubDate>Tue, 21 Aug 2007 04:21:49 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/863/Reverse_Engineering_Of_Strong_Crypto_Signatures_Schemes</link>
                                        <author>evilcry &lt;email-suppressed@example.com&gt;</author>
                                                    <description>Hi,&lt;br /&gt;
&lt;br /&gt;
The english version of my last paper can be viewed here:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://evilcry.altervista.org/tuts/StrongCryptoTrsl.zip&quot;&gt;http://evilcry.altervista.org/tuts/StrongCryptoTrsl.zip&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
See you to the next post</description>
                    </item>
                <item>
            <title>Xmas Cryptanalisys :)</title>
                            <pubDate>Mon, 25 Dec 2006 04:25:51 -0600</pubDate>
                                        <link>https://www.openrce.org/blog/view/558/Xmas_Cryptanalisys_:)</link>
                                        <author>evilcry &lt;email-suppressed@example.com&gt;</author>
                                                    <description>First of all, i would give you my best wishes for a Peaceful and Happy Christmas, i've published this post because, as someone already said, &amp;quot;this make me fell alive&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here i'll talk about the cryptanalysis of a simple Binary Addition, but this can be usefull for people that have some Psion5 PDA file Encrypted ;)&lt;br /&gt;
&lt;br /&gt;
Psion 5 PDA implements a very weak encryption system, here i'll demonstrate how we can obtain a fully clear plaintext from an encrypted block (a Cipher Only Attack).&lt;br /&gt;
&lt;br /&gt;
The algorithm used is a simple Binary Addition:&lt;br /&gt;
&lt;br /&gt;
Encryption phase: The key entered is added character by character (byte by byte) to the data to be encrypted. Here addition modulo 256 is used. The key is applied cyclically, once all bytes of the key have been used, the algorithm reverts to the first character until the text has been completely encrypted.&lt;br /&gt;
&lt;br /&gt;
Decryption phase: The characters of the key have to be subtracted from the encrypted text modulo 256.&lt;br /&gt;
&lt;br /&gt;
As previously said a Cipher Only Attack can be performed, we need to know: &lt;br /&gt;
&lt;br /&gt;
1)Statistical Frequency: The characters which occur most frequently), but if we don't know this parameter, there is no problem, because we can use statistical tables, or at least a small bruteforce it's range is truly small, only 26 as the number of letters, more if we are working with not common languages (xenographyc tables are useful in this case).&lt;br /&gt;
&lt;br /&gt;
2)The key length: We can determine the keylenght using Autocorrelation (which is an index of similarity for differents portions of text). &lt;br /&gt;
Each character had not an equal probability occurs, but the probability of two identical characters occurring is relatively large if they are separated by a multiple of the key length. Thanks to the Autocorrelation analisys, we can determine a &amp;quot;distance value&amp;quot;, calculated between equal frequency values, this value is our Derived Key Lenght.&lt;br /&gt;
&lt;br /&gt;
3)Discovering The Key: After we know the Key Lenght, throughout the Histogram analisys of every character of the key, we can determine the correct key char. It's important to underline that, in this process we have to assume a Most Common Character,&lt;br /&gt;
for example on english texts we can assume the 'e' OR the space ' '.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------[Background Philosophy]-----------&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The base concept that allowed this attack, is the The Unicity Distance, which is one of the fundamentals of Cryptanalisys.&lt;br /&gt;
The Unicity Distance, is the minimum amount of ciphertext (expressed in number of of chars) required to allow a computationally unlimited adversari to recovery the Encryption Key.&lt;br /&gt;
&lt;br /&gt;
We can express this concept in more strict terms, as No = H(K)/D, where&lt;br /&gt;
No=Expected Unicity Distance&lt;br /&gt;
H(K)=Entropy of Key Space&lt;br /&gt;
D=Plaintext Redundancy (Referred to the Histogram Analisys)&lt;br /&gt;
&lt;br /&gt;
In our case we have to introduce another parameter, t which is the period of our cipher. Assuming D as 3.2 bits/chars we have:&lt;br /&gt;
&lt;br /&gt;
H(K)/D=lg(t!)/3.2&lt;br /&gt;
&lt;br /&gt;
Using Stirling's Approximation we can rewrite the previous as:&lt;br /&gt;
&lt;br /&gt;
t! Approximately Is Sqrt((2Pi*t))* (t/e)^t&lt;br /&gt;
&lt;br /&gt;
As usual i exceded in the Math Back-Ground analysis :)&lt;br /&gt;
but reported informations should be enough for people that want to implement some Automatic Cryptanalisys Proggie :)&lt;br /&gt;
&lt;br /&gt;
Again Merry Xmas and see you to the next post ;) &lt;br /&gt;
</description>
                    </item>
                <item>
            <title>Kartoffel and Vulnerable Device Drivers</title>
                            <pubDate>Sun, 22 Oct 2006 03:22:16 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/492/Kartoffel_and_Vulnerable_Device_Drivers</link>
                                        <author>evilcry &lt;email-suppressed@example.com&gt;</author>
                                                    <description>Some days ago i'v founded a nice and useful, &lt;b&gt;Kartoffel&lt;/b&gt; Driver Verification Tool, that allow us a rapid verification of some of the most common Device Driver weaknesses, as untrusted IOCTLs.&lt;br /&gt;
&lt;br /&gt;
For example, we can see that mrxsmb.sys (which is directly related to cscdll.dll) does not trust User Mode ingoing buffer)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;gt;kartoffel -s \\.\Shadow -n 0 -o 0x10 -z 0 -Z 0x18 -U VALUE,HANDLES -c 2000 -I 141047 &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In other work we're &amp;quot;overflowing&amp;quot; the CTL code 141047, output result of Kartoffel&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
Input Size:[0x0000] &lt;br /&gt;
Ouput Size:[0x0018] &lt;br /&gt;
IOCTL:[0x00141047] -&amp;gt; Response received [IOM notified] &lt;br /&gt;
[ RESULTS ] _________________________________________________________ &lt;br /&gt;
Test ID [ 0x0001 ] ------------------------------------------------------------ &lt;br /&gt;
[ FUZZING ] &lt;br /&gt;
- Input Buffer Size: (0x0000) Method: &amp;quot;&amp;quot; Submethod: &amp;quot;&amp;quot; &lt;br /&gt;
- Output Buffer Size: (0x0018) Method: &amp;quot;VALUE&amp;quot; Submethod: &amp;quot;HANDLES&amp;quot; &lt;br /&gt;
- IOCTL [ 0x00141047 ] &lt;br /&gt;
=&amp;gt; DEVICE: FILE_DEVICE_NETWORK_FILE_SYSTEM &lt;br /&gt;
=&amp;gt; ACCESS: ANY ACCESS &lt;br /&gt;
=&amp;gt; FUNCTION: 0x0411 &lt;br /&gt;
=&amp;gt; METHOD: METHOD_NEITHER &lt;br /&gt;
[ FLAW ] &lt;br /&gt;
- POSSIBLE DEADLOCK DETECTED - &lt;br /&gt;
[ BUFFERS ] &lt;br /&gt;
[INPUT BUFFER] = NULL &lt;br /&gt;
Original Data [OUTPUT BUFFER] &lt;br /&gt;
[0x000]: 000007E8 000007E8 000007E8 000007E8 &lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
Oh, here is the link&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
hXXp://www.reversemode.com/index.php?option=com_remository&amp;amp;Itemid=2&amp;amp;func=fileinfo&amp;amp;id=17&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
..and it's also Open Source!&lt;br /&gt;
&lt;br /&gt;
See you to the next post</description>
                    </item>
                <item>
            <title>MFC Undeclared Identifier</title>
                            <pubDate>Sun, 08 Oct 2006 05:06:08 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/488/MFC_Undeclared_Identifier</link>
                                        <author>evilcry &lt;email-suppressed@example.com&gt;</author>
                                                    <description>Yesterday, i tried to use OpenSCManager() and the other common CreateService(), but VS compiler refuses to compile, the&lt;br /&gt;
reason was &lt;b&gt;Undeclared Identifier: &lt;/b&gt;, but all headers were ok. &lt;br /&gt;
&lt;br /&gt;
Thanks to a little discovery, i finally builded my application, here i'll share this, because could help in a variety of similar problems, when using not many common APIs on MFC.&lt;br /&gt;
&lt;br /&gt;
Into &lt;b&gt;stdafx.h&lt;/b&gt; there is:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
by clearing this line, all not common functio prototipes will be working :)&lt;br /&gt;
&lt;br /&gt;
See you to the next post&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</description>
                    </item>
                <item>
            <title>Something about Firewall hooking and Packet Filtering (2)</title>
                            <pubDate>Tue, 26 Sep 2006 11:01:30 -0500</pubDate>
                                        <link>https://www.openrce.org/blog/view/454/Something_about_Firewall_hooking_and_Packet_Filtering_(2)</link>
                                        <author>evilcry &lt;email-suppressed@example.com&gt;</author>
                                                    <description>Let's introduce some more specification, to make previous blog entry more clear.&lt;br /&gt;
&lt;br /&gt;
The last struct showed, is the _FIREWALL_CONTEXT_T, and as can be seen there is &lt;b&gt;DIRECTION_E&lt;/b&gt;&amp;nbsp;&amp;nbsp;that could be a little obscure, so here is reported:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
typedef enum &lt;b&gt;_IP_DIRECTION_E&lt;/b&gt; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IP_TRANSMIT,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IP_RECEIVE&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } DIRECTION_E, *PDIRECTION_E;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
Represents easly a packet is&amp;nbsp;&amp;nbsp;Receiver or Transmitted.&lt;br /&gt;
&lt;br /&gt;
The return values by the filter-routine can be:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
FORWARD = 0&lt;br /&gt;
DROP = 1&lt;br /&gt;
ICMP_ON_DROP = 2&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
That are proprer of &lt;b&gt;FORWARD_ACTION&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
As previously said, to implement IP_SET_FIREWALL_HOOK_INFO, it's necessary to write a filter function for \device\IP, so the pointer (to IP) self can be obtained easly by calling &lt;br /&gt;
&lt;b&gt;IoGetDeviceObjectPointer( )&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Now can be installed the filter function, by passing througout IP's pointer the address of the filtering function self, with &lt;b&gt;IoBuildDeviceIoControlRequest&lt;/b&gt;(IOCTL_IP_SET_FIREWALL_HOOK,IpDeviceObject,.....)&lt;br /&gt;
It's important to say also (according to DDK documentation) that &lt;b&gt;IOCTL_PF_SET_EXTENSION_POINTER&lt;/b&gt;registers filter-hook callback to the IP filter driver, to &amp;quot;make known&amp;quot; \device\IP to reroute every packet received or transmitted, and finally this same IOCTL clears the filter function from IP device. All these specifications could be made, by filling up the proper structure of this IOCTL, that will go to constitute the InputBuffer of IoBuildDeviceIoControlRequest:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;PF_SET_EXTENSION_HOOK_INFO&lt;/b&gt;, that inside have another struct &lt;b&gt;PacketFilterExtensionPtr&lt;/b&gt; which specifies the pointer to the filter hook callback, and when ins FALSE clears the filter.&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
typedef&amp;nbsp;&amp;nbsp;PF_FORWARD_ACTION &lt;br /&gt;
(*PacketFilterExtensionPtr)(&lt;br /&gt;
&amp;nbsp;&amp;nbsp;IN unsigned char *PacketHeader,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//Pointer to Ip header of packet&lt;br /&gt;
&amp;nbsp;&amp;nbsp;IN unsigned char *Packet,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//Points a buffer with informations in the packet&lt;br /&gt;
&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //that filter-hook receives &lt;br /&gt;
&amp;nbsp;&amp;nbsp;IN unsigned int PacketLength,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//Length of the packet&lt;br /&gt;
&amp;nbsp;&amp;nbsp;IN unsigned int RecvInterfaceIndex,//Index number for the interface adapter (InGoing)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;IN unsigned int SendInterfaceIndex,//Index number for the interface adapter (OutGoing) &lt;br /&gt;
&amp;nbsp;&amp;nbsp;IN IPAddr RecvLinkNextHop,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //IP address for the interface adapter that received the packet&lt;br /&gt;
&amp;nbsp;&amp;nbsp;IN IPAddr SendLinkNextHop&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//IP address for the interface adapter that will transmit the packet&lt;br /&gt;
&amp;nbsp;&amp;nbsp;); &lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
It's also important to notice that only on filter function per time can be installed, if others resides functions are stil working this one will not work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See you to the next post</description>
                    </item>
            </channel>
</rss>
