<?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 Stefan Grimminck on Medium]]></title>
        <description><![CDATA[Stories by Stefan Grimminck on Medium]]></description>
        <link>https://medium.com/@grimminck?source=rss-55ca9930e813------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VjjfgaZAoDS0MBpKFq07sg.jpeg</url>
            <title>Stories by Stefan Grimminck on Medium</title>
            <link>https://medium.com/@grimminck?source=rss-55ca9930e813------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 14:38:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@grimminck/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[JSON Smuggling: A far-fetched intrusion detection evasion technique]]></title>
            <link>https://grimminck.medium.com/json-smuggling-a-far-fetched-intrusion-detection-evasion-technique-51ed8f5ee05f?source=rss-55ca9930e813------2</link>
            <guid isPermaLink="false">https://medium.com/p/51ed8f5ee05f</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Stefan Grimminck]]></dc:creator>
            <pubDate>Wed, 07 Feb 2024 10:26:32 GMT</pubDate>
            <atom:updated>2025-09-17T09:55:49.352Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>TL:DR Insignificant whitespaces in the JSON standard can be used to encode data without breaking the format. This could aid malicious actors in covert lateral movement or data exfiltration.</em></strong></p><p>Mastering the art of intrusion involves a delicate balance: gaining access to critical systems and doing so in a covert manner. This drives attackers to find ways to move files, data, and executables around networks to either gain access, gather data or navigate through different parts of the network in a concealed way.</p><p>In this blog post, I try to shed some light on JSON smuggling, a technique that uses the standard implementation of the JSON specification [<a href="https://datatracker.ietf.org/doc/html/rfc8259#section-2"><em>RFC 8259</em></a>] itself to discreetly transfer data across networks, presenting a formidable challenge to conventional IDS and IPS detection mechanisms.</p><p>This technique resembles similar methods observed in real-world scenarios, where attackers have utilized tactics like whitespace steganography, image steganography, covert channels within protocols, concealed data within file formats, and DNS tunneling to fulfill their malicious goals. By using these covert communication techniques, attackers can bypass traditional security measures and execute their actions without being noticed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*cwwJWhuyOF-CobQb" /></figure><p>The JSON specification as defined in <a href="https://datatracker.ietf.org/doc/html/rfc8259#section-2">https://datatracker.ietf.org/doc/html/rfc8259</a> allows for “insignificant whitespace” characters to be used within the JSON objects.</p><pre>Insignificant whitespace is allowed before or after any of the six<br>   structural characters.<br><br>      ws = *(<br>              %x20 /              ; Space<br>              %x09 /              ; Horizontal tab<br>              %x0A /              ; Line feed or New line<br>              %x0D )              ; Carriage return</pre><p>This smuggling technique uses these characters as data encoding for injecting a valid JSON object with additional data, without altering the source data itself. Remarkably, this process doesn’t compromise the integrity of the JSON data or trigger alarms in most intrusion detection systems. By using combinations of spaces, tabs, newlines, and carriage returns, data can be covertly embedded within JSON files, flying under the radar of parsers and detection systems.</p><h4>An example:</h4><p>Normal JSON object:</p><pre>{<br>  &quot;Month&quot;: &quot;February&quot;,<br>  &quot;year&quot;: 2024<br>}</pre><p>JSON object with smuggled data (<em>hint: select the text</em>):</p><pre>{<br>  &quot;Month&quot;: &quot;February&quot;,<br>  &quot;year&quot;: 2024<br>}                                                                                                      ⏎</pre><p>To the human eye, and almost all systems that interpret JSON these two examples are exactly the same, as the standard allows for insignificant whitespaces characters to exist. They both contain one valid JSON object, and are interpreted as such. However, the second example contains the encoded data “Hello World!” in tabs and spaces.</p><p>A hexdump of the last objects reveals us the encoded data:</p><pre>00000000  7b 0a 20 20 22 4d 6f 6e  74 68 22 3a 20 22 46 65  |{.  &quot;Month&quot;: &quot;Fe|<br>00000010  62 72 75 61 72 79 22 2c  0a 20 20 22 79 65 61 72  |bruary&quot;,.  &quot;year|<br>00000020  22 3a 20 32 30 32 34 0a  7d 0a 20 09 20 20 09 20  |&quot;: 2024.}. .  . |<br>00000030  20 20 20 09 09 20 20 09  20 09 20 09 09 20 09 09  |   ..  . . .. ..|<br>00000040  20 20 20 09 09 20 09 09  20 20 20 09 09 20 09 09  |   .. ..   .. ..|<br>00000050  09 09 20 20 09 20 20 20  20 20 20 09 20 09 20 09  |..  .      . . .|<br>00000060  09 09 20 09 09 20 09 09  09 09 20 09 09 09 20 20  |.. .. .... ...  |<br>00000070  09 20 20 09 09 20 09 09  20 20 20 09 09 20 20 09  |.  .. ..   ..  .|<br>00000080  20 20 20 20 09 20 20 20  20 09 20 20 20 20 09 20  |    .    .    . |<br>00000090  09 20                                             |. |<br>00000092</pre><p>While not inherently remarkable, the intriguing aspect lies in the potential for encoding data within a JSON file. I’ve developed a script that reads data from various file formats, including executables, images, and videos. This script then transforms this data into the “insignificant” whitespace characters which can be added to a normal JSON object. Subsequently, a decoding program can revert this encoding to the original data from the JSON file, making the possibilities quite expansive.</p><p>In the following example I add an executable to a JSON object, validate it against a JSON processor and then decode it back to the original executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qlJMl2lMLii6zVI6XfO_Xw.png" /></figure><p>In scenarios where attackers seek to exchange data between compromised network segments for lateral movement or data exfiltration, especially in the presence of perimeter monitoring, JSON smuggling emerges as a potent technique. By leveraging this method, adversaries can effectively sidestep conventional malware detection rules, creating files that remain valid and innocuous on the surface.</p><p>Fortunately, YARA can aid in detecting JSON smuggling by identifying consecutive whitespace characters within the JSON structure. However, detecting these whitespace characters is a computationally intensive operation, so it might not be logical for your security setup. To illustrate, the following YARA rule provides a means to accomplish this detection:</p><pre>/*<br>    This Yara ruleset is under the GNU-GPLv2 license (http://www.gnu.org/licenses/gpl-2.0.html) and open to any user or organization, as long as you use it under this license.<br>*/<br><br>rule Detect_Hidden_Data_In_Files {<br>    meta:<br>        author = &quot;Stefan Grimminck&quot;<br>        description = &quot;Detects hidden data in files by identifying sequences of at least 8 consecutive whitespace characters.&quot;<br>        date = &quot;2024-02-05&quot;<br><br>    strings:<br>        $hidden_data = /[\x20\x09\x0A\x0D]{8,}/   // Pattern for at least 8 consecutive whitespace characters<br><br>    condition:<br>        $hidden_data<br>}</pre><p>For many, the JSON smuggling technique may not initially pose a significant threat to their infrastructure. However, when integrated with intrusion frameworks, this method transforms into a potent tool for moving data within or beyond monitored networks, all while maintaining a low risk of detection.</p><p>Moreover, by employing more sophisticated encoding techniques utilizing the six insignificant characters, attackers can further minimize the size of the encoded payload, enhancing their stealth and efficacy in covert operations.</p><p>In summary, JSON smuggling is an intrusion evasion technique that utilizes insignificant whitespaces in the JSON specification to allow covert data transfer across monitored networks. It poses a risk for lateral movement and data theft within monitored perimeters. However, due to its niche nature and likely infrequent usage, detection may be challenging and resource-intensive. Despite these challenges, attackers can still exploit common formats for malicious purposes (<em>XML isn’t save either ;) </em>).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51ed8f5ee05f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Digital False Flag Operations: A How-To Guide]]></title>
            <link>https://grimminck.medium.com/digital-false-flag-operations-a-how-to-guide-bc529b54cc22?source=rss-55ca9930e813------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc529b54cc22</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[intrusion-detection]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[state-actor]]></category>
            <dc:creator><![CDATA[Stefan Grimminck]]></dc:creator>
            <pubDate>Thu, 26 Jan 2023 09:17:31 GMT</pubDate>
            <atom:updated>2023-01-26T09:17:31.585Z</atom:updated>
            <content:encoded><![CDATA[<h4>Pinning your malicious cyber operations to the opposition</h4><p>In today’s digital age, the threat of cyber attacks is a constant concern for organizations and individuals alike. One tactic that has gained attention in recent years is the use of false flag operations. But what exactly is a false flag operation and how is it being utilized in the realm of cyber security?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PS19KRB6Fepy9Ui5PETBhw.jpeg" /></figure><p>This post goes into possible methods and techniques of falsifying the source of malware and intrusions with the intent of shedding some light on how threat analysts might be deceived.</p><p>This post covers:</p><ul><li>Deceiving using known techniques and exploitation tools</li><li>Adding false flags within malware using region-specific exclusions</li><li>Adding language-specific code comments in malware</li><li>Re-using leaked or open-source code from known threat actors</li><li>Claiming uncovered operations under false identities</li></ul><h4>Deceiving using known techniques and exploitation tools</h4><p>Threat attributors, <em>the individuals tasked with tracking, identifying, and accrediting perpetrators of cyberattacks,</em> use threat indicators to track and identify adversaries. A popular source of these indicators (techniques and software) is gathered and published <a href="https://attack.mitre.org/groups/">here</a> by the MITRE corporation.</p><p>It is a very useful and respected database, currently containing the techniques and software used by 135 identified threat actors. However, this database is useful for threat actors themselves as well.</p><p>They can choose to purposefully run attacks on and within networks to cater to the techniques used by different malicious groups. This would let security analysts down the wrong path and create a digital smokescreen.</p><p><strong>An example:</strong></p><p>First, as a threat actor, you need to find a known group that has the potential to target the same victim as you do. This can be a company within the financial sector, vital infrastructure in a different country, your local bakery, you name it.</p><p>For this experiment, we’ll go after an imaginary financial institution in Europe. Now, we go through the list of known threat actors with the same target group. A quick Google search results in the following of possible groups: FIN7, Monkey Taker, MetaStrike, Lazarus, Carbanak.</p><p>Let’s make the FIN7 group take the blame for our operation! MITRE shows us a list of known exploitation techniques used: <a href="https://attack.mitre.org/groups/G0046/">https://attack.mitre.org/groups/G0046/</a>.</p><p>A few specific actions stand out:</p><ul><li>FIN7 makes use of the MEGA file-sharing site for data exfiltration</li><li>FIN7 has created a scheduled task named “AdobeFlashSync” to establish persistence.</li><li>FIN7 has exploited ZeroLogon (CVE-2020–1472) against vulnerable domain controllers.</li></ul><p>It is reasonable to assume that a security mature company has detection rules set up for this specific behaviour. It can be used to your advantage as it increases the possibility of your false flags being found. Using similar file names and file-sharing sites for data exfiltration might help get this Russian threat group get blamed for your operation.</p><h4>Adding false flags within malware using region-specific exclusions</h4><p>On Friday, July 2nd, 2021 the threat group REvil commits a worldwide ransomware attack exploiting Kaseya VSA software to deliver a malicious payload. The ransomware would check for certain keyboard languages to be installed. In specific, keyboards using the Cyrillic script. If this was configured, the ransomware would not further infect the system. REvil used this as a built-in failsafe designed to cover the backsides of the threat actor.</p><p>Imagine how implementing such a feature can be used to create a false flag. First check for specific regions, languages, and keyboards to be installed on systems from a country you want to take the blame for your actions and exclude your malware for these machines. This piece of code doesn’t even have to be operational as long as it exists in payload used in the operation.</p><h4>Adding language-specific code comments in malware</h4><p>Malicious actors often make use of scripting languages for staging malware. Commonly used ones are PowerShell, Bash, and Python. The following image shows a script used by threat actors to install a cryptojacker on a target. As you can see, it uses the English language for function names and code comments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/0*YrwYTMGFYDquZmYK.png" /><figcaption>Install script Sysrv-hello Cryptjacking Botnet</figcaption></figure><p>Purposefully translating function names and comments in malicious scripts to, for example, the Cyrillic script or Mandarin language could be used to side-track the security analysts working on attributing the malware to a specific actor.</p><h4>Re-using leaked or open-source code from known threat actors</h4><p>A lot of hacking frameworks and exploit kits get leaked to the internet. Using MITRE, we can trace back what kind of exploit kits are used by specific threat actors. For example, FIN7 is known to use the following software: AdFind, BOOSTWRITE, Carbanak, Cobalt Strike, CrackMapExec, GRIFFON, HALFBAKED, JSS Loader, Lizar, Mimikatz, Pillowmint, POWERSOURCE, PowerSploit, RDFSNIFFER, REvil, SQLRat, TEXTMATE</p><p>From a lot of these tools, source code is available. Re-using it in your attack would further enhance your digital smokescreen. Also, exploit kits may have been leaked, like the backdoor used by FIN7 for their attacks. Re-using or dropping such payloads in target networks would certainly misguide security analysts.</p><h4><strong>Claiming uncovered operations under false identities</strong></h4><p>As a last resort a threat actor can make use of tools outside the scope of the original operation. Let’s say you successfully infiltrated a target and they later find out that a breach has taken place. Now you could use false social media accounts to claim the attack or sell stolen information under fake identity linked to the groups/individuals you want to take blame.</p><h4>Who would perform these operations?</h4><p>It’s important to note that the typical threat actor would not employ false flags to obscure their attacks as doing so would increase the likelihood of detection. Skilled and sophisticated malicious actors would also be careful not to make their false flags too conspicuous, as this would raise suspicion and reveal to threat analysts that they are being misled. False flag cyber operations are primarily used for the purpose of creating confusion and spreading disinformation, which may be employed by state actors for strategic gain. It’s important not to be naive about the potential use of such tactics.</p><p>The purpose of this post is not to instruct individuals with nefarious intentions on how to conceal their actions, as that would only complicate my own efforts. These techniques are well-known and used in the wild. My intention is to emphasize the importance of a thorough examination during the triage process, as things may not always be as they initially appear.</p><p>Often they will, but examining high-value targets may require a more thorough look. Wrongly attributing cyber attacks can have real-world consequences and be used as a tool for misinformation. Therefore, it is crucial to ensure that our findings are correctly attributed.</p><p>Thank you for reading &amp; stay vigilant!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc529b54cc22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Threat Intelligence Feed using the Twitter API and a bit of code]]></title>
            <link>https://grimminck.medium.com/building-a-threat-intelligence-feed-using-the-twitter-api-and-a-bit-of-code-5787808e32ef?source=rss-55ca9930e813------2</link>
            <guid isPermaLink="false">https://medium.com/p/5787808e32ef</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[twitter]]></category>
            <category><![CDATA[threat-intelligence]]></category>
            <dc:creator><![CDATA[Stefan Grimminck]]></dc:creator>
            <pubDate>Sat, 28 May 2022 12:02:14 GMT</pubDate>
            <atom:updated>2022-06-05T09:41:22.350Z</atom:updated>
            <content:encoded><![CDATA[<p>The InfoSec community is highly active on Twitter. The platform is, among other things, used is for sharing malware and phishing URLs through the <a href="https://twitter.com/search?q=%23opendir"><em>#opendir</em></a> hashtag. Very useful for correlating with DNS traffic, but not often used due to the difficulty of interpreting Twitter feeds in an automated manner. This post goes into how Twitter can be used as a threat intelligence feed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*6u3cf1kTzdCa6SHHYPmu2Q.png" /></figure><p>I’ve written a small program that receives a stream of tweets containing URLs using ‘hxxp://’ and ‘hxxps://’. This is the format malicious URLs are often shared in to prevent users from accidentally clicking on them. The program retrieves these tweets, parses the Twitter response and extracts the malicious URLs. The feed is available at <a href="https://twitter.threatintel.rocks/">twitter.threatintel.rocks</a> and is made to be interpreted by machines.</p><h3>A few examples</h3><p>Pretty printing the feed using the JQ tool, a JSON command-line processor, allows us the more clearly view the results.</p><pre>curl <a href="https://twitter.threatintel.rocks/">https://twitter.threatintel.rocks/</a> --silent | jq</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xe1ZzMaZ7dO-8TI90m1_mA.png" /></figure><p><strong>Retrieving only the reported URLs</strong></p><p>JQ also allows us to apply filters on the retrieved content. A simple cURL command with a filter on the ‘malicious_urls’ array shows us all the reported URLs transformed back into their original form.</p><pre>curl <a href="https://twitter.threatintel.rocks/">https://twitter.threatintel.rocks/</a> --silent | jq -r &#39;.malicious_urls | .[]&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N1z-TymOvVz1hM_aDT9Ttg.png" /></figure><h4>Generating a list of IP addresses from the most reported URLs</h4><p>The following command allows you to extract all values from the malicious_ips array and sort it on occurrence.</p><pre>curl <a href="https://twitter.threatintel.rocks/">https://twitter.threatintel.rocks/</a> --silent | jq &#39;.malicious_ips |  .[]?&#39; -r | sort | uniq -c | sort -nr</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BxQk-F_afIlDlFBi6t-1gA.png" /></figure><h4>Generating a list of top contributors of malicious URLs.</h4><p>This only contains contributors that have been active since the launch of the feed. However, it’s continuously updated.</p><pre>curl <a href="https://twitter.threatintel.rocks/">https://twitter.threatintel.rocks/</a> --silent | jq -r .username | sort | uniq -c | sort -nr</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mYs2ytcLYcPzlrJtS7JK2w.png" /></figure><p>Most SIEM tools have the ability to retrieve threat intelligence feeds over REST and parse JSON. So, I’ve made the feed to represent the data in the JSONL format as it seemed the most logical format for now.</p><p>Have fun!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5787808e32ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running a WiFi-less Home Network: Security Paranoid Edition]]></title>
            <link>https://grimminck.medium.com/running-a-wifi-less-home-network-security-paranoid-edition-e9453345006e?source=rss-55ca9930e813------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9453345006e</guid>
            <category><![CDATA[wifi]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Stefan Grimminck]]></dc:creator>
            <pubDate>Mon, 15 Nov 2021 13:15:15 GMT</pubDate>
            <atom:updated>2021-11-15T14:28:38.497Z</atom:updated>
            <content:encoded><![CDATA[<h4>And a few <strong>reasons</strong> why you should consider it.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nddwcEwuF_0KmsuRlIcEjg.jpeg" /></figure><p>When reading the title, you might have asked yourself: Why would anyone get rid of the Wi-Fi capabilities of their network? Aren’t wireless access points something that should improve my internet experience? Here a few reasons why you might consider moving away from using a wireless internet connection in general.</p><ol><li>Wi-Fi hacking is of such importance in (physical) pen-testing that industry recognized wireless <a href="https://www.offensive-security.com/wifu-oswp/">penetration certifications</a> and courses have been created specifically to train people to breaking into networks wirelessly.</li><li>Your network will likely be included in public wardriving databases, for the whole world to find. Seriously, look it up on: W<a href="https://wigle.net/">igle.net</a>. This information could be used for tracking you through geolocation correlation in combination with your mobile devices.</li><li>Wi-Fi networks are prone to exploitation through publicly known vulnerabilities. Let alone the vulnerabilities found in the poor attempts from some manufacturers at integrating the WPA-protocols into their products.</li><li>Networks often get compromised through wireless access points as they allow interaction with the network without having need to cross physical boundaries (i.e. locked doors, walls, windows). A good real-life example is how Russian GRU operatives attempted to hack <em>The Organisation for the Prohibition of Chemical Weapons</em> via the wireless access points.</li><li>Wireless access points add an extra layer of complexity to your network that could introduce connection interference. WiFi issues are something every network owner has struggled with. Removing this factor from your network helps improve connection stability.</li><li>Control. Having all devices connected over wire will allow you to have more insight and control over everything that accesses your network. It will also prevent your network from unintentionally leaving the building. And, let’s be honest, you have probably shared your Wi-Fi password with quite a bit more people than necessary.</li></ol><h3>Starting Out</h3><p>Now we have that out of the way, it’s time to think of a proper integration strategy. Often, more devices than you’d expect make use of your WiFi network to function. These can range from smart lights, wireless printers, fridges, televisions, thermostats, laptops, tables, smartphones, and many more.</p><p>To get more insight into all connected devices in your home network the routers “connected devices” page can be used to find all wireless connected devices. You’ll find devices that don’t directly allow you to connect them via cable. Here we’ve arrived at the first roadblock. You will need to consider if running these devices via Wi-Fi is necessary. Phones can still reach the internet through a cellular plan and you should ask yourself if your home thermostat really need that internet connection. Other devices like televisions, gaming consoles, or even “smart” fridges can often reach your router through a wired connection.</p><h3>Paranoia Mode: Removing Wi-Fi radios</h3><p>A measure to make sure your systems don’t use Wi-Fi, is to remove and disable the radios in your systems. The last system you should start disabling the Wi-Fi radios from is your networks wireless access point, as it will allow you to keep an inventory of all devices still trying to connect wirelessly. Start with “smart” kitchen appliances, televisions, home automation appliances, etc. Then progress to laptops, computers, and tablets. Here you can choose to disable the radio programmatically or to crack open the systems and remove the Wi-Fi radio manually, something often easier said than done. At this point you’ll also consider investing in some quality switches, network cables and Ethernet adapters to facilitate the change to cable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4ybd3B1r_1HcEGjn.jpg" /><figcaption>Wireless network adapter inside laptop</figcaption></figure><p>A lot of devices will setup their own wireless access point when a Wi-Fi connection is not available. Think of all to wireless printers you’re able to connect to through your smartphone or the device controllers for your smart lights. Consider disabling these access points as well. They might even introduce a greater risk than the access point from your network.</p><h3>Invest in some Network Insights</h3><p>Now you’ve got all these pesky network devices under control, you should consider setting up some systems to help you investigate on what is going on over the wire. A range of open-source products have been created to help you out.</p><h4>Pi-Hole</h4><p>A DNS caching/<a href="https://en.wikipedia.org/wiki/DNS_sinkhole">sinkhole</a> system that gives you control over DNS lookups done by systems inside your network. A great tool for hunting suspicious activity on your network. An example usage of this would be the DNS sinkholing of all cryptocurrency mining pools, which would indicate devices in your network are infected by miners. Ads and trackers can also be blocked through Pi-Hole.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8nCFXGXa1vfnAIq4Ui8e2w.png" /></figure><h4>pfSense / OPNsense</h4><p>Network security gateways running PFsense or OPNsense allows you to more closely monitor and block traffic coming through your network. You could invest in <a href="http://shop.netgate.com/products/1100-pfsense">this</a> out-of-the-box solution network firewall from Netgate if you don’t own your own hardware to run it on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*vzvNCsSt-3aNdcN4.jpg" /></figure><h4>Prometheus</h4><p>Tools like <a href="https://prometheus.io/">prometheus.io</a> will help you gather the metrics from your network appliances and graph them on customizable dashboards. This will allow you to create an overview of network performance and stability over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mAp4csDX_XFXQaCc" /></figure><h3>Long story short</h3><p>I’ve not written this article with the expectation that you start to abandon your wireless access points all together. The goal is to make you aware of the risks introduced with wireless network equipment and the possible attack vectors it introduces to your home network. For some, these measures seem unreasonable and the motives far-fetched. However, the reasons someone could infiltrate your home network could differ from what you initially expect.</p><p>You could live next to an important building or individual and your network can be used as a steppingstone into theirs, or your network could be used as medium for malicious actors to setup shop or spread malware. The above-mentioned tools can help create network (security) insights regardless of your reasons or integration strategy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9453345006e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The implications of neglecting IPv6 on your internet facing services]]></title>
            <link>https://grimminck.medium.com/the-implications-of-neglecting-ipv6-on-your-internet-facing-services-538ebe3506fa?source=rss-55ca9930e813------2</link>
            <guid isPermaLink="false">https://medium.com/p/538ebe3506fa</guid>
            <category><![CDATA[ipv4]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[ipv6]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Stefan Grimminck]]></dc:creator>
            <pubDate>Wed, 12 May 2021 16:17:30 GMT</pubDate>
            <atom:updated>2021-05-12T23:56:45.707Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TL;DR</strong>: Managing the online exposure of systems can be difficult. Sometimes IPv6 network configurations get forgotten, leading to services unknowingly connected to the internet.</p><p>We’ve been (very) slowly adopting IPv6 since its introduction in 1995. This added protocol version allows computer systems to be available in two different address spaces (IPv4 and IPv6). This could possibly expand the attack surface of a system if it’s not managed properly. Fortunately, most firewalls will update user defined rules for both versions simultaneously. This blog-post goes further into finding exposed online services in the IPv6 space, which aren’t reachable via their IPv4 counterpart.</p><p>I’ve scanned a subset of the public IP space to get an idea of how many firewalls/systems actually have different configurations in the two address spaces. I was able to match these using DNS look-ups and validating them by looking for exposed services that make use of certificates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fUZpTdHVM9z9FZrdt0hj3g.png" /><figcaption>Scanning and matching IP versions using a custom written Go program</figcaption></figure><p>The experiment started with a sample group of <strong>18 710 </strong>IPv4/6 address pairs. Of these, <strong>10 683</strong> (~57.1%) address couples had matching certs and <strong>8 027 </strong>(~42.9%) did not (mostly due to incorrect DNS records). The non-matching pairs were disregarded.</p><p>A<strong> </strong>suspiciously overwhelming amount of <strong>5 055</strong> (~47.3% of <strong>10 683</strong>) systems returned having discrepancies between the services exposed on the different addresses (<em>according to Nmap</em>).</p><p><strong>4 510 </strong>(<em>~</em>42.2% of <strong>10 683 </strong>total) of the systems in this dataset had more ports open on IPv4 than IPv6. This could be due to sysadmins disabling specific services for IPv6.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-KY-zQ3yon-2D7N4k732cA.png" /><figcaption>This graph shows all services that were found on the IPv4 address but not on the IPv6 address of systems in the dataset</figcaption></figure><p>The amount of exposed IPv4 only services here is interesting, knowing that there are “just” <strong>4 510 </strong>servers with more IPv4 than IPv6 services in the dataset. Looking at the top domains with discrepancies shows us that there’s probably one network exposing the bulk these endpoints:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*00tHxP_DCcH9s0szZ8DUUA.png" /></figure><p>Home.pl is a Polish internet provider that apparently doesn’t expose some services in the IPv6 space, explaining the huge amount of xxx.home.pl servers with this specific discrepancy. The data explains why we have so many xxx.home.pl systems in there. It’s because of the validation step requiring a system to expose at least one service using certificates on both IPv4 and IPv6. The system administrators / architects have probably decided to only support IPv4 for some specific services resulting in the above graph.</p><h4>Here is where it starts to become interesting…</h4><p>The amount of servers with specific services <strong><em>only</em> </strong>exposed on IPv6 came out to be <strong>422</strong> (<em>~</em>4.0% of <strong>10 683 </strong>total)*. Let’s have a closer look the exposed services on these machines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qfnXLqWDYbDFAGVR-xfSxw.png" /></figure><p>In this dataset there are 132 systems that <strong><em>only</em> </strong>expose SSH on IPv6 and 133 systems that have this for rpcbind as well. 27 HTTP servers were also found to not be exposed on IPv4.</p><p>Having services like SSH run only on IPv6 could be a “security” measure (<a href="https://en.wikipedia.org/wiki/Security_through_obscurity">security through obscurity</a>), but is more likely due a mis- or unmanaged system. This would especially be likely for services as HTTP or MySQL.</p><h4>Some examples of possible misconfiguration</h4><p>A university in Germany running a switch where the telnet access is still enabled for IPv6 allowing anyone on the internet to connect (not authenticate).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fb1p1O_3sf0T5TyeJ6VreQ.png" /><figcaption>Access to a switch only disabled for IPv4 (Telnet), but not for IPv6</figcaption></figure><p>A website promoting IT certifications running an SSH service accessible via IPv6, but not IPv4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*axNZcnlpfolw8qXcV3wt1Q.png" /><figcaption>SSH server only disabled for IPv4, but not for IPv6</figcaption></figure><p>A content delivery network or CDN exposing a FTP service via their IPv6 address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oHw8Y1G--Wf0ejC2kN1ABg.png" /></figure><p>These are all examples of systems were you’d expect to have access, or none at all. Having access, but only through IPv6 suggests (but doesn’t confirm) that something went wrong in the network configuration of their respective servers.</p><h3>Conclusion</h3><p>There are quite a bit of servers running services only in the IPv6 space. Not keeping track how your firewall and network settings are configured could lead to unwanted exposed services on the internet. This is especially harmfully when the service itself lacks authentication or is vulnerable to exploitation. Unfortunately there are a lot of publicly accessible systems that still are only reachable through IPv6, suggesting misconfiguration**.</p><p>Some notes:</p><ul><li>Datasets have been generated in February of 2021</li><li>This does not, in any way, shape or form, quality as scientific research. This is just a result of an interest in firewall discrepancies and a few free evenings.</li></ul><p>* A number that would be higher if the certificate validation wasn’t needed on both IPv4 and IPv6 to ensure a valid match.</p><p>** In an ideal world we would only use IPv6, but we still have a long way to go to get there. Currently IPv4 is still the de facto as it’s more widely supported.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=538ebe3506fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running a fake power plant on the internet for a month]]></title>
            <link>https://grimminck.medium.com/running-a-fake-power-plant-on-the-internet-for-a-month-4a624f685aaa?source=rss-55ca9930e813------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a624f685aaa</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[honeypot]]></category>
            <category><![CDATA[scada]]></category>
            <dc:creator><![CDATA[Stefan Grimminck]]></dc:creator>
            <pubDate>Fri, 15 Jan 2021 14:13:51 GMT</pubDate>
            <atom:updated>2022-11-16T11:50:46.747Z</atom:updated>
            <content:encoded><![CDATA[<p>People think of the internet as a host for services like banking websites, blogs and social networks. However, this is only a small part of everything connected. The internet is home to a big range of IoT systems and machines as well. These vary from simple “smart” light switches, to machinery used in industrial plants.</p><p>One of the concerns stated in the yearly publication by the Dutch government called “<a href="https://www.rijksoverheid.nl/documenten/rapporten/2019/06/12/tk-bijlage-cybersecuritybeeld-nederland-csbn-2019">Cybersecuritybeeld Nederland</a>” (2019) was the lack of insight into malicious digital (state sponsored) activity towards vital infrastructure. We (<em>the Dutch</em>) don’t know who is trying to hack our dams, locks, dikes and bridges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fe1jmBrEL0AsXcJNfcuNlg.jpeg" /></figure><p>One of the systems often used to get more information about digital attackers are called honeypots. These mechanisms detect attempts at unauthorised use of computer systems. You could think of these as a digital version of bait cars used by the police to catch thieves. For this particular project I wrote a small <a href="https://github.com/honeytrap/honeytrap">HoneyTrap</a> listener (an open-source project by <a href="https://dtact.com/">DTACT</a>) that can interact with systems scanning for devices on the s7comm protocol.</p><h3>About the simulator</h3><p>I decided to simulate a programmable logic controller, or PLC for short. In particular, a PLC that acts like a value regulator in a nuclear installation. PLCs interface with actuators and sensors to open valves, run motors and start pumps. They can be found everywhere from the rollercoasters in your local theme park to control boards for huge industrial pumpjacks. PLCs both act in the digital and physical space. This could make them very interesting for malicious actors, as a faulty system could potentially have catastrophic physical outcomes.</p><p>The simulation I created is very basic and is not considered “high-interaction”. After little interaction a skilled hacker would know that the system is actually a fake. However, this is not a concern of mine, as my sole purpose is to figure out who is responsible for the initial contact. Despite its simplicity, it was still able to deceive simple exploitation scripts in faking a system disruption.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rV-iKZkNgikR6EY_.jpg" /></figure><h3>How it works</h3><p>Siemens PLCs use SZL for showing other machines what type of PLC it is. SZL stands for <strong>S</strong>ystem<strong>Z</strong>ustands<strong>L</strong>iste and is German for system information list. Internet scanners make use of this by making two requests. A module ID request and component ID request. The response is then decoded by the (internet) scanners and used for indexing. See results from Censys and Shodan below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*8ImNuCpIsbzpMaZz9uIaAA.png" /><figcaption>(old) test setup with two Siemens S7 1200 PLCs</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G2zmUNGx_ZXYSd-A4fd4Dw.png" /><figcaption>Setting up communications to the PLC</figcaption></figure><p>First, a TCP connection is set up using the 3-way handshake. After that a COTP connection request (CR) is sent to the machine. If accepted, the PLC will return a COTP Connection Confirmed response. The client system will now send a S7Comm job request to setup a connection on the Siemens s7 protocol called s7comm.</p><p>Now that everything is in place, the client can start retrieving information about the PLC by doing multiple requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AvnwKQAPTsV7fAqi30x16A.png" /><figcaption>Retrieving SLZ information using Nmap</figcaption></figure><p>The image above shows the interaction that the honeypot needs to setup to be fingerprinted as a Siemens PLC. It needs to react to 3 Read SZL requests. These have SZL ID 0x11 and 0x1c (module ID and component ID requests).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*xwoFwxc2FVOisjjL6OLB7w.png" /></figure><p>Next to implementing SZL it’s also interesting to fake exploit execution to deceive a malicious actor in thinking they can damage the system.</p><p>One method used to disable the machines is using a CPU stop command. This is also part of the S7Comm protocol and will disable the unit. After implementing the right response, my honeypot would fake being disabled.</p><p>And voilà, ICSSploit shows the exploit ran successfully.</p><p>For al the <strong>Nmap</strong> users: result of a network scan on the honeypot crafted to simulate industrial PLCs below.</p><pre>PORT    STATE SERVICE<br>102/tcp open  iso-tsap<br>| s7-info:<br>|   Module: 6ES7 518-4AP00-0AB0<br>|   Basic Hardware: 6ES7 518-4AP00-0AB0<br>|   Version: 2.6.0<br>|   System Name: INTERN_VALVE_REG_O1<br>|   Serial Number: S C-N5820302<br>|   Plant Identification: NUCL_POWER_GEN_05<br>|_  Copyright: Original Siemens Equipment<br>Service Info: Device: specialized</pre><pre>Nmap done: 1 IP address (1 host up) scanned in 0.57 seconds</pre><h4>Probe example</h4><p>This is what the Nmap probes look like from the Honeypot’s side of view.</p><pre>{<br> “category”: “s7comm”,<br> “date”: “2020–12–08T21:23:32.541508039+01:00”,<br> “destination-ip”: “x.x.x.x”,<br> “destination-port”: 102,<br> “payload-hex”:     “0300002102f080320700000000000800080001120411440100ff09000400110001,<br> “payload-length”: 33,<br> “request.ID”: “17”,<br> “request.type”: “module ID request”,<br> “sensor”: “services”,<br> “source-ip”: “x.x.x.x”,<br> “source-port”: 53662,<br> “token”: “bssglu3k2l04oeabnus0”,<br> “type”: “ics”<br>}</pre><h3>Getting indexed by internet scanners</h3><p>After initial setup I waited for the system to be indexed by scanning services such as <a href="https://www.shodan.io/">Shodan</a> and <a href="https://censys.io/">Censys</a>. These are search engines for actual machines instead of webpages. Setting aside the differences, the goal is the same: to be recorded in online search engines for all of the internet to find. Preferably as an actual nuclear reactor instead of a honeypot.</p><p>First system to connect was an internet scanner in Romania. The machine resolved to turtle.census.shodan.io which meant the Shodan.io scanners started to index the valve regulator from the fake nuclear reactor! This resulted in the following record on their site:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*Hth5570wqfUc-3T0kSF0bQ.png" /></figure><p>It also seemed to fool the Honeypot detector created by Shodan when the honeypot ran at lesser known hosting providers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*UtXrW6iy7abWNiNXWqFsEg.png" /></figure><p>Censys also had no problem indexing the HoneyPot as a real industrial machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*i7FHErQXAUr1eMmn9DW4Fg.png" /></figure><h3>About the data…</h3><p>Most traffic received in the month of operation originated from the United States. This was expected, as most internet scanners are hosted there. Especially Censys using their ZGrab2 scanners is quite active, but ipip.net wins with an average count of two scans a day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*n9xT22Z5Me1FZbMa3Lgxag.png" /><figcaption>Top 10 hosts connecting to the honeypot</figcaption></figure><p>When looking at the data a bit more in-depth, it becomes apparent that most requests received by the honeypot are not recognised. This can have two reasons. First, this specific honeypot implementation is a rather specific. It’s best used as a decoy in an internal network. This is because of its low interaction and the fact that S7commPlus is not implemented yet. And secondly, not all traffic sent to the honeypot was traffic destined for the device itself. Someone even tried sending RDP packets to the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7CDiHMjKe6Uk8ZyFB87Owg.png" /><figcaption>Total amount of requests received by category</figcaption></figure><p>(Un)fortunately no-one tried to actively harm the PLC by trying to send CPU stop commands like (<a href="https://www.exploit-db.com/exploits/19833">https://www.exploit-db.com/exploits/19833</a>) to the machine.</p><p>When filtering out all regular big internet scanners I was left with a list of small scanners and people genuinely interested in the simulator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xLBubyOXP-tMb4JFZmeEHg.png" /></figure><p>The first domain that stands out is security.criminalip.com, this is a somewhat smaller global internet scanning project, so not targeting the honeypot in particular.</p><p>The top results is coming from telenet.be, which is an internet provider for consumers in Belgium. This is interesting as it’s targeted traffic. When looking at the requests it becomes clear that this system tried to connect to our honeypot, using the s7commPlus protocol.</p><p>Next is traffic coming from a system at a Swedish hosting company. It’s a system from F-Secure for global indexing.</p><p>The fourth system is from ovo.cs. It claims to be a global collective of service providers and provided services and that its members share knowledge, resources, and support with the aim of building sustainable, independent online businesses.</p><p>Lastly, we have a system pointing to cron.optisan.com.tw, which is a weird one. The domain didn’t resolve, but optisan.com.tw gets redirected to www.optisanoptics.eu a store that sells weaponry. It seems they’ve sent multiple GET requests to the honeypot on port 102/tcp which is not part of the s7comm protocol. Interesting, to say the least.</p><h3>Conclusion</h3><p>There is active scanning for industrial equipment on the internet. Not only by big companies that index the whole IPv4 space, but also by individuals and organisations interested in which machines are available. Luckily most traffic received is from researchers scanning the whole IPv4 space for systems in the vein of responsible disclosure. However, this does not exclude that there are real people looking for industrial machines on the internet as well.</p><h3>Questions &amp; Answers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_t4ul5-2j1EF-nKS.jpg" /></figure><p><strong>Q: </strong>Tools used? <strong>A: </strong>Wireshark, Nmap, Zgrab2, ICSSploit, MetaSploit.</p><p><strong>Q: </strong>Aware of the Purdue model for ICS security? <strong>A: </strong>Yes, but setting up level 3, 4 and 5 would’ve made this small project way too big.</p><p><strong>Q</strong>: Did you run just one? <strong>A:</strong> Yes, for this project at least. This simulator has also been part of bigger global deployment at as part of a project at <a href="https://dtact.com/">DTACT</a></p><p><strong>Q</strong>: Difficult to create the simulator? <strong>A: </strong>Implementing? No, HoneyTrap is very well suited for such projects. Protocol research? Quite. The protocol knows multiple iterations and implementations…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*sCG94eENymgADGIB.gif" /><figcaption><em>ISO — OSI classification</em></figcaption></figure><p><strong>Q: </strong>Why not use Conpot? <strong>A: </strong>I wanted a simulation with a bit more interaction, a bit of s7commPlus support and have the ability to fake system exploits. Also, Conpot has become easily detectable as it uses some static values in its component ID response.</p><h3></h3><p>Matching public #IPv4 and #IPv6 addresses using TLS-certificates for an upcoming project. #zmap pic.twitter.com/mIvIvAhkya</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a624f685aaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spoofing JARM signatures. I am the Cobalt Strike server now!]]></title>
            <link>https://grimminck.medium.com/spoofing-jarm-signatures-i-am-the-cobalt-strike-server-now-a27bd549fc6b?source=rss-55ca9930e813------2</link>
            <guid isPermaLink="false">https://medium.com/p/a27bd549fc6b</guid>
            <category><![CDATA[spoofing]]></category>
            <category><![CDATA[scanning]]></category>
            <category><![CDATA[jarm]]></category>
            <category><![CDATA[fingerprinting]]></category>
            <category><![CDATA[ja3]]></category>
            <dc:creator><![CDATA[Stefan Grimminck]]></dc:creator>
            <pubDate>Fri, 25 Dec 2020 19:33:44 GMT</pubDate>
            <atom:updated>2020-12-25T19:33:44.945Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TL;DR</strong>: JARM is very useful fingerprinting tool, but can be deceived by replaying server hello’s from other services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QPTlFMfgJV0qtygA0tqx5A.jpeg" /></figure><p>The JARM scanner created by <a href="https://medium.com/u/41ea9b1cdc2b">@SalesforceEng</a> is quite an effective tool for system fingerprinting. It uses the Server Hello responses from a <a href="https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/">TLS handshake</a> to generate a signature. These can then be used to find similar software or services. Ideal for finding C2 or other malicious servers that implement TLS. So, It doesn’t come as a surprise that <a href="https://www.shodan.io/">Shodan</a>.io uses this fingerprinting mechanism in their scanners. Read the <a href="https://engineering.salesforce.com/easily-identify-malicious-servers-on-the-internet-with-jarm-e095edac525a">Salesforce</a> post for more information about the JARM library, scanner and its uses.</p><h3></h3><p>We&#39;ve added JARM fingerprinting and with it introduce a new &quot;ssl.jarm&quot; property/ filter/ facet. Here&#39;s a breakdown of the current values for JARM fingerprints in Shodan: https://t.co/njOLlE9uWR (h/t @4A4133 and @SalesforceEng)</p><p>The question, then, arises: Is it possible to spoof these JARM signatures? Let’s find out! Salesforce stated in <a href="https://engineering.salesforce.com/easily-identify-malicious-servers-on-the-internet-with-jarm-e095edac525a?gi=64f20df2d111">their</a> post that scanning a Cobalt Strike server would result in the following signature 07d14d16d21d21d07c42d41d00041d24a458a375eef0c576d23a7bab9a9fb1</p><p>That this signature isn’t Cobalt Strike specific, was revealed in the C<a href="https://blog.cobaltstrike.com/2020/12/08/a-red-teamer-plays-with-jarm/amp/">obalt Strike blog</a>. Let’s still use it as a starting point anyway.</p><p>First I used the list of addresses published by Salesforce to find a server with a matching hash. I scanned it using <a href="https://github.com/RumbleDiscovery/jarm-go">jarmscan</a> and created a packet capture of the response. The ssl handshake (filter: ssl.handshake.type == 1) filter in Wireshark will display all TLS client hello’s sent by the scanner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cy99KzBwDnhsi5s3RS_C5w.png" /><figcaption>Wireshark capture of 10 TLS Client Hello’s</figcaption></figure><p>And in turn the “Cobalt Strike“ server will return its Server Hello’s. These are used by jarmscan to generate a unique signature (filter: ssl.handshake.type == 2).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v3dQRBIlLdzDQQp9fCvBFw.png" /><figcaption>Wireshark capture of 10 TLS Server Hello’s</figcaption></figure><p>These Server Hello’s are the packets we want to replay. This can easily be done by setting up a TCP server listening for the specific Client Hello’s, then replaying their corresponding Server Hello’s captured from the alleged Cobalt Strike server. A rather lazy, but effective approach.</p><p>I scanned the server on three separate occasions and found the duplicate bytes for every request. I used these bytes to identify each specific Client Hello.</p><p>Luckily Wireshark has an option to display packets as C Arrays. This made it pretty easy to get the Server Hello’s working in my Golang spoofing application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XzEO3Tne9jpow-LgPdo0wA.png" /></figure><p>By replaying these responses, slowly but steadily the fingerprint can be rebuilt.</p><pre>if bytes.Contains(request, [] byte {<br>     0x00, 0x8c, 0x1a, 0x1a, 0x00, 0x16, 0x00, 0x33, 0x00,<br>     0x67, 0xc0, 0x9e, 0xc0, 0xa2, 0x00, 0x9e, 0x00, 0x39,<br>     0x00, 0x6b, 0xc0, 0x9f, 0xc0, 0xa3, 0x00, 0x9f, 0x00,<br>     0x45, 0x00, 0xbe, 0x00, 0x88, 0x00, 0xc4, 0x00, 0x9a,<br>     ... ... <br> }) {<br>     fmt.Println(&quot;replaying: tls12Forward&quot;)<br>     conn.Write([] byte {<br>         0x16, 0x03, 0x03, 0x00, 0x5a, 0x02, 0x00, 0x00,<br>         0x56, 0x03, 0x03, 0x17, 0xa6, 0xa3, 0x84, 0x80,<br>         0x0b, 0xda, 0xbb, 0x3d, 0xe9, 0x3e, 0x92, 0x65,<br>         0x9a, 0x68, 0x7d, 0x70, 0xda, 0x00, 0xe9, 0x7c,<br>         ... ...<br>     })<br> }</pre><p>A full signature can be faked after implementing a reply for all ten different requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wWCczdjQ1l85aK60N8bUrQ.png" /></figure><h3>(Mis)usage of spoofed signatures</h3><p>You’re probably thinking: So what? What is the use of spoofed TLS fingerprints? They could be used by malicious actors to hide their applications when tools like JARM scanners are deployed to identify services in a network or on the internet. It can also be used for good. A honeypot replaying the fingerprint of a specific service can be used to setup a digital smokescreen for attackers.</p><p><strong>Notes</strong></p><ul><li>jarmscan (jarm-go) is not a product of Salesforce. They’ve published <a href="https://github.com/salesforce/jarm">JARM</a> a Python based JARM scanner implementation. Jarmscan (the scanner used here) is a Golang based implementation by <a href="https://twitter.com/RumbleDiscovery">@RumbleDiscovery</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a27bd549fc6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>