<?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>triage &#8211; PT ESC</title>
	<atom:link href="https://ptesc.tech/en/tag/triage/feed/" rel="self" type="application/rss+xml" />
	<link>https://ptesc.tech/en/</link>
	<description></description>
	<lastBuildDate>Wed, 30 Sep 2026 17:50:15 +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>triage &#8211; PT ESC</title>
	<link>https://ptesc.tech/en/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Where to look for network indicators of compromise on Windows?</title>
		<link>https://ptesc.tech/en/where-to-look-for-network-indicators-of-compromise-on-windows/</link>
		
		<dc:creator><![CDATA[oUth0R]]></dc:creator>
		<pubDate>Mon, 12 Aug 2024 17:03:49 +0000</pubDate>
				<category><![CDATA[Incident Response]]></category>
		<category><![CDATA[dfir]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[hunt]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[triage]]></category>
		<category><![CDATA[win]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d0%b3%d0%b4%d0%b5-%d0%b8%d1%81%d0%ba%d0%b0%d1%82%d1%8c-%d1%81%d0%b5%d1%82%d0%b5%d0%b2%d1%8b%d0%b5-%d0%b8%d0%bd%d0%b4%d0%b8%d0%ba%d0%b0%d1%82%d0%be%d1%80%d1%8b-%d0%ba%d0%be%d0%bc%d0%bf%d1%80%d0%be/</guid>

					<description><![CDATA[Where to look for network indicators of compromise on Windows? For example, in the DNS cache 💡 The DNS cache is a mechanism for caching records that map domain names to IP addresses (and more). It is needed so that the system does not have…]]></description>
										<content:encoded><![CDATA[<p><strong>Where to look for network indicators of compromise on Windows?</strong> For example, in the DNS cache 💡</p>
<p>The DNS cache is a mechanism for caching records that map domain names to IP addresses (and more). It is needed so that the system does not have to query DNS servers for this information every time. You can view the cache contents using the command <code>ipconfig /displaydns</code>, <strong>but do not rush to do this</strong>.</p>
<p>Each DNS record has a TTL (time to live) parameter, which determines how long the record remains valid. When the TTL expires, the record &#8220;goes stale&#8221; — and the system must again request the data from the DNS server.</p>
<p>Windows stores the list of cached domains as a linked list, and querying the cache contents consists of two stages: in the first stage, a complete list of cached domains is built using the system call <code>DnsGetCacheDataTable</code>; then, for each domain in the list, a cache resolution is performed using the system call <code>DnsQuery</code> with the flag <code>DNS_QUERY_NO_WIRE_QUERY</code>. Thus, for each cached domain, the corresponding resource records are retrieved from the cache: A, AAAA, TXT, and so on.</p>
<p>😐 <strong>And here lies the catch</strong>. If a domain is in the cached list but its TTL has expired, the command <code>ipconfig /displaydns</code> will not only fail to show that domain in the list, but will also remove it from the list of cached domains, thereby destroying potential evidence.</p>
<p>To get the full list of cached domains (even the &#8220;stale&#8221; ones), you can use the <code>DnsGetCacheDataTable</code> call. Below is a <code>PowerShell</code> script that implements this function:</p>
<pre><code>
Add-Type -TypeDefinition @&quot;
using System;
using System.Runtime.InteropServices;

namespace DnsCache
{
    [StructLayout(LayoutKind.Sequential)]
    public struct DnsCacheEntry
    {
        public IntPtr PNext;
        public IntPtr Name;
        public ushort Type;
        public ushort DataLength;
        public uint Flags;
    }

    public class Program
    {

        [DllImport(&quot;dnsapi.dll&quot;)]
        public static extern void DnsGetCacheDataTable(ref DnsCacheEntry entry);
        public static void GetCache()
        {
            DnsCacheEntry a = new DnsCacheEntry();
            DnsGetCacheDataTable(ref a);
            while (true)
            {
                Console.WriteLine(&quot;RR name: {0}&quot;, Marshal.PtrToStringAuto(a.Name));
                if (a.PNext == IntPtr.Zero) break;
                a = Marshal.PtrToStructure&lt;DnsCacheEntry&gt;(a.PNext);
            }

        }
    }
}
&quot;@
[DnsCache.Program]::GetCache()
</code></pre>
<p>Try running this script, and then compare the results with the output of <code>ipconfig /displaydns</code> (in that exact order).</p>
<p>Happy hunting!</p>
<p><span class="hashtag">#tips</span> <span class="hashtag">#hunting</span> <span class="hashtag">#win</span> <span class="hashtag">#dfir</span> <span class="hashtag">#dotnet</span> <span class="hashtag">#triage</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
