<?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>tls &#8211; PT ESC</title>
	<atom:link href="https://ptesc.tech/en/tag/tls/feed/" rel="self" type="application/rss+xml" />
	<link>https://ptesc.tech/en/</link>
	<description></description>
	<lastBuildDate>Mon, 05 Oct 2026 12:11:27 +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>tls &#8211; PT ESC</title>
	<link>https://ptesc.tech/en/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Hunting RATs by their own certificates 🕵️</title>
		<link>https://ptesc.tech/en/hunting-for-rats-by-their-own-certificates/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Thu, 02 Jul 2026 15:43:34 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[C2]]></category>
		<category><![CDATA[detect]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[rat]]></category>
		<category><![CDATA[suricata]]></category>
		<category><![CDATA[TI]]></category>
		<category><![CDATA[tls]]></category>
		<guid isPermaLink="false">https://ptesc.tech/hunting-for-rats-by-their-own-certificates/</guid>

					<description><![CDATA[Our colleagues at Censys published a breakdown of the AsyncRAT family, describing an entire genealogical tree: AsyncRAT → DCRAT (DarkCrystal RAT) → VenomRAT → dozens more forks all the way down to LMTeamRAT, Alfa Red Fox, EchoRAT, Gh0stRAT…]]></description>
										<content:encoded><![CDATA[<p>Our colleagues at Censys <a href="https://censys.com/blog/asyncrat-family-threat-overview/" rel="noopener" target="_blank">published</a> a breakdown of the AsyncRAT family, describing an entire genealogical tree: AsyncRAT → DCRAT (DarkCrystal RAT) → VenomRAT → dozens more forks all the way down to LMTeamRAT, Alfa Red Fox, EchoRAT, Gh0stRAT (not to be confused with the original Gh0st RAT from 2008), and so on. In total, they counted around 40 named variants, 13 of which had live C2 infrastructure at the time of the research.</p>
<p>The key takeaway of their research: forks almost never rewrite the TLS certificate of the server inherited from the parent. DCRAT brought into the family the structure <code>O=&lt;Name&gt; By &lt;author&gt;</code>, <code>L=SH</code>, <code>C=CN</code>, and this is inherited all the way down to the smallest descendants — even if the build itself is no longer branded in any other way. It is this pattern that Censys calls the most reliable signal for the entire lineage, regardless of the specific variant.</p>
<p>We, the network forensics department of the antivirus lab, already had experience detecting <strong>VenomRAT</strong> by its default certificate, and we even contributed a Suricata <a href="https://rules.ptsecurity.com/view/rules/ptopen-malware.rules#L135" rel="noopener" target="_blank">signature</a> to the community as part of the <strong>PT Rules</strong> project.</p>
<p>That is exactly why this research, naturally, caught our attention — and we decided to run similar logic not against an internet scan, but against traffic from our own sandboxes: what if we missed something?</p>
<p>We took our favorite NTA and ran the following query in it (an equivalent hunt can be done anywhere, even in a database):</p>
<pre><code>tls.server_cert.subject.value ~ &quot;*RAT*&quot; 
&amp;&amp; !tls.server_cert.subject.value ~ &quot;*CORPORAT*&quot; 
&amp;&amp; !tls.server_cert.subject.value ~ &quot;*INTEGRAT*&quot;</code></pre>
<p>(the exclusions are needed because <code>corporated</code>, <code>corporation</code>, or <code>integrator</code> will also happily match on <code>*RAT*</code> — hello, false positives)</p>
<p>The result was genuinely interesting: besides the aforementioned VenomRAT, a bunch of other C2 servers literally sign themselves.</p>
<p>For example, the progenitor AsyncRAT is not shy about signing itself as <code>AsyncRAT Server</code>:</p>
<figure class="wp-block-image"><img width="1024" height="682" src="https://ptesc.tech/wp-content/uploads/2026/07/photo_587@02-07-2026_15-43-34-1024x682.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2026/07/photo_587@02-07-2026_15-43-34-1024x682.jpg 1024w, https://ptesc.tech/wp-content/uploads/2026/07/photo_587@02-07-2026_15-43-34-300x200.jpg 300w, https://ptesc.tech/wp-content/uploads/2026/07/photo_587@02-07-2026_15-43-34-768x512.jpg 768w, https://ptesc.tech/wp-content/uploads/2026/07/photo_587@02-07-2026_15-43-34.jpg 1501w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<p>PureRAT pretends to be <code>PureRAT Agent</code>:</p>
<figure class="wp-block-image"><img width="1024" height="682" src="https://ptesc.tech/wp-content/uploads/2026/07/photo_588@02-07-2026_15-43-34-1024x682.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2026/07/photo_588@02-07-2026_15-43-34-1024x682.jpg 1024w, https://ptesc.tech/wp-content/uploads/2026/07/photo_588@02-07-2026_15-43-34-300x200.jpg 300w, https://ptesc.tech/wp-content/uploads/2026/07/photo_588@02-07-2026_15-43-34-768x512.jpg 768w, https://ptesc.tech/wp-content/uploads/2026/07/photo_588@02-07-2026_15-43-34.jpg 1501w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<p>LiberiumRAT signed itself a certificate under the name <code>Liberium RAT Authority</code>:</p>
<figure class="wp-block-image"><img width="1024" height="682" src="https://ptesc.tech/wp-content/uploads/2026/07/photo_589@02-07-2026_15-43-34-1024x682.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2026/07/photo_589@02-07-2026_15-43-34-1024x682.jpg 1024w, https://ptesc.tech/wp-content/uploads/2026/07/photo_589@02-07-2026_15-43-34-300x200.jpg 300w, https://ptesc.tech/wp-content/uploads/2026/07/photo_589@02-07-2026_15-43-34-768x512.jpg 768w, https://ptesc.tech/wp-content/uploads/2026/07/photo_589@02-07-2026_15-43-34.jpg 1501w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<p>A number of other, lesser-known samples all happily advertise their purpose right in the certificate.</p>
<h2>How to detect in Suricata?</h2>
<p>Similarly to our VenomRAT rule, you can key on the bytes <code>|3082|</code> — they appear at the start of the certificate, then <code>|550403|</code> — this is the encoded <code>ASN.1 Object ID 2.5.4.3 (id-at-commonName)</code>, and finally — the target string, for example:</p>
<pre><code>alert tls any any -&gt; any any (msg: &quot;REMOTE [PTsecurity] LiberiumRAT SSL certificate&quot;; flow: established, from_server; content: &quot;|3082|&quot;; depth: 300; content: &quot;|550403|&quot;; depth: 600; content: &quot;Liberium RAT&quot;; distance: 2; within: 12; classtype: trojan-activity; sid: 1; rev: 1;)</code></pre>
<figure class="wp-block-image"><img width="1024" height="682" src="https://ptesc.tech/wp-content/uploads/2026/07/photo_590@02-07-2026_15-43-34-1024x682.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2026/07/photo_590@02-07-2026_15-43-34-1024x682.jpg 1024w, https://ptesc.tech/wp-content/uploads/2026/07/photo_590@02-07-2026_15-43-34-300x200.jpg 300w, https://ptesc.tech/wp-content/uploads/2026/07/photo_590@02-07-2026_15-43-34-768x512.jpg 768w, https://ptesc.tech/wp-content/uploads/2026/07/photo_590@02-07-2026_15-43-34.jpg 1501w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<h2>And how to hunt, what to look at:</h2>
<ul>
<li><strong>Issuer/Subject</strong> of the form <code>CN=.*RAT.*</code> — as seen above, it works perfectly.</li>
<li><strong>The combination</strong> <code>L=SH</code>, <code>C=CN + O=* By *</code> on a non-standard port.</li>
<li><strong>Self-signed certificates in general</strong> — malware C2, unlike phishing sites, is not afraid of browser errors, so self-signing is used en masse.</li>
<li><strong>Signs of default generation</strong> — empty <code>O/L/ST</code>, <code>CN</code> duplicated in <code>SAN</code> or <code>Issuer</code> — <code>CN=example.com</code>, <code>O=Acme</code>.</li>
</ul>
<p>From the history of the issue — a similar trick was pulled back in 2023 with Quasar RAT: there, the default certificate <code>CN=Quasar Server CA</code> via Shodan/Censys led researchers straight to 60+ live servers. Nuff said.</p>
<p>The moral: a TLS certificate, when present of course, is metadata that remains in the clear even when all the rest of the traffic is encrypted. For some reason, the authors of RAT builders regularly forget about this 🙂</p>
<p>Happy hunting!</p>
<p><span class="hashtag">#TI</span> <span class="hashtag">#malware</span> <span class="hashtag">#RAT</span> <span class="hashtag">#C2</span> <span class="hashtag">#tls</span> <span class="hashtag">#detect</span> <span class="hashtag">#suricata</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>🦈 Looking under the hood of secure connections in Wireshark. Part 3.1: MITM attack on SSL/TLS connections</title>
		<link>https://ptesc.tech/en/looking-under-the-hood-of-secure-connections-in-wireshark-part-3-1-mitm-attack-on-ssl-tls/</link>
		
		<dc:creator><![CDATA[oUth0R]]></dc:creator>
		<pubDate>Wed, 22 Oct 2025 12:13:01 +0000</pubDate>
				<category><![CDATA[Incident Response]]></category>
		<category><![CDATA[dfir]]></category>
		<category><![CDATA[mitm]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tls]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d1%81%d0%bc%d0%be%d1%82%d1%80%d0%b8%d0%bc-%d0%bf%d0%be%d0%b4-%d0%ba%d0%b0%d0%bf%d0%be%d1%82-%d0%b7%d0%b0%d1%89%d0%b8%d1%89%d0%b5%d0%bd%d0%bd%d1%8b%d1%85-%d1%81%d0%be%d0%b5%d0%b4%d0%b8%d0%bd%d0%b5-3/</guid>

					<description><![CDATA[&#160; In addition to the previous post we are looking at additional tools for decrypting network traffic. Let's look at an alternative to PolarProxy that is not proprietary. SSLproxy is a tool that is essentially a continuation of sslsplit…]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<p><em>In addition </em><a href="https://t.me/ptescalator/522" target="_blank" rel="noopener">to the previous post</a><em> we are looking at additional tools for decrypting network traffic.</em></p>
<p>Let&#8217;s look at an alternative to <em>PolarProxy</em> that is not proprietary. <a href="https://github.com/sonertari/SSLproxy" target="_blank" rel="noopener">SSLproxy</a> is a tool that is essentially a continuation of <em>sslsplit</em>, but has a number of other advantages, in particular — writing decrypted data to a PCAP file. This project is used in <a href="https://sonertari.github.io/" target="_blank" rel="noopener">UTMFW.</a> First, let&#8217;s configure the host as in the case of <em>sslsplit</em>, except here traffic will be redirected to a single port 8443.</p>

<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">sslproxy -k ca.key -c ca.crt -P https 0.0.0.0 8443 -X sslproxy.pcap</code></span></pre>

<p>Let&#8217;s form a request specifying the pre-generated certificate in the <code>--cacert</code> option.</p>

<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash">curl --cacert ca.crt --tlsv1.3 https://ptsecurity.com/</code></span></pre>

<p>Unlike the previously described tools, here a PCAP file with decrypted data is generated, so it can be parsed using Zeek, Suricata and other DPI. But the tool has a drawback similar to <em>sslsplit</em> — the file with master keys is generated incorrectly for TLSv1.3.</p>
<p>To sum up on the <em>PolarProxy</em> and <em>SSLProxy</em> tools: they are excellent analogues of <em>sslsplit</em>, which can also be used in one or another automated service, for example in an application analysis system or NGFW.</p>
<p>All the tools mentioned above have one key drawback — they do not have the ability to generate, or fully generate, a file with master keys of SSL/TLS sessions. Let&#8217;s look at a tool that solves specifically this problem.</p>
<p>❕ <strong>mitmproxy</strong> — an interactive open-source tool. It has the ability to use a web UI (<em>mitmweb</em>). Unlike the previous analogues, this tool does not have the ability to write decrypted data to a PCAP file, but it is capable of working with master keys most effectively. This tool is contained in many repositories, including PyPI.</p>
<p><strong>To capture network traffic in real time using mitmproxy, you can use the following command:<br />
</strong></p>

<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash">SSLKEYLOGFILE=<span class="hljs-string">"<span class="hljs-variable">$PWD</span>/.mitmproxy/sslkeylogfile.txt"</span> mitmproxy --<span class="hljs-built_in">set</span> confdir=.mitmproxy/ --listen-host 0.0.0.0 -p 8080</code></span></pre>

<p>In the working directory where <em>mitmproxy</em> was launched, a directory with configuration files <em>.mitmproxy</em> will be created, which will contain <a href="https://docs.mitmproxy.org/stable/concepts/certificates/" rel="noopener" target="_blank">these certificates.</a> Subsequently, they can be used when implementing a MITM attack on SSL/TLS.</p>
<p><strong>Let&#8217;s try to make an HTTP/2 request through the running proxy, while specifying the CA (certificate authority).<br />
</strong></p>

<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash">curl --proxy 127.0.0.1:8080 --cacert ~/.mitmproxy/mitmproxy-ca-cert.pem https://www.ptsecurity.com/</code></span></pre>

<p>Since the data arrives in decrypted form, we can interactively observe the request headers (<em>screenshot 4</em>) and response headers (<em>screenshot 5</em>). The obtained keys <em>sslkeylogfile.txt</em>, which we specified in the environment variable <em>SSLKEYLOGFILE</em>, we can use later for our purposes, including in Wireshark. At the same time, the keys of TLSv1.3 sessions will have the correct format, unlike the previous tools. <em>mitmproxy</em> also has transparent proxy functionality, if the <code>--mode transparent</code> option is added.</p>
<p>Thus, among the advantages of <em>mitmproxy</em> we can note the speed of deployment, interactivity (including web UI), relevance (the tool is regularly updated and improved), as well as the ability to generate working master keys for TLSv1.3.</p>
<p>💬 To sum up, I would like to note that there are many tools for carrying out MITM attacks on SSL/TLS connections. Each of these tools has its own pros and cons and is suitable for different tasks.</p>
<figure class="wp-block-image"><img decoding="async" width="1024" height="561" src="https://ptesc.tech/wp-content/uploads/2025/10/photo_407@22-10-2025_12-13-01-1024x561.jpg" class="attachment-large size-large" alt="" loading="lazy" /></figure>
<p><span class="hashtag">#dfir</span> <span class="hashtag">#tip</span> <span class="hashtag">#mitm</span> <span class="hashtag">#ssl</span> <span class="hashtag">#tls</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>🦈 Looking under the hood of secure connections in Wireshark. Part 3: MITM attack on SSL/TLS connections</title>
		<link>https://ptesc.tech/en/looking-under-the-hood-of-secure-connections-in-wireshark-part-3-mitm-attack-on-ssl-tls/</link>
		
		<dc:creator><![CDATA[oUth0R]]></dc:creator>
		<pubDate>Wed, 22 Oct 2025 12:12:00 +0000</pubDate>
				<category><![CDATA[Incident Response]]></category>
		<category><![CDATA[dfir]]></category>
		<category><![CDATA[mitm]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tls]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d1%81%d0%bc%d0%be%d1%82%d1%80%d0%b8%d0%bc-%d0%bf%d0%be%d0%b4-%d0%ba%d0%b0%d0%bf%d0%be%d1%82-%d0%b7%d0%b0%d1%89%d0%b8%d1%89%d0%b5%d0%bd%d0%bd%d1%8b%d1%85-%d1%81%d0%be%d0%b5%d0%b4%d0%b8%d0%bd%d0%b5-2/</guid>

					<description><![CDATA[&#160; MITM attack is a fairly popular feature of various sandboxes and application analysis systems. Typically, tools that enable MITM attacks are a proxy server that allows flexible processing of incoming traffic and interception of SSL/T…]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<p>MITM attack is a fairly popular feature of various sandboxes and application analysis systems. Typically, tools that enable MITM attacks are a proxy server that allows flexible processing of incoming traffic and interception of SSL/TLS sessions, extraction of master keys, and much more. In this case, we need to specify this proxy server in the application or service that is planned to be MITM-attacked. Depending on the flexibility of the tool, it may also have a built-in transparent proxy mode, which, unlike a classic proxy, usually requires traffic to be redirected by network rules (e.g., using iptables) to a specific machine.</p>
<p>👀 <strong>Let&#8217;s look at </strong><a href="https://github.com/droe/sslsplit" target="_blank" rel="noopener">sslsplit</a> — an open-source tool that allows decrypting SSL/TLS connections transparently. <br />Let&#8217;s configure a Debian-based gateway using the <a href="https://github.com/infokek/network-configuration-scripts/blob/main/make_gateway.sh" target="_blank" rel="noopener">make_gateway.sh</a><a href="https://vk.com/s/v1/doc/GIsHZtSTl8HAoAx9a6-S3vC-ulL7a9RT_OyNjSrjhIJtTWU1dT0" target="_blank" rel="noopener">.</a> script as an example.</p>
<p><strong>First, let&#8217;s generate certificates for the subsequent operation of the transparent proxy.<br /></strong></p>

<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">openssl genrsa -out ca.key 2048
openssl req -new -x509 -days 365 -key ca.key -out ca.crt</code></span></pre>

<p><strong>Let&#8217;s launch sslsplit with the specified parameters.</strong></p>

<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">sslsplit -M keys.log -D -l connections.log -j sslsplit/ -S logdir/ -k ca.key -c ca.crt ssl 0.0.0.0 8443 tcp 0.0.0.0 8080</code></span></pre>

<p>From another machine, let&#8217;s make a request without specifying any proxy parameters, since here the proxy is transparent for us and traffic is redirected to the gateway from the client machine, and then SSL/TLS from port 443 is redirected to the running transparent proxy on port 8443, while there are no traffic redirection rules on the client.</p>

<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash">curl --cacert ca.crt --tlsv1.3 https://www.ptsecurity.com/</code></span></pre>

<p>The tool&#8217;s log outputs information that the request passed through the proxy, even though we did not specify it directly (<em>screenshot 1</em>). In the <em>logdir</em> directory that we specified in the tool, a file appears containing the decrypted stream (<em>screenshot 2</em>). At the same time, the <em>keys.log</em> file records SSL/TLS master keys, and subsequently these keys can be used, for example, in Wireshark, if we first capture all the traffic that needs to be decrypted. We talked about this <a href="https://t.me/ptescalator/508" rel="noopener" target="_blank">in the first part of the posts about Wireshark.</a> It is worth noting a shortcoming of this tool — SSLKEYLOGFILE for TLSv1.3 sessions is generated incorrectly, and as a result, when opening a PCAP file in Wireshark, there will be no access to the decrypted data.</p>
<p>But what if we want to generate a PCAP file with decrypted data?</p>
<p>🐻<a href="https://www.netresec.com/?page=PolarProxy" rel="noopener" target="_blank"> </a><a href="https://www.netresec.com/?page=PolarProxy" rel="noopener" target="_blank">PolarProxy</a> — unlike the tool mentioned above, PolarProxy allows generating a PCAP file with decrypted data, but its main drawback is that it is proprietary.</p>
<p><strong>Let&#8217;s launch SOCKS in PolarProxy and specify recording directly to a PCAP file.</strong><br />
At the same time, PolarProxy has a built-in certificate web host; let&#8217;s launch it on port 10080.</p>

<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash">sudo ./PolarProxy -v --certhttp 10080 --socks 1080 -w polarproxy.pcap</code></span></pre>

<p><strong>Let&#8217;s download the certificate</strong></p>

<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash">wget http://127.0.0.1:10080/polarproxy.crt</code></span></pre>

<p><strong>Let&#8217;s form a request through the launched proxy.<br />
</strong>First, specify the certificate in the <code>--cacert</code> option.</p>

<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash">curl --cacert polarproxy.crt --proxy socks5://127.0.0.1:1080 https://ptsecurity.com/</code></span></pre>

<p>After <em>PolarProxy</em> finishes running, we get the recorded PCAP file <em>polarproxy.pcap</em>. In it, we can view this decrypted request through Wireshark (<em>screenshot 3</em>). Unlike the previously described tools, here a decrypted PCAP file is generated in its pure form, so this file can be parsed using Zeek, Suricata, and other DPI tools. </p>
<p>The tool has the ability to use the transparent proxy option, for example:</p>

<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash">sudo ./PolarProxy -v -p 0.0.0.0,10443,80,443 -w polarproxy.pcap</code></span></pre>

<p>Then PolarProxy will be launched transparently on port 10443 and will process traffic from the client machine from ports 80, 443 on all interfaces.</p>
<p>Continued in the post below 👇</p>
<figure class="wp-block-image"><img decoding="async" width="1024" height="577" src="https://ptesc.tech/wp-content/uploads/2025/10/photo_404@22-10-2025_12-12-00-1024x577.jpg" class="attachment-large size-large" alt="" loading="lazy" /></figure>
<figure class="wp-block-image"><img decoding="async" width="1024" height="646" src="https://ptesc.tech/wp-content/uploads/2025/10/photo_405@22-10-2025_12-12-00-1024x646.jpg" class="attachment-large size-large" alt="" loading="lazy" /></figure>
<p><span class="hashtag">#dfir</span> <span class="hashtag">#tip</span> <span class="hashtag">#mitm</span> <span class="hashtag">#ssl</span> <span class="hashtag">#tls</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Looking under the hood of secure connections in Wireshark. Part 1: TLS</title>
		<link>https://ptesc.tech/en/looking-under-the-hood-of-secure-connections-in-wireshark-part-1-tls/</link>
		
		<dc:creator><![CDATA[oUth0R]]></dc:creator>
		<pubDate>Mon, 06 Oct 2025 15:14:50 +0000</pubDate>
				<category><![CDATA[Incident Response]]></category>
		<category><![CDATA[dfir]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tls]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d1%81%d0%bc%d0%be%d1%82%d1%80%d0%b8%d0%bc-%d0%bf%d0%be%d0%b4-%d0%ba%d0%b0%d0%bf%d0%be%d1%82-%d0%b7%d0%b0%d1%89%d0%b8%d1%89%d0%b5%d0%bd%d0%bd%d1%8b%d1%85-%d1%81%d0%be%d0%b5%d0%b4%d0%b8%d0%bd%d0%b5/</guid>

					<description><![CDATA[🦈 Looking Under the Hood of Secure Connections in Wireshark. Part 1: TLS Our network experts often need to decrypt TLS connection traffic and analyze protected content. Modern TLS algorithms have long been using the Ephemeral Diffie–Hellman…]]></description>
										<content:encoded><![CDATA[🦈 <strong>Looking Under the Hood of Secure Connections in Wireshark. Part 1: TLS</strong><br />
<br />
Our network experts often need to decrypt TLS connection traffic and analyze protected content. Modern TLS algorithms have long been using the Ephemeral Diffie–Hellman (EDH) scheme, which prevents decrypting TLS sessions with an RSA private key. <br />
<br />
Now, to decrypt, you need to collect the so-called session keys using the TLS client or server itself. And over many years, we&#8217;ve gathered several life hacks that work for most applications being analyzed. Let&#8217;s go!<br />
<br />
<strong>1️⃣ Browsers and console utilities</strong><br />
<br />
To decrypt browser TLS sessions or console utilities, such as curl, you need to set the SSLKEYLOG environment variable. This is done using the command <code>export SSLKEYLOGFILE=/path/to/keylog.log</code> for Linux systems or via environment variables (<em>screenshots 1 and 2</em>) on Windows systems. Now browsers and utilities will save session keys to the specified file.<br />
<br />
<strong>2️⃣ Go applications</strong><br />
<br />
Setting up a key dump in such applications will require a small patch. You need to either add these lines to the application&#8217;s own code (<a href="https://pkg.go.dev/crypto/tls#example-Config-KeyLogWriter" rel="noopener" target="_blank">example</a>).<br />
<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">w, err := os.OpenFile("/path/to/SSLKEYLOGFILE", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
config := &amp;tls.Config{KeyLogWriter: w}
</code></span></pre><br />
<br />
Or, if the tls config is not explicitly defined in the file, but the standard crypto/go library is used in the program itself or in a library, you can set the sslkeylog file directly in it. We&#8217;ve provided an example diff file (<a href="https://disk.yandex.ru/d/MMcWIr9YlM8FAw" rel="noopener" target="_blank">common_go.diff</a>) for <code>go version go1.24.4 linux/amd64</code>. After that, it&#8217;s enough to set the path to the keylog file in the SSLKEYLOGFILE environment variable:<br />
<br />
<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash"><span class="hljs-built_in">export</span> SSLKEYLOGFILE=/path/to/keylog.log
</code></span></pre><br />
<br />
<strong>3️⃣ Python applications</strong><br />
<br />
Setting up a key dump also works by setting the SSLKEYLOGFILE environment variable:<br />
<br />
<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash"><span class="hljs-built_in">export</span> SSLKEYLOGFILE=/path/to/keylog.log
python main.py
</code></span></pre><br />
<br />
<strong>4️⃣ Node.js applications</strong><br />
<br />
You simply need to run the application with the tls-keylog flag<br />
<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">node --tls-keylog=/path/to/keylog.log program.js
</code></span></pre><br />
<br />
Or set the NODE_OPTIONS environment variable and run the program in the same console:<br />
<br />
<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash"><span class="hljs-built_in">export</span> NODE_OPTIONS=--tls-keylog=/path/to/keylog.log
</code></span></pre><br />
<br />
<strong>5️⃣ Xray Core</strong><br />
<br />
Other proprietary applications may use their own parameters for dumping session keys. Especially those that implement TLS connections in their own way. Xray is a whole framework that supports many VPN protocols, including VMess, VLESS, and XTLS. Thanks to the Xray core developers, collecting session keys is no trouble. You just need to add the masterKeyLog key to the outbound connection configuration.<br />
<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">"realitySettings": {
  "serverName": "yahoo.com",
  "publicKey": "publicKey",
  "shortId": "shortId",
  "fingerprint": "chrome",
  "spiderX": "/",
  "masterKeyLog": "/path/to/keylog"
}
</code></span></pre><br />
<br />
Most Xray configurations are set using URLs; to add the key, you need to edit the JSON configuration inside the client or server after adding the key.<br />
<br />
<strong>How to use the obtained session keys</strong><br />
<br />
To decrypt a TLS session in Wireshark, you need to open Edit → Preferences, then in the TLS protocol settings select the Master-Secret log filename file (<em>screenshot 3, result in screenshot 4</em>).<br />
<br />
☠️ And in the next part, we&#8217;ll talk about decrypting the encrypted content of SMB/LDAP/DCERPC protocols with NTLM and Kerberos authentication. <br />
<br />
Share your own life hacks in the comments ⬇️

<figure class="wp-block-image"><img width="1024" height="439" src="https://ptesc.tech/wp-content/uploads/2025/10/photo_393@06-10-2025_15-14-50-1024x439.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/10/photo_393@06-10-2025_15-14-50-1024x439.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/10/photo_393@06-10-2025_15-14-50-300x129.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/10/photo_393@06-10-2025_15-14-50-768x330.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/10/photo_393@06-10-2025_15-14-50.jpg 1172w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="824" src="https://ptesc.tech/wp-content/uploads/2025/10/photo_394@06-10-2025_15-14-50-1024x824.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/10/photo_394@06-10-2025_15-14-50-1024x824.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/10/photo_394@06-10-2025_15-14-50-300x241.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/10/photo_394@06-10-2025_15-14-50-768x618.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/10/photo_394@06-10-2025_15-14-50.jpg 1102w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="634" src="https://ptesc.tech/wp-content/uploads/2025/10/photo_395@06-10-2025_15-14-50-1024x634.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/10/photo_395@06-10-2025_15-14-50-1024x634.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/10/photo_395@06-10-2025_15-14-50-300x186.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/10/photo_395@06-10-2025_15-14-50-768x475.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/10/photo_395@06-10-2025_15-14-50.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>

<br />
<br />
<span class="hashtag">#dfir</span> <span class="hashtag">#tip</span> <span class="hashtag">#tls</span> <span class="hashtag">#network</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
