<?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>PowerShell &#8211; PT ESC</title>
	<atom:link href="https://ptesc.tech/en/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>https://ptesc.tech/en/</link>
	<description></description>
	<lastBuildDate>Wed, 30 Sep 2026 18:09:37 +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>PowerShell &#8211; PT ESC</title>
	<link>https://ptesc.tech/en/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Analysis of reports.db</title>
		<link>https://ptesc.tech/en/analysis-of-reports-db/</link>
		
		<dc:creator><![CDATA[oUth0R]]></dc:creator>
		<pubDate>Fri, 09 Aug 2024 14:27:44 +0000</pubDate>
				<category><![CDATA[Incident Response]]></category>
		<category><![CDATA[detect]]></category>
		<category><![CDATA[dfir]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[win]]></category>
		<guid isPermaLink="false">https://ptesc.tech/%d0%bf%d0%be%d0%bc%d0%b8%d0%bc%d0%be-%d0%b6%d1%83%d1%80%d0%bd%d0%b0%d0%bb%d0%be%d0%b2-windows-%d0%b2-%d1%80%d0%b0%d1%81%d1%81%d0%bb%d0%b5%d0%b4%d0%be%d0%b2%d0%b0%d0%bd%d0%b8%d0%b8-%d0%b0%d0%ba%d1%82/</guid>

					<description><![CDATA[☝️ In addition to Windows logs, another interesting artifact provided by a popular antivirus protection tool helped us in investigating the activity described in the previous post. This artifact is a database (reports.db) that stores inform…]]></description>
										<content:encoded><![CDATA[<p>☝️ <strong>In addition to Windows logs, another interesting artifact provided by a popular antivirus protection tool helped us in investigating the activity described </strong><a href="https://t.me/ptescalator/52" rel="noopener" target="_blank">in the previous post</a><strong>.<br />
</strong><br />
This artifact is a database (<code>reports.db</code>) that stores information about application activity, including files and web resources that a given process interacted with.</p>
<pre><code>
{&quot;application.description&quot;:&quot;Windows PowerShell&quot;,&quot;application.directory&quot;:&quot;C:\\Windows\\System32\\WindowsPowerShell\\v1.0&quot;,&quot;application.name&quot;:&quot;powershell.exe&quot;,&quot;eventId&quot;:154,&quot;object.directory&quot;:&quot;\\\\10.50.1.39\\E$\\Очень важные документы\\отчет.xlsx//&quot;,&quot;object.name&quot;:&quot;encrypted&quot;,&quot;timestamp&quot;:&quot;2024-05-06T15:44:15.305346Z&quot;,&quot;user.name&quot;:&quot;COMPANY\\admin&quot;,&quot;user.type&quot;:1}
</code></pre>
<pre><code>
{&quot;application.description&quot;:&quot;Windows PowerShell&quot;,&quot;application.directory&quot;:&quot;C:\\Windows\\System32\\WindowsPowerShell\\v1.0&quot;,&quot;application.name&quot;:&quot;powershell.exe&quot;,&quot;eventId&quot;:154,&quot;object.directory&quot;:&quot;http://94.158.247.19/files/upload/4c3df659-4299-4f3d-a159-5cca5215f74f///WREQ//XFwxMC40MC4xMC4zNFxFJFzQntGH0LXQvdGMINCy0LDQttC90YvQtSDQtNC+0LrRg9C80LXQvdGC0Ytc0L7RgtGH0LXRgi54bHN4JiYyOC4wMi4yMDI0IDc6NDI6MTImJjM2NzQyJiZWTTAwMSYmYWRtaW4mJkRGNDUzNjI0//&quot;,&quot;object.name&quot;:&quot;encrypted&quot;,&quot;timestamp&quot;:&quot;2024-05-06T15:44:15.305346Z&quot;,&quot;user.name&quot;:&quot;COMPANY\\admin&quot;,&quot;user.type&quot;:1}
</code></pre>
<p>The events above, obtained after parsing the database with one of our tools, indicate that the <code>powershell.exe</code> process accessed a document in a network folder and a web page.</p>
<p>🖥 The URL reflected in the <code>object.directory</code> field has the following format:</p>
<pre><code>
ip_address/files/upload/guid///WREQ//base64_id//
</code></pre>
<p>🧑‍💻 After decoding from Base64, we get the following string:</p>
<pre><code>
\\10.40.10.34\E$\Очень важные документы\отчет.xlsx&amp;&amp;28.02.2024 7:42:12&amp;&amp;36742&amp;&amp;VM001&amp;&amp;admin&amp;&amp;DF453624
</code></pre>
<p>The exfiltration request contains the file path, modification date, file size in bytes, host name, user name, and hard drive serial number, separated by double ampersands.</p>
<p>Thus, <code>reports.db</code> is an excellent source of data in which one can find:</p>
<p><strong>•</strong> evidence of this script being used for exfiltration;<br />
<strong>•</strong> a list of exfiltrated resources;<br />
<strong>•</strong> the account under which the malicious activity was conducted.</p>
<p><span class="hashtag">#detect</span> <span class="hashtag">#dfir</span> <span class="hashtag">#PowerShell</span> <span class="hashtag">#win</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Exfiltration using PowerShell/C#</title>
		<link>https://ptesc.tech/en/exfiltration-using-powershell-c/</link>
		
		<dc:creator><![CDATA[oUth0R]]></dc:creator>
		<pubDate>Wed, 07 Aug 2024 20:11:00 +0000</pubDate>
				<category><![CDATA[Incident Response]]></category>
		<category><![CDATA[detect]]></category>
		<category><![CDATA[dfir]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[win]]></category>
		<guid isPermaLink="false">https://ptesc.tech/%e2%84%b9%ef%b8%8f/</guid>

					<description><![CDATA[ℹ️ Exfiltration using PowerShell/C# During an incident investigation, while analyzing Windows event logs on one of the compromised hosts, we discovered that a PowerShell script had been executed to exfiltrate sensitive files from network sh…]]></description>
										<content:encoded><![CDATA[<p><strong>ℹ️</strong> <strong>Exfiltration using PowerShell/C#</strong></p>
<p>During an incident investigation, while analyzing Windows event logs on one of the compromised hosts, we discovered that a PowerShell script had been executed to exfiltrate sensitive files from network shares to a server controlled by the attackers 🧐</p>
<p>The required network folder is mounted using the <code>New-SmbMapping,</code> cmdlet, using credentials compromised during one of the earlier stages of the attack. After that, C# code defined inside the PowerShell script is executed, containing the main file upload logic.</p>
<p>The C# program recursively enumerates files located in a specified folder and its subfolders, and uploads to an attacker-controlled web server those files that meet the following conditions:</p>
<p><strong>•</strong> size does not exceed 750,000 bytes.<br />
<strong>• </strong>the file was last modified no more than 130 days ago.</p>
<p>📑 During enumeration, information is written to <code>%APPDATA%\tree.ini</code>, including the full path to the files, their sizes in bytes, the last modification date, and the last access date.</p>
<p>The contents of each file matching the conditions described above are sent via a POST request to the attackers&#8217; web server in <code>multipart/form-data</code> format, in chunks of 16,384 bytes.</p>
<p>The <code>filename</code> parameter receives a file identifier, which is a Base64-encoded string in the following format:</p>
<pre><code>
fullpath&amp;&amp;last_write_time&amp;&amp;file_size&amp;&amp;host_name&amp;&amp;current_user&amp;&amp;drive_serial_number
</code></pre>
<p>After all files have been processed and uploaded, the <code>tree.ini</code> file is also uploaded to the server, after which it is deleted from the system.</p>
<p>🔦 <strong>Analyzing the following Windows security log events can help detect such activity:<br />
</strong><br />
1️⃣ <strong>Sysmon event ID 11</strong>: creation of files in the user folder <code>%AppData%</code> by the <code>powershell.exe</code> process. In our case, files are created with names defined in the code: <code>tree.ini</code>, <code>profiles_int.ini</code> (a database where MD5 hashes of file identifiers are written), <code>sys_error.log</code> and<code> sys_error_ps.log </code>(log files).</p>
<p>2️⃣ <strong>Sysmon event ID 3</strong>: network connections by the <code>powershell.exe</code> process to internal network hosts on TCP port 445.</p>
<p>3️⃣ <strong>Security event ID 4656, 4663</strong>: handle request and access to files in the network folder by the <code>powershell.exe</code> process.</p>
<p>4️⃣ <strong>Windows PowerShell event ID 800 and Microsoft-Windows-PowerShell/Operational event ID 4103, 4104</strong>, containing strings characteristic of the script. In particular, the names of variables and methods defined in the code:</p>
<pre><code>
C#: ___directoriesToUpload___, ___fileBase64Id___, ___WritePartInfo, ___SendTreeFileAndTryRemove
</code></pre>
<p>💡 An indicator of possible malicious activity is also the presence in network traffic of a large number of HTTP POST requests whose URLs contain Base64-encoded fragments.</p>
<p>👉 <a href="https://vk.com/s/v1/doc/WP1_hPlfdiPbmJ1thSNwJ_Z-xw4xG7qHFCUDS1AnO2RuglsKSIE" rel="noopener" target="_blank">SIGMA rule</a></p>
<p><strong>IoC:</strong></p>
<pre><code>
94.158.247.19
</code></pre>
<p><span class="hashtag">#detect</span> <span class="hashtag">#dfir</span> <span class="hashtag">#PowerShell</span> <span class="hashtag">#win</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
