<?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 ka1d0 on Medium]]></title>
        <description><![CDATA[Stories by ka1d0 on Medium]]></description>
        <link>https://medium.com/@nikhilh20?source=rss-e7692a561d6e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wXo-936SU18IiKsmQDibeg.png</url>
            <title>Stories by ka1d0 on Medium</title>
            <link>https://medium.com/@nikhilh20?source=rss-e7692a561d6e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 14:54:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nikhilh20/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[Bitcoin Blockchain as a Graph in Neo4j]]></title>
            <link>https://nikhilh20.medium.com/bitcoin-blockchain-as-a-graph-in-neo4j-2ae5938d4a7a?source=rss-e7692a561d6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ae5938d4a7a</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[neo4j]]></category>
            <dc:creator><![CDATA[ka1d0]]></dc:creator>
            <pubDate>Fri, 20 Sep 2019 17:17:19 GMT</pubDate>
            <atom:updated>2019-11-01T00:15:06.146Z</atom:updated>
            <content:encoded><![CDATA[<p>Blockchain is one of the top technology trends of our times. It was originally invented by Satoshi Nakamoto as a public, distributed, transaction ledger for the cryptocurrency, Bitcoin. As part of the first phase of an ongoing project, I have been experimenting with the visualization of the Bitcoin blockchain as a graph in Neo4j. With this article, I hope to help you do the same.</p><h3>Why Graph Database?</h3><p>I have had reason to work with MySQL (RDBMS) only a few times. In that time, I have learnt the following:</p><ul><li>Relational databases have a schema which describes the structure of the database. All data in the database must conform to the schema, else the schema needs to be changed.</li><li>Relationships between tables is defined when the tables are first created.</li><li>This implies that structure of all future data must be known when creating the database.</li><li>Relational databases use primary and foreign keys to determine references. The foreign key value must match the primary key value in the parent table.</li><li>Many a time, foreign keys are auto-generated numbers. Due to this, human readable values can be extracted only by running a query that joins the tables on the primary and foreign key.</li><li>If there is large amount of data, multiple joins can degrade performance.</li></ul><p>A graph database:</p><ul><li>Requires no schema. It uses nodes and relationships to store data and the data itself determines the structure of the nodes and their relationships.</li><li>In a RDBMS, each node would be a separate record in one table and relationships would be defined in another table.</li><li>Relationships have names and properties which makes graph databases suitable to connected data such as social networks.</li></ul><p>In summary, graph databases are more suitable for visualizing the Bitcoin blockchain because a graph query works only on the data within the specified relationships. On the other hand, RDBMS would have bad performance when using <em>JOIN</em> on multiple tables possibly having hundreds of thousands of transaction data.</p><h3>The Plan</h3><p>To successfully import the Bitcoin blockchain into Neo4j, the following steps need to be completed:</p><p><strong>Install Docker on Ubuntu VM</strong></p><p>I use VMware Workstation 15 Pro and Ubuntu 18.04 Desktop with the primary disk partition having maximum size of 983 GB. <a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04"><em>https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04</em></a></p><p><strong>Get Docker Compose File</strong></p><p>Get the docker compose file from <a href="https://gist.github.com/straumat/54edc240554f84c71b81a8d926b8f5be"><em>https://gist.github.com/straumat/54edc240554f84c71b81a8d926b8f5be</em></a><em> and r</em>ename it to <em>docker-compose.yml. </em>Make the following modifications in the <em>bitcoin-core</em> service:</p><ol><li>Previous: <em>ruimarinho/bitcoin-core:0.18.0</em>, Modified: <em>ruimarinho/bitcoin-core:latest</em></li><li>Add two arguments: <em>-rpcbind=127.0.0.1</em> and <em>-rpcbind=bitcoin-core</em></li></ol><p><strong>Download Docker Compose</strong></p><p><a href="https://www.digitalocean.com/community/tutorials/how-to-install-docker-compose-on-ubuntu-18-04"><em>https://www.digitalocean.com/community/tutorials/how-to-install-docker-compose-on-ubuntu-18-04</em></a></p><p><strong>Docker Compose Up</strong></p><p>Execute the following command in the directory in which the above docker compose file exists: <em>COMPOSE_HTTP_TIMEOUT=240 docker-compose up</em></p><h3>Summary</h3><p>Here are some snapshots while I was working on this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*iDvw8UpeYDI4nK9c" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*kHUefrMl06xjmZfv" /></figure><p>Here are a few points on the overall process:</p><ul><li>It took me about 24–28 hours to sync up to the latest block in the Bitcoin blockchain and it’ll take me a few weeks to import all the blocks in Neo4j.</li><li>The import into Neo4j can be interrupted at any time and it’ll resume at that point when started later.</li><li>Analysis can be started on the already imported blocks in Neo4j. It is not necessary to wait for the entire blockchain to be imported.</li><li>This method is useful only if you’re not in a hurry to analyze the blockchain.</li></ul><h3>Appendix</h3><ol><li><a href="https://database.guide/whats-the-difference-between-graph-database-and-relational-database/"><em>https://database.guide/whats-the-difference-between-graph-database-and-relational-database/</em></a></li><li><a href="https://github.com/straumat/blockchain2graph"><em>https://github.com/straumat/blockchain2graph</em></a></li></ol><p><strong>Feature Image Credits:</strong> <a href="https://neo4j.com/blog/import-bitcoin-blockchain-neo4j/"><em>https://neo4j.com/blog/import-bitcoin-blockchain-neo4j/</em></a></p><p>P.S. I also write on my blog <a href="https://0x90sploiter.wordpress.com/"><em>https://0x90sploiter.wordpress.com</em></a></p><p><em>Originally published at </em><a href="https://0x90sploiter.wordpress.com/2019/09/20/bitcoin-blockchain-as-a-graph-in-neo4j/"><em>http://0x90sploiter.wordpress.com</em></a><em> on September 20, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ae5938d4a7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Malware Analysis — Gozi/Ursnif Downloader]]></title>
            <link>https://nikhilh20.medium.com/malware-analysis-gozi-ursnif-downloader-3a9bb1646239?source=rss-e7692a561d6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a9bb1646239</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[ka1d0]]></dc:creator>
            <pubDate>Tue, 10 Sep 2019 09:30:38 GMT</pubDate>
            <atom:updated>2019-09-19T08:17:37.080Z</atom:updated>
            <content:encoded><![CDATA[<h3>Malware Analysis — Gozi/Ursnif Downloader</h3><p>In the <a href="https://medium.com/@nikhilh20/malware-analysis-nanocore-9024e9e9be7b">previous article</a>, we looked at basic dynamic analysis of a NanoCore variant. In this article, we’ll be analyzing a VBA malware which I came across on the <a href="https://any.run/">ANY.RUN</a> platform.</p><p><strong>Note: Ensure you have the malware sample placed in a safe environment (preferably, a malware analysis lab setup) before starting analysis.</strong></p><p><strong>Credits: A big shout out to Max ‘Libra’ Kersten who helped me format this article and understand the intel behind this malware. Do check out his </strong><a href="https://twitter.com/libraanalysis"><strong>Twitter</strong></a><strong> and </strong><a href="https://maxkersten.nl/binary-analysis-course/"><strong>binary analysis course</strong></a><strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*cDdpcuCE79u6x4i1q0TA5g.jpeg" /></figure><p>Hashes for the sample:</p><ul><li>MD5: <em>ed7af781dd9f2b13c17da952da0742d3</em></li><li>SHA256: <em>ed75e995bab56b1de4e25e453de84e0726ead021426d6bcbacf8c62e7385114f</em></li></ul><p>Unzip the sample using the default password, <em>infected</em>. The resultant ZIP file is also password protected. To crack the password, I used John The Ripper on Kali Linux. You can use your preferred tool.</p><pre>root@malnet:~# /opt/JohnTheRipper/run/zip2john /root/malware/Ursnif/ursnif.zip &gt; /root/malware/Ursnif/hash.txt<br>ver 2.0 ursnif.zip/info_08.22.doc PKZIP Encr: cmplen=50689, decmplen=101376, crc=2DCC1165</pre><pre>root@malnet:~# /opt/JohnTheRipper/run/john --format=pkzip /root/malware/Ursnif/hash.txt<br>Using default input encoding: UTF-8<br>Loaded 1 password hash (PKZIP [32/64])<br>Will run 2 OpenMP threads<br>Proceeding with single, rules:Single<br>Press &#39;q&#39; or Ctrl-C to abort, almost any other key for status<br>Almost done: Processing the remaining buffered candidate passwords, if any.<br>Proceeding with wordlist:/opt/JohnTheRipper/run/password.lst, rules:Wordlist<br>777 (ursnif.zip/info_08.22.doc)<br>1g 0:00:00:00 DONE 2/3 (2019-09-08 17:56) 25.00g/s 1401Kp/s 1401Kc/s 1401KC/s 123456..Peter<br>Use the &quot;--show&quot; option to display all of the cracked passwords reliably<br>Session completed</pre><p>The password for the sample is <em>777</em>.</p><pre>root@malnet:~# unzip /root/malware/Ursnif/ursnif.zip<br>Archive: /root/malware/Ursnif/ursnif.zip<br>[/root/malware/Ursnif/ursnif.zip] info_08.22.doc password: <br>  inflating: info_08.22.doc</pre><p>Hashes for <em>info_08.22.doc</em>:</p><ul><li>MD5: <em>d4c7cadc810aeaf4397f1a1a245a35ea</em></li><li>SHA256: <em>f8c81e287393aadfc13905f46aab34edd55eed46a57ffa4dc74346e438495d4e</em></li></ul><h3>Dumping VBA Macros</h3><p>I used <em>officemalscanner</em> to dump the VBA macros. On viewing the VBA code, I could see that strings were obfuscated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*bWakp9THpGY4w7Ls" /></figure><h3>High-Level Notes</h3><p>The code contained many statements which were junk code. Consider the following snippet from the file, <em>aYxCV</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/0*f4X0o2Q4-PcACkB8" /></figure><p>The blocks of code enclosed in red is junk code, while relevant code is enclosed in green. In the sample, junk code is present in the following forms:</p><p>(Adding bookmarks)</p><pre>With ActiveDocument.Bookmarks<br>.Add Range:=Selection.Range, Name:=&quot;_obfuscatedString_&quot;<br>.ShowHidden = False<br>End With</pre><p>(Deleting bookmarks)</p><pre>If ActiveDocument.Bookmarks.Exists(&quot;_obfuscatedString_&quot;) = True Then<br>ActiveDocument.Bookmarks(&quot;_obfuscatedString_&quot;).Delete<br>End If</pre><p>(Renaming bookmarks)</p><pre>If ActiveDocument.Bookmarks.Exists(&quot;_obfuscatedString_&quot;) = True Then <br>ActiveDocument.Bookmarks(&quot;_obfuscatedString_&quot;).Select<br>Selection.TypeText Text:=&quot;_obfuscatedString_&quot;<br>End If</pre><p>(Updating document)</p><pre>_obfuscatedString_ = ActiveDocument.ActiveTheme<br>ActiveDocument.AcceptAllRevisionsShown<br>_obfuscatedString_ = ActiveDocument.ActiveThemeDisplayName<br>ActiveDocument.Activate</pre><p>For readability purposes, I’ve removed all junk code and comments from the code in screenshots from this point onward.</p><h3>Drop axJBYm.xsl</h3><h3>Dynamic Method</h3><p>To emulate the VBA code, I used the dev version of <a href="https://github.com/kirk-sayre-work/ViperMonkey">ViperMonkey</a>. This was very helpful in this case because the sample dropped a file named, <em>axJBYm.xsl</em>.</p><pre>root@malnet:~/malware/Ursnif# vmonkey info_08.22.doc<br>...<br>...<br>vmonkey 0.08 - <a href="https://github.com/decalage2/ViperMonkey">https://github.com/decalage2/ViperMonkey</a><br>THIS IS WORK IN PROGRESS - Check updates regularly!<br>Please report any issue at <a href="https://github.com/decalage2/ViperMonkey/issues">https://github.com/decalage2/ViperMonkey/issues</a> <br>===============================================================================<br>FILE: info_08.22.doc INFO<br>Starting emulation...<br>INFO Emulating an Office (VBA) file.<br>...<br>...<br>INFO Saving dropped analysis artifacts in info_08.22.doc_artifacts/ INFO Parsing VB...<br>-------------------------------------------------------------------------------<br>VBA MACRO ThisDocument.cls<br>in file: - OLE stream: u&#39;Macros/VBA/ThisDocument&#39;<br>...<br>...<br>Recorded Actions:<br>+-------------------+---------------------------+---------------------------+<br>| Action | Parameters | Description |<br>+-------------------+---------------------------+---------------------------+<br>| Found Entry Point | document_open | |<br>| OPEN | axJBYm.xsl | Open File |<br>| Dropped File Hash | f17da1f0dbf6f32579e75b600 | File Name: axJBYm.xsl |<br>| | bfc6673fe04e4ccde57094feb | |<br>| | 1772387f153a1b | |<br>| run | [&#39;c:\\Windows\\System32\\ | Interesting Function Call |<br>| | wbem\\wmic process list | |<br>| | /format:&quot;axJBYm.xsl&quot;&#39;, 0] | |<br>| Run | xsl&quot; | Interesting Function Call |<br>| Found Entry Point | userform_initialize | |<br>+-------------------+---------------------------+---------------------------+<br>VBA Builtins Called: [&#39;Bookmarks&#39;, &#39;Chr&#39;, &#39;Close&#39;, &#39;Len&#39;, &#39;Mid&#39;, &#39;TypeText&#39;, &#39;Val&#39;, &#39;run&#39;]</pre><pre>Finished analyzing info_08.22.doc .</pre><pre>root@malnet:~/malware/Ursnif/info_08.22.doc_artifacts# ls<br>axJBYm.xsl</pre><h3>Static Method</h3><p>The content of <em>axJBYm.xsl</em> ( <em>3c3f78…</em>) is embedded inside <em>info_08.22.doc </em>in hex form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*tRC8erwcDU34zNOG" /></figure><p>The highlighted statement (in screenshot below) in <em>main()</em> in attribute, <em>afP7R </em>reads the <em>xsl</em> content, converts the hex to ascii and writes to <em>axJBYm.xsl</em> on disk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*4YHDBB4nWDvh9ZNq" /></figure><p>The function, <em>aFTqlABJK() </em>in attribute, <em>acUTw9q</em> converts its argument from its hex form to ASCII. The function <em>a8q3wRJi()</em> in attribute, <em>acUTw9q</em> writes to a file on disk.</p><p>Hashes for <em>axJBYm.xsl</em>:</p><ul><li>MD5: <em>a8f0def13cb3fae52f6e06050513c2c8</em></li><li>SHA256: <em>f17da1f0dbf6f32579e75b600bfc6673fe04e4ccde57094feb1772387f153a1b</em></li></ul><h3>Execute Embedded Code in axJBYm.xsl</h3><p>The sample constructs a cmdline command (highlighted in screenshot below) using <em>aFTqlABJK()</em> which is called from <em>main()</em> in attribute, <em>afP7R:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*kLBTsECxQCAh8COA" /></figure><p>After converting the hex form to ASCII, the cmdline command constructed is:</p><pre>c:\Windows\System32\wbem\wmic process list /format:&quot;axJBYm.xsl&quot;</pre><p>The above command is then executed on the Windows shell via a <em>WshShell</em> object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/0*d_5y_AI7Nn1caV2S" /></figure><p>In other words, the malware author uses a legit Windows tool, to call JavaScript code that is embedded inside <em>axJBYm.xsl</em>.</p><h3>Downloading Malware</h3><p><em>axJBYm.xsl </em>contained a lot of junk JavaScript code. Two such blocks are enclosed in red in the screenshot below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*s6bNedA7bUngld3j" /></figure><p>I’ve removed the junk code from <em>axJBYm.xsl</em> for readability purposes.</p><p>The JavaScript code in <em>axJBYm.xsl</em> first called the function, <em>a7DGra()</em> with argument, <em>0</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*LpJm3cCiTsXMINLZ" /></figure><p>The array consists of elements that modify themselves at runtime. After the modifications, the array <em>auC9FNxgG</em> contained:</p><pre>[<br>&quot;http://wlibby71e.com/qtra/ttqr.php?l=spxo9.j12&quot;,<br>&quot;wscript.shell&quot;,<br>&quot;scripting.filesystemobject&quot;,<br>&quot;msxml2.xmlhttp&quot;,<br>&quot;savetofile&quot;,<br>&quot;run&quot;,<br>&quot;deletefile&quot;,<br>&quot;c:\\windows\\temp\\aChDfgl4.exe&quot;<br>]</pre><p>(First element in the array above is the C&amp;C URL.)</p><p>The function, <em>ay92Yiw() </em>(in <em>axJBYm.xsl</em>) is called through a <em>xsl</em> tag in <em>axJBYm.xsl</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/0*B7ttOkw9dUYQ7MSp" /></figure><p><em>ay92Yiw()</em> contains calls to <em>ActiveXObject()</em> which is supported on Internet Explorer only. This implies that remote files are downloaded through IE.</p><p>The code creates an <a href="https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms759148(v%3Dvs.85)"><em>IXMLHttpRequest</em></a><em> ActiveXObject</em> object which provides HTTP communication capabilities. It sends a <em>GET</em> request to the C&amp;C URL and waits until it receives a response (malware binary data). If a favorable response is received, the code creates a binary file at c<em>:\windows\temp\aChDfgl4.exe</em>, executes it and deletes <em>axJBYm.xsl</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*v_U99wjWT8HyiUC4" /></figure><p>At the time of writing this article, the C&amp;C URL was not reachable and no longer delivering malware.</p><h3>Component of Gozi/Ursnif Campaign</h3><p><a href="https://clickallthethings.wordpress.com/2019/08/22/gozi-ursnif-8-22-2019-document-and-dropped-file-analysis/">Analysis</a> from another security researcher, <a href="https://www.twipu.com/jcarndt">Jammy</a> also suggests that the maldoc is part of an Gozi/Ursnif campaign. Another researcher, <a href="https://www.twipu.com/SecSome">SomeInfoSecJerk</a> also found a maldoc protected by password, 777 which dropped Gozi/Ursnif malware. Another similar sample that uses <em>wmic</em> to download an Gozi/Ursnif variant can be found <a href="https://app.any.run/tasks/dbd6aee0-0dca-4071-b0d1-f64f6702be42/">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/367/0*H4kTvtT2uUNvU361" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/0*lIKJm66Sk4PlSC23" /></figure><h3>A Variant</h3><p>Unlike the Ursnif downloader sample analyzed by <a href="https://www.fortinet.com/blog/threat-research/ursnif-variant-spreading-word-document.html">Fortinet</a> (which uses <em>PowerShell</em> commands), the sample that I’ve analyzed downloads the malware by executing <em>JavaScript</em> code embedded inside a <em>xsl</em> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*5mcli0CuIDNPv8VJ" /></figure><h3>Domain Information</h3><p>According to VirusTotal (VT), as on 3rd September 2019, <em>wlibby71e.com</em> was being served by <em>185.174.172.98 </em>(enclosed in green below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*dp-73J9OhFCohDO2" /></figure><p>According to <a href="https://www.whois.com/whois/">Whois</a> records, <em>wlibby71e.com</em> was registered on 22nd August 2019 by registrar, <em>ERANET INTERNATIONAL LIMITED.</em> According to <a href="http://www.eranet.com/news/Mess_68416.html">this</a> page, the said registrar was founded in 2000 and is based in China. The registrar’s contact phone has country code, <em>+86</em> which belongs to China as well. The name servers are registered on the domain, dnspod.com and<em> DNSPod</em> is a DNS service provider based in China.</p><p>The above information suggests that this malware campaign may be orchestrated by a Chinese actor or someone who has made it look like a Chinese actor. However, there is no evidence to prove either case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*KqKS0W6FxG5CFK-4" /></figure><p>A Google search to find presence of the string, <em>wlibby71e.com</em> before August 22nd 2019 did not reveal anything substantial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*K7KekT3PxaJrdmcE" /></figure><h3>IP Information</h3><p><em>185.174.172.98</em> is mapped to <a href="https://mxtoolbox.com/SuperTool.aspx?action=ptr%3a185.174.172.98&amp;run=toolpage"><em>vps29604nl.hyperhost.name</em></a> according to a reverse IP lookup on <a href="https://mxtoolbox.com/SuperTool.aspx?action=ptr%3a185.174.172.98&amp;run=toolpage">this</a> page. The domain’s registrar is <em>Center of Ukrainian Internet Names (UKRNAMES)</em> which is based in Ukraine. <em>Whois </em>information for the said domain is available <a href="https://www.whois.com/whois/hyperhost.name">here</a>.</p><p>The above information suggests that the C&amp;C server (with domain, <em>wlibby71e.com</em>) was hosted on a Virtual Private Server (VPS). So, geo-locating the IP isn’t very useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*AzJP-zGQ2DXcBwdv" /></figure><h3>STIX Feed</h3><pre>{<br>&quot;type&quot;: &quot;bundle&quot;,<br>&quot;id&quot;: &quot;bundle--e8b3e0c9-e43e-4aec-a2de-7ad5337040dc&quot;,<br>&quot;spec_version&quot;: &quot;2.0&quot;,<br>&quot;objects&quot;: [<br>{&quot;type&quot;: &quot;malware&quot;,<br>&quot;id&quot;: &quot;malware--0999ea0c-a6f2-4c46-b2ee-3ea923848753&quot;,<br>&quot;created&quot;: &quot;2019-09-13T20:05:00.000Z&quot;,<br>&quot;modified&quot;: &quot;2019-09-14T00:16:20.696Z&quot;,<br>&quot;name&quot;: &quot;Gozi/Ursnif Downloader&quot;,<br>&quot;description&quot;: &quot;Downloads a Gozi/Ursnif variant from a remote URL when opened in MS Word with macros enabled.&quot;,<br>&quot;labels&quot;: [ &quot;dropper&quot; ]<br>},<br>{<br>&quot;type&quot;: &quot;relationship&quot;,<br>&quot;id&quot;: &quot;relationship--4ad721d4-04d0-445d-a035-be35871f647d&quot;,<br>&quot;created&quot;: &quot;2019-09-14T00:16:20.712Z&quot;,<br>&quot;modified&quot;: &quot;2019-09-14T00:16:20.712Z&quot;,<br>&quot;relationship_type&quot;: &quot;indicates&quot;,<br>&quot;source_ref&quot;: &quot;indicator--23bbd32b-c98f-4a4a-b0ab-91aeabc7a58d&quot;,<br>&quot;target_ref&quot;: &quot;malware--0999ea0c-a6f2-4c46-b2ee-3ea923848753&quot; },<br>{<br>&quot;type&quot;: &quot;indicator&quot;,<br>&quot;id&quot;: &quot;indicator--23bbd32b-c98f-4a4a-b0ab-91aeabc7a58d&quot;,<br>&quot;created&quot;: &quot;2019-09-13T20:05:00.000Z&quot;,<br>&quot;modified&quot;: &quot;2019-09-14T00:16:20.697Z&quot;,<br>&quot;name&quot;: &quot;Gozi/Ursnif Downloader&quot;,<br>&quot;description&quot;: &quot;This file hash indicates that a sample of Gozi/Ursnif Downloader is present.&quot;,<br>&quot;pattern&quot;: &quot;[file:hashes.&#39;MD5&#39; = &#39;d4c7cadc810aeaf4397f1a1a245a35ea&#39;] AND [url:value = &#39;http://wlibby71e.com/qtra/ttqr.php?l=spxo9.j12&#39;]&quot;,<br>&quot;valid_from&quot;: &quot;2019-09-13T20:05:00Z&quot;,<br>&quot;labels&quot;: [ &quot;malicious-activity&quot; ]<br>}<br>]<br>}</pre><h3>Hashes</h3><p>ursnif.zip.zip</p><ul><li>MD5: <em>ed7af781dd9f2b13c17da952da0742d3</em></li><li>SHA256: <em>ed75e995bab56b1de4e25e453de84e0726ead021426d6bcbacf8c62e7385114f</em></li></ul><p>info_08.22.doc</p><ul><li>MD5: <em>d4c7cadc810aeaf4397f1a1a245a35ea</em></li><li>SHA256: <em>f8c81e287393aadfc13905f46aab34edd55eed46a57ffa4dc74346e438495d4e</em></li></ul><p>axJBYm.xsl</p><ul><li>MD5: <em>a8f0def13cb3fae52f6e06050513c2c8</em></li><li>SHA256: <em>f17da1f0dbf6f32579e75b600bfc6673fe04e4ccde57094feb1772387f153a1b</em></li></ul><h3>C&amp;C</h3><pre><a href="http://wlibby71e.com/qtra/ttqr.php?l=spxo9.j12">http://wlibby71e.com/qtra/ttqr.php?l=spxo9.j12</a></pre><p>Other URLs associated with this host are available <a href="https://urlhaus.abuse.ch/host/wlibby71e.com/">here</a> and in the screenshot below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*-hCK_HRmB2uAXH82" /></figure><p>The malware sample is a <em>.doc</em> file which has VBA macros embedded in it. The malicious code is executed when a user enables macros when the sample is opened in MS Word. It drops a <em>xsl</em> file on disk and executes the embedded JavaScript through <em>wmic</em>. The <em>xsl</em> file downloads a malware binary (Gozi/Ursnif variant) from a remote C&amp;C and executes it on the system.</p><p>In this article, I described my analysis for a VBA malware which downloads a Gozi/Ursnif variant. The VBA macros and the <em>xsl</em> file had lots of junk code, which I believe help the malware evade anti-virus software (untested hypothesis).</p><p>Thank you for reading! If you have any questions, leave them in the comments section below and I’ll get back to you as soon as I can!</p><p>Feature image credits:<a href="https://coderacademy.edu.au/blog/coding-starters/what-does-malware-analysis-involve"> https://coderacademy.edu.au/blog/coding-starters/what-does-malware-analysis-involve</a></p><p>P.S. I also write on my blog <a href="https://0x90sploiter.wordpress.com/?source=post_page---------------------------">https://0x90sploiter.wordpress.com</a>.</p><p><em>Originally published at </em><a href="https://0x90sploiter.wordpress.com/2019/09/10/malware-analysis-ursnif-downloader/"><em>http://0x90sploiter.wordpress.com</em></a><em> on September 10, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a9bb1646239" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Malware Analysis — NanoCore]]></title>
            <link>https://nikhilh20.medium.com/malware-analysis-nanocore-9024e9e9be7b?source=rss-e7692a561d6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9024e9e9be7b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[ka1d0]]></dc:creator>
            <pubDate>Thu, 05 Sep 2019 01:17:52 GMT</pubDate>
            <atom:updated>2019-09-06T04:00:24.160Z</atom:updated>
            <content:encoded><![CDATA[<h3>Malware Analysis — NanoCore + MITRE ATT&amp;CK Mapping</h3><p>In my <a href="https://0x90sploiter.wordpress.com/2019/09/01/malware-analysis-wannacry/">previous article</a>, we analyzed the famous ransomware, WannaCry which wreaked havoc in 2017. In this article, we’ll be looking at a variant of NanoCore which was found more recently — early 2019. This article will cover just basic dynamic analysis and so, it’s quite short.</p><p><strong>Note: </strong>I highly recommend reading my article on <a href="https://0x90sploiter.wordpress.com/2019/01/30/malware-analysis-infostealer-dyre-part-1/"><em>Infostealer.Dyre</em></a><em> </em>before reading this post. I’ve explained the test lab setup and basic malware analysis process in detail and that information will not be repeated in every article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*basUsoMPahNBhCim0WvG7w.png" /></figure><h3>Basic Static</h3><p>SHA256: <em>8394496d6464a1413c12ffddcf554da8f7ad3b1fdc9880d109b4f181078236c5</em></p><h3>What kind of file is it?</h3><p>The sample is a <em>.NET</em> file with a compilation timestamp of <em>Fri May 31 11:13:32 1985</em>. It is definitely obfuscated with some tool, as is evident from the function names / symbols.</p><h3>Basic Dynamic</h3><h3>What file system modifications does the sample make?</h3><p>The malware creates multiple files/directories under <em>C:\Users\\AppData\Roaming\\ </em>directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*h4B-wj1enyzV13GT" /></figure><p><em>run.dat</em> has obfuscated data of small length.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*9GQUtlNIVJMvSZt1" /></figure><p>It also copies itself to <em>C:\Users\\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\app.exe</em> and <em>C:\Users\\AppData\Roaming\BE5DE3F7–33F4–48F5–9438–0060EB487369\TCP Service\tcpsv.exe</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*FMBMj0GEYlyEV0SV" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*mdIEe_Ol_f7ii-Mj" /></figure><p>It then hooks into browsers present in the system and spies on user activity. In the image below, it can be seen that the malware tracked the user visiting <em>google.com</em> and <em>facebook.com</em> on Chrome and <em>google.com</em> and <em>bankofamerica.com</em> on IE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*56roK-3cg_g_1EiP" /></figure><p>The sample also keeps track of the processes that are spawned on the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*f9B445wRXLI9LnoC" /></figure><h3>What network activity exists?</h3><p>On execution, the malware periodically pings back obfuscated data to the C&amp;C server at <em>89.35.228.199</em> on port <em>3365</em>. We can expect this data to contain identifying information about the infected system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*B23EQi5GdzjDijQd" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*tTvQ_P17az5X_R4p" /></figure><h3>What processes are spawned when the sample is executed?</h3><p>When the sample is executed, it spawns a sub-process, <em>cmd.exe</em> to launch <em>app.exe</em> (same as the original sample). <em>app.exe</em> in turn spawns itself as an independent process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*pn5--Rc3tYf2ItEJ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*j4GC88O3wuWFiJoS" /></figure><h3>What modifications are made to the Registry and Startup activity?</h3><p>The malware achieves persistence by installing itself as a startup service in the <em>HKCU\SOFTWARE|Microsoft\Windows\CurrentVersion\Run</em> registry key. Unlike other malware that I’ve encountered, <em>NanoCore</em> installs itself as two separate startup services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*Vwtm-B7pHta0Y5tC" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*8qv1aaLOqVFVGHJf" /></figure><p>On system restart, even though there are two <em>NanoCore</em> instances that are started, only one remains at the end. The other one exits. The running <em>app.exe </em>process again connects to the C&amp;C on the same address and port.</p><h3>Mapping to MITRE ATT&amp;CK</h3><p>Let’s map <em>NanoCore’s</em> activity to MITRE ATT&amp;CK Framework:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*ejTr_56aeaoDf3Jtl3e2NA.png" /></figure><h3>Thanks for reading!</h3><p>In this article, I described my analysis for the RAT — <em>NanoCore</em>. I wasn’t able to de-obfuscate the EXE, so I presented only my basic analysis. This implies that the sample may be capable of more malicious behavior than what is described here. The malicious behavior may depend on the installed software or the OS itself or some other factor which can only be known through code analysis.</p><p>Thank you for reading! If you have any questions, leave them in the comments section below and I’ll get back to you as soon as I can!</p><p>Feature image credits: <a href="https://hackersonlineclub.com/malware-analysis/">https://hackersonlineclub.com/malware-analysis/</a></p><p>P.S. I also write on my blog <a href="https://0x90sploiter.wordpress.com/?source=post_page---------------------------">https://0x90sploiter.wordpress.com</a>.</p><p><em>Originally published at </em><a href="https://0x90sploiter.wordpress.com/2019/09/04/malware-analysis-nanocore/"><em>http://0x90sploiter.wordpress.com</em></a><em> on September 5, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9024e9e9be7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Malware Analysis — WannaCry]]></title>
            <link>https://nikhilh20.medium.com/malware-analysis-wannacry-b0d35f1b2033?source=rss-e7692a561d6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0d35f1b2033</guid>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[wannacry]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[malware]]></category>
            <dc:creator><![CDATA[ka1d0]]></dc:creator>
            <pubDate>Tue, 03 Sep 2019 17:04:57 GMT</pubDate>
            <atom:updated>2019-09-03T17:04:57.999Z</atom:updated>
            <content:encoded><![CDATA[<h3>Malware Analysis — WannaCry</h3><p>In the previous article, we analyzed an Android malware (<a href="https://medium.com/@nikhilh20/android-malware-analysis-droiddream-d06fc0d87bd2">DroidDream</a>) for a change. Now, we’re back to Windows malware and a very famous one at that! Many people have heard about the ransomware that we’ll be analyzing today — <em>WannaCry</em>. Unlike my other malware analysis related articles, I’ll be focusing solely on code analysis. I’ve not included any dynamic analysis information in this article.</p><p><strong>Note 1: </strong>I highly recommend reading my article on <a href="https://medium.com/@nikhilh20/basic-malware-analysis-infostealer-dyre-8eea577a8a19"><em>Infostealer.Dyre</em></a><em> </em>before reading this post. I’ve explained the test lab setup and basic malware analysis process in detail and that information will not be repeated in every article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*basUsoMPahNBhCim0WvG7w.png" /></figure><h3>Analysis</h3><h3>Dropper Static Analysis</h3><p>SHA256: <em>24d004a104d4d54034dbcffc2a4b19a11f39008a575aa614ea04703480b1022c</em></p><h3>What kind of file is it?</h3><p>The dropper is a <em>Microsoft Visual C++ PE</em> with a compilation timestamp of <em>Sat Nov 20 04:03:08 2010</em>. Fortunately, it’s not packed/encrypted. This information can be seen in the tool, <em>Detect-It-Easy (die)</em>.</p><h3>What are some interesting imports?</h3><p>Some interesting imports include <em>GetProcAddress, GetModuleHandleA, RegisterServiceCtrlHandlerA, CreateServiceA, RegSetValueEx, CryptGenRandom, CreateFileA, ReadFile</em>.</p><p>These imports can be seen in <em>PEstudio</em>. These suggest that the sample is involved in dynamic function imports, registry key-value pair modifications, cryptography and file system operations.</p><h3>What are some interesting cleartext strings?</h3><p>Some cleartext strings include <em>mssecsvc.exe, tasksche.exe, </em><a href="http://www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com,/"><em>http://www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com,</em></a><em> Global\MsWinZonesCacheCounterMutex, icacls . /grant Everyone:F /T /C /Q, attrib +h .</em></p><p>These strings can be seen in <em>PEstudio</em>. We can see a URL (which we’ll see later is the famous <em>WannaCry</em> kill-switch), mutex that the sample uses and file/directory attributes modifications.</p><h3>Does the sample have any embedded resources?</h3><p>Yes, the sample has an embedded executable. This resource can be found using the tool, <em>ResourceHacker</em>.</p><h3>Dropper Code Analysis</h3><p>The dropper exits if the URL, <a href="http://www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com/"><em>http://www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com</em></a> is available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*D2lXPX1bmu78K29M.png" /></figure><p>When the dropper is executed for the first time without any arguments, it installs/starts a service named, “<em>Microsoft Security Center (2.0) Service</em>” with the arguments, “<em>-m security</em>”. The service binary is the dropper itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/0*fgTnsef1wvwePjMI.png" /></figure><p>After starting the service, the dropper loads the embedded resource (<em>R1831</em> AKA <em>tasksche.exe</em>), writes the content into <em>C:\WINDOWS\tasksche.exe</em> and starts it as a process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*xoi3_HWRutK5_Q772KC6nw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*GbIJ7saQLuKJ7NAY0Vf59w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*7uPAw5bPCh8cIRWxA8VVyg.png" /></figure><p>The service, “<em>Microsoft Security Center (2.0) Service</em>” which when started with “<em>-m security</em>” arguments begins to exploit <em>EternalBlue</em> and <em>DoublePulsar</em> vulnerabilities on other connected computers through its <em>ServiceMain</em> function. This constitutes the propagation mechanism of <em>WannaCry</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/0*VkNY8ecvxsPOl6j_.png" /></figure><h3>tasksche.exe Code Analysis</h3><p>SHA256: <em>ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa</em></p><p>First, <em>tasksche.exe</em> gets the local computer name and obfuscates it.</p><p>If it is started with “<em>/i</em>” argument:</p><ul><li>It copies itself to “<em>C:\ProgramData\&lt;obfuscatedComputerName&gt;\tasksche.exe</em>”.</li><li>After the copy, it tries to start <em>C:\ProgramData\&lt;obfuscatedComputerName&gt;\tasksche.exe</em> as a service. If it fails, it tries to start it as a process.</li><li>If the system has a global mutex named, “<em>MsWinZonesCacheCounterMutex</em>”, then <em>tasksche.exe</em> exits. The presence of this mutex indicates that a sample of <em>WannaCry</em> is already active on the system.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*Ltk7H6khyC4aG7UuNMmjUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*w5RmlBvCt3WTLsNhyoCgBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*RsGHNeKHZIPwZidYeOalyw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*beJjQQ8oc3slcAsh2OVHLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*PEWV5RqE2cJvZNOkIh6uZQ.png" /></figure><p>Next, an embedded ZIP file is extracted using the password, <em>WNcry@2ol7</em>. The contents are extracted in the directory where <em>tasksche.exe</em> is located.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/0*nsF-BqRuq7Oh9CVN.png" /></figure><p><em>tasksche.exe </em>then loads bitcoin wallet addresses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/0*XJw8aQuzAYs3VT92.png" /></figure><p>It reads <em>c.wnry</em> which contains TOR zip information, its configuration data and multiple <em>.onion</em> addresses:</p><ol><li><em>gx7ekbenv2riucmf.onion</em></li><li><em>57g7spgrzlojinas.onion</em></li><li><em>xxlvbrloxvriy2c5.onion</em></li><li><em>76jdd2ir2embyv47.onion</em></li><li><em>cwwnhwhlz52maqm7.onion</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5BykBbICTZkanULcarMhlw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*1Hri1duHunlwMr3RQFxCWg.png" /></figure><p>It changes the attributes of the files/directory where the zip files were extracted into. It hides the contents of that directory and grants full access to all files in the directory to all users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/0*Rf0qDbDFMoMgxMUv.png" /></figure><p>It retrieves the cryptographic key provider — <em>Microsoft Enhanced RSA and AES Cryptographic Provider</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/0*iMPGzXVw5cLTODQP.png" /></figure><p><em>tasksche.exe</em> starts reading <em>t.wnry</em>. It determines the integrity of <em>t.wnry</em> by checking if the first 8 bytes of the file is <em>WANACRY!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/0*TIXEBRynMtuxDyLU.png" /></figure><p>It proceeds to read the encrypted AES key which is decrypted using the hard-coded public key present in <em>tasksche.exe</em>. The decrypted AES key is then used to decrypt a DLL in memory. The decrypted DLL code is then copied over to the heap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*M8URwwK6gJLla2VN-SQ6bA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*KVkPqOhoJpx8eUCSoWnZ_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*volM4rE6B4m7uJFec5Vlhg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*9X_PiNBMnd2kItbaOwJ78A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*U9WD7fpSHKd-FWxv95WUbg.png" /></figure><p>Next, the function <em>TaskStart</em> (exported by the DLL) is called. This function does the following actions through threads:</p><ol><li>Retrieve the public key used to encrypt files on the system,</li><li>Create a global mutex named, “<em>MsWinZonesCacheCounterMutex</em>”,</li><li>Set the registry key-value pair: “<em>HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run\&lt;obfuscatedComputerName&gt; = &lt;tasksche.exeFilePath&gt;</em>”,</li><li>Encrypt files on the system.</li><li>Rename file extensions to <em>.WNCRY</em>. (It also has code for attaching other extensions like <em>.WNCRYT</em> and <em>.WNCYR</em>.), and</li><li>Start multiple processes — <em>taskdl.exe,</em> <em>taskse.exe</em> and<em> @WanaDecryptor@.exe</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*Vi2fFnVy7VsTjQdVmTyOuQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*PzfBpYyUo-vCcqOZOFoIeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*72EEWhCqcFoyt0ej4RbQ_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*U9r5QGXjGhdBBEnbG2DJCg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*zd7Nhy9LNz-QVbRuOCd1Zg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*1YcDTmEDMy3crzOAmYZUeA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*qVO6DacwUB3Z1OmlS_1amQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*3KCguNmBlc4fGgP926s1pQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*dMKfPbOPoXVF4HYYkOSQKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*4QOjV2j1qF5nf069yW7DpA.png" /></figure><h3>Other Dropped Files</h3><h4>taskse.exe</h4><p>Responsible for enumerating all active RDP sessions and executing <em>tasksche.exe</em> in each session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/309/0*pphHxnUYuPk7i1zT.png" /></figure><h4>@WanaCryptor@.exe (AKA u.wnry)</h4><p>Responsible for showing the timer and payment window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BBZFBhHFO7EunyG6.png" /></figure><h4>taskdl.exe</h4><p>I did not analyze the code for this EXE. FireEye <a href="https://www.fireeye.com/blog/threat-research/2017/05/wannacry-malware-profile.html">states in their blog</a> that this binary is used for deleting temporary files.</p><h4>r.wnry</h4><p>Shows the ransom message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nj1mfekTtYX58oub.png" /></figure><h4>s.wnry</h4><p>Contains TOR executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/0*s2DjG6w-kCJBz5GY.png" /></figure><h4>msg/</h4><p>Contains language files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/0*TkSnuRbTeUdLK-gi.png" /></figure><p>Other dropped files include <em>f.wnry</em> and <em>b.wnry </em>whose functions/usage I’ve not explored.</p><h3>YARA Rules</h3><h3>Creation</h3><pre>root@malnet:/opt/yarGen-0.21.2# python yarGen.py --opcodes -a &quot;Nikhil Hegde&quot; --oe --score -m /root/malware/Wannacry/dropper.bin/<br>###############################################################################<br>______<br>__ ______ ______/ ____/__ ____<br>/ / / / __ `/ ___/ / __/ _ \/ __ \<br>/ /_/ / /_/ / / / /_/ / __/ / / /<br>\__, /\__,_/_/ \____/\___/_/ /_/<br>/____/</pre><pre>Yara Rule Generator by Florian Roth<br>December 2018<br>Version 0.21.1</pre><pre>###############################################################################<br>[+] Using identifier &#39;dropper.bin&#39;<br>[+] Using reference &#39;<a href="https://github.com/Neo23x0/yarGen&#39;">https://github.com/Neo23x0/yarGen&#39;</a><br>[+] Using prefix &#39;dropper.bin&#39;<br>[+] Processing PEStudio strings ...<br>[+] Reading goodware strings from database &#39;good-strings.db&#39; and &#39;good-opcodes.db&#39; ...<br>(This could take some time and uses at least 6 GB of RAM)<br>[+] Loading ./dbs/good-strings-part4.db ...<br>...<br>...<br>[+] Processing /root/malware/Wannacry/dropper.bin/XIA2058.zip ...<br>[+] Processing /root/malware/Wannacry/dropper.bin/XIA2058/c.wnry ...<br>[+] Processing /root/malware/Wannacry/dropper.bin/XIA2058/b.wnry ...<br>[+] Processing /root/malware/Wannacry/dropper.bin/XIA2058/r.wnry ...<br>[+] Processing /root/malware/Wannacry/dropper.bin/XIA2058/t.wnry ...<br>[+] Processing /root/malware/Wannacry/dropper.bin/XIA2058/u.exe ...<br>[-] Extracting OpCodes: /root/malware/Wannacry/dropper.bin/XIA2058/u.exe<br>[+] Processing /root/malware/Wannacry/dropper.bin/XIA2058/taskdl.exe ...<br>[-] Extracting OpCodes: /root/malware/Wannacry/dropper.bin/XIA2058/taskdl.exe<br>[+] Processing /root/malware/Wannacry/dropper.bin/XIA2058/s.zip ...<br>[+] Processing /root/malware/Wannacry/dropper.bin/XIA2058/taskse.exe ...<br>[-] Extracting OpCodes: /root/malware/Wannacry/dropper.bin/XIA2058/taskse.exe<br>...<br>...<br>[+] Generating Super Rules ... (a lot of foo magic)<br>[-] Adding Super Rule with 5721 strings.<br>[-] Adding Super Rule with 29 strings.<br>[+] Generating Simple Rules ...<br>[-] Applying intelligent filters to string findings ...<br>[-] Filtering string set for /root/malware/Wannacry/dropper.bin/dropper.exe ...<br>[-] Filtering opcode set for /root/malware/Wannacry/dropper.bin/dropper.exe ...<br>[-] Filtering string set for /root/malware/Wannacry/dropper.bin/XIA2058/u.exe ...<br>[-] Filtering opcode set for /root/malware/Wannacry/dropper.bin/XIA2058/u.exe ...<br>[-] Filtering string set for /root/malware/Wannacry/dropper.bin/XIA2058/taskse.exe ...<br>[-] Filtering opcode set for /root/malware/Wannacry/dropper.bin/XIA2058/taskse.exe ...<br>[-] Filtering string set for /root/malware/Wannacry/dropper.bin/XIA2058/taskdl.exe ...<br>[-] Filtering opcode set for /root/malware/Wannacry/dropper.bin/XIA2058/taskdl.exe ...<br>[-] Filtering string set for /root/malware/Wannacry/dropper.bin/R1831.exe ...<br>[-] Filtering opcode set for /root/malware/Wannacry/dropper.bin/R1831.exe ...<br>[+] Generating Super Rules ...<br>[=] Generated 5 SIMPLE rules.<br>[=] Generated 2 SUPER rules.<br>[=] All rules written to yargen_rules.yar<br>[+] yarGen run finished</pre><h3>Verification</h3><pre>root@malnet:~/malware/Wannacry/dropper.bin# yara -r yargen_rules.yar .<br>_root_malware_Wannacry_dropper_bin_XIA2058_taskse ./XIA2058/taskse.exe<br>_root_malware_Wannacry_dropper_bin_XIA2058_taskdl ./XIA2058/taskdl.exe<br>_root_malware_Wannacry_dropper_bin_XIA2058_u ./XIA2058/u.exe<br>_dropper_R1831_u_1 ./XIA2058/u.exe<br>_root_malware_Wannacry_dropper_bin_dropper ./R1831.exe<br>_root_malware_Wannacry_dropper_bin_R1831 ./R1831.exe<br>_dropper_R1831_0 ./R1831.exe<br>_root_malware_Wannacry_dropper_bin_dropper ./dropper.exe<br>_root_malware_Wannacry_dropper_bin_R1831 ./dropper.exe<br>_dropper_R1831_0 ./dropper.exe</pre><h3>SHA256 Hashes</h3><ul><li>Dropper: <em>24d004a104d4d54034dbcffc2a4b19a11f39008a575aa614ea04703480b1022c</em></li><li>tasksche.exe: <em>ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa</em></li><li>taskdl.exe: <em>4a468603fdcb7a2eb5770705898cf9ef37aade532a7964642ecd705a74794b79</em></li><li>taskse.exe: <em>2ca2d550e603d74dedda03156023135b38da3630cb014e3d00b1263358c5f00d</em></li><li>@WanaCryptor@.exe: <em>b9c5d4339809e0ad9a00d4d3dd26fdf44a32819a54abf846bb9b560d81391c25</em></li></ul><h3>Thanks for reading!</h3><p>In this article, I described my analysis for the ransomware — <em>WannaCry</em>. It wasn’t easy and it took me many days to analyze the sample. This is the first time I’ve described assembly program analysis and as such, I’ve minimized the details to keep the article from becoming too lengthy.</p><p>Thank you for reading! If you have any questions, leave them in the comments section below and I’ll get back to you as soon as I can!</p><p>Feature image credits: <a href="https://hackersonlineclub.com/malware-analysis/">https://hackersonlineclub.com/malware-analysis/</a></p><p>P.S. I also write on my blog <a href="https://0x90sploiter.wordpress.com/?source=post_page---------------------------">https://0x90sploiter.wordpress.com</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0d35f1b2033" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android Malware Analysis — DroidDream]]></title>
            <link>https://nikhilh20.medium.com/android-malware-analysis-droiddream-d06fc0d87bd2?source=rss-e7692a561d6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d06fc0d87bd2</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[ka1d0]]></dc:creator>
            <pubDate>Sun, 28 Jul 2019 00:19:57 GMT</pubDate>
            <atom:updated>2019-07-28T00:44:33.581Z</atom:updated>
            <content:encoded><![CDATA[<h3>Android Malware Analysis — DroidDream</h3><p>All the malware analysis related articles on my <a href="https://0x90sploiter.wordpress.com/">blog</a> so far have been PE malware. But malware isn’t restricted to Windows OS. There are malware for Linux, macOS, IoT-related OSes, etc. In this article, I’ll break down an Android malware called DroidDream which was infamous back in 2011. It affected Android versions before 2.3 (Gingerbread).</p><p>Android applications are written in Java. The <em>.class</em> bytecode (after compiling Java source code) is then converted to <em>.dex</em> bytecode (using the DEX compiler). The <em>.dex</em> bytecode is consumed by the Android RunTime (or Android Dalvik Virtual Machine for older Android versions) which sits on top of a HAL (Hardware Abstraction Layer) over Linux.</p><p>I was able to obtain DroidDream’s APK (Application Package) file sample from <a href="https://www.hybrid-analysis.com/sample/83e813b09918219649863cc7140d715d6df6e5fc77a208f6be6be48ec5a4a475">Hybrid-Analysis</a>. The APK zip file contains a <em>.dex</em> file which we’ll convert to a <em>.jar</em> file for analysis. The dex-to-jar conversion is lossy, so you will find many weirdly located break or return statements and loop expressions that don’t makes sense. Also, I’ve skipped dynamic analysis for this sample because my aim is to write about source code analysis.</p><p>Let’s get it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*basUsoMPahNBhCim0WvG7w.png" /></figure><h3>Basic Static Analysis</h3><h4>File Signature</h4><p><em>50 4B 03 04</em> is the APK file signature and is located at offset 0.</p><h4>Hashes</h4><p>MD5: <em>ecad34c72d2388aafec0a1352bff2dd9</em></p><p>SHA256: <em>83e813b09918219649863cc7140d715d6df6e5fc77a208f6be6be48ec5a4a475</em></p><h4>AndroidManifest.xml</h4><p>The <em>AndroidManifest.xml</em> file contains information about:</p><ul><li>Target Android SDK,</li><li>Entry Point of application,</li><li>Application Activities,</li><li>Spawned services, and</li><li>Permissions required by the application</li></ul><p>Also, DroidDream’s code is part of the main application, which in this case is Super Guitar Solo. So, the target Android SDK version may be relevant to the main application and not the malware. However, the malware is sure to run on versions before the target SDK version. In this case, DroidDream executed successfully on Android versions prior to Android Gingerbread (2.3).</p><p>The entry point of the application is the package, <em>com.android.root.main</em>. In this variant, only the <em>com.android.root.Setting</em> service is started by the malware. It also uses multiple permissions related to the Internet and phone calls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*Chk2in2XfTRwYCgx29Ggcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*jHiILiD8KdoZ-nguhCu_uQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*03eoUo6ZOcpy2Cuz9poayQ.png" /></figure><h3>Advanced Static Analysis</h3><p>The only important piece of code in <em>com.android.root.main.class</em> is the one which starts the service <em>com.android.root.Setting</em>. The rest of the code belongs to the main application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/0*5kFfApeiuprDzYB5" /></figure><p>The first item of interest is the decryption of a hard-coded encrypted URL using a hard-coded key. The <em>adbRoot.crypt()</em> function in <em>adbRoot.class</em> decrypts its argument using a single-key XOR operation. The decrypted URL is <a href="http://184.105.245.17:8080/GMServer/GMServlet"><em>http://184.105.245.17:8080/GMServer/GMServlet</em></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/0*TYR56V8KoLE83hai" /></figure><p>It then calls a few functions to determine device information, encrypts it using the same hard-coded key and POSTs it to the above URL in XML format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*Ndi1-11nBxtdMJ11X5jUUw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*C2vZu8N_SjN0zDod0lEg0w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*5Wwrszi75EqtsXjooU2Ofg.png" /></figure><p>After sending the device information, DroidDream proceeds to execute the <em>exploid</em> exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/0*20HVJZgUYr8ocrm2" /></figure><p>The <em>exploid</em> exploit is stored in a file in the <em>assets/exploid</em> file in the APK. The exploit is then run to escalate privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/0*NpliTgZT3KEfqap0" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/243/0*SbvG4CaLEdjHrrd9" /></figure><p>If the exploit is successful, the sample goes on to change the WiFi state. The source code here is quite confusing, so I’m not sure if my reasoning is correct. According to the code, it seems that the WiFi state is toggled but I can’t understand a reason to do so. It makes sense if the WiFi is turned on if it is turned off initially.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/0*FMXVwQZztUIOPNxs" /></figure><p>The sample proceeds to place the <em>su </em>binary in <em>/system/bin/</em> directory. The <em>su</em> binary must be called by an application to be given <em>root</em> access. In this case, the <em>su</em> binary is named <em>profile</em>. The ELF file, <em>assets/profile</em> is copied to <em>/system/bin/profile, </em>the SUID bit set on it and executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*5yc85yDj9L6ecLDZ" /></figure><p>Once the <em>su</em> binary is successfully placed, the sample restores WiFi state to its previous state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/0*Gk_qEW3P0TKjOdM1" /></figure><p>The sample then deletes the <em>exploid</em> file from the device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/0*8WPaxDdcwPCjpi_n" /></figure><p>Now, the sample is ready to execute another exploit, <em>RageAgainstTheCage</em> which will give it root access. The exploit is present in <em>assets/rageagainstthecage</em> file in the APK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/0*1ZF4-4qjfEjuiFTw" /></figure><p>At this point, if the exploit was successful the malware has root access on the device; the exploitation phase ends here. Post-exploitation phase starts now.</p><p>The sample checks if a package, <em>com.android.providers.downloadsmanager</em> is installed. If not, it copies the file <em>assets/sqlite.db</em> to <em>/system/app/DownloadProvidersManager.apk</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*tKAGZcQqfDcTCT1R" /></figure><p><em>DownloadProvidersManager.apk</em> is installed with <em>root </em>privileges in the ensuing block of code which is in the form of Java bytecode. Unfortunately, it looks like the person who submitted the sample modified it and commented out the entire <em>runRootCommand()</em> function.</p><p>While explaining the bytecode is out of scope, the function calls to install APKs (shown in <a href="https://stackoverflow.com/questions/35824445/installing-apk-on-android-device-via-adb-with-java-program-on-linux/54167709#54167709">this</a> SO article) are very similar to the invoked functions in the <em>runRootCommand() </em>bytecode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*poey_dcVuVE5hk2wNc0IqA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*AWrYqD2LpKGKc1pBTT0QJg.png" /></figure><p>After installing <em>DownloadProvidersManager.apk</em>, the <em>com.android.root.Setting</em> service exits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/114/0*f__3USplTwYouh69" /></figure><p><strong>Note: The analysis from this point forward is relevant to <em>DownloadProvidersManager.apk</em> file.</strong></p><h3>Basic Static Analysis</h3><h4>Hashes</h4><p>MD5: <em>a891aa9095fd2f21cedb41d882916b09</em></p><p>SHA256: <em>94ea44688feb558e2786e52fbfa46d90984e40c0980e28035fd2311d5f17f8e3</em></p><h4>AndroidManifest.xml</h4><p><em>DownloadProvidersManager.apk</em> is installed (with <em>root</em> privileges) as a broadcast receiver. It starts a service named <em>DownloadManageService</em> and requires several permissions as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*_64aLfjQrrjwbiNW6EbjVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*sqmCWow0tExZtuc85s4ZTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*twE9K8X5GIIsCCR_dFCPaA.png" /></figure><h3>Advanced Static Analysis</h3><p>The <em>DownloadManageService</em> service will be started when the device reboots or when the user makes a call-related action (picking up call, declining call, etc.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*WsQRtbcIp27wf71X" /></figure><p>A task is scheduled to run after 2 minutes and every 2 hours.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/0*5FGp73aEtyQkn1j7" /></figure><p>The main code of the task runs only between 23:00 and 08:00. This is also the time when most people sleep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/0*0yvA2EFZnwwASTI2" /></figure><p>It queries for downloaded applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*EFliFgvwbjGxEsyK" /></figure><p>It decrypts the URL with the same key as before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/0*6xByvFZtWfI4pQAi" /></figure><p>It builds an XML payload containing device and downloaded applications’ information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*yW8Nry3Gv7lrVWoJgul-3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*tbRkuGjPosrhY0Y9y_WQzg.png" /></figure><p>The sample embeds the XML payload in the URL that it decrypted before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/0*mrQM3-dEcmHB5k9a" /></figure><p>It then connects with the C&amp;C and sends user device information. The code responsible for this is in Java bytecode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*jF5bquYj1p_qEJ5aseF7PA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*zS8cAxxdIEC-hV9KhNLYwQ.png" /></figure><p>The sample then determines the next time to connect to the C&amp;C server and stores this value. I’m not sure where the sample gets this value from, but I believe in its communication with the C&amp;C server, it receives an XML payload which has an element named, <em>NextConnectTime</em> in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*fNInfI7jBiWjCb_sc8A-aw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*WS0-1OBzTfxq5FgV-TpEow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*2aph5TbvJiDNxW0kRAi5kw.png" /></figure><p>After storing device and downloaded applications’ information in its application database, the timed task completes.</p><h3>Summary</h3><p>DroidDream is an Android-based malware embedded inside another legitimate application. It uses the WiFi, multiple permissions, starts a background service and also, installs an embedded APK file. It executes two Linux local privilege exploits to escape the application sandbox and gain <em>root</em> access on the device. Since it achieves <em>root</em>, it is capable of virtually anything. However, the variant that I analyzed only periodically sent device and downloaded applications’ information to the C&amp;C server.</p><h3>Thanks for reading!</h3><p>In this article, I describe my analysis for an Android malware — DroidDream. After understanding the capabilities of an Android malware, it is quite frightening to realize that mobile devices are less protected than desktops or servers but the malware can be equally destructive.</p><p>Thank you for reading! If you have any questions, leave them in the comments section below and I’ll get back to you as soon as I can!</p><p>Feature image credits: <a href="https://hackersonlineclub.com/malware-analysis/">https://hackersonlineclub.com/malware-analysis/</a></p><p>P.S. I also write on my blog <a href="https://0x90sploiter.wordpress.com/?source=post_page---------------------------">https://0x90sploiter.wordpress.com</a>.</p><p><em>Originally published at </em><a href="https://0x90sploiter.wordpress.com/2019/07/27/android-malware-analysis-droiddream/"><em>http://0x90sploiter.wordpress.com</em></a><em> on July 28, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d06fc0d87bd2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pentesting — VulnHub: DC-2]]></title>
            <link>https://nikhilh20.medium.com/pentesting-vulnhub-dc-2-dd45c02a3031?source=rss-e7692a561d6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd45c02a3031</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[ka1d0]]></dc:creator>
            <pubDate>Thu, 27 Jun 2019 21:58:19 GMT</pubDate>
            <atom:updated>2019-06-27T22:00:33.985Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pentesting — VulnHub: DC-2</h3><p>In the <a href="https://0x90sploiter.wordpress.com/2019/06/27/pentesting-vulnhub-dc-1/">last article</a>, we rooted a VulnHub machine — DC-1. Moving on to the next machine in the series, we’re going to look at DC-2. The machine is available <a href="https://www.vulnhub.com/entry/dc-2,311/">here</a>.</p><p><strong>Note: The methodologies and tools that you learn from pentesting are real. Do NOT attempt to try and hack into machines you’re not authorized to. I will not be held responsible for your actions.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NgRYkwRRXDQ2sLsS_q1bZw.jpeg" /></figure><h3>Finding the IP Address of DC-2</h3><p>After powering up the machine in Workstation, the first step is to determine its IP address. We’ll need the IP address for all communications with DC-2. My personal choice is <em>netdiscover</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/0*V9C9mj20BaOpqGva" /></figure><p>So, the IP address of DC-1 is 192.168.248.140. Let’s modify our <em>/etc/hosts</em> file on Kali to reflect this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/0*PULs1yog6bUwcmo1" /></figure><h3>Deep Nmap Scan</h3><p>Now that we know the IP address of DC-2, we’ll scan it more deeply to get more information out of it. I have written a port scan bash script which is basically two nmap scans. The first scan determines open ports and the second scan uses the <em>-A</em> flag on those ports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*uoUweQUziNzbTQmj" /></figure><p>From the nmap scan, we can note the following:</p><ul><li>Software: Apache httpd 2.4.10, OpenSSH 6.7p1 Debian</li><li>OS: Linux 3.X</li></ul><p>Notice that OpenSSH is running on 7744. SSH on port 22 is not mandatory; it is just popular and expected. But essentially, SSH can be listening on any port.</p><h3>Port 80</h3><p>Port 80 served a WordPress website. Noted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*QTPMDNDPesnL2Sic" /></figure><p>The flag tab says, <em>Your usual wordlists probably won’t work, so instead, maybe you just need to be cewl.</em> This means that we may need to brute-force a login form using a custom wordlist. Nice tip!</p><h3>Dirbuster</h3><p>We don’t know where the login page is. So, we’ll use a website directory enumeration tool like <em>dirbuster</em> to find the URI of various web directories that are not visible to us right now. My standard <em>dirbuster</em> search configuration for Apache web server is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/0*WCABz44vetbdS19y" /></figure><p><em>dirbuster</em> found the URI of the web login page, <em>/wp-login.php</em>. Since this is a practice machine and the flag is quite obvious, you can stop enumerating directories. In reality, I feel it’s good to let it run for about half hour.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/0*KUpzmXb7qklalOvV" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*kXa8Fo5t6qY_iJNe" /></figure><h3>Brute Force!</h3><p>Remember that the flag mentioned <em>cewl</em>. It’s a tool to generate custom wordlists by parsing the content off a website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/0*o4u1OlB8bTjw_KWC" /></figure><p>Now that we have our custom wordlist, we’ll brute force the credentials of the WordPress login form. There is a tool called <em>wpscan</em> which will be helpful here. If you know how to use <em>hydra</em>, you can use that as well.</p><p>Command: <em>wpscan -url </em><a href="http://dc-2/"><em>http://dc-2</em></a><em> -enumerate -w /path/to/cewl/wordlist/dc2_wordlist.txt</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*JKVzGojEusf3OLGt" /></figure><p>We didn’t get the <em>admin</em> password, but that’s okay. We got credentials of two others. Nice! Now that we have user access to the web portal, the next step is to find a location to upload a shell script.</p><h3>Y U NO Upload?</h3><p>I found an upload location in the <em>Media Library</em> section but that was a dead-end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/0*vQzjmI3sxxMovmue" /></figure><p>GTFOBins</p><p>I wanted to try another bypass technique using Burp Proxy, but then I remembered that users reuse passwords.</p><h3>Consequences of Password Reuse</h3><p>Remember that SSH is running on port 7744. Before I dive into serious shell upload bypass techniques, I wanted to test my hypothesis that either <em>jerry</em> or <em>tom</em> might have used the same password for their SSH logins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/0*4hvY_56OsipcpIyF" /></figure><p>And indeed! <em>tom</em> reused his web portal credentials for SSH login. This is why it’s important to have different passwords for different portals.</p><h3>Breaking out of Restricted Shell</h3><p>You might have noticed that the shell that we got is very restricted. There’s not much we can work with. Let’s break out! <em>vi</em> is a great friend!</p><p>Type <em>vi</em> at the console and press <em>Enter</em>. Type the following commands into <em>vi</em>:</p><p>These commands set a configuration variable, <em>shell</em> and then call it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*3zSWQTwCzD4sznfT" /></figure><p>We’re free!</p><h3>Lateral Movement</h3><p>We still have privileges of <em>tom</em>. Let’s check what programs <em>tom</em> can execute as <em>root</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/0*xiePrfQ7iNsOTmrJ" /></figure><p>Ah, well. We need to somehow switch to another user account. <em>jerry </em>did not reuse his web credentials in SSH.</p><p>Another flag in <em>tom</em>’s home directory says <em>Poor old Tom is always running after Jerry. Perhaps he should su for all the stress he causes.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*Tx9KVPEYFNos8au5" /></figure><p>Turns out <em>jerry</em> reused his web credentials in his system account! Nice!</p><h3>Privilege Escalation</h3><p>Let’s check what programs <em>jerry</em> can execute as <em>root</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*NEwthHTi4NaPJNKW" /></figure><p>So, we can execute <em>git</em> with <em>root</em> privileges. Let’s head off to <a href="https://gtfobins.github.io/">GTFOBins</a> and see how <em>git</em> can be used to escalate privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*KM_bjRWN2zG70GXI" /></figure><p>So, I need to set a <em>PAGER</em> environment variable with the mentioned value. DC-2 does not allow me to preserve the environment, so the <em>-E</em> flag must not be used with <em>sudo</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/0*bfpXlJXBqhnth10J" /></figure><p>Note: On executing <em>sudo git help config</em>, a <em>vi</em> like editor opens where you need to type <em>!/bin/sh</em> as mentioned in GTFOBins. You’ll then get the <em>root </em>shell.</p><p>Nice! We have <em>root</em> shell and we have successfully compromised the DC-2 machine!</p><h3>Thank you for reading!</h3><p>In this article, we used a different methodology compared to DC-1. We did not upload any shell script after we logged into WordPress. Instead, we exploited the fact that users reuse their credentials in different services. We also looked at a technique that uses <em>vi</em> to break out of a restricted shell. We also learnt how to find programs that can be executed with <em>root</em> privileges.</p><p>Things are slowly getting spicy, are they not? If you have any questions, leave them in the comments section below and I’ll get back to you as soon as I can!</p><p>P.S. I also write on my blog <a href="https://0x90sploiter.wordpress.com/">https://0x90sploiter.wordpress.com</a>.</p><p>Feature image credit: <a href="https://www.360logica.com/blog/different-methodologies-penetration-testing/">https://www.360logica.com/blog/different-methodologies-penetration-testing/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd45c02a3031" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pentesting — VulnHub: DC-1]]></title>
            <link>https://nikhilh20.medium.com/pentesting-vulnhub-dc-1-86cc001659f4?source=rss-e7692a561d6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/86cc001659f4</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[vulnhub]]></category>
            <dc:creator><![CDATA[ka1d0]]></dc:creator>
            <pubDate>Thu, 27 Jun 2019 20:02:08 GMT</pubDate>
            <atom:updated>2019-06-27T21:54:13.321Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pentesting — VulnHub: DC-1</h3><p>This post is one of the many that I’ll be writing on basic pentesting. <a href="https://www.vulnhub.com/">VulnHub</a> is a fantastic starting point for those who are beginners to pentesting and as such, all the machines that we’ll be hacking into are available as <em>.ova</em> downloads on VulnHub. I usually always import them into VMware Workstation, just because I’m more comfortable with Workstation than VirtualBox.</p><p>I’ll be using Kali Linux as my attacking machine. Since I’m preparing for the OSCP, my Kali Linux is not the standard release. Instead, I’ve downloaded an image provided by Offensive Security, so there might be some tools that I use which might not be present in your installation. In such cases, it is very easy to install the tools as they are popular and easily available.</p><p>The vulnerable machine that we’ll be using in this article is available <a href="https://www.vulnhub.com/entry/dc-1,292/">here</a>.</p><p><strong>Note: The methodologies and tools that you learn from pentesting are real. Do NOT attempt to try and hack into machines you’re not authorized to. I will not be held responsible for your actions.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NgRYkwRRXDQ2sLsS_q1bZw.jpeg" /></figure><h3>Finding IP Address of DC-1</h3><p>After powering up the machine in Workstation, the first step is to determine its IP address. We’ll need the IP address for all communications with DC-1. My personal choice is <em>netdiscover</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/0*LZXiHgJ9_Vx0XiYC" /></figure><p>So, the IP address of DC-1 is 192.168.248.144. Let’s modify our <em>/etc/hosts</em> file on Kali to reflect this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/0*3IRyRhQ16-60MWhD" /></figure><h3>Deep Nmap Scan</h3><p>Now that we know the IP address of DC-1, we’ll scan it more deeply to get more information out of it. I have written a port scan bash script which is basically two nmap scans. The first scan determines open ports and the second scan uses the <em>-A</em> flag on those ports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/0*NRhBVFHDFrvcxNPN" /></figure><p>From the nmap scan, we can note the following:</p><ul><li>Software: OpenSSH 6.0p1 Debian 4+deb7u7, Apache httpd 2.2.22, Drupal 7</li><li>OS: Linux 3.X</li></ul><p>OpenSSH 6.0p1 was released on 2012–04–22, which is quite old so there might be vulnerabilities in it. However, we have more interesting and possibly easy entry options through port 80, so let’s go for that route first.</p><h3>Port 80</h3><p>Port 80 served a Drupal login form. Noted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/0*tMex9qMC9K8gQ5yu" /></figure><p>From the nmap scan, we know the <em>robots.txt</em> file contains many entries, so let’s look into that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/0*PGaWb8ORxTFeJ3Er" /></figure><p>It looks like the interesting pages like / <em>admin</em> and <em>/cron.php</em> are behind the login page that we saw. Noted.</p><p>For now, I don’t see any point in running <em>dirbuster</em> or other website directory enumeration tools since <em>robots.txt</em> gave us information about it.</p><h3>Searchsploit</h3><p>Let’s see if <em>searchsploit</em> gives us any interesting Drupal 7 exploits that we can use to log into the web application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/0*YpAbeUa5OpzUe90e" /></figure><p>Let’s look at <em>‘Drupalgeddon’ SQL Injection (Add Admin User)</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/0*gC60CIU_WnN6whAg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*HxrBgEJiIVDJh1ad" /></figure><p>Looks like it was a success! We’re now logged into the web application as a Drupal 7 admin user. Our next aim is to find a location where we can upload a shell script.</p><h3>Initial Access — Shell Upload and Execute</h3><p>I found an <a href="https://blog.csdn.net/nixawk/article/details/46365671">article</a> through Google-fu which outlines how to upload a shell on Drupal 7. Besides the steps in the article, there’s one additional step in our situation — to allow permissions for all users on the PHP filter module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*zALrqPznrHcrQKwc" /></figure><p>Once that is done, you’ll have a page like the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*H0n6cVf788JaHr-J" /></figure><p>Upload a simple PHP reverse shell. Remember to change the IP address to your Kali’s IP. You can also change the port number if you feel like doing so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/0*jP-x9cw-82cUj8sr" /></figure><p>Start a netcat listener — <em>sudo nc -nlvp 443</em> — on Kali and execute the shell from the browser (or even <em>curl</em>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/0*JMzYRyc3YCMCbKKZ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/0*kTxLvLz0yz2O2DOu" /></figure><p>Nice! We now have a low privilege <em>www-data</em> user shell. Our next step would be to find a way to escalate privileges to another user or even <em>root</em> if possible.</p><p>In the raw shell that we receive on our netcat listener, you’ll notice that there is no auto-complete feature, command history, etc. But we can get all of those nice things! Follow these steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/0*EpJ7PhLeedLPSYLw" /></figure><h3>Privilege Escalation</h3><p>Let’s find all programs which have the SUID bit set. I search for them specifically because when they are executed, they run with the privileges of their owner. If the owner is <em>root</em> and the program itself is vulnerable, we have a chance of escalating our privileges to <em>root</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/0*-PjSGzaluOpPKFx3" /></figure><p>Focus on the <em>/usr/bin/find</em> program. <em>find </em>allows you to execute commands. In this case, it has the SUID bit set and it will run with <em>root</em> privileges. Nice! Let’s head off to <a href="https://gtfobins.github.io/">GTFOBins</a> to find (pun unintended!) how to exploit this weakness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*ZbYTJ7D45zPwu8bG" /></figure><p>So, the command that will (hopefully) give us <em>root</em> shell is <em>/usr/bin/find . -exec /bin/sh \; -quit</em>. I omit the <em>-p</em> flag because DC-1 is a Debian machine (verify with <em>uname -a</em> command).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*Iu1gyPNY431ndzbb" /></figure><p>Nice! We have <em>root</em> shell and we have successfully compromised the DC-1 machine!</p><h3>Thank you for reading!</h3><p>In this article, I gave you a small glimpse into the pentesting world. The methodology that we used in this article was very simple. We got a login form; got an exploit to get in; easily uploaded a shell; easily escalated privileges. This was a very simple machine to crack, even though you may not feel so at this point and that’s okay! You’re learning and I feel your pain!</p><p>Things will start getting spicy in the coming weeks, so hold on tight! If you have any questions, leave them in the comments section below and I’ll get back to you as soon as I can!</p><p>P.S. I also write on my blog <a href="https://0x90sploiter.wordpress.com/">https://0x90sploiter.wordpress.com</a>.</p><p>Feature image credit: <a href="https://www.360logica.com/blog/different-methodologies-penetration-testing/">https://www.360logica.com/blog/different-methodologies-penetration-testing/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86cc001659f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[String Deobfuscation using SMT Solver]]></title>
            <link>https://nikhilh20.medium.com/string-deobfuscation-using-smt-solver-eba5816ccbf5?source=rss-e7692a561d6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/eba5816ccbf5</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[ka1d0]]></dc:creator>
            <pubDate>Sun, 12 May 2019 02:17:04 GMT</pubDate>
            <atom:updated>2019-05-12T02:19:43.628Z</atom:updated>
            <content:encoded><![CDATA[<p>Most malware authors employ string obfuscation techniques to hide important strings from malware analysts. Usually, my approach to deobfuscating these strings would be to either execute the malware sample under a debugger or codify the decoding scheme in a high-level language like Python.</p><p>These methods work well. Even if the malware employs anti-debugging techniques, they can be bypassed by carefully stepping through instructions in debuggers like OllyDbg, x64dbg, etc. However, it cannot be denied that it is hard work. Codifying the decoding scheme in a high-level language by studying the assembly code is quite prone to errors. If a mistake does occur, it is again hard work to find the faulty statement(s).</p><p>Enter, <em>Satisfiability Modulo Theories</em> (SMT). In simple words, it is a computer science concept which involves building a formula (or expression) and finding inputs that satisfy the said formula. With respect to string deobfuscation, it has the potential to find the input to an algebraic-like (or combinatoric) encoding scheme, provided the obfuscated string is available. Also, I don’t have to codify the decoding scheme, instead I codify the encoding scheme which is relatively easier because I just have to copy the assembly instruction’s functionality line by line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*xVr5x0eZq_7j7C-DlGVXvw.png" /></figure><h3>Sample Encoding Scheme</h3><p>Consider the simple encoding scheme shown in the snap below. It is not very sophisticated, but it serves the purpose for now.</p><pre>0x0000000000000844 &lt;+0&gt;: push rbp<br>0x0000000000000845 &lt;+1&gt;: mov rbp,rsp<br>0x0000000000000848 &lt;+4&gt;: push rbx<br>0x0000000000000849 &lt;+5&gt;: sub rsp,0x28<br>0x000000000000084d &lt;+9&gt;: mov QWORD PTR [rbp-0x28],rdi<br>0x0000000000000851 &lt;+13&gt;: mov DWORD PTR [rbp-0x14],0x0<br>0x0000000000000858 &lt;+20&gt;: jmp 0x8d3 &lt;encode+143&gt;<br>0x000000000000085a &lt;+22&gt;: mov eax,DWORD PTR [rbp-0x14]<br>0x000000000000085d &lt;+25&gt;: movsxd rdx,eax<br>0x0000000000000860 &lt;+28&gt;: mov rax,QWORD PTR [rbp-0x28]<br>0x0000000000000864 &lt;+32&gt;: add rax,rdx<br>0x0000000000000867 &lt;+35&gt;: movzx eax,BYTE PTR [rax]<br>0x000000000000086a &lt;+38&gt;: add eax,0x4<br>0x000000000000086d &lt;+41&gt;: mov ecx,eax<br>0x000000000000086f &lt;+43&gt;: mov eax,DWORD PTR [rbp-0x14]<br>0x0000000000000872 &lt;+46&gt;: movsxd rdx,eax<br>0x0000000000000875 &lt;+49&gt;: mov rax,QWORD PTR [rbp-0x28]<br>0x0000000000000879 &lt;+53&gt;: add rax,rdx<br>0x000000000000087c &lt;+56&gt;: xor ecx,0xc<br>0x000000000000087f &lt;+59&gt;: mov edx,ecx<br>0x0000000000000881 &lt;+61&gt;: mov BYTE PTR [rax],dl<br>0x0000000000000883 &lt;+63&gt;: mov eax,DWORD PTR [rbp-0x14]<br>0x0000000000000886 &lt;+66&gt;: movsxd rdx,eax<br>0x0000000000000889 &lt;+69&gt;: mov rax,QWORD PTR [rbp-0x28]<br>0x000000000000088d &lt;+73&gt;: add rax,rdx<br>0x0000000000000890 &lt;+76&gt;: movzx eax,BYTE PTR [rax]<br>0x0000000000000893 &lt;+79&gt;: movsx eax,al<br>0x0000000000000896 &lt;+82&gt;: mov esi,0x3<br>0x000000000000089b &lt;+87&gt;: mov edi,eax<br>0x000000000000089d &lt;+89&gt;: call 0x73a &lt;logical_shift_right&gt;<br>0x00000000000008a2 &lt;+94&gt;: mov esi,eax<br>0x00000000000008a4 &lt;+96&gt;: mov eax,DWORD PTR [rbp-0x14]<br>0x00000000000008a7 &lt;+99&gt;: movsxd rdx,eax<br>0x00000000000008aa &lt;+102&gt;: mov rax,QWORD PTR [rbp-0x28]<br>0x00000000000008ae &lt;+106&gt;: add rax,rdx<br>0x00000000000008b1 &lt;+109&gt;: movzx eax,BYTE PTR [rax]<br>0x00000000000008b4 &lt;+112&gt;: movsx eax,al<br>0x00000000000008b7 &lt;+115&gt;: shl eax,0x5<br>0x00000000000008ba &lt;+118&gt;: mov ecx,eax<br>0x00000000000008bc &lt;+120&gt;: mov eax,DWORD PTR [rbp-0x14]<br>0x00000000000008bf &lt;+123&gt;: movsxd rdx,eax<br>0x00000000000008c2 &lt;+126&gt;: mov rax,QWORD PTR [rbp-0x28]<br>0x00000000000008c6 &lt;+130&gt;: add rax,rdx<br>0x00000000000008c9 &lt;+133&gt;: or esi,ecx<br>0x00000000000008cb &lt;+135&gt;: mov edx,esi<br>0x00000000000008cd &lt;+137&gt;: mov BYTE PTR [rax],dl<br>0x00000000000008cf &lt;+139&gt;: add DWORD PTR [rbp-0x14],0x1<br>0x00000000000008d3 &lt;+143&gt;: mov eax,DWORD PTR [rbp-0x14]<br>0x00000000000008d6 &lt;+146&gt;: movsxd rbx,eax<br>0x00000000000008d9 &lt;+149&gt;: mov rax,QWORD PTR [rbp-0x28]<br>0x00000000000008dd &lt;+153&gt;: mov rdi,rax<br>0x00000000000008e0 &lt;+156&gt;: call 0x5f0 &lt;strlen@plt&gt;<br>0x00000000000008e5 &lt;+161&gt;: cmp rbx,rax<br>0x00000000000008e8 &lt;+164&gt;: jb 0x85a &lt;encode+22&gt;<br>0x00000000000008ee &lt;+170&gt;: nop<br>0x00000000000008ef &lt;+171&gt;: add rsp,0x28<br>0x00000000000008f3 &lt;+175&gt;: pop rbx<br>0x00000000000008f4 &lt;+176&gt;: pop rbp<br>0x00000000000008f5 &lt;+177&gt;: ret</pre><p>From the assembly, we can observe the following:</p><ol><li>IDA makes it simple to see that there exists a loop. The index loops until the end of string — function argument.</li><li>Each character in the function argument is accessed through indexing.</li><li>The encoding scheme consists of addition, circular shifts and XOR.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N12CtgIUWvPgPks6.png" /></figure><h3>SMT solving using angr</h3><p><em>“angr is a platform-agnostic binary analysis framework.”</em></p><p>I’d been studying <em>angr</em> docs over the past few days and I came across its solver engine. <a href="https://github.com/angr/angr"><em>angr</em></a> internally utilizes <a href="https://github.com/Z3Prover/z3"><em>Z3</em></a><em> </em>— a SMT solver by Microsoft.</p><p>Studying the assembly code, we can theorize that the core encoding is taken care by the following statements:</p><pre>...<br>0x000000000000086a &lt;+38&gt;: add eax,0x4<br>...<br>0x000000000000087c &lt;+56&gt;: xor ecx,0xc<br>...<br>0x0000000000000896 &lt;+82&gt;: mov esi,0x3<br>...<br>0x000000000000089d &lt;+89&gt;: call 0x73a &lt;logical_shift_right&gt;<br>...<br>0x00000000000008b7 &lt;+115&gt;: shl eax,0x5<br>...<br>0x00000000000008c9 &lt;+133&gt;: or esi,ecx<br>...</pre><p>The encoding scheme can be described as:</p><ol><li><em>0x4</em> is added to a character.</li><li>The result is xor’d with <em>0xc</em></li><li>The result is shifted right circularly by <em>3</em> bits.</li></ol><p>This encoding scheme can be codified in <em>angr</em> as follows:</p><pre>#!/usr/bin/python</pre><pre>import angr</pre><pre>def rshift(val, n):<br>&quot;&quot;&quot;<br>Logical right shift<br>&quot;&quot;&quot;<br>    return (val % 0x100000000) &gt;&gt; n</pre><pre># Hex values of the obfuscated string<br>encoded_string_hex = [0xffffff8a, 0xc, 0x25, 0x6f, 0x5, 0xffffffaf, \<br>                      0xffffffae, 0xffffff84, 0xffffff8e, 0x5, 0x4d, \<br>                      0x67, 0x5, 0xffffffac, 0xffffffcf, 0x6d, 0x7, \<br>                      0xffffff8c, 0x67, 0xffffff8c]</pre><pre>decoded_string = &quot;&quot;</pre><pre>proj = angr.Project(&quot;encode_decode&quot;)<br>state = proj.factory.entry_state()</pre><pre>for hex_code in encoded_string_hex:<br>    ch = state.solver.BVS(&quot;ch&quot;, 8)</pre><pre>    # Construct encoding expression<br>    base = (ch + 0x4) ^ 0xC<br>    expr = rshift(base, 3) | base &lt;&lt; 5</pre><pre>    # Constrain the input to generate the required output<br>    state.solver.add(expr == hex_code)</pre><pre>    try:<br>        # Find inputs to satisfy the constraint.<br>        value_ch = state.solver.eval(ch)<br>        decoded_string += chr(value_ch)<br>    except angr.errors.SimUnsatError:<br>        print (&quot;Unsat result for &quot; + hex(hex_code))<br>        state.solver._stored_solver = None<br>        decoded_string += &quot;.&quot;</pre><pre>print (decoded_string)</pre><p>When the above code is executed, <em>Z3 </em>finds the input (deobfuscated characters) which satisfies the constraint (output = obfuscated characters).</p><pre>(angr) angr@ubuntu:~/Downloads/angr/custom_encoding$ python solver.py <br>WARNING | 2019-05-11 18:57:20,539 | cle.loader | The main binary is a position-independent executable. It is being loaded with a base address of 0x400000.<br>Th!s mu$t b3 enc0d3d</pre><p>This was a very simple encoding scheme. If you’ve a real malware sample that uses a sophisticated algebraic-like (or combinatoric) encoding scheme, please let me know and I’ll definitely apply SMT solving concepts to it.</p><h3>Thanks for reading!</h3><p>In this article, I demonstrated ONE application of SMT solvers in reverse engineering. I’ve not yet explored other applications but according to <em>Thaís Moreira Hamasaki</em>, they include garbage code elimination, packing, crypto analysis etc. Here’s her talk on SMT solvers in security: <a href="https://www.youtube.com/watch?v=cyr_4_rN4pY"><em>https://www.youtube.com/watch?v=cyr_4_rN4pY</em></a></p><p>Thank you for reading! If you have any questions, leave them in the comments section below and I’ll get back to you as soon as I can!</p><p>P.S. I also write on my blog <a href="https://0x90sploiter.wordpress.com/">https://0x90sploiter.wordpress.com</a>.</p><p>Feature image credit: <a href="https://www.researchgate.net/figure/Schematic-view-of-an-SMT-solver_fig2_236147244">https://www.researchgate.net/figure/Schematic-view-of-an-SMT-solver_fig2_236147244</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eba5816ccbf5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Steganography to Distribute Malware?]]></title>
            <link>https://nikhilh20.medium.com/using-steganography-to-distribute-malware-2714e285e5ca?source=rss-e7692a561d6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2714e285e5ca</guid>
            <category><![CDATA[steganography]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[phishing]]></category>
            <category><![CDATA[malware]]></category>
            <dc:creator><![CDATA[ka1d0]]></dc:creator>
            <pubDate>Sat, 20 Apr 2019 08:12:24 GMT</pubDate>
            <atom:updated>2019-04-20T08:12:24.797Z</atom:updated>
            <content:encoded><![CDATA[<p>Steganography is a well-known concept. It involves hiding secret data inside another <em>carrier</em> file. In general, the carrier is usually an image, video or text file.</p><p>Unlike encryption, steganography is not very obvious to detect — one cannot judge that steganography was used just by looking at an image or video or text file. It is this property which makes it awesome to use by attackers and cyber-criminals for data exfiltration from an internal network.</p><p>In this article, I’ll be exploring a possible application of Steganography to distribute malware through traditional mediums such as email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D6Ozzin4RddTXmWigyvVhQ.jpeg" /></figure><h3>Malware Sample</h3><p>I’m using a malware sample that I recently acquired and analyzed — ste.exe. The threat intel analysis can be found <a href="https://0x90sploiter.wordpress.com/2019/04/10/threat-intelligence-ste-exe/">here</a>. The sample is malicious as seen on VirusTotal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I52beZJtlv2A2qWr.png" /></figure><h3>Splitting the Malware</h3><p>Instead of embedding the complete malware sample in a single carrier file, it would be better to split the malware binary into multiple parts and then apply steganography. In this case, I split the malware binary into five parts. I randomly chose the number five, but in general having more pieces is beneficial.</p><pre>nikhilh@ubuntu:~/Downloads/steg$ split --number=5 ste.exe</pre><pre>nikhilh@ubuntu:~/Downloads/steg$ ls xa*<br>xaa xab xac xad xae</pre><p>Only the first piece was marked malicious (5/72) by VirusTotal — likely because of the PE header.</p><p>[gallery ids=”855,856,857,858,859&quot; type=”square” link=”file”]</p><h3>Time to Steg!</h3><p>I’ve already installed <a href="https://github.com/syvaidya/openstego"><em>OpenStego</em> </a>on my Ubuntu machine. It is the application that I’ve used for steganography. It is open source and easy to use.</p><p>A sample configuration to hide data is shown in the snap below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AmnGfoDjb45-quFJ.png" /></figure><p>I’ve used five carrier images to hide five pieces of malware. Each steg image is stored as a <em>.bmp</em> file.</p><pre>nikhilh@ubuntu:~/Downloads/steg$ ls *bmp<br>chrollo.bmp ging.bmp hisoka.bmp killua.bmp kurapika.bmp</pre><p>None of these steg files were marked malicious by VirusTotal.</p><p>[gallery ids=”861,862,863,864,865&quot; type=”square” link=”file”]</p><h3>Attacker Tactic</h3><p>We’ve seen that it is possible to bypass AV software with a fair probability using Steganography as shown above. But why would an attacker use this tactic? Consider the following scenario:</p><pre>You&#39;ve posted on social media that you&#39;re looking to buy a house. Assuming that your social media handle is public, an attacker could view this information. They could pose as a real estate agent and send you an email with attachments - floor plan images and a word document describing their organization. These images would have separate pieces of the malware embedded in them. Say, you download these attachments for later viewing. The word document would have an embedded macro which downloads OpenStego on the victim machine, extracts individual pieces of the malware from the images, combines them into one and executes it in memory. Unlike downloader malware, the attacker does not have to rely on a C2 server to provide the second stage malware.</pre><p>A sample configuration for extraction is shown in the snap below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S3uQU9PpJnDSMkGb.png" /></figure><pre>nikhilh@ubuntu:~/Downloads/steg$ cat xa<br>xaa xab xac xad xae</pre><pre>nikhilh@ubuntu:~/Downloads/steg$ cat xa* &gt; malware</pre><pre>nikhilh@ubuntu:~/Downloads/steg$ file malware<br>malware: PE32 executable (GUI) Intel 80386, for MS Windows</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e_MGi8xucmVj3nj4.png" /></figure><p>We can see that the malware is functional after being extracted and combined.</p><p>Is the above mentioned scenario probable? Is it useful to an attacker? Please let me know in the comments!</p><h3>Detecting Steganography</h3><p>Detecting steganography is especially difficult. An <a href="https://security.stackexchange.com/questions/44249/how-can-i-detect-that-steganography-has-been-used">answer</a> from StackOverflow states:</p><pre>There can be no universal algorithm to detect steganography.</pre><pre>You can implement a series of tests against every known specific steganographic system in existence. But an attacker can use that as a test to develop a new form of steganography that bypasses all existing tests.</pre><p>Another <a href="https://security.stackexchange.com/questions/2144/detecting-steganography-in-images">answer</a> states:</p><pre>To detect Steganography it really comes down to statistical analysis</pre><h3>Aletheia</h3><p><a href="https://github.com/daniellerch/aletheia"><em>Aletheia</em></a><em> </em>is an open source tool for image steganalysis that uses state-of-the-art machine learning techniques. It incorporates many statistical analysis algorithms, one of which is <em>sample pairs analysis</em>. The whitepaper of the concept can be found <a href="http://www.ece.mcmaster.ca/~sorina/papers/LSBfinalTSP.pdf">here</a>.</p><p>To detect the steganography performed by <em>OpenStego</em>, I’ll use the <em>sample pairs analysis</em> technique in <em>Aletheia</em>.</p><p>Original image analysis:</p><pre>nikhilh@ubuntu:~/Downloads/steg/aletheia$ ./aletheia.py spa ../hisoka.jpg<br>Using TensorFlow backend.<br>No hiden data found</pre><p>Steg image analysis:</p><pre>nikhilh@ubuntu:~/Downloads/steg/aletheia$ ./aletheia.py spa ../hisoka.bmp<br>Using TensorFlow backend.<br>Hiden data found in channel R 0.2843646191333121<br>Hiden data found in channel G 0.3022934574290977<br>Hiden data found in channel B 0.27226889148257266</pre><h3>Special Mention: Cisco Stealthwatch</h3><p>While I don’t have the software resources to understand <em>Cisco Stealthwatch</em>, it certainly seems interesting. It is based on <a href="https://en.wikipedia.org/wiki/NetFlow"><em>NetFlow</em> </a>technology and probably is a mighty contender to detect steganography inline. According to the introductory video, <a href="https://www.cisco.com/c/en/us/products/security/stealthwatch/index.html"><em>Stealthwatch in 2 minutes</em></a>,</p><pre>Stealthwatch uses advanced security analytics to identify and mitigate threats. Using multi-layered machine learning and without decryption, Stealthwatch detects malware and data loss embedded in encrypted traffic. An industry standard only Stealthwatch provides.</pre><h3>Thanks for reading!</h3><p>In this article, we looked at a possible application of steganography to distribute malware.</p><ol><li>We used <em>OpenStego</em> to hide and extract the malware.</li><li>We were able to verify that the malware was functional after extraction and combination.</li><li>We used <em>Aletheia</em> to successfully detect steganography.</li></ol><p>Thank you for reading! If you have any questions, leave them in the comments section below and I’ll get back to you as soon as I can!</p><p>P.S. I also write on my blog <a href="https://0x90sploiter.wordpress.com/">https://0x90sploiter.wordpress.com</a>.</p><p><strong>Feature image credits: </strong><a href="https://towardsdatascience.com/steganography-hiding-an-image-inside-another-77ca66b2acb1">https://towardsdatascience.com/steganography-hiding-an-image-inside-another-77ca66b2acb1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2714e285e5ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing Basic Splunk Rules]]></title>
            <link>https://nikhilh20.medium.com/writing-basic-splunk-rules-ec474e778477?source=rss-e7692a561d6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec474e778477</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[firewall]]></category>
            <dc:creator><![CDATA[ka1d0]]></dc:creator>
            <pubDate>Sat, 20 Apr 2019 08:08:32 GMT</pubDate>
            <atom:updated>2019-04-20T08:11:09.966Z</atom:updated>
            <content:encoded><![CDATA[<p>The 21st century is the age where information is power. This information comes in various forms of machine data which is generated by a multitude of computerized sources. However, when you face terabytes of information it is difficult to feel powerful, rather it feels like facing an uncontrolled demon.</p><p>In this article, we’ll look at an application of the <em>Splunk Enterprise</em> (rather than <em>Splunk Enterprise Security</em>) platform. We’ll analyze an open source set of <em>iptables</em> logs and answer a few interesting questions. The sample set is available <a href="http://log-sharing.dreamhosters.com/SotM30-anton.log.gz">here</a>.</p><p><strong>Note: I’ve already created a <em>Splunk</em> app called “iptables logs” and ingested the data set into an index named “iptables”.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bi93ZCtyU-7me0IKjUcjuw.jpeg" /></figure><h3>Exploratory Analysis</h3><h3>What is the time range of the data set?</h3><pre><em>index=&quot;iptables&quot; | timechart count</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FDBYOzMvqueBsm6V.png" /></figure><p>We can see that the data set has a time range from <em>February 1, 2004 — February 27, 2004</em>.</p><h3>What is the average number of events per day? Are there any abnormalities?</h3><pre><em>index=&quot;iptables&quot; | timechart count | stats avg(count)</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CzwkjH05yhBwkmpT.png" /></figure><p>On average, there are about <em>11390</em> events per day.</p><p>I call a day abnormal if there are very less or very high number of events. A day with very few events can be considered a very good day (abnormal) and a day with very high number of events can be considered a very bad day (abnormal). With this in mind, we can determine those days that have an abnormal number (<em>+/- 3000</em>) of events.</p><pre><em>index=&quot;iptables&quot; | timechart count | eval abnormal=if(count = 14390, 1, NULL) | replace 1 with &quot;True&quot;, 0 with &quot;False&quot; in abnormal</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DBN8CKQ7YZpl6D-H.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zskhdyh23BSi-vEi.png" /></figure><p>Very few events on the following days:</p><ol><li><em>February 1, 2004</em></li><li><em>February 6, 2004</em></li><li><em>February 10, 2004</em></li><li><em>February 27, 2004</em></li></ol><p>Very high number of events on the following days:</p><ol><li><em>February 3, 2004</em></li><li><em>February 7, 2004</em></li><li><em>February 8, 2004</em></li><li><em>February 21, 2004</em></li><li><em>February 26, 2004</em></li></ol><h3>How many distinct source and destination IPs exist?</h3><pre><em>index=&quot;iptables&quot; | stats dc(SRC) AS &quot;Distinct Source IPs&quot; dc(DST) AS &quot;Distinct Destination IPs&quot;</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dM2eG7M6442hlII7.png" /></figure><p>There are <em>20382</em> distinct source IPs and <em>369</em> distinct destination IPs. This is expected since the data set comes from a honeynet (refer data set docs <a href="http://old.honeynet.org/scans/scan30/sol/index.html">here</a>). High number of inbound connections (likely malicious) are expected in a honeynet.</p><h3>What connection types exist in the data set?</h3><pre><em>index=&quot;iptables&quot; | rex field=_raw &quot;bridge kernel: (?(.+)?):&quot; | top conn_type</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1f036eEud2gXAK_U.png" /></figure><p>We can see there are 10 types of connections. The important connection type here is the <em>INBLOCK</em> type. During normal operation, a honeynet is open to all inbound connections. The <em>INBLOCK</em> connection type suggests that something went wrong with the honeynet. Let’s see at what points in time the <em>INBLOCK</em> connection type was observed.</p><pre><em>index=&quot;iptables&quot; | rex field=_raw &quot;bridge kernel: (?(.+)?):&quot; | search conn_type=INBLOCK* | timechart count</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zu1xzmTKqSDqV3T2.png" /></figure><p>We can see that there were over <em>150</em> <em>INBLOCK</em> connections on <em>February 10</em> and around<em> 40 </em>on <em>February 11</em>. This could mean that something went wrong around <em>February 10</em>.</p><p>Since the honeynet attracts maliciousness from all over the world, it is possible that the honeynet was compromised around <em>February 10</em>. We also know that there were very few events on <em>February 10</em>. This could mean that the honeynet was not operational (thus, no events were logged) because of the compromise.</p><p><strong>The next step is to find what actually occurred on <em>February 10</em> and answer questions related to the abnormality.</strong></p><h3>Focused Analysis</h3><h3>Are there any scan patterns?</h3><p>Simple scan patterns are relatively easy to detect. When executing a sweeping scan, a single source host pings multiple destination hosts on the same network.</p><pre><em>index=iptables ICMP | stats dc(DST) AS dst_ip by SRC | where dst_ip &gt; 20 | sort - dst_ip</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uy4lM7weoB60Q-IZ.png" /></figure><p>There are 23 hosts (1 actual system and 22 virtual) and 1 router on the honeynet. Since multiple external sources are pinging using <em>ICMP</em> to 24 distinct IP addresses, we can say with high probability that the honeynet is being scanned (possible automated with tools like <em>Nmap</em>).</p><h3>Was the honeynet compromised?</h3><pre><em>index=iptables | rex field=_raw &quot;bridge kernel: (?(.+)?):&quot; | timechart limit=0 count(conn_type) by conn_type</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tmUhMLaGb0MjJgD_.png" /></figure><p>We can see that there were an abnormally high number of <em>INBOUND TCP</em> connections on <em>February 7 </em>and <em>8</em>. But the honeynet was still operational as the number of <em>OUTG TCP</em> connections were non-zero and higher than average (on first sight).</p><p>On <em>February 10 </em>and <em>11</em>, there were an abnormally high number of <em>INBLOCK</em> connections and also the number of <em>OUTG</em> <em>TCP</em> connections was <em>0</em>. The honeynet might have been shut down on <em>February</em> <em>10</em>. Since there are non-zero number of outgoing <em>TCP</em> connections on <em>February 11</em>, the honeynet must have been turned back on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DrD7Db_aBNiHxxJL.png" /></figure><p>From the above observations, we can theorize that the compromise occurred on or before <em>February 10 </em>and <em>11</em>.</p><pre><em>index=iptables | timechart count by DPT</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cnVJyUW1CutENVex.png" /></figure><p>We can see from the above statistic that there were more than <em>16000</em> connections on port <em>443</em> on <em>February 7</em> and more than <em>7500</em> connections on <em>February 8</em>. It is possible that there was a compromise using the <em>HTTP</em> <em>over</em> <em>TLS/SSL</em> protocol.</p><pre><em>index=iptables OUTG* | where DPT==21 OR DPT == 80 | timechart count by DPT</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cxuLHkfOL5-0XzD-.png" /></figure><p>We can see that there were an abnormally high number of outgoing <em>HTTP</em> and <em>FTP</em> connections on ports <em>80</em> and <em>21</em> respectively on <em>February 7</em> and <em>8</em>. This is a sign of compromise since attackers are using <em>FTP</em> and <em>HTTP</em> to exfiltrate data out of the honeynet.</p><h3>What possible evidence of malware is there?</h3><p>If the honeynet was infected with malware, there must be a particular destination port number which was used many times during the connection for purposes like backdoor communication, etc.</p><pre><em>index=iptables | stats count by DPT | where count &gt; 100 | sort - count</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*59j9eTNcf9Fo4OuF.png" /></figure><p>We can see that port numbers <em>135, 445,</em> <em>443</em>,<em> 3127, 53, 139, 80, 137, 1434, 138</em> were used in more than 3<em>000</em> connections each.</p><p><strong>Note: I created an automatic lookup named, “port_desc” which returns port descriptions for the four ports mentioned above.</strong></p><pre><em>index=iptables | stats count by DPT | where count &gt; 3000 | sort - count limit=10 | lookup port_desc DPT OUTPUT</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IGCpYJUs13hrbCPu.png" /></figure><p>The following popular malware (around 2004 time frame) used the ports shown above:</p><ol><li><em>Port 135 — Blaster Worm, Welchia/Nachi Worm</em></li><li><em>Port 3127 — Mydoom Virus</em></li><li><em>Port 53 — Adm Worm</em></li><li><em>Port 137, 139 — Opaserv/Opasoft Worm</em></li><li><em>Port 80 — Executor Trojan</em></li><li><em>Port 1434 — Slammer Worm</em></li></ol><p>For example, I used the following procedure to determine if the honeynet was infected with the <em>Mydoom </em>virus.</p><h4>Mydoom Virus Check</h4><p><em>Mydoom</em> is a virus which opens a backdoor on port <em>3127</em> and can download and execute arbitrary files. To check whether the honeynet is compromised by <em>Mydoom</em>, I visualized the traffic on port <em>3127</em>.</p><pre><em>index=iptables INBOUND | where DPT==3127 | timechart count</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C2S28YDB15s6RlL6.png" /></figure><p>We can see that there was no <em>INBOUND </em>traffic on port <em>3127</em> until <em>February 5</em>. However, the traffic considerably increased after <em>February 9</em>. It is possible that the honey was infected with <em>Mydoom</em>.</p><h3>Thanks for reading!</h3><p>In this article, we looked at an application of <em>Splunk Enterprise</em> where we determined if a honeynet was compromised and infected. This is a valuable skill for those of us who are interested in the fields of incident response, threat intelligence, etc.</p><p>We determined that the honeynet was compromised using <em>HTTP over TLS/SSL</em> on <em>February 7 </em>and it was shut down on <em>February 10</em>. There were also signs of infection by malware like <em>Mydoom</em>. Other malware also might have been used since non-popular ports like <em>1434</em> were sending/receiving traffic.</p><p>Thank you for reading! If you have any questions, leave them in the comments section below and I’ll get back to you as soon as I can!</p><p>P.S. I also write on my blog <a href="https://0x90sploiter.wordpress.com/">https://0x90sploiter.wordpress.com</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec474e778477" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>