<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>tools &#8211; PT ESC</title>
	<atom:link href="https://ptesc.tech/en/tag/tools/feed/" rel="self" type="application/rss+xml" />
	<link>https://ptesc.tech/en/</link>
	<description></description>
	<lastBuildDate>Wed, 30 Sep 2026 19:20:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://ptesc.tech/wp-content/uploads/2026/09/cropped-cropped-large_icon-32x32.png</url>
	<title>tools &#8211; PT ESC</title>
	<link>https://ptesc.tech/en/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Tools for working with Python</title>
		<link>https://ptesc.tech/en/tools-for-working-with-python/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Fri, 24 Jan 2025 13:46:35 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scs]]></category>
		<category><![CDATA[TI]]></category>
		<category><![CDATA[tools]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82%d1%8b-%d0%b4%d0%bb%d1%8f-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d1%8b-%d1%81-python/</guid>

					<description><![CDATA[Tools for Working with Python 😦 Attackers are not shy about using Python for their purposes. LazyStealer, packaged with PyInstaller, the Python backdoor in ShadowPad, and modules for Pupy RAT are proof of that. Additionally, tasks involving…]]></description>
										<content:encoded><![CDATA[<p><strong>Tools for Working with Python</strong> 😦</p>
<p>Attackers are not shy about using Python for their purposes. <a href="https://global.ptsecurity.com/analytics/pt-esc-threat-intelligence/lazystealer-sophisticated-does-not-mean-better/?utm_source=tg_escalator&#038;utm_medium=post&#038;utm_campaign=esc&#038;utm_content=24_01" rel="noopener" target="_blank">LazyStealer, packaged with PyInstaller</a>, <a href="https://www.ptsecurity.com/ru-ru/research/pt-esc-threat-intelligence/shadowpad-novaya-aktivnost-gruppirovki-winnti/?utm_source=tg_escalator&#038;utm_medium=post&#038;utm_campaign=esc&#038;utm_content=24_01" rel="noopener" target="_blank">the Python backdoor in ShadowPad</a>, and <a href="https://www.ptsecurity.com/ru-ru/research/pt-esc-threat-intelligence/hellhounds-operaciya-lahat/?utm_source=tg_escalator&#038;utm_medium=post&#038;utm_campaign=esc&#038;utm_content=24_01" rel="noopener" target="_blank">modules for Pupy RAT</a> are proof of that. Additionally, tasks involving unpacking packers for further analysis are encountered <a href="https://ctftime.org/writeup/28897" rel="noopener" target="_blank">at capture the flag competitions</a>.</p>
<p>The Supply Chain Security team has compiled a cheat sheet on working with the <code>PyInstaller</code>, <code>py2exe</code> tools and compiled <code>.pyc</code> files.</p>
<p><strong>PyInstaller</strong></p>
<p>One of the most popular tools for packaging a project into an executable file for Windows, Linux, and macOS. Libraries related to the project are additionally serialized using the standard marshal library into a PYZ file.</p>
<p>To work with PyInstaller, you can use one of the first projects — <a href="https://github.com/extremecoders-re/pyinstxtractor" rel="noopener" target="_blank">pyinstxtractor</a>. Marshal does not implement backward compatibility between its versions, so to unpack a PYZ file, pyinstxtractor requires running on the same Python version that was used to package PyInstaller.</p>
<p><a href="https://github.com/pyinstxtractor/pyinstxtractor-ng" rel="noopener" target="_blank">pyinstxtractor-ng</a> solves this issue: it uses the <a href="https://github.com/rocky/python-xdis/" rel="noopener" target="_blank">xdis</a> library, which implements a (de)serializer for Python 2.4–3.13, meaning a specific Python version is no longer required for full unpacking. The author of pyinstxtractor-ng has released a <a href="https://pyinstxtractor-web.netlify.app/" rel="noopener" target="_blank">web version</a>, rewritten in Go, which runs locally in the browser. Both projects are actively updated and handle the latest versions of PyInstaller.</p>
<p><strong>py2exe</strong></p>
<p>A solution aimed at packaging a project into an executable file for Windows. It lags slightly behind trends and currently does not support Python 3.12 and 3.13. <a href="https://github.com/matiasb/unpy2exe" rel="noopener" target="_blank">unpy2exe</a> was supposed to be the &#8220;killer&#8221; of this packer, but the last commit to master seven years ago leaves a feeling of sadness. The author of this solution, like the author of pyinstxtractor, warns that the versions (at least major) of the installed Python and the final payload must match.</p>
<p><strong>.pyc Files</strong></p>
<p>At the Python level, they are used to speed up code execution and optimize module imports. There are several projects for converting them back to source code, and if possible, it is worth comparing the decompiled code obtained from one project with the decompiled code from another.</p>
<p>1️⃣ <a href="https://github.com/rocky/python-uncompyle6" rel="noopener" target="_blank">Uncompyle6</a> and <a href="https://github.com/rocky/python-decompile3" rel="noopener" target="_blank">decompyle3</a> — two utilities from the author of the aforementioned xdis. Uncompyle6 covers Python versions up to 3.8, decompyle3 covers from 3.7 to, partially, 3.9. The author is <a href="https://github.com/rocky/python-decompile3/issues/45" rel="noopener" target="_blank">asking for help</a> with the project.</p>
<p>2️⃣ The unpyc family (<a href="https://github.com/figment/unpyc3" rel="noopener" target="_blank">unpyc3</a>, <a href="https://github.com/andrews4s/unpyc37" rel="noopener" target="_blank">unpyc37</a>, <a href="https://github.com/greyblue9/unpyc37-3.10" rel="noopener" target="_blank">unpyc37-3.10</a>) — supports specific versions 3.3, 3.7, 3.10.</p>
<p>3️⃣ <a href="https://github.com/zrax/pycdc" rel="noopener" target="_blank">Pycdc</a> — a promising decompiler written in C++, also regularly updated and striving to support all versions of Python bytecode. It sometimes has difficulties parsing constructs, so&#8230;</p>
<p>4️⃣ Pycdas — a disassembler from the pycdc project, helps to try and analyze a .pyc file when decompilers are powerless 🐱🐱🐱</p>
<p>Existing online projects for .pyc files (caution: they send files to a server):</p>
<p><strong>•</strong> <a href="https://www.decompiler.com/" rel="noopener" target="_blank">Decompiler.com</a> — multifunctional, &#8220;under the hood&#8221; uses uncompyle6.</p>
<p><strong>•</strong> <a href="https://pylingual.io/" rel="noopener" target="_blank">PyLingual.io</a> — a promising solution currently in beta. It opens files from versions 3.11, 3.12, 3.13 without any issues.</p>
<p>Happy hacking!</p>
<p><span class="hashtag">#ti</span> <span class="hashtag">#python</span> <span class="hashtag">#tools</span> <span class="hashtag">#scs</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Useful tools: Mandiant capa</title>
		<link>https://ptesc.tech/en/useful-tools-mandiant-capa/</link>
		
		<dc:creator><![CDATA[global_author]]></dc:creator>
		<pubDate>Wed, 25 Dec 2024 16:27:04 +0000</pubDate>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tools]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d0%bf%d0%be%d0%bb%d0%b5%d0%b7%d0%bd%d1%8b%d0%b5-%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82%d1%8b-mandiant-capa/</guid>

					<description><![CDATA[😏 Useful tools: Mandiant capa Imagine the situation: you are a malware analyst or an incident response specialist and you need to analyze a large volume of binary files in a short time. As part of this analysis, you need to separate harmles…]]></description>
										<content:encoded><![CDATA[<p>😏  <strong>Useful tools: Mandiant capa</strong></p>
<p>Imagine the situation: you are a malware analyst or an incident response specialist and you need to analyze a large volume of binary files in a short time. As part of this analysis, you need to separate harmless files from potentially dangerous ones and, for the latter, determine their functions and presumed role in the compromise chain of the infected host. You will need all of this to form a picture of the attack, as well as to prioritize your response.</p>
<p>😐  You can separate good files from bad ones, for example, using whitelists of file hash sums, but quickly determining functions may prove difficult, since this requires the analyst to have extensive experience with malware analysis. </p>
<p>Unfortunately, such common tools as string viewers (for example, strings or FLOSS), as well as PE file analyzers (for example, Detect It Easy or CFF Explorer), display only the lowest level of detail and do not offer users any help in interpreting the data obtained.</p>
<p>😠  To solve the task of rapid code analysis and finding malicious techniques implemented in a program, you can use scanning with heuristic engines. These engines use a set of rules that are aimed at identifying specific code sections or individual artifacts characteristic of certain techniques. A good example of such an engine is <a href="https://github.com/mandiant/capa" rel="noopener" target="_blank">capa</a> from Mandiant. </p>
<p>After analyzing the file you are interested in with this tool, you can obtain a list of detected techniques, <em>as, for example, in screenshots 1 and 2</em>.</p>
<p>☹️  <strong>How do you work with this data?</strong> To identify malicious software, you can proceed as follows:</p>
<p>1️⃣ Analyze all available <a href="https://github.com/mandiant/capa-rules" rel="noopener" target="_blank">capa rules</a>.</p>
<p>2️⃣ Assign a danger rating to each of them (for example, as a number from 0 to 10).</p>
<p>3️⃣ Set a threshold value for classifying a file as malicious.</p>
<p>4️⃣ Sum the ratings of the detections for the file being analyzed and compare them with the threshold value: if the sum of the ratings is greater, then the file is potentially malicious.</p>
<p>This way, you will be able to quickly classify large sets of files, and most importantly, understand how they can cause harm.</p>
<p>🫰  <strong>But you can dig deeper and use capa as an auxiliary tool for reverse engineering.</strong> Here we are helped by the fact that capa detections allow you to locate the place in the file&#8217;s code where a particular technique was implemented (<em>screenshot 3</em>). </p>
<p>Thanks to this, if the goal of reverse engineering comes down to clarifying the implementation of certain malicious mechanisms, it will be possible to speed up their discovery.</p>
<p>🤌  <strong>And as a third, more specific scenario, capa can be considered as a tool to help in finding similar malware samples</strong>. </p>
<p>Due to the fact that capa has quite a lot of different detection rules, detection profiles can be generated for the files being analyzed, which, given a sufficient number, will be relatively unique. If, while analyzing a stream of malware, you encounter files with similar profiles, then they can be taken for comparison and identification of new versions of malware families.</p>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/12/photo_164@25-12-2024_16-27-04-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/12/photo_164@25-12-2024_16-27-04-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/12/photo_164@25-12-2024_16-27-04-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/12/photo_164@25-12-2024_16-27-04-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/12/photo_164@25-12-2024_16-27-04-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/12/photo_164@25-12-2024_16-27-04.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="576" src="https://ptesc.tech/wp-content/uploads/2024/12/photo_165@25-12-2024_16-27-04-1024x576.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/12/photo_165@25-12-2024_16-27-04-1024x576.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/12/photo_165@25-12-2024_16-27-04-300x169.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/12/photo_165@25-12-2024_16-27-04-768x432.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/12/photo_165@25-12-2024_16-27-04.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<p><span class="hashtag">#tip</span> <span class="hashtag">#tool</span> <span class="hashtag">#malware</span><br />
<a href="https://t.me/ptesaclator" rel="noopener" target="_blank">@ptesaclator</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Virtual disk as the start of an attack</title>
		<link>https://ptesc.tech/en/virtual-disk-as-the-start-of-an-attack/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Wed, 25 Sep 2024 18:19:46 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[TI]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tools]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d0%b2%d0%b8%d1%80%d1%82%d1%83%d0%b0%d0%bb%d1%8c%d0%bd%d1%8b%d0%b9-%d0%b4%d0%b8%d1%81%d0%ba-%d0%ba%d0%b0%d0%ba-%d0%bd%d0%b0%d1%87%d0%b0%d0%bb%d0%be-%d0%b0%d1%82%d0%b0%d0%ba%d0%b8/</guid>

					<description><![CDATA[🟥 ⚔️ 💿 Virtual Disk as the Start of an Attack In early September, experts from the TI cyberintelligence group of the PT ESC department discovered an interesting VHDX file that turned out to be part of an attack chain targeting organizations…]]></description>
										<content:encoded><![CDATA[<p>🟥  ⚔️ 💿 <strong>Virtual Disk as the Start of an Attack</strong></p>
<p>In early September, experts from the TI cyberintelligence group of the PT ESC department discovered an interesting VHDX file that turned out to be part of an attack chain targeting organizations in Asian countries. We don&#8217;t know the exact initial vector, but most likely the file was distributed via phishing.</p>
<p>✍️ <strong>A VHDX file</strong> is a virtual disk that can be mounted to a system starting with Windows 8 by double-clicking. It will be treated as a logical volume until the system is shut down. </p>
<p>Like any container, a VHDX file can act as a malicious object. Researcher Will Dormann in a 2019 post <a href="https://insights.sei.cmu.edu/blog/the-dangers-of-vhd-and-vhdx-files/" rel="noopener" target="_blank">described</a> how a specially crafted image can trigger a system error in Windows and cause a &#8220;blue screen of death.&#8221;</p>
<p>👾 In attacks, we rarely see this container used, but a virtual disk can contain malicious files that the victim is supposed to launch. A hacker can convince the victim to do this through social engineering techniques. To begin infecting the device, the victim only needs to open the disk sent to them and run the malicious file inside it. The infection scheme (<em>for example, as in the first screenshot</em>) is the same as if the user had been sent an archive with the same malicious embedded file.</p>
<p>💡 For hackers, the advantage of using VHDX files (as with using ZIP files) is that they <strong>are not subject to MoTW</strong> (Mark of the Web): when launching a document from these containers, Protected View is not enabled, and Windows SmartScreen does not warn the victim of the danger. It is also worth noting that fewer antivirus solutions are adapted to the VHDX format than to the same ISO files. Consequently, when the image enters the system, it is unlikely to be immediately deleted by this security tool.</p>
<p>Although VHDX files are rarely used in attacks, it is important for a TI analyst, like any other researcher, to be able to analyze these files effectively so as not to miss important details that could help with attribution or provide additional IoCs that allow building connections with other attacks.</p>
<p><strong>Hackers make mistakes:</strong> they may use the same VHDX file in two different attacks or upload erroneous files. In either of these cases, the attackers typically delete the files, and since this is a disk, the analyst can try to recover them (including with the exact creation dates of these files) — in other words, the analyst can build a timeline of file changes on the disk. This can be done using specialized forensics tools.</p>
<p>👀 <strong>Let&#8217;s look at the most effective methods and tools that can be used for disk analysis:</strong></p>
<p><strong>•</strong> <strong>Creating a virtual machine and mounting the disk in it</strong>. This will allow you to view the files in Explorer and see what the attack victim received (but not deleted files).</p>
<p><strong>•</strong> <strong>Autopsy</strong> — a universal tool for examining images that can extract data from many different file types, physical disks, and raw images. It has a timeline of file changes within the image (<em>example — in the second screenshot</em>).</p>
<p><strong>• FTK Imager</strong> — an analog of the Autopsy program that showed the best results in recovering deleted files from a disk.</p>
<p>🛡  <strong>As an option for protection against attacks using VHDX</strong>, email filters should be used that prohibit the transmission of this file type in email attachments — both from external senders and from internal ones.</p>
<p>We will soon publish an article in which we analyze this attack in detail. Stay tuned for news.</p>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/09/photo_70@25-09-2024_18-19-47-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/09/photo_70@25-09-2024_18-19-47-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/09/photo_70@25-09-2024_18-19-47-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/09/photo_70@25-09-2024_18-19-47-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/09/photo_70@25-09-2024_18-19-47-768x767.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/09/photo_70@25-09-2024_18-19-47.jpg 1202w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<p><span class="hashtag">#ti</span> <span class="hashtag">#tool</span> <span class="hashtag">#tip</span> <span class="hashtag">#news</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Useful data sources: MISP Warning Lists</title>
		<link>https://ptesc.tech/en/useful-data-sources-misp-warning-lists/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Wed, 11 Sep 2024 16:57:30 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[TI]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tools]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d0%bf%d0%be%d0%bb%d0%b5%d0%b7%d0%bd%d1%8b%d0%b5-%d0%b8%d1%81%d1%82%d0%be%d1%87%d0%bd%d0%b8%d0%ba%d0%b8-%d0%b4%d0%b0%d0%bd%d0%bd%d1%8b%d1%85-misp-warning-lists/</guid>

					<description><![CDATA[🗂 Useful Data Sources: MISP Warning Lists Information security analysts deal with massive volumes of threat data on a daily basis. To extract the most relevant events, they spend countless hours performing complex checks. In large quantitie…]]></description>
										<content:encoded><![CDATA[<p>🗂 <strong>Useful Data Sources: MISP Warning Lists</strong></p>
<p>Information security analysts deal with massive volumes of threat data on a daily basis. To extract the most relevant events, they spend countless hours performing complex checks. In large quantities, such checks can lead to analyst information overload and, ultimately, errors in analysis.</p>
<p>To avoid this, you can use initial filtering of the incoming security event stream to eliminate false positives using indicator whitelists. The open-source <strong> </strong><a href="https://github.com/MISP/misp-warninglists" rel="noopener" target="_blank">MISP Warning Lists repository</a> is perfect for this purpose. It currently contains 89 different indicator sets, grouped into categories.</p>
<p>All indicator sets in this source can be roughly divided into two groups: &#8220;white&#8221; and &#8220;gray.&#8221;</p>
<p>☑️ <strong>&#8220;White&#8221; indicators are unequivocally legitimate.</strong> These include sets such as:</p>
<blockquote><p>• dax30 — a list of known web pages of major German companies;</p>
<p>• security-provider-blogpost — a list of blog addresses from well-known security vendors;</p>
<p>• eicar.com — a list of hash sums for the EICAR test malware.</p></blockquote>
<p>Such indicators are the most useful way to filter out false positives from security tools.</p>
<p>ℹ️ <strong>&#8220;Gray&#8221; indicators are legitimate in themselves but can be involved in malicious activity.</strong> Sets containing such indicators include, for example:</p>
<blockquote><p>• amazon_aws — a list of Amazon Web Services IP address ranges;</p>
<p>• vpn-ipv4 — a list of IP address ranges belonging to common VPN providers;</p>
<p>• dynamic-dns — a list of known TLD and DDNS providers;</p>
<p>• url-shortener — a list of known URL shortening services.</p></blockquote>
<p>You can apply such lists to &#8220;whitelist&#8221; incoming events based on your organization&#8217;s security policy and your own experience (for example, you might assume that all traffic between your infrastructure and cloud providers is &#8220;white&#8221;).</p>
<p>At the same time, these same lists can be used to highlight events that indicate a security policy violation (for example, if DNS resolution events for DDNS domains are observed on a DNS server, this is always suspicious).</p>
<p>💡 <strong>A few tips for use:</strong></p>
<p><strong>•</strong> Evaluate the usefulness of each specific list for your own infrastructure. Don&#8217;t load everything indiscriminately.</p>
<p>• Pay attention to how often lists are updated. Some are updated rarely or not at all.</p>
<p><span class="hashtag">#tool</span> <span class="hashtag">#tip</span> <span class="hashtag">#TI</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Exfiltration gone wrong</title>
		<link>https://ptesc.tech/en/exfiltration-not-according-to-plan/</link>
		
		<dc:creator><![CDATA[oUth0R]]></dc:creator>
		<pubDate>Thu, 22 Aug 2024 12:51:02 +0000</pubDate>
				<category><![CDATA[Incident Response]]></category>
		<category><![CDATA[detect]]></category>
		<category><![CDATA[dfir]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tools]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d1%8d%d0%ba%d1%81%d1%84%d0%b8%d0%bb%d1%8c%d1%82%d1%80%d0%b0%d1%86%d0%b8%d1%8f-%d0%bd%d0%b5-%d0%bf%d0%be-%d0%bf%d0%bb%d0%b0%d0%bd%d1%83/</guid>

					<description><![CDATA[😈 Exfiltration Gone Wrong When investigating incidents, we periodically encounter threat actors exfiltrating data before encrypting infrastructure. One of the exfiltration tools can be the rclone utility, which is often used in conjunction…]]></description>
										<content:encoded><![CDATA[<p>😈 <strong>Exfiltration Gone Wrong</strong></p>
<p>When investigating incidents, we periodically encounter threat actors exfiltrating data before encrypting infrastructure.</p>
<p>One of the exfiltration tools can be the <a href="https://rclone.org/" rel="noopener" target="_blank">rclone</a> utility, which is often used in conjunction with <a href="https://mega.io/" rel="noopener" target="_blank">MEGA</a>. Hackers clean up and delete the utilities after use.</p>
<p><strong>This is where the </strong><a href="https://en.wikipedia.org/wiki/NTFS" rel="noopener" target="_blank">USN</a><strong> journal comes to the rescue:</strong></p>

<pre class="wp-block-code"><span><code class="hljs language-plaintext">
"2024-01-01 00:05:00","rclone.exe","","File_Created","Normal","Archive"...
"2024-01-01 01:01:10","rclone","\Users\&lt;username&gt;\AppData\Roaming\rclone","File_Created","Normal","Directory"...
"2024-01-01 02:01:11","mega.conf","","File_Closed / File_Deleted","Normal","Archive"...
"2024-01-01 02:01:11","rclone.exe","","File_Closed / File_Deleted","Normal","Archive"...
</code></span></pre>

<p><strong>What useful information can we learn:</strong></p>
<p><strong>•</strong> the fact that rclone was used;<br />
<strong>•</strong> the date and time of its use;<br />
<strong>•</strong> file names (they may be modified, which is a new indicator).</p>
<p>🤷‍♂️<strong> The config could not be recovered. What should we do?<br />
</strong><br />
In the MFT, small files (a few hundred bytes) are stored entirely within the corresponding record. Given this feature, we use the <a href="https://ericzimmerman.github.io/" rel="noopener" target="_blank">MFTECmd</a> utility with the <code>--dr</code> flag to recover them and then search for the config using the pattern<code> &#039;^(type|pass(word[0-9]?)?) \= &#039;</code>.</p>
<p><strong>Example of the configuration file contents:</strong></p>

<pre class="wp-block-code"><span><code class="hljs language-plaintext">
type = mega
user = evilname@evildomain
pass = qhLeOj9dBRBMCRPptaZA7rghfCkM7b_fsMR0cQ

&#91;mega_crypt]
type = crypt
remote = mega_clear:files
password = v55MNmgFh3qEIfsNA0UtwNaRPYufBOyWNb69pOE
password2 = Ooxh0-uHI2Wb9MrrmPrTgOSsgqUN4QaKwsi0Yt4
</code></span></pre>

<p>Once you have obtained information about the account, you can file a complaint with <a href="https://mega.io/ru/contact" rel="noopener" target="_blank">MEGA</a> and try to prevent the data from appearing in public access.</p>
<p>✨ <strong>Bonus</strong></p>
<p>To decode the data in the pass field, you can use one of the following tools:</p>
<p><strong>•</strong> <a href="https://github.com/maaaaz/rclonedeobscure" rel="noopener" target="_blank">rclone obscure</a>;<br />
<strong>•</strong> <a href="https://go.dev/play/p/4hahOBqxbw2" rel="noopener" target="_blank">Go playground</a>.</p>
<p>When transferred to cloud storage, files (as well as their names) may be encrypted. To solve this problem, there is a utility called <a href="https://github.com/lithium0003/DecodeRclone" rel="noopener" target="_blank">DecodeRclone</a>.</p>
<p><strong>Thus, we discovered:</strong></p>
<p>• the fact of data exfiltration;<br />
• the time of exfiltration;<br />
• the threat actors&#8217; account;<br />
• the list of leaked data (for risk assessment, for example);<br />
• authentication credentials in the &#8220;cloud&#8221; (for general knowledge 🙂).</p>
<p><span class="hashtag">#tools</span> <span class="hashtag">#detect</span> <span class="hashtag">#tips</span> <span class="hashtag">#dfir</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>While investigating the incident, we discovered a useful artifact smb_context</title>
		<link>https://ptesc.tech/en/while-investigating-the-incident-we-discovered-a-useful-artifact-smb-context/</link>
		
		<dc:creator><![CDATA[global_author]]></dc:creator>
		<pubDate>Thu, 20 Jun 2024 14:13:03 +0000</pubDate>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[detect]]></category>
		<category><![CDATA[hunt]]></category>
		<category><![CDATA[tools]]></category>
		<guid isPermaLink="false">https://ptesc.tech/%d1%80%d0%b0%d1%81%d1%81%d0%bb%d0%b5%d0%b4%d1%83%d1%8f-%d0%b8%d0%bd%d1%86%d0%b8%d0%b4%d0%b5%d0%bd%d1%82-%d0%bc%d1%8b-%d0%be%d0%b1%d0%bd%d0%b0%d1%80%d1%83%d0%b6%d0%b8%d0%bb%d0%b8-%d0%bf%d0%be%d0%bb/</guid>

					<description><![CDATA[💻 While investigating an incident, we discovered a useful artifact, smb_context C:\Windows\SysWOW64\smb_context.log — the SMB event log from a well-known antivirus vendor. We have not yet fully investigated how it works, but we found that b…]]></description>
										<content:encoded><![CDATA[<p>💻 <strong>While investigating an incident, we discovered a useful artifact, smb_context</strong></p>
<p>C:\Windows\SysWOW64\smb_context.log — the SMB event log from a well-known antivirus vendor.</p>
<p>We have not yet fully investigated how it works, but we found that by analyzing this log, it is possible to detect command execution, in particular using the <a href="https://github.com/fortra/impacket/blob/master/examples/smbexec.py" rel="noopener" target="_blank">smbexec,</a> utility, as well as file access on disk.</p>
<p><strong>The log may contain the following events: </strong></p>
<pre><code>
PDMSmbFileAccessed
PDMSmbCreateFile
PDMSmbRenameFile</code></pre>
<p><strong>Example:</strong></p>
<pre><code>
&lt;BeginStream&gt;
PDMSmbFileAccessed(&quot;$windir\__1715675753.48&quot;,00000011000000000010010100100000,1399528814);
PDMSmbFileAccessed(&quot;$system32\cmpspy.dll&quot;,00001011110000000010001100100001,1399106043);
PDMSmbFileAccessed(&quot;$system32\reg.bat&quot;,00001011110000000010001100100001,1399106043);
&lt;EndStream&gt;

&lt;BeginStream&gt;
PDMSmbFileAccessed(&quot;$windir\psexesvc.exe&quot;,00001010100000000010001100100001,405741904);
&lt;EndStream&gt;</code></pre>
<p><span class="hashtag">#tool</span> <span class="hashtag">#detect</span> <span class="hashtag">#hunt</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Exchange_SSRF</title>
		<link>https://ptesc.tech/en/exchange_ssrf/</link>
		
		<dc:creator><![CDATA[oUth0R]]></dc:creator>
		<pubDate>Fri, 14 Jun 2024 12:13:12 +0000</pubDate>
				<category><![CDATA[Incident Response]]></category>
		<category><![CDATA[detect]]></category>
		<category><![CDATA[dfir]]></category>
		<category><![CDATA[hunt]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[win]]></category>
		<guid isPermaLink="false">https://ptesc.tech/exchange_ssrf/</guid>

					<description><![CDATA[📬 Exchange_SSRF Our practice shows that a fairly large number of organizations still have not installed updates on their public Microsoft Exchange mail servers. As a result, attackers have the ability to gain access to email correspondence…]]></description>
										<content:encoded><![CDATA[<p>📬 <strong>Exchange_SSRF</strong></p>
<p>Our practice shows that a fairly large number of organizations still have not installed updates on their public Microsoft Exchange mail servers. </p>
<p>As a result, attackers have the ability to gain access to email correspondence at these companies. To do this, attackers use the open-source project Exchange_SSRF.</p>
<p><a href="https://github.com/Jumbo-WJB/Exchange_SSRF/tree/main" rel="noopener" target="_blank">Exchange_SSRF</a> is a publicly available Python script that allows dumping user mailboxes (100 by default) from a victim&#8217;s Microsoft Exchange server. In effect, the script exploits two vulnerabilities (CVE-2021-34473 and CVE-2021-34523) from the <a href="https://github.com/ktecv2000/ProxyShell" rel="noopener" target="_blank">ProxyShell chain.</a> </p>
<p>To dump mailbox files, the FindItem, GetItem, and GetAttachment methods are used, which are executed not under a user account but under the system NT AUTHORITY\SYSTEM account, which is clearly visible in the Exchange Web Services (EWS) logs:</p>
<blockquote><p>C:\Program Files\Microsoft\Exchange Server\V15\Logging\EWS</p></blockquote>
<p>As a rule, attackers do not modify the script and use it with the default User-Agent specified in the source code, with a period at the end.</p>
<p><strong>User-Agent:</strong></p>
<blockquote><p>Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36.</p></blockquote>
<p>It is also worth noting that almost all recorded attacks using this script were carried out from Latvian VPN addresses of the Mullvad VPN service.</p>
<p>Examples were <a href="https://telegra.ph/Examples-Exchange-SSRF-06-13" rel="noopener" target="_blank">published on Telegraph.</a></p>
<p><strong>C2:</strong></p>
<pre><code>31.170.22.18
31.170.22.20
31.170.22.22
31.170.22.26
31.170.22.5
31.170.22.6</code></pre>
<p><span class="hashtag">#tool</span> <span class="hashtag">#detect</span> <span class="hashtag">#hunt</span> <span class="hashtag">#win</span> <span class="hashtag">#dfir</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>utmpdump dual-purpose</title>
		<link>https://ptesc.tech/en/utmpdump-dual-purpose/</link>
		
		<dc:creator><![CDATA[oUth0R]]></dc:creator>
		<pubDate>Fri, 07 Jun 2024 15:04:04 +0000</pubDate>
				<category><![CDATA[Incident Response]]></category>
		<category><![CDATA[detect]]></category>
		<category><![CDATA[dfir]]></category>
		<category><![CDATA[hunt]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">https://ptesc.tech/utmpdump-%d0%b4%d0%b2%d0%be%d0%b9%d0%bd%d0%be%d0%b3%d0%be-%d0%bd%d0%b0%d0%b7%d0%bd%d0%b0%d1%87%d0%b5%d0%bd%d0%b8%d1%8f/</guid>

					<description><![CDATA[utmpdump dual-use Default Unix systems have little forensic information (vs Windows) and a lot of useful utilities. For example, there is a "wonderful" utility that allows dumping information from [ubw]tmp files into ASCII files, and also…]]></description>
										<content:encoded><![CDATA[<p><strong>utmpdump dual-use</strong></p>
<p>Default Unix systems have little forensic information (vs Windows) and a lot of useful utilities. For example, there is a &#8220;wonderful&#8221; utility that allows dumping information from [ubw]tmp files into ASCII files, and also, verbatim from the man page:</p>
<blockquote><p>&#8230;which can then be edited to remove bogus entries, and reintegrated using:<br />
utmpdump -r &lt; ascii_file &gt; wtmp</p></blockquote>
<p>So if some &#8220;crooked&#8221; IP address ended up in the logs, illegitimate &#8220;system administrators&#8221; can simply delete it, which is exactly what we encountered on cases:</p>
<p>Dumping:</p>
<pre><code>
utmpdump /var/log/wtmp</code></pre>
<p>Through a pipe, lines are grepped with the exclusion of the &#8220;crooked&#8221; IP address and output to a temp file:</p>
<pre><code>
| grep -v $EYE_PEE &gt;/tmp/.wt </code></pre>
<p>The result is imported back:</p>
<pre><code>
&amp;&amp; utmpdump -r &lt;/tmp/.wt &gt;/var/log/wtmp </code></pre>
<p>Then the temp file is deleted:</p>
<pre><code>
&amp;&amp; rm -f /tmp/.wt</code></pre>
<p>And of course, as stated in the man page:</p>
<blockquote><p>But be warned, utmpdump was written for debugging purposes only.</p></blockquote>
<p>The detections have been described a very long time ago, <a href="https://sandflysecurity.com/blog/using-linux-utmpdump-for-forensics-and-detecting-log-file-tampering/" rel="noopener" target="_blank">you can refresh your memory on them.</a></p>
<p><span class="hashtag">#tool</span> <span class="hashtag">#detect</span> <span class="hashtag">#hunt</span> <span class="hashtag">#nix</span> <span class="hashtag">#dfir</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
