<?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 Adam Maxwell on Medium]]></title>
        <description><![CDATA[Stories by Adam Maxwell on Medium]]></description>
        <link>https://medium.com/@catalyst256?source=rss-7512bc47fc17------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ypLb9WykYxQfVwZJnIyDvQ@2x.jpeg</url>
            <title>Stories by Adam Maxwell on Medium</title>
            <link>https://medium.com/@catalyst256?source=rss-7512bc47fc17------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 08:42:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@catalyst256/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[Introducing Hades]]></title>
            <link>https://catalyst256.medium.com/introducing-hades-0918b357d77d?source=rss-7512bc47fc17------2</link>
            <guid isPermaLink="false">https://medium.com/p/0918b357d77d</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[threatintel]]></category>
            <category><![CDATA[darkweb]]></category>
            <category><![CDATA[osint]]></category>
            <dc:creator><![CDATA[Adam Maxwell]]></dc:creator>
            <pubDate>Sun, 15 Feb 2026 20:01:48 GMT</pubDate>
            <atom:updated>2026-02-15T20:01:48.995Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*peBPlG4QhbCHLLQ8wXGf6Q.png" /></figure><p>So here we go…</p><p>Back in 2015 I was sitting on the floor of a train heading back home from London having a conversation with Daniel Cuthbert via Signal about whether you could map dark web infrastructure the same way you map the surface web. Not the content. The connections. The invisible relationships between servers, shared code, overlapping entities.</p><p>That conversation turned into a side project (obsession). That side project turned into years of late nights, mass amounts of coffee, rewriting the same chunks of code over and over and more MongoDB queries than I care to admit. At one point I even built my master’s dissertation around it (any excuse to keep working on it, honestly).</p><p>Today I’m putting something out into the world that I’m genuinely proud of.</p><p>**Hades is live: <a href="https://hades.aikostek.com**/">https://hades.aikostek.com**</a></p><p>It’s a free demo of the intelligence platform I’ve been building. Search any .onion address and see what we’ve mapped:</p><p>→ Over 190,000 Tor servers analysed<br>→ Over 300,00 unique extracted entities (crypto wallets, emails, Discord invites, Telegram handles)<br>→ Over 600,000 image fingerprints tracked across the network<br>→ Over 15,000 JavaScript files fingerprinted for infrastructure clustering<br>→ Over 100,00 risk classifications across 36 intent categories<br>→ And some other stuff I’ve probably forgotten</p><p>But here’s the thing that matters most to me.</p><p>**Hades was never about content. It’s about connections.**</p><p>Which servers share the same JavaScript fingerprint? That’s likely the same operator. Which Bitcoin wallet appears across five different marketplaces? That’s probably the same vendor. Which servers link to each other, share entities, or mirror the same infrastructure?</p><p>That web of relationships is where the real intelligence lives (in my opinion). Not in what a server says, but in what it connects to.</p><p>To be fair, this demo is just a taster. If you know me, you know I love a network graph, Hades is already available in Maltego Technologies Data Hub, I’m working on an MCP server (because you know AI is the thing at the moment), and looking at building a browser based graph platform.</p><p>Oh, and the .onion address you search never leaves your browser. It’s SHA256 hashed client-side before anything hits the server. Privacy-first wasn’t an afterthought, it was a requirement.</p><p>I don’t mind admitting the journey from that initial conversation to this point hasn’t been straightforward. There were plenty of moments where I wondered if anyone would actually care about mapping Tor infrastructure at this level. But I kept coming back to the same thought: if you can’t see the connections, you can’t see the full picture.</p><p>Have a play. Search an address. Break it (there is a “Report a Bug” function). Tell me what’s missing (or maybe it’s not).</p><p>I genuinely want feedback, good or bad.</p><p>**<a href="https://hades.aikostek.com**/">https://hades.aikostek.com**</a></p><p>Full disclosure, the web site was written by AI , mainly because I hate CSS and JS and despite the 10,000’s line of code I’ve written I will always struggle with it. All the code for the data collection, enrichment, Maltego transforms (the stuff you don’t see) was written by me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0918b357d77d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dark web: Building a Tor Gateway]]></title>
            <link>https://catalyst256.medium.com/dark-web-building-a-tor-gateway-7a7dfa45884f?source=rss-7512bc47fc17------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a7dfa45884f</guid>
            <category><![CDATA[osint]]></category>
            <category><![CDATA[vmware]]></category>
            <category><![CDATA[darkweb]]></category>
            <dc:creator><![CDATA[Adam Maxwell]]></dc:creator>
            <pubDate>Mon, 29 Mar 2021 19:27:16 GMT</pubDate>
            <atom:updated>2021-03-29T19:27:16.860Z</atom:updated>
            <content:encoded><![CDATA[<p>In some instances it may be necessary (or desired) to route <strong>ALL</strong> your network traffic through Tor but also make sure you limit your risk of exposure. There are already some established ways of doing this such as using Tails/Whonix and different VM’s, containers and the such however each solution can have drawbacks or issues.</p><p>Using pfSense (FreeBSD based firewall) as a single VM we are going to create a Tor gateway that will not only allow us to route traffic through it to Tor but also block any other traffic from leaking from your network.</p><p>This solution could also be transferred to a physical appliance such as the Netgate SG-1100 or any supported device (I will be doing this soon). This could not only operate as a network gateway but also as a mobile Tor gateway (unless you rack mount the thing).</p><p>This document is based on the original work by <a href="https://twitter.com/MalwareTechBlog">@MalwareTechBlog</a> back in 2015 which can be found here: (<a href="https://www.malwaretech.com/2015/08/creating-ultimate-tor-virtual-network.html">https://www.malwaretech.com/2015/08/creating-ultimate-tor-virtual-network.html</a>)</p><ol><li>Download pfSense: Community Edition version 2.5.0-RELEASE (amd64) was used, and the ISO image downloaded from <a href="https://www.pfsense.org/download/">https://www.pfsense.org/download/</a>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*J_vXlDtKrHQ9QejRSME6WA.png" /></figure><p>2. Create a VM: A single VM (VMware) was created with the following configuration;</p><ul><li>512MB of RAM (depending on your throughput you might need/want to increase this)</li><li>1 vCPU</li><li>20GB HDD (Can be smaller)</li><li>2 virtual network adapters</li><li>1 set to Bridged mode (obtains an IP on your physical network)</li><li>1 set to Host only (private network)</li><li>CDROM set to use the pfSense ISO (only for install)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*E39hqFC388l2u80bidsrEg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*4k3ip7ZtZPkFT7-uZ2fh8w.png" /></figure><p><strong>NOTE</strong>: It’s important to ensure that the default network adapter (the first one) in VMware is configured as your <strong>Bridged </strong>adapter, this ensures that when pfSense is installed it will be chosen as the WAN interface.</p><p>3. Install pfSense: The VM will boot from the mounted ISO image, following the installation screens until it’s completed. Once installation is complete you will be prompted to configure the network interfaces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*UlrECp7r9BX_RS_hzFF_gA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*38ZQfJhGWtPNWTLTXQ13Lw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*ByVAc57JAVv32EwyxmeXig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*77iIVESnCGpxy9dPHtk4VQ.png" /></figure><p>4. <strong>Initial Configuration: </strong>Your <em>bridged</em> interface should obtain a DHCP address from your home router. The IP address assigned to your LAN interface is a static IP which in my case is not the right one for my virtual network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*0TVsw1vgHbSs2HS7zZRFsg.png" /></figure><p>We are going to change the IP address for the LAN interface (em1) so that it falls into the right network range. Select option <strong>2</strong> and then enter a static IP address for your host-only network. I tend to use a higher number 200+ as this usually falls out of the DHCP range.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*6A0tm5vt1xcRzQmoCaQhUQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*aM1h0OYFs65X9RfvgIO1mQ.png" /></figure><p>We chose to disable the DHCP server as we will be using VMware and we don’t want a conflict between them (2 DHCP servers a happy network doesn’t make).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*zR-ok0jQWEDLtpnmsPzQ4A.png" /></figure><p>We are going to configure pfSense using the web interface, by default the web interface is configured to only allow connections from the LAN network (192.168.168.200).</p><p>If you are using VMware you can access this web interface directly (wonders of VMware networking), the default username/password is <strong>admin/pfsense</strong>. On initial login you will be prompted to complete the setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mKCbV8QCmDewnTb6PLPQlg.png" /></figure><p>Follow the wizard through to completion, you shouldn’t need to make any changes but feel free to change the hostname of the firewall and set your new admin password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UJIE7BhfC0z6yThRy29FcQ.png" /></figure><p>We need to disable the <strong>DNS Resolver</strong> service as this is going to be replaced by Tor once we have installed it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*dQYe_fAM3NNgIcyL2jfPwA.png" /></figure><p>Untick the <strong>Enable DNS Resolver </strong>tick box and click on the <strong>Save</strong> button at the bottom of the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ubN8hHJgxahETbITm6A0vw.png" /></figure><p>5. <strong>Installing Tor</strong>: Now that the basic setup has been done we need to install Tor and configure it for use. The easiest way is to use SSH, but first we need to enable it on the firewall. On the VM you need to select option <strong>14 </strong>and then confirm you want it enabling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*8APo7vfRmngztXTzhLKj9w.png" /></figure><p>You can now SSH onto the firewall to install Tor. Using your SSH client of choice, connect to the LAN IP address of your firewall.</p><blockquote>ssh admin@192.168.168.200</blockquote><p>Use the same password to login via SSH as you set during the final firewall configuration.</p><p>Once you have logged in you need to drop down in a shell. To do this select option <strong>8</strong>.</p><p>pfSense allows for additional package installations, however Tor is not in the default available repo’s. In order to install Tor we need to enable the standard FreeBSD repo’s, we do this by modifying two configuration files.</p><blockquote>vi /usr/local/etc/pkg/repos/FreeBSD.conf</blockquote><p>Change:</p><blockquote>FreeBSD: { enabled: no }</blockquote><p>To:</p><blockquote>FreeBSD: { enabled: yes }</blockquote><p>Then you need to:</p><blockquote>vi /usr/local/etc/pkg/repos/pfSense.conf</blockquote><p>and again change:</p><blockquote>FreeBSD: { enabled: no }</blockquote><p>To:</p><blockquote>FreeBSD: { enabled: yes }</blockquote><p>This will allow us to install the Tor package, to do this use the following command:</p><blockquote>pkg install tor</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*PMD1B8MXS6QcKxxfWYUnGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*JMpLYIylpBAymIX-ewFxoQ.png" /></figure><p>Tor should now be installed, before we move onto configuring the firewall we need to configure the torrc file (Tor configuration file).</p><p>The actual requirements for our use of Tor are minimum so we are going to delete the existing file and then replace it with a new one.</p><p>To delete the existing torrc file we use the following command:</p><blockquote>rm /usr/local/etc/tor/torrc</blockquote><p>We are now going create a new torrc file with the following content.</p><blockquote>DNSPort YOUR_PFSENSE_LAN_IP_HERE:53<br>VirtualAddrNetworkIPv4 10.192.0.0/11<br>AutomapHostsOnResolve 1<br>RunAsDaemon 1<br>TransPort 9040</blockquote><p>You need to replace the <strong>YOUR_PFSENSE_LAN_IP_HERE</strong> with the IP address you configured earlier, for the VM I created this would be.</p><blockquote>DNSPort 192.168.168.200:53</blockquote><p>These settings allow us to use Tor to resolve both .onion addresses and external domains (all through Tor). The <em>TransPort 9040</em> setting is what we are going to be using later to “proxy” our traffic through Tor.</p><p>The last task is to setup Tor to run each time the firewall runs, to do this run the following commands on the pfSense SSH shell.</p><blockquote>touch /usr/local/etc/rc.d/tor.sh<br>cd /usr/local/etc/rc.d/<br>echo “/usr/local/bin/tor” &gt;&gt; tor.sh &amp;&amp; chmod +x tor.sh<br>/usr/local/bin/tor</blockquote><p>6. <strong>Configuring the Firewall</strong></p><p>In order for pfSense to work with Tor we need to configure firewall rules and port forwarding. Port forwarding allows us to redirect traffic through Tor without the need for using proxies. The firewall rules will ensure that we can control the outbound traffic and prevent network traffic from leaking outside of our environment.</p><p><strong>Firewall Rules</strong></p><p>First we are going to configure a rule to allow DNS resolution through Tor. To do this we need to you need to navigate to:</p><p>Firewall — Rules</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*hY0SPZrT22OoGA8QGeOo4Q.png" /></figure><p>Then select <strong>LAN</strong> (it defaults to WAN)</p><p>By default there are 3 rules that are auto configured by pfSense. We can leave them in place for the time being. We need to add a new rule to allow DNS resolution from the LAN the firewall.</p><p>The rule needs to be configured as follows:</p><ul><li>Action: Pass</li><li>Interface: LAN</li><li>Address Family: IPv4</li><li>Protocol: TCP/UDP (DNS can be both)</li><li>Source: LAN net (anything on the LAN)</li><li>Destination: Single host or alias [IP address of LAN interface]</li><li>Destination Port Range: DNS (53)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hvPTgsUhMskYCF7-IC1jMg.png" /></figure><p>Click on <strong>Save</strong> and this will return you to the firewall rule list.</p><p>Before we move onto port forwarding, we need to delete 2 of the default rules as they aren’t needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*h4BYPxG-YZqTBMQ62htgeQ.png" /></figure><p>Both of these rules will bypass our restrictions and as we want to control the flow of traffic through our firewall.</p><p>Click on the delete icon (the one that looks like a bin), next to each rule. You will notice that there is a rule at the top that can’t be deleted, this is to ensure that you don’t lock yourself out of managing the firewall (trust me it happens a lot).</p><p>There is an option to “Apply Changes” that will appear at the top. Click on that to apply the firewall rule changes we’ve just made.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FxDvonYWkqyhLbOcpV-1eQ.png" /></figure><p><strong>Port Forwarding</strong></p><p>For each port we want to send through Tor we need to add a port forwarding rule, while this might seem like an overhead it does ensure that only traffic we want is sent via Tor. The other restriction is that the pfSense firewall will only port forward TCP based traffic (not UDP).</p><p>To add a port forward rule we need to navigate to:</p><p>Firewall — NAT</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*SeGbZneJiJBSRH7ZCrSTdw.png" /></figure><p>The default is Port Forward, click on Add Rule (either option as it’s empty at the moment). Each rule is configured the same with the exception of the <em>Destination Port Range</em>. The rules need to be configured as follows.</p><ul><li>Interface: LAN</li><li>Address Family: IPv4</li><li>Protocol: TCP</li><li>Destination: LAN net</li><li>Destination: Invert Match (ticked)</li><li>Destination Port Range: HTTP (80)</li><li>Redirect target IP: Single host 127.0.0.1</li><li>Redirect target port: Other 9040</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CuWUusbKwEf8ubpQdv2tdA.png" /></figure><p>You can then add another rule for port HTTPS (443) these are going to be the only ones we add during the example. However you can add other TCP ports such as SSH etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FLlRcqmiMOMJlYqLlsZseQ.png" /></figure><p>There is an option to “Apply Changes” that will appear at the top. Click on that to apply the port forwarding rule changes we’ve just made.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FxDvonYWkqyhLbOcpV-1eQ.png" /></figure><p>The configuration is all done, you can now reboot the firewall (just to make sure it all works). You can do this via the SSH connection. If you are still in the shell type <strong>exit</strong> and then chose option <strong>5</strong> and press <strong>y</strong> to reboot the firewall.</p><p>7. <strong>Testing</strong></p><p>For testing I used a VM (Ubuntu Desktop) and reconfigured the network adapter in VMware to <em>host-only</em>. The network interface (in Ubuntu) is then configured as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*gldVOGtjY__BZ-ui2AsOAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*lAVAAd6aoQGIeB7ivfaE-A.png" /></figure><p>The important part is to ensure that the <strong>Gateway</strong> and <strong>DNS</strong> server are set to the LAN IP address of the pfSense firewall.</p><p>Once you have reconfigured your NIC, we need to test that DNS is working as expected. In this example I used <strong>nslookup </strong>and queried two domains, one .onion website and one external domain. Both requests were responded to by the pfSense firewall, and both were resolved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*6A0tm5vt1xcRzQmoCaQhUQ.png" /></figure><p>Finally we need to check that the port forwarding is working as expected. Using your browser connect to <a href="https://check.torproject.org/">https://check.torproject.org</a> and you should see the following message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*ExxnldwLSoP2H2DVFU3EJw.png" /></figure><p>Once everything is working it’s a good idea to take a snapshot of your pfSense VM to make sure you can roll back when needed.</p><p><strong>Important:</strong> It’s important to note that while you are routing your traffic through Tor, there are other ways you can be fingerprinted by third parties (browser, operating system etc.).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a7dfa45884f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dark Web: Scanning the dark web like a threat intel company]]></title>
            <link>https://catalyst256.medium.com/dark-web-scanning-the-dark-web-like-a-threat-intel-company-f61756807652?source=rss-7512bc47fc17------2</link>
            <guid isPermaLink="false">https://medium.com/p/f61756807652</guid>
            <category><![CDATA[darkweb]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[osint]]></category>
            <category><![CDATA[scrapy]]></category>
            <dc:creator><![CDATA[Adam Maxwell]]></dc:creator>
            <pubDate>Mon, 21 Sep 2020 12:00:00 GMT</pubDate>
            <atom:updated>2020-09-28T11:22:38.030Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introduction</h4><p>Back in 2015 (before the dark web was “trendy”) I started writing code to scan the dark web (specifically Tor). It was based off a conversation with Daniel Cuthbert (<a href="https://twitter.com/dcuthbert">@danielcuthbert</a>) about whether you could use the same techniques for mapping infrastructure on the surface web (the normal web bit) on dark web servers.</p><p>Over the years the number of companies selling “Dark Web” data as part of their platform has grown, but it doesn’t have to be expensive or complicated to build your own “Dark Web Threat Intel” platform.</p><p><strong>DISCLAIMER: You will find some websites on Tor that contain illicit/illegal material, be sensible about what you view and be willing to accept the risk/liability if you do something stupid</strong></p><p>We have 4 objectives that we want to achieve.</p><ol><li>Validate a list of dark web servers</li><li>Build your Tor infrastructure (proxies, load balancers)</li><li>Run your Tor scraper</li><li>Analyse the results</li></ol><p>To achieve our goals we are going to use the following technology (in no particular order).</p><p><strong>NOTE: All code in this post is based on Python 3.x</strong></p><p>The good news for you, is that I’ve done most of the hard work to get this up and running and all you need to do is to follow the instructions as we go. All the code is up in the GitHub repo which you can find <a href="https://github.com/catalyst256/CyberNomadResources">HERE</a>.</p><p>And off we go…</p><p>Validate a list of dark web servers</p><p>All servers that run within the Tor network have the TLD <em>.onion</em>, but unlike the normal domains/URLs that you might be use to seeing these can look like a jumble of random characters and numbers. That being said there is some rules to what a .onion address can look like, .onion addresses can now come in two different lengths and are either 16 characters long (not including the .onion) or 56 characters long (not including the .onion). They will only contain the letters <em>a-z</em> and the numbers <em>2–7</em>, the code below shows have to use Python and the python library <em>re</em> to extract .onion addresses from blocks of text.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dba7ff9dc0e71b848dca3c65fac35b79/href">https://medium.com/media/dba7ff9dc0e71b848dca3c65fac35b79/href</a></iframe><p>This code is used in the web scraper we will talk about later, but the function is the same regardless of what data you feed it.</p><p>Now we have the code we need a list to start of us off, in this instance I used the <a href="https://www.hunch.ly/darkweb-osint/">Hunchly Dark Web Report</a>. Once you’ve signed up you get daily emails which will give you a link to download the latest lists. Download the list (it comes as an Microsoft Excel document), and then copy the <em>Hidden Services</em> from the <em>Up</em> and <em>Down</em> sheets into a text document.</p><p>Now we need to sort those, validate them against and regular expressions above and remove any duplicates. The Python code for this is below, you will need to change the <em>input</em> filename and the <em>output</em> filename.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/82c767df1af430a12f11212c8a9c10f9/href">https://medium.com/media/82c767df1af430a12f11212c8a9c10f9/href</a></iframe><p>All being well you should have a neat list of .onion addresses that all match the rules defined above. If you want to skip this part then you can download the list <a href="https://github.com/catalyst256/CyberNomadResources/blob/master/Darkweb/ScanningTheDarkWeb/ServerList/validated-server-list.txt">HERE</a>.</p><p>Build your Tor infrastructure</p><p>Now we have a list of .onion addresses we need to build some infrastructure so we can run our web scraper. Over the years I have messed around with the best way to scan services within Tor at a sensible rate (not too fast, not too slow). In the end my preferred way is to use docker to build a set of servers running Tor and Prixovy and a load balancer in front of them.</p><p><em>Random side note (not to be taken seriously): Over the years I’ve built/designed and managed some high volume e-commerce sites with load balancers and I’m 90% sure most of the world’s internet problems can be solved with a load balancer…just saying…</em></p><p>To build the infrastructure part of this project we need a host machine that we can install Docker on, for my testing I use a VM running Ubuntu 20.04 with 2GB of RAM, 20GB HDD and 1 Processor. It really doesn’t need a lot of resources, the web scraper ran through over 5000 addresses in about 8 hours.</p><p>For purposes of this blog post I’m not going to go into detail about installing docker and docker-compose. Instead I will just provide some handy links below.</p><p><strong>NOTE: If at this point you are like, “oh god I have to build VM’s and install stuff”, don’t worry you can skip this part (well most of this blog) and download the </strong><a href="https://github.com/catalyst256/CyberNomadResources/blob/master/Darkweb/ScanningTheDarkWeb/Results/results.json"><strong>results.json</strong></a><strong> file from the repo.</strong></p><p><em>Random side note (to be taken seriously): I have to give massive thanks to Digital Ocean for the sheer number of install guides they produce for a whole range of things, it makes my life much easier</em></p><p>Once you have your VM up and running (or your laptop whatever you fancy), you just need to build the docker images and get them running. The config files are <a href="https://github.com/catalyst256/CyberNomadResources/tree/master/Darkweb/ScanningTheDarkWeb/Docker">HERE</a> and can be stored in the same directory. Once you have downloaded them you can just run:</p><pre>docker-compose up</pre><p>This should build you 3 Tor containers and a HA Proxy container, the HA proxy is responsible for directing traffic from your web scraper to each of the Tor containers and for making sure that they are accepting traffic.</p><p>The HA proxy exposes two TCP ports that you can connect to:</p><ul><li>8118: This is the port for the proxy</li><li>8888: This is just a HA proxy stats web page under /stats</li></ul><p>You need to make a note of the IP address that your docker containers are running on as you will need to configure the web scraper with the correct proxy address in the next section.</p><h4>Run your Tor scraper</h4><p>All being well you will now have a list of .onion addresses and a running set of infrastructure that we can proxy requests through. Now onto probably the most and interesting point our own Tor web scraper.</p><p>For this use case the Tor web scraper has been written using the Python library <em>scrapy</em> (which is awesome by the way). We feed the web scraper a list of .onion addresses and it attempts to connect to each one.</p><p>If it is successful in that attempt there are a number of <em>extractors</em> built into the web scraper that look for the following <em>artifacts</em> in the HTML content of the first page it connected to.</p><ul><li>Bitcoin addresses</li><li>Email addresses</li><li>PGP blocks (signature or public blocks)</li><li>Google tracking codes</li><li>.onion addresses</li></ul><p>In addition it also attempts to get the following:</p><ul><li>Favicon hash (md5)</li><li>Robots.txt (Disallowed entries only)</li></ul><p>We also store the following information from the web scraper response:</p><ul><li>HTTP headers</li><li>Web page encoding</li><li>Web page title</li><li>List of HTTP redirects (if any)</li></ul><p><strong>NOTE: Running web scrapers (or any kind of connection) into the Tor network is not 100% reliable you will miss live servers or they might be offline at the time etc. etc.</strong></p><p>The extractors that are used are all based on regular expressions, if you are interested in how those work you can find them <a href="https://github.com/catalyst256/CyberNomadResources/blob/master/Darkweb/ScanningTheDarkWeb/WebScraper/torexplorer/extractors.py">HERE</a>.</p><p>To get the web scraper running on your own environment the easiest way is to clone the entire GitHub repo which will give you access to all the files relating to this blog post.</p><pre>git clone <a href="https://github.com/catalyst256/CyberNomadResources">https://github.com/catalyst256/CyberNomadResources</a></pre><p>Now you just need to navigate into the directory for this blog post.</p><pre>cd CyberNomadResources/Darkweb/ScanningTheDarkWeb/WebScraper</pre><p>and then we can install the Python libraries;</p><pre>pip3 install -r requirements.txt</pre><p>Before you run the web scraper for the first time you need to update the IP address of the proxy. In the <a href="https://github.com/catalyst256/CyberNomadResources/blob/master/Darkweb/ScanningTheDarkWeb/WebScraper/torexplorer/settings.py">settings.py</a> file for the web scraper, scroll to the end and update the <em>HTTP_PROXY</em> variable with the IP address of your VM running the docker containers.</p><p>Once that update is done you should be ready to run the web scraper. To do this we need to pass it two arguments at the command line.</p><ul><li>The name of the file containing the list of servers</li><li>The name of the output file we want to save</li></ul><p>Assuming you downloaded the whole repo from GitHub then your command should look like this:</p><pre>cd Darkweb/ScanningTheDarkWeb/WebScraper scrapy crawl explorer -a filename=../ServerList/validated-server-list.txt -o ../Results/results.json</pre><p>If the Python gods have been kind this should start working its way through the list of servers. Scrapy by default is verbose with it’s logging so don’t worry about it too much when you see mountains of text fly across your terminal screen.</p><p>Once the web scraper is finished you will have a JSON file with individual lines for each web server that was running (and returned the right HTTP status code).</p><p>The screenshots below show a couple of examples taken from the <a href="https://github.com/catalyst256/CyberNomadResources/blob/master/Darkweb/ScanningTheDarkWeb/Results/results.json">results.json</a> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vWW8P8nCURnNrY_h.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*RiHqTcfj8Rejnz7V.png" /></figure><p>Now we have the output from our web scraper we can move onto the last objective.</p><h4>Analyse the results</h4><p>It would be impossible in this blog post to work through all the different scenario’s you could look at with the data we have collected. Instead we are going to look to answer a small subset of questions out of all the possibilities.</p><p>We are going to answer these questions:</p><ul><li>How many servers returned data?</li><li>How many servers run off a Raspberry PI?</li><li>How many servers share the same favicon.ico hash?</li><li>How many artifacts did we find (email, pgp, bitcoin, google codes)?</li></ul><p><strong>NOTE: The data is all stored in a JSON file so you load this into NOSQL databases or something like Elasticsearch/Splunk.</strong></p><p>The first step is to load the JSON data from the file so that it is available to use. Again using Python we just need a simple block of code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cf74652b01b2c538afa827d9f6703296/href">https://medium.com/media/cf74652b01b2c538afa827d9f6703296/href</a></iframe><p>Now we can move forward and answer the questions we are interested in.</p><p><strong>How many servers returned data?</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8290fff436d12d81354fe4a4cc8ae225/href">https://medium.com/media/8290fff436d12d81354fe4a4cc8ae225/href</a></iframe><p><strong>How many servers run off a Raspberry PI?</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7464f3ea34a38be9cff556e4cec1ef6/href">https://medium.com/media/f7464f3ea34a38be9cff556e4cec1ef6/href</a></iframe><p><strong>How many servers share the same favicon.ico hash?</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/72e97483cc986d518214ee514c880ccb/href">https://medium.com/media/72e97483cc986d518214ee514c880ccb/href</a></iframe><p><strong>How many artifacts did we find (email, pgp, bitcoin, google codes)?</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6151d385bf960af43f6f61e94ba253e7/href">https://medium.com/media/6151d385bf960af43f6f61e94ba253e7/href</a></iframe><h4>Conclusions</h4><p>This is just a small subset of the type of questions you can find answers to in this data, the end goal would be find ways to pivot between the data collected by the web scraper and other sources to build profiles and persona’s of either the infrastructure hosting a particular website or the individual’s running them.</p><p>Moving forward I will probably keep adding functionality to the web scraper and look at ways to enrich the data more (I have more tricks up my sleeve). I might even make the data available as a free service depending on the costs involved.</p><p><em>Originally published at </em><a href="https://cybernomad.online/2020/09/21/dark-web-scanning-the-dark-web-like-a-threat-intel-company/"><em>https://cybernomad.online</em></a><em> on September 21, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f61756807652" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSINT — Certificate Transparency Lists]]></title>
            <link>https://catalyst256.medium.com/osint-certificate-transparency-lists-a603c9d2b776?source=rss-7512bc47fc17------2</link>
            <guid isPermaLink="false">https://medium.com/p/a603c9d2b776</guid>
            <category><![CDATA[certificate]]></category>
            <category><![CDATA[osint]]></category>
            <category><![CDATA[phishing]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Adam Maxwell]]></dc:creator>
            <pubDate>Tue, 07 Jan 2020 16:51:03 GMT</pubDate>
            <atom:updated>2020-01-09T08:11:19.721Z</atom:updated>
            <content:encoded><![CDATA[<h3>OSINT — Certificate Transparency Lists</h3><p>NOTE: The wonderful people over at OSINT Curious wrote a similar blog post about this last year. The link is <a href="https://osintcurio.us/2019/03/12/certificates-the-osint-gift-that-keeps-on-giving/">HERE</a>. I recommend giving it a read if you want to know more about how to “hunt” using information from certificates.</p><p>It’s 2020 and I made myself a promise to try and write more blog posts about things so here is the first for the year. SSL/TLS certificates have been a great resource for a while now to identify, pivot from and hunt for infrastructure on the internet. The introduction of the Certificate Transparency Lists were first introduced by Google in 2013 after DigiNotar was compromised in 2011. It basically provides public logs of certificates issued by trusted certificate authorities and is a great source of intel for a number of functions (such as, but not limited to):</p><p>Detection of phishing websites<br>Brand/Reputation Monitoring<br>Tracking malicious infrastructure<br>Bug Bounties</p><p>For a long time newly registered/observed domains have been an indicator or potential malicious activity, for example if ebaythisisfake.com was registered you could guess that this was going to be a phishing website. The issue with watching for newly registered domains (it’s still a good indicator), is that a domain could be purchased and then not used for days/months/years.</p><p>The wonderful thing about using the CT lists is that the fact a certificate has been registered usually (probably 95% of the time) means that the infrastructure is active and in use, it also means that there is active DNS (required for requesting a certificate) for that domain and an IP address to investigate. It also allows you to catch when a legitimate domain has been compromised and is being used for malicious stuff, for example ebay.legitimatedomain.com which is why CT lists are great for catching phishing websites.</p><p>Since the initial launch of number of companies have started collecting the information published on the CT lists (why not it’s free), and either providing it as part of an existing service (Cyber Threat Intel), providing tools to look up specific domains (Facebook for example) or giving people access to the raw data in an easy to consume way (this is the one we are interested in).</p><p>It’s worth noting that while the CT lists are publicly available, the sheer volume of data generated by them means it’s much easier to use a feed from someone else than build your own, unless of course you want to..</p><p>For the rest of this post we are going to be focusing on one specific provider, which is from Calidog (<a href="https://certstream.calidog.io/">https://certstream.calidog.io/</a>), this company provide the data for free, and have a number of libraries for different programming languages and a command line tool as well.</p><p>The command line tool is python based so you can simply install it using Python’s PIP library (we use pip3 because Python 2.7 is end of life).</p><pre>pip3 install certstream</pre><p>Once it’s been installed you can then run “certstream” from the command line, running it without any options will just connect and start pulling down the firehose of certificate information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3rYEAJvkNXRNxUkYSXPhLg.png" /><figcaption>certstream just being run from the command line</figcaption></figure><p>Straight away you can start to see the certificates information flying across your terminal. The default option just shows a timestamp, certificate authority and the certificate common name that is being registered. OK its interesting but not very helpful (for our needs anyway). If you run “certstream — full” you will get the same information as well as “all domains” which are any other domain names assigned to that certificate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qMATHYk34C2ppWzvyt72_w.png" /><figcaption>certstream with the — full switch</figcaption></figure><p>This “all domains” information is really useful if you are for example tracking a domain or keyword that uses Cloudflare or similar platforms that provide SSL certificates. If you were to run “certstream — full | grep cloudflare” you would see all the new certificates for services behind Cloudflare.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmdtVTS1QJyIesRbjlOM8g.png" /><figcaption>certstream with — full and grepping for cloudflare</figcaption></figure><p>Let’s have a look at some use cases, how about if you were interesting in bug bounties you can use CT lists to discover new infrastructure being created by your target company. If you were to run “certstream — full | grep tesla.com” for example you see any new certificates being created that contained the word “tesla.com”. You could even remove the “.com” part and search for the word tesla, this would generate more false positives but would show third party services that Tesla might be using (for example tesla.glassdoor.com). Another use case similar to this if you were to run “certstream — full | grep amazon” (for example) it would show any new certificates (as well as some false positives) that are generated by Amazon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ooLsyW6rQXWMnvtRM83rOw.png" /><figcaption>certstream with — full and grepping for amazon</figcaption></figure><p>What about brand reputation monitoring, this is where someone is registering a certificate that will be part of a phishing website. This is important if you have customers that have to log into your website, or have to enter some kind of credentials. You can easily do this at the command line using similar commands to before, such as “certstream — full | grep [keyword]”.</p><p>The problem with using the command line in this way is that it’s great for short time monitoring but if you want to include this as part of an overall monitoring solution or longer term research you will need to code up a solution. The good thing is that there are libraries available on the calidog.io website and they provide code examples and data pulled from the CT lists (via calidog.io) is JSON formatted so easy to use (well sometimes at least).</p><p>For this example we are going to use the Python library and extend the code example to allow the use of multiple keywords. The output will write to the command line but can easily be changed to send either the full JSON or the parts you want to another platform (NoSQL, Elastic, Splunk, Slack etc. etc.).</p><p>This is the code currently, it takes a list of keywords and then looks for those in each newly registered certificate, if there is a match it will print it out to the command line. The code uses “paypal”, “ebay” &amp; “amazon” as our example keywords but you can could change this to anything you want.</p><pre>import logging<br>import sys<br>import datetime<br>import certstream</pre><pre>keyword = [&#39;paypal&#39;, &#39;amazon&#39;, &#39;ebay&#39;]</pre><pre>def print_callback(message, context):<br>    logging.debug(&quot;Message -&gt; {}&quot;.format(message))</pre><pre>if message[&#39;message_type&#39;] == &quot;heartbeat&quot;:<br>        return</pre><pre>if message[&#39;message_type&#39;] == &quot;certificate_update&quot;:<br>        domains = message[&#39;data&#39;][&#39;leaf_cert&#39;][&#39;all_domains&#39;]<br>        if [k for k in keyword if k in &#39; &#39;.join(domains)]:<br>            sys.stdout.write(u&quot;[{}] {} {} \n&quot;.format(datetime.datetime.now().strftime(&#39;%m/%d/%y %H:%M:%S&#39;), domains[0], &#39;,&#39;.join(domains)))<br>            sys.stdout.flush()</pre><pre>logging.basicConfig(format=&#39;[%(levelname)s:%(name)s] %(asctime)s - %(message)s&#39;, level=logging.INFO)</pre><pre>certstream.listen_for_events(print_callback, url=&#39;wss://certstream.calidog.io/&#39;)</pre><p>Now the code won’t necessarily output something straight away as it’s looking just for the keywords you’ve specified but in the screenshot below you can see the output from about 5 minutes using the example keywords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OaHA8DKy7v3ivHdrwdJ_fQ.png" /><figcaption>Example output of the above python script after 5 minutes</figcaption></figure><p>If you want to use the data retrieved from the CT list to pivot into other data sources, you can expand the number of fields returned (or use the whole thing) to get the certificate serial number, fingerprint etc.</p><p>All the available fields are shown in the Github repository for the calidog.io Python library which is available at the link below:<br><a href="https://github.com/CaliDog/certstream-python">https://github.com/CaliDog/certstream-python</a></p><p><strong>Python Code:</strong></p><p>I’ve made the code used in this post a bit more robust and pushed it to my “Junk” Github repo which you can find <a href="https://github.com/catalyst256/MyJunk/blob/master/osint-certstream.py">HERE</a>.</p><p>To run the code you first need to make sure you are using Python3, and have installed the “certstream” library. To install the certstream python library you just need to type on a terminal/command line.</p><pre>pip3 install certstream</pre><p>Once the certstream python library is installed you need to create a text file with your list of “keywords”. A single keyword per line is perfect so for example if you wanted to look for new certificate requests for <em>Amazon</em>, <em>EBay</em> and <em>PayPal</em> (for example) just create a file (doesn’t matter what the filename is) and add;</p><pre>amazon<br>ebay<br>paypal</pre><p>To run the code just execute the following;</p><pre>python3 osint-certstream.py [filename]</pre><p>So if your keywords filename is keywords.txt for example you would just run;</p><pre>python3 osint-certstream.py keywords.txt</pre><p>To stop the code at any time you can just CTRL + C to kill it.</p><p>Let me know if you have any issues, the code works it’s just production ready but gives you an idea of what is possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a603c9d2b776" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSINT: Getting email addresses from PGP Signatures]]></title>
            <link>https://catalyst256.medium.com/osint-getting-email-addresses-from-pgp-signatures-bf8991e5b624?source=rss-7512bc47fc17------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf8991e5b624</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[osint]]></category>
            <dc:creator><![CDATA[Adam Maxwell]]></dc:creator>
            <pubDate>Mon, 10 Jun 2019 10:04:09 GMT</pubDate>
            <atom:updated>2019-06-10T10:04:09.895Z</atom:updated>
            <content:encoded><![CDATA[<p>This morning I was reviewing some new Tor onion addresses one of my scripts had collected over the weekend, a lot of the websites I collect are either junk or no longer working.</p><p>One of the ones I checked was working, and on the website there was a PGP signature block. That got me thinking if you don’t know someones email address can you determine it from the PGP signature block??</p><p>Well the answer is yes, yes you can and with a little of time and some Python (who doesn’t love Python on a Monday morning) you can work out the email address(es) associated from just a PGP signature. The magic comes in determining the KeyId associated with a PGP signature and then using that Key ID querying a PGP key server to find the email address.</p><p>The code only currently works on PGP signatures that are the format as the one below (I may update it to work on other formats):</p><p>DISCLAIMER: I found this on the “darkweb” so I hold no responsibility/liability for what you do with it.</p><p>— — -BEGIN PGP SIGNATURE — — -</p><p>iQIzBAEBCgAdFiEEekpX72xWccPpVa0cjllHEKAeV0MFAlzthwgACgkQjllHEKAe<br>V0N9pxAApaQWg36TkemWvTu5a4BNuDEVjRQlnYPXg3XGllnIhsMFbiJvUbUJ4JHB<br>9qe979q1NEjHUaj2Z9u5n7zEs3w6DseZ5/yHAX63ozYfzhTCoix1SZmd+s5bAuPD<br>EvxCWPDe9jZSnNEPdMSsUMaD47YzNhQW8ZZniefBh1VUArZoUN96EaTk3KNsWYza<br>lzDH5gs+dALohQYdQiXp65bOsX0jrs7ouqBbY0kEdr/KymPLtiHsOPzzOgOrkLX8<br>t0oide+/wowbgV/8efH2ryu9s+hr1imVOIeH//0sjm6l64elNv3gp+81hQwCYtTN<br>NaHP2xDLq/pceFBDksWcPBSrzg4Zm7zJ7Tq0DJ/2HakM0RlpHUVnUoel/SYPWjYY<br>46Hwom0m5uFE6Lwf8uFaoWnxVYlppt0RxBefIFFX1EBpTCgGgkU6ARInLt0OfHee<br>M5xmgIjv6DXuebfZ0C1I+tMHI/NcnypUt+fKFTQyI0j6GqJcmIWCRquKHb5Z9LXk<br>HP491lO/9irqvTf9HYXWTB6pS7pjV8oZQ1E07CEOKcsfBymYoiJ6cCWTNsGikmNM<br>M7YhxK+ebF78YO13jbKg2hvEtasRtHfrVfB1GLO8XchUkMQx0ib7sktZf6TRAO/F<br>E5UJnleebONjITCiNffP7yys3E5EbaHJkcq/0bbbUs0H0bqHIe0=<br>=5p/y<br> — — -END PGP SIGNATURE — — -</p><p>There is a specific RFC associated with PGP formats, which you can find <a href="https://tools.ietf.org/html/rfc4880">HERE </a>. I’ve not read it to be honest (it’s not that kind of Monday morning). In order to get the Key ID you need to a few steps.</p><ol><li>Strip out the start and end of the signature block (the bits with — — ).</li></ol><p>regex_pgp = re.compile(<br> r” — — -BEGIN [^-]+ — — -([A-Za-z0–9+\/=\s]+) — — -END [^-]+ — — -”, re.MULTILINE)<br>matches = regex_pgp.findall(m)[0]</p><p>2. Decode the signature, which is base64 encoded.</p><p>b64 = base64.b64decode(matches)</p><p>3. Convert to hex, so you can pull out the values you need.</p><p>hx = binascii.hexlify(b64)</p><p>4. Get the values you need.</p><p>keyid = hx.decode()[48:64]</p><p>Once you have the Key ID you can just make a web call to a PGP key server to search for the key.</p><p>server = ‘<a href="http://keys.gnupg.net/pks/lookup?search=0x{0}&amp;fingerprint=on&amp;op=index&#39;.format(">http://keys.gnupg.net/pks/lookup?search=0x{0}&amp;fingerprint=on&amp;op=index&#39;.format(</a><br> keyid)</p><p>Then because well I’m lazy I used regex to find any email address.</p><p>regex_email = re.compile(r’([\w.-]+@[\w.-]+\.\w+)’, re.DOTALL | re.MULTILINE)<br>email = re.findall(regex_email, resp.text)</p><p>The full script can be found <a href="https://github.com/catalyst256/MyJunk/blob/master/decode-pgpsig.py">HERE</a></p><p>NOTE: I’ve not tested it exhaustively but it works enough for my needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf8991e5b624" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSINT: ETag you’re it…]]></title>
            <link>https://catalyst256.medium.com/osint-etag-youre-it-ecd7e923392c?source=rss-7512bc47fc17------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecd7e923392c</guid>
            <category><![CDATA[osint]]></category>
            <dc:creator><![CDATA[Adam Maxwell]]></dc:creator>
            <pubDate>Thu, 25 Oct 2018 11:01:10 GMT</pubDate>
            <atom:updated>2018-10-25T11:01:10.011Z</atom:updated>
            <content:encoded><![CDATA[<p>Investigators, malware analysts and a whole host of other people spend time mapping out infrastructure that may or may not belong to criminal entities. Some of the time this infrastructure is hidden behind services that are designed to provide anonymity (think Tor and Cloudflare) which makes any kind of attribution difficult.</p><p>Now I’m a data magpie, I have a tendency to collect data and work out later what I’m going to do with it. A while back someone suggested ETag (HTTP Header) as something worth collecting, so I thought I would have a look at potential uses.</p><p>ETag’s are part of the HTTP response header and is used for web cache validation. ETag’s are an opaque identifier assigned by a web server to a specific version of a resource found at a URL. The method for how ETag’s are generated isn’t specified in the HTTP specification but generated ETag’s are supposed to use a “collision resistant hash function” (source: <a href="https://en.wikipedia.org/wiki/HTTP_ETag).">https://en.wikipedia.org/wiki/HTTP_ETag).</a></p><p>I wanted to see if you could use ETag’s as a way to fingerprint web servers, however ETag’s are optional so not all web servers will return an ETag in the HTTP response header. Let’s look at an example, I have an image hosted on an Amazon S3 bucket, this S3 bucket is also fronted by Cloudflare (mostly for caching and performance). The HTTP headers for both requests are below;</p><p><strong>Direct request:</strong></p><p>HTTP/1.1 200 OK</p><p>Accept-Ranges: bytes<br>Content-Length: 1150<br>Content-Type: image/x-icon<br>Date: Thu, 25 Oct 2018 09:06:25 GMT<br><em>ETag: “e910c46eac10d2dc5ecf144e32b688d6”</em><br>Last-Modified: Mon, 06 Aug 2018 12:18:30 GMT<br>Server: AmazonS3<br>x-amz-id-2: LxghTaCpRKQhaP69Qm942BrdyhN87m+SIJTh1xz403c5nVEGj4Y7fsPtNrZ2uedLPRL3zCIeHas=<br>x-amz-request-id: 5116840933538C62</p><p><strong>Through Cloudflare:</strong></p><p>HTTP/1.1 200 OK</p><p>CF-Cache-Status: REVALIDATED<br>CF-RAY: 46f3876dbb4b135f-LHR<br>Cache-Control: public, max-age=14400<br>Connection: keep-alive<br>Content-Encoding: gzip<br>Content-Type: image/x-icon<br>Date: Thu, 25 Oct 2018 09:06:46 GMT<br><em>ETag: W/”e910c46eac10d2dc5ecf144e32b688d6&quot;<br></em>Expect-CT: max-age=604800, report-uri=”https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct&quot;<br>Expires: Thu, 25 Oct 2018 13:06:46 GMT<br>Last-Modified: Mon, 06 Aug 2018 12:18:30 GMT<br>Server: cloudflare<br>Set-Cookie: __cfduid=d5bd0309883f2470956c30bdbca9c99751540458406; expires=Fri, 25-Oct-19 09:06:46 GMT; path=/; domain=.sneakersinc.net; HttpOnly<br>Transfer-Encoding: chunked<br>Vary: Accept-Encoding<br>x-amz-id-2: vJsCSPCMJFdBmxdPemrtoX07SCKHliZicOpUYM32Do9TPnCFFLiZxsNXeNo3SK/lv/90sqDBPa0=<br>x-amz-request-id: CDC9A8EF960ABE44</p><p>From this example you can see that the ETag’s are the same, with the exception that the Cloudflare returned ETag has an additional “W/” in the front. According to the Wikipedia article a “W/” at the start of an ETag means it’s a “weak ETag validator”, whereas the direct ETag (not through Cloudflare) had a “strong ETag validator”.</p><p>A search on Shodan shows over <strong>23 million</strong> results where ETag’s are shown in the results, this gives us a big data set to compare results against. Let’s look at another example, if we search Shodan for this ETag “<em>122f-537eaccb76800</em>” we find <strong>263</strong> results, which shows that ETag’s aren’t necessarily unique. However, if you look at the results the web page titles are the same “Test Page for the Apache HTTP Server on Fedora”. So, it seems that the ETag does relate to the content of the web page, which is in line with the information from Wikipedia.</p><p>So, in some instances the ETag is unique, in others it might not be, but it does give you another pivot point to work from.</p><p>Let’s have another look at an example, the ETag “<em>dd8094–2c-3e9564c23b600</em>” provides <strong>16,042</strong> results. That’s a lot but if you look at the results (not all of them obviously), you will notice that they are all the same organisation “Team Cymru”. So, while the ETag in this example doesn’t provide a unique match it does provide a unique organisation, which again gives you an additional pivot point.</p><p>I’m going to continue looking at ways to collate ETag’s to web servers, if nothing else it’s an interesting way to match content being hosted on a web server. Have a look at this ETag “<em>574d9ce4–264</em>”.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecd7e923392c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maltego & Metasearch Engines]]></title>
            <link>https://catalyst256.medium.com/maltego-metasearch-engines-e08e64b0912?source=rss-7512bc47fc17------2</link>
            <guid isPermaLink="false">https://medium.com/p/e08e64b0912</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[maltego]]></category>
            <dc:creator><![CDATA[Adam Maxwell]]></dc:creator>
            <pubDate>Fri, 22 Jun 2018 11:09:33 GMT</pubDate>
            <atom:updated>2018-06-22T11:09:33.704Z</atom:updated>
            <content:encoded><![CDATA[<p>The other day on the train, I was reading “The Tao of Open Source Intelligence” by Stewart Bertram and there is a section when he talks about “Metasearch Engines”. Basically when you use search engines like Google or Bing you are searching their database of results. Metasearch engines typically aggregate the results from multiple different search engines which is useful when performing OSINT related searches or just if you want to save time.</p><p>A while back I came across <a href="https://asciimoo.github.io/searx/index.html">searx</a>:</p><blockquote>Searx is a free internet metasearch engine which aggregates results from more than 70 search services. Users are neither tracked nor profiled. Additionally, searx can be used over Tor for online anonymity.</blockquote><p>Now I like searx for a number of reasons;</p><ol><li>It’s written in Python (flask).</li><li>You can run it in a Docker container.</li><li>You can create your own (or add) search engines.</li><li>You can search for images, files, bittorents etc.</li><li>It has the ability to output in JSON, CSV and RSS</li></ol><p>The part of searx that really interests me is the ability to add your own search engines. I’ve yet to try this but in theory not only can you add “normal” search engines but you should also be able to add your own internal data sources. For example if you have an Elastic search index you could write a simple API to query it and then add it as a search engine within searx.</p><p>You could in theory (I am going to test this) remove all the normal search engines and use searx as a search engine over all your internal data sources (some assembly required).</p><p>Now what’s any of this got to do with Maltego? Well Maltego (out of the box) has some transforms for passing entities through search engines, however sometimes you just want to “Google” something and see what you get back (well that might just be me).</p><p>The idea was to run a docker instance of searx, and then create a local Maltego transform to run a query and return the first 10 pages of results.</p><p>Lets break down the steps:</p><ol><li>Build a docker image for searx.</li><li>Write a local transform to query searx and return the results.</li></ol><p>Before I get into the good stuff, let me quickly explain local transforms (in case you don’t know). Local transforms work the same as remote transforms except that they are run locally on your machine. Local transforms have some benefits over remote transforms but also some downsides as well (not an exhaustive list).</p><p><strong>Benefits:</strong></p><ol><li>You get all the benefits of the processing power of your local machine.</li><li>You can run transforms that query local files on your machine, for example if you want to have a transform to parse a pcap file you can (more difficult with remote transforms).</li><li>It’s much quicker to develop/make changes to local transforms and you don’t have any other infrastructure requirements.</li></ol><p><strong>Downsides:</strong></p><ol><li>Its more difficult to share local transforms with others (sharing is caring).</li><li>You have to worry about library dependencies and all that stuff.</li></ol><p>Ok enough of that stuff, lets get onto the interesting stuff.</p><p>First off we need to get a Docker image for searx, luckily this is really easy as the author’s documentation is really good. The instructions for this can be found <a href="https://asciimoo.github.io/searx/dev/install/installation.html#id12">HERE</a>.</p><p>All being well you should have a running instance of searx which should look like the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4hPBIgOcrnNJypzjTzVcnQ.png" /></figure><p>Have a play with searx, it’s well worth the time and has lots of cool features.</p><p>The local Maltego transform (it’s written in Python 3.x ) is pretty simple, pass it your query (based on a Maltego Phrase entity) and it will return the results as URL entities.</p><p>Paterva provide a Python library for local transforms, and similar to the remote TRX library it was written in Python 2.x so I tweaked it to work with Python 3.x.</p><p>Here is the code for the transform (Github repo linked at the end).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/58edaa905f3480e50002525fcdcd158f/href">https://medium.com/media/58edaa905f3480e50002525fcdcd158f/href</a></iframe><p>Now the transform maps across the URL, the title of the page (if it exists) and the content (which is a snippet of text, similar to Google results) as an additional field.</p><p>Below is a screenshot of what it looks like in Maltego.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sb6eRvH4zgVvMFaUAYw4pQ.png" /></figure><p>To get the transform working, clone the Github repo (link below) and then you will just need to add the new transform, if you’ve never done it before Paterva provide instructions <a href="https://docs.paterva.com/en/user-guide/ribbon-menu/transforms-tab/">HERE</a> (scroll to the bottom).</p><p>One of the things I love about Maltego is it doesn’t need to be complicated, creating transforms is easy, and then using them is just as simple. The ability to define what the tool can do for you, makes it powerful and versatile.</p><p>The Github repo is here:</p><p><a href="https://github.com/catalyst256/maltego-metasearch">catalyst256/maltego-metasearch</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e08e64b0912" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maltego + AWS Lambda]]></title>
            <link>https://catalyst256.medium.com/maltego-aws-lambda-c1a1524eb2bd?source=rss-7512bc47fc17------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1a1524eb2bd</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[maltego]]></category>
            <dc:creator><![CDATA[Adam Maxwell]]></dc:creator>
            <pubDate>Mon, 18 Jun 2018 11:24:32 GMT</pubDate>
            <atom:updated>2018-06-18T11:24:32.696Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the awesome things about Maltego (and Paterva, the company that makes it), is that they allow people like me, to host remote Maltego transforms (Transform Host Server) using a mixture of their Community <a href="https://cetas.paterva.com/TDS/">iTDS</a> server and your own infrastructure.</p><p>For a few years now I’ve been running remote Maltego Transforms on an AWS instance (t2.micro). All you need to get it up and working is a Linux server, Apache2 (you could probably use nginx) and a little bit of time. Paterva provide all the files and installation notes you need <a href="https://docs.paterva.com/en/developer-portal/tds-transforms/transform-host-server-setup/">HERE</a> and it works a treat.</p><p>If you work in tech you can’t really escape the flood of people talking about “Serverless” deployments and all that kind of stuff so I thought it would be cool to try and recreate the Transform Host Server but using Python 3.x, Flask (instead of Bottle), Zappa, and AWS’s Lambda functions.</p><p>Paterva’s original Maltego.py (the Python library for remote transforms) is written in Python 2.x, which means the first job was to tweak the file so Python 3.x didn’t get all funny about <em>print</em> statements (the good news is the tweaked version is available in the Github repo below).</p><p>Once that was done, I then needed to recreate the web server component (which was originally written in Python’s bottle framework) to make use of the awesome Python Flask framework. This probably took the longest as I had to work out the differences between Flask &amp; Bottle.</p><p>A skeleton Flask server is shown below, the transform I wrote to prove the concept was to simply connect to a website, and return the status code (200, 404 etc. etc.).</p><pre>#!/usr/bin/env python</pre><pre>from flask import Flask, request</pre><pre>from maltego import MaltegoMsg</pre><pre>from transforms import trx_getstastuscode</pre><pre><br>app = Flask(__name__)</pre><pre><br>@app.route(‘/’, methods=[‘GET’])</pre><pre>def lambda_test():</pre><pre>     return ‘Hello World’</pre><pre><br>@app.route(‘/tds/robots’, methods=[‘GET’, ‘POST’])</pre><pre>def get_robots():</pre><pre>     return (trx_getstastuscode(MaltegoMsg(request.data)))<br></pre><pre>if __name__ == ‘__main__’:</pre><pre>    app.run()</pre><p>The <em>lamba_test</em> function, is just there so I could make sure it was working, you can (and probably should remove it).</p><p>Now the next step was to deploy this to AWS’s Lambda service, being lazy I decided to try <a href="https://github.com/Miserlou/Zappa">Zappa</a>;</p><blockquote>Zappa makes it super easy to build and deploy server-less, event-driven Python applications (including, but not limited to, WSGI web apps) on AWS Lambda + API Gateway. Think of it as “serverless” web hosting for your Python apps. That means infinite scaling, zero downtime, zero maintenance — and at a fraction of the cost of your current deployments!</blockquote><p>Zappa is super easy to use, just follow the instructions and make sure to use Python virtual environments (not like someone we won’t mention, who forgot). Provide Zappa with some AWS credentials that have the level of access and within minutes you will be deploying your new app as a AWS Lambda function (seriously it only takes a few minutes). It’s important that you take note of the URL provided at the end of the deployment as you will need it in the final stage.</p><p>The final stage to this great masterpiece is to configure your account on Paterva’s Community iTDS server to point to your new transform. The documentation is <a href="https://docs.paterva.com/en/server-guides/itds-server/itds-module/">HERE</a> if you’ve never done before. Just one thing to note, the <em>Transform URL </em>is the URL outputted by Zappa above (it should stay the same not matter how many times you deploy).</p><p>The nice thing about using AWS’s Lambda functions is that its really easy and quick to deploy and the pricing model works great if you aren’t expecting heavy usage (1 million requests per month or 400,000 GB-seconds per month on the free-tier). Now there is no reason for you not to be hosting Maltego transforms for the world to share…</p><p>All the files you need to deploy your first Maltego Lambda function are in my Github repo below, clone the repo, configure your virtual environment (there is a handy requirements.txt to help) and off you go.</p><p><a href="https://github.com/catalyst256/aws-maltegotransforms">catalyst256/aws-maltegotransforms</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1a1524eb2bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>