<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shivam Trivedi on Medium]]></title>
        <description><![CDATA[Stories by Shivam Trivedi on Medium]]></description>
        <link>https://medium.com/@shivamtrivedi18?source=rss-702b686df031------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*bq1fiu7xWhHgZ3XH.jpg</url>
            <title>Stories by Shivam Trivedi on Medium</title>
            <link>https://medium.com/@shivamtrivedi18?source=rss-702b686df031------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 18:34:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shivamtrivedi18/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Noobie approach towards MalwareBytes CrackMe#2]]></title>
            <link>https://medium.com/@shivamtrivedi18/a-noobie-approach-towards-malwarebytes-crackme-2-a8ad0477c58f?source=rss-702b686df031------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8ad0477c58f</guid>
            <dc:creator><![CDATA[Shivam Trivedi]]></dc:creator>
            <pubDate>Sat, 28 Apr 2018 16:02:16 GMT</pubDate>
            <atom:updated>2018-04-28T22:25:26.392Z</atom:updated>
            <content:encoded><![CDATA[<p>This challenge by malwarebytes is particularly designed for the aspiring malware analysts to test their skills and to learn something new. I also tried to get my hands dirty on it and succeeded. So, Get the crackme from <a href="https://blog.malwarebytes.com/security-world/2018/04/malwarebytes-crackme-2-another-challenge/">here</a>, boot up your virtual machines and lets get started.</p><p><strong>Level1:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*Xl71rjXj4QeS3ZMHro9n8Q.png" /><figcaption>Level1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*GLBNYnkoDuBrBwy9ZsVA1g.png" /><figcaption>Child process created by the binary</figcaption></figure><p>I use <a href="https://github.com/katjahahn/PortEx">PortexAnalyzer</a> to analyze this binary first and I got the suspicious signatures regarding zlib archive. Now to look more in depth I attached the debugger to the child process and I easily saw that python2.7 is loaded in the modules section. Now I confirmed that the binary is a wrapper of a python script. So I decompile that python script using <a href="https://sourceforge.net/projects/pyinstallerextractor/">PyInstallerExtractor</a> and <a href="https://github.com/rocky/python-uncompyle6">uncompyle6</a>.</p><p>After applying the pyinstxtractor.py script over the binary. I got another.pyc (a compiled python file). After running this <strong>.pyc</strong> file over uncompyle6 I got a whole python script. In this script I saw a stage1_login function called in main. In stage1_login function I saw another two functions (check_login and check_password).Here, check_login function gave me <strong>login=hackerman</strong> and check_pass gave me <strong>md5(password)=42f749ade7f9e195bf475f37a44cafcb</strong>. Password from this md5 can be easily known by using any online md5 decryptor. I got the <strong>password=Password123</strong>. Next the binary is asking for a PIN. For PIN I wrote a simple python script to bruteforce it and got <strong>PIN=9667</strong>. Now I all have that binary asks for it. Let’s test it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*V897mU6xU4eSEm8XrbITzw.png" /><figcaption>Baam!! We cracked the level1</figcaption></figure><p><strong>Level2:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*6qLbt3cDPnSHxDy5PV34rA.png" /><figcaption>Level2</figcaption></figure><p>So this level wants me to find some secret kind of console. Hmm interesting…</p><p>In decompiled python script I saw prepare_stage function which uses VirtualAlloc API to allocate some memory space and the downloaded content is moved to that memory space by using memmove. So I use debugger to know what content should it downloaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*YFbeZemI1HTfvzS-jFnrtQ.png" /><figcaption>PE file in Allocated Region with (ERW) permissions</figcaption></figure><p>So a PE file is dumped into that memory section and having an ERW(Executable,Read and Write) permissions. I use <a href="https://github.com/hasherezade/pe-sieve">pe-sieve</a> to dump those PE executables and we find 2 suspicious Dlls. I guess that both of those files are similiar but one of them have fixed IAT and other doesn’t have. So I named them suspicious_fixed and suspicious_unfixed accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*S5396RndCV3tgRn7OeyCng.png" /><figcaption>Anti-Debug check using ZwContinue (Exception Handler)</figcaption></figure><p>Open the suspicious_fixed Dll in IDA and in string view I can easily found my secret_console string. Seems like this is what we are looking for. By tracing back through various XREFs I reached sub_10001170. Here I got an anti-debug check using AddVectoredExceptionHandler to invoke the exception.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*5_Xtt0FGwozKjz2xh4VSiw.png" /><figcaption>StartAddress :- Enumerating through all top levels windows on the screen</figcaption></figure><p>When I pass this exception check, a new thread is created. When I break at the entry of the newly created thread, I landed at <strong>StartAddress</strong> function. So the exception cause to call the <strong>callThread</strong> function and it creates a new thread.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*oML9Y_XNFPUGkOMC5mk3fw.png" /><figcaption>Check for “Notepad” and “secret_console”</figcaption></figure><p>While Enumerating and getting the handle of each windows. The SecretConsole function checks whether the windows name contains “Notepad” and “secret_console”. After finding the desired window, it enumerates through the child windows of the notepad and recursively calls the EnumFunc where it checks for the command “dump_the_key” in the same manner as it finds “secret_console” and “Notepad”. So now I have to create a file named search_console and open it up with notepad and then type “dump_the_key”. Lets try it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*CpBgKYThRGTN-32im_4Lsw.png" /><figcaption>Yeah!!! Cracked this one too….</figcaption></figure><p>Next level coming soon…. Feeling sleepy….</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8ad0477c58f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>