<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Paweł Pokrywka's Lab: Privacy & Security]]></title><description><![CDATA[Privacy & security-related topics.]]></description><link>https://www.pawelpokrywka.com/s/privacy-security</link><image><url>https://substackcdn.com/image/fetch/$s_!gJuv!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe44a7fc6-d5ec-4a99-984a-7a7e0bc80a17_800x800.png</url><title>Paweł Pokrywka&apos;s Lab: Privacy &amp; Security</title><link>https://www.pawelpokrywka.com/s/privacy-security</link></image><generator>Substack</generator><lastBuildDate>Wed, 08 Apr 2026 15:35:35 GMT</lastBuildDate><atom:link href="https://www.pawelpokrywka.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Paweł Pokrywka]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[rss1@pawelpokrywka.com]]></webMaster><itunes:owner><itunes:email><![CDATA[rss1@pawelpokrywka.com]]></itunes:email><itunes:name><![CDATA[Paweł Pokrywka]]></itunes:name></itunes:owner><itunes:author><![CDATA[Paweł Pokrywka]]></itunes:author><googleplay:owner><![CDATA[rss1@pawelpokrywka.com]]></googleplay:owner><googleplay:email><![CDATA[rss1@pawelpokrywka.com]]></googleplay:email><googleplay:author><![CDATA[Paweł Pokrywka]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Rebooting Linux with encrypted disk]]></title><description><![CDATA[How to make it easier to keep the kernel updated]]></description><link>https://www.pawelpokrywka.com/p/rebooting-linux-with-encrypted-disk</link><guid isPermaLink="false">https://www.pawelpokrywka.com/p/rebooting-linux-with-encrypted-disk</guid><dc:creator><![CDATA[Paweł Pokrywka]]></dc:creator><pubDate>Mon, 31 Jul 2023 13:53:24 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!y6S8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60692078-4e29-4484-9988-f262d39b153f_4608x3456.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!y6S8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60692078-4e29-4484-9988-f262d39b153f_4608x3456.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!y6S8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60692078-4e29-4484-9988-f262d39b153f_4608x3456.jpeg 424w, https://substackcdn.com/image/fetch/$s_!y6S8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60692078-4e29-4484-9988-f262d39b153f_4608x3456.jpeg 848w, https://substackcdn.com/image/fetch/$s_!y6S8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60692078-4e29-4484-9988-f262d39b153f_4608x3456.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!y6S8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60692078-4e29-4484-9988-f262d39b153f_4608x3456.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!y6S8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60692078-4e29-4484-9988-f262d39b153f_4608x3456.jpeg" width="728" height="546" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/60692078-4e29-4484-9988-f262d39b153f_4608x3456.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:1092,&quot;width&quot;:1456,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:6956375,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!y6S8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60692078-4e29-4484-9988-f262d39b153f_4608x3456.jpeg 424w, https://substackcdn.com/image/fetch/$s_!y6S8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60692078-4e29-4484-9988-f262d39b153f_4608x3456.jpeg 848w, https://substackcdn.com/image/fetch/$s_!y6S8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60692078-4e29-4484-9988-f262d39b153f_4608x3456.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!y6S8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60692078-4e29-4484-9988-f262d39b153f_4608x3456.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>As an <a href="https://ethstaker.cc/">Ethereum solo staker</a>, I want my Linux staking box to be as secure as feasible. It applies to physical security too. If the attacker gains access to the validator key stored on disk, it will allow him/her to do malicious things such as intentionally exposing the validator to the slashing penalties.</p><p>My machine isn&#8217;t placed in a data center guarded 24/7, therefore to protect it from the physical attacker I used cryptography.</p><h2>Encryption inconvenience</h2><p>I decided to use <a href="https://en.wikipedia.org/wiki/Linux_Unified_Key_Setup">LUKS disk encryption</a> which can be enabled easily during the Linux installation. I set a long passphrase and I rest assured my data is well protected.</p><p>I need to provide the passphrase each time I turn the machine on. This way the volume key used to unlock the disk, can be derived from the text I enter. It requires a keyboard and physical presence during startup, therefore it may be inconvenient for headless systems.</p><p>There are many methods to make it easier. Though I use one of them, I find them either complex, costly, unreliable, or compromising security. I don&#8217;t want to discuss them here, because this topic deserves a separate post.</p><p>The important thing is, <strong>once started, the node should stay online</strong>. And with UPS protection, turning it off doesn&#8217;t happen almost at all.</p><h2>Maintenance</h2><p>To ensure there are no security bugs I perform regular software updates. Modern Linux distributions make it really easy to automate.</p><p>However, kernel updates are not that simple. To use a new kernel, the system needs to be rebooted. It&#8217;s just a short downtime which is often acceptable.</p><p>But when using disk encryption, the disk needs to be unlocked. How to achieve that when using ssh connection from a remote location? Given the fact kernel updates can be frequent, it becomes an issue.</p><p>One way to approach it is to try to avoid reboots.</p><h2>Live patching&#8230;</h2><p>&#8230;is a technique to apply changes to the running kernel, without a reboot. There are <a href="https://ubuntu.com/security/livepatch">many</a> <a href="https://www.suse.com/products/live-patching/">proprietary</a> <a href="https://www.redhat.com/sysadmin/kernel-live-patching-linux">implementations</a> <a href="https://ksplice.oracle.com/">provided</a> <a href="https://www.ninjaone.com/patch-management/linux/">as</a> <a href="https://tuxcare.com/enterprise-live-patching-services/kernelcare-enterprise/">services</a>. Preparing a binary patch ready to be applied to a running kernel seems to me a complex task that requires a lot of testing. Probably that&#8217;s why most suppliers charge for this service. In the case of <a href="https://ubuntu.com/security/livepatch">Ubuntu Livepatch</a>, before the patch is pushed to the customers, it is tested on the production systems of non-paying users. That&#8217;s the cost of using it for free!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-hmy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9afe46f8-e620-41c0-b425-84f240a99e4a_1481x850.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-hmy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9afe46f8-e620-41c0-b425-84f240a99e4a_1481x850.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-hmy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9afe46f8-e620-41c0-b425-84f240a99e4a_1481x850.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-hmy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9afe46f8-e620-41c0-b425-84f240a99e4a_1481x850.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-hmy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9afe46f8-e620-41c0-b425-84f240a99e4a_1481x850.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-hmy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9afe46f8-e620-41c0-b425-84f240a99e4a_1481x850.jpeg" width="728" height="418" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9afe46f8-e620-41c0-b425-84f240a99e4a_1481x850.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:836,&quot;width&quot;:1456,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:1108687,&quot;alt&quot;:&quot;A classic image of a Linux distro vendor testing patches on non-paying users.&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A classic image of a Linux distro vendor testing patches on non-paying users." title="A classic image of a Linux distro vendor testing patches on non-paying users." srcset="https://substackcdn.com/image/fetch/$s_!-hmy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9afe46f8-e620-41c0-b425-84f240a99e4a_1481x850.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-hmy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9afe46f8-e620-41c0-b425-84f240a99e4a_1481x850.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-hmy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9afe46f8-e620-41c0-b425-84f240a99e4a_1481x850.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-hmy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9afe46f8-e620-41c0-b425-84f240a99e4a_1481x850.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Inspired by <em>Cleopatra Testing Poisons on Condemned Prisoners</em> (1887) by Alexandre Cabanel, oil on canvas, 162.6 cm x 287.6 cm, Royal Museum of Fine Arts Antwerp</figcaption></figure></div><p>But still, when your kernel gets a live patch it is recommended to reboot in the nearest maintenance window.</p><p>I like to use open-source solutions instead of proprietary ones. Therefore I needed something else.</p><h2>No rebooting at all?</h2><p>In some environments and threat models, most vulnerabilities in the kernel are not a big deal. If you trust your local users, expose one or a few regularly updated services, and firewall the rest of the ports, then it&#8217;s just unlikely for the attacker to succeed. He/she will need a remote exploit in the tried and tested TCP/IP stack. I believe those types of bugs are extremely rare.</p><p>In the above scenario, one may choose to keep running with the same kernel, avoiding reboots. For the record: I don&#8217;t recommend this approach.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wna4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f48be77-e37b-4082-81db-879c4e507643_3213x2176.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wna4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f48be77-e37b-4082-81db-879c4e507643_3213x2176.jpeg 424w, https://substackcdn.com/image/fetch/$s_!wna4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f48be77-e37b-4082-81db-879c4e507643_3213x2176.jpeg 848w, https://substackcdn.com/image/fetch/$s_!wna4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f48be77-e37b-4082-81db-879c4e507643_3213x2176.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!wna4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f48be77-e37b-4082-81db-879c4e507643_3213x2176.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wna4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f48be77-e37b-4082-81db-879c4e507643_3213x2176.jpeg" width="1456" height="986" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5f48be77-e37b-4082-81db-879c4e507643_3213x2176.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:986,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2391945,&quot;alt&quot;:&quot;A classic image of a person in the lions' den. The person clearly ignores good security practices.&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A classic image of a person in the lions' den. The person clearly ignores good security practices." title="A classic image of a person in the lions' den. The person clearly ignores good security practices." srcset="https://substackcdn.com/image/fetch/$s_!wna4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f48be77-e37b-4082-81db-879c4e507643_3213x2176.jpeg 424w, https://substackcdn.com/image/fetch/$s_!wna4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f48be77-e37b-4082-81db-879c4e507643_3213x2176.jpeg 848w, https://substackcdn.com/image/fetch/$s_!wna4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f48be77-e37b-4082-81db-879c4e507643_3213x2176.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!wna4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f48be77-e37b-4082-81db-879c4e507643_3213x2176.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Inspired by <em>Daniel in the Lions' Den</em> (1614-1616) by Peter Paul Rubens, oil on canvas, 224.2 cm &#215; 330.5 cm, National Gallery of Art in Washington</figcaption></figure></div><p>That said, if the only reason for ignoring established good security practices is to prevent reboots because disk encryption makes it inconvenient, then I think we should do better.</p><p>We should make reboots convenient.</p><h2>How I wish it would work</h2><p>I would like to reboot to the new kernel without entering the passphrase again. It was entered once: can&#8217;t it be reused for a new kernel?</p><p>Well, we have <a href="https://wiki.archlinux.org/title/kexec">kexec</a>. It will be <a href="https://kernelnewbies.org/Linux_2_6_13">18 this year</a>, but it is not popular amongst people. If you haven&#8217;t heard about it, it allows you to replace the currently running kernel with a new one. And it does it without involving hardware reset and executing the boot loader:</p><pre><code>$ sudo kexec -l new_kernel.img   # load kernel into memory
$ sudo kexec -e                  # boot the loaded kernel</code></pre><p>While being cool, it&#8217;s not the same as live patching. The new kernel has to boot the entire system, filesystems need to be mounted and services have to start. The disk has to be unlocked, so the passphrase is required again.</p><h4>What if it was possible to preserve the volume encryption key?</h4><p>Linux keeps the keys for disk encryption in the kernel keyring. It is a special, secure place in memory. Even the root can&#8217;t retrieve volume encryption keys from there!<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a></p><pre><code>$ sudo dmsetup table
dm_crypt-0: 0 36284416 crypt aes-xts-plain64 :64:logon:cryptsetup:edd435cc-b51a-4530-aef3-5010caeee165-d0 0 252:3 32768</code></pre><p>As you can see above, only key reference is provided. The actual key is kept securely in kernel memory.</p><p>If the user could tell kexec to keep the given key intact, then the new kernel could reuse it. The newly booted system could unlock the disk without asking for a passphrase. I imagine kexec adds a new option allowing to specify a key to preserve:</p><pre><code><code>$ sudo kexec -l new_kernel.img --keep-key=my-key-reference</code></code></pre><h4>We are not there yet</h4><p>Most of the work related to the volume key preservation feature would need to be done on the kernel side, but kexec and cryptsetup would also need to implement support. From my limited perspective, it seems doable, but I cannot estimate the amount of work required.</p><p>In the meantime, let&#8217;s try to resolve this issue using the tools we already have.</p><h2>Initramfs</h2><p>Kexec allows to pass 2 things to the new kernel:</p><ul><li><p><em>kernel command line</em> containing various options for kernel and userspace,</p></li><li><p><em>initramfs</em> which is run by a new kernel to initialize various things, including disk encryption.</p></li></ul><p>We could include a volume key in the kernel command line and later use it to set up disk encryption. It would work, but the kernel command line is visible to the users, which disqualifies this concept.</p><p>So we are left with initramfs. This is a file located typically in an unencrypted /boot partition. We definitely don&#8217;t want to store the volume key on an unencrypted disk, because it defeats the purpose of encryption.</p><p>But we don&#8217;t need to modify the original initramfs file permanently. It&#8217;s enough to modify it temporarily and pass it to kexec.</p><h2>Introducing cryptreboot</h2><p>This led me to create a tool that:</p><ol><li><p>Asks the user for a passphrase to derive the volume key.</p></li><li><p>Copies original initramfs into memory and patches it to include the volume key.</p></li><li><p>Uses kexec to load patched initramfs and kernel into memory.</p></li><li><p>Initiates standard system shutdown to stop services and unmount filesystems.</p></li><li><p>On shutdown completion, a kernel with patched initramfs is executed. This step is done by systemd.</p></li></ol><p>Here is what it looks like compared to the standard reboot. If you prefer, you can check <a href="https://www.youtube.com/watch?v=C5anmOjOhBI">the identical YouTube version</a>.</p><div class="native-video-embed" data-component-name="VideoPlaceholder" data-attrs="{&quot;mediaUploadId&quot;:&quot;ca422f20-1829-453c-851e-22635f5fa785&quot;,&quot;duration&quot;:null}"></div><p></p><p>As you can see, the user is still asked for a passphrase, but it&#8217;s done before reboot, not after. This way the user could execute a reboot remotely. Physical presence during startup is not required anymore.</p><p>From a security standpoint, it should be almost as secure as the standard setup:</p><ul><li><p>secrets are not persisted anywhere, everything is done in memory,</p></li><li><p>volume key touches userspace for just a brief moment; the rest of the time it stays safely in the kernel keyring.</p></li></ul><p>If you have a different perspective, please leave a comment below.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.pawelpokrywka.com/p/rebooting-linux-with-encrypted-disk/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.pawelpokrywka.com/p/rebooting-linux-with-encrypted-disk/comments"><span>Leave a comment</span></a></p><p>Cryptreboot is an easy-to-use, drop-in solution written in Ruby and released under the MIT license. You can find <a href="https://github.com/phantom-node/cryptreboot">it on GitHub</a>.</p><h2>What&#8217;s next</h2><p>Here are the features I plan to implement:</p><ul><li><p>boot loader configuration parsing; currently, cryptreboot relies on symlinks or the user to pick the kernel and initramfs,</p></li><li><p>optionally persist the volume key on an encrypted disk in a file accessible to root only; this way user accepting a slight security trade-off won&#8217;t be prompted for the passphrase at all,</p></li><li><p>integration with systemd, to make cryptreboot the default reboot handler,</p></li><li><p>deb package to make installation easier,</p></li><li><p>support for non-Debian Linux distributions.</p></li></ul><p>If you use disk encryption in Linux, please give cryptreboot a try and share your feedback!</p><p>Thank you for reading this post. If you want to stay in the loop, subscribe and <a href="https://github.com/phantom-node/cryptreboot">star the project</a> on Github, so you won&#8217;t miss new cryptreboot releases.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.pawelpokrywka.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.pawelpokrywka.com/subscribe?"><span>Subscribe now</span></a></p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>It is actually possible to get the volume key from user space, but the disk has to be unlocked with a non-default &#8212;disable-keyring cryptsetup flag.</p></div></div>]]></content:encoded></item><item><title><![CDATA[Ledger card: was there a data leak?]]></title><description><![CDATA[How I traced the source of the potential data leak]]></description><link>https://www.pawelpokrywka.com/p/ledger-card-was-there-a-data-leak</link><guid isPermaLink="false">https://www.pawelpokrywka.com/p/ledger-card-was-there-a-data-leak</guid><dc:creator><![CDATA[Paweł Pokrywka]]></dc:creator><pubDate>Tue, 04 Jul 2023 12:47:03 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!RSwL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe04a86b2-6341-4912-bd42-6b36d941af8d_1154x1679.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>2023-10-23 update</h2><p>3 months ago I received an email that got my attention. I subsequently wrote a blog post about it. To make a long story short I suspected the disposable email address I used exclusively for Ledger Card leaked somehow because I got a suspicious email on that address. Later on, I found out the source of the problem lay in Baanx, Ledger's business partner.</p><p>Baanx informed the email I got had been sent by a legitimate project, which is a partner of Baanx. I neglected to check the project carefully &#8212; that&#8217;s on me!</p><p>However, it&#8217;s only one part of the issue.</p><p>The email message came unsolicited to the address which shouldn&#8217;t be used for this type of communication. There is no doubt Baanx failed to handle my email address properly. While Baanx might see it differently, I believe this specific mailing campaign reached others as well. However&#8230;</p><h4>The breach probably did not happen</h4><p>We exchanged a few messages and had video calls with Baanx. I learned a lot of details, which I won&#8217;t provide here. The common part of our conclusions is that there was a human error during the handling of marketing email campaigns.</p><p>Most importantly, Baanx said they investigated the case, fixed a software bug, and cleaned up internal processes. Here is part of the email I got from Baanx:</p><blockquote><p>There definitely were some "human error" learnings here on our internal processes that were cleaned up, so I thank you for reporting the issue. No other customers or waiting list participants contacted us, so it appears to be a single edge case - at least from reports.</p></blockquote><p>While I think they could do a bit better, I believe them.</p><p>The end of this story is positive. Something that looked like a data breach turned out to be a relatively harmless human error. That&#8217;s a relief!</p><p>A special thanks to Scott Carlson from Baanx for his diligent management of the situation.</p><h2>2023-07-05 update</h2><p>I got an <a href="https://www.reddit.com/r/ledgerwallet/comments/14qeh9w/comment/jqqo4od">official response from CL Card support</a> on Reddit. I also spoke to a person from Baanx. It seems that Anrk is Baanx&#8217;s partner. They're conducting an internal investigation. They say there was no data breach. I'm still not 100% clear why I got this email message. I will update this post when more data becomes available.</p><h2>Here comes the original text</h2><p>Do you remember how <a href="https://www.ledger.com/message-ledgers-ceo-data-leak">1 million records leaked from Ledger</a>?</p><p>Today I received this funny-looking email message:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RSwL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe04a86b2-6341-4912-bd42-6b36d941af8d_1154x1679.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RSwL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe04a86b2-6341-4912-bd42-6b36d941af8d_1154x1679.png 424w, https://substackcdn.com/image/fetch/$s_!RSwL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe04a86b2-6341-4912-bd42-6b36d941af8d_1154x1679.png 848w, https://substackcdn.com/image/fetch/$s_!RSwL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe04a86b2-6341-4912-bd42-6b36d941af8d_1154x1679.png 1272w, https://substackcdn.com/image/fetch/$s_!RSwL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe04a86b2-6341-4912-bd42-6b36d941af8d_1154x1679.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RSwL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe04a86b2-6341-4912-bd42-6b36d941af8d_1154x1679.png" width="1154" height="1679" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e04a86b2-6341-4912-bd42-6b36d941af8d_1154x1679.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1679,&quot;width&quot;:1154,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:871941,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RSwL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe04a86b2-6341-4912-bd42-6b36d941af8d_1154x1679.png 424w, https://substackcdn.com/image/fetch/$s_!RSwL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe04a86b2-6341-4912-bd42-6b36d941af8d_1154x1679.png 848w, https://substackcdn.com/image/fetch/$s_!RSwL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe04a86b2-6341-4912-bd42-6b36d941af8d_1154x1679.png 1272w, https://substackcdn.com/image/fetch/$s_!RSwL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe04a86b2-6341-4912-bd42-6b36d941af8d_1154x1679.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Seems similar to <a href="https://www.ankr.com/">Ankr</a>. But if you check it closely you will notice a typo.</p><h2>Recipient address</h2><p>&#8220;Oh, just another scam attempt&#8221; - I thought<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. However, when I checked the recipient address of this message, I found this address looks similar to the one, I use exclusively for my Ledger <a href="https://www.ledger.com/cl-card">CL card</a>.</p><p>By <em>exclusively</em> I mean, I don&#8217;t provide this address in any other place. Every time I register somewhere, I use a different, unique email address. This is my method of localizing sources of data leaks (if it was my data that leaked).</p><p>However, in this particular case, I used the same email address twice. I used it to contact CL Card support regarding the issues with my card. After closer inspection, I found that I made a typo in my email address when contacting CL Card support. To sum things up, I used:</p><ul><li><p>address #1 as a login for the CL Card system,</p></li><li><p>address #2 for contacting CL Card support<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>.</p></li></ul><p>The scam message was delivered to email address #2.</p><h2>Source of the leak</h2><p>So it seems, my address leaked from the support department and <strong>not the CL card system itself</strong>. That&#8217;s a big relief!</p><p>But still, the data we have now leads to many questions. Here are some of them:</p><ul><li><p>When the leak happened?</p></li><li><p>How many other addresses leaked?</p></li><li><p>Apart from email addresses, what other data leaked?</p></li><li><p>Was it a corrupt or careless employee?</p></li><li><p>Was it a CRM database leak?</p></li><li><p>Is CRM self-hosted by Ledger or outsourced? Maybe they outsource support entirely?</p></li><li><p>Was CRM data transferred into another system (for example for <a href="https://blog.trezor.io/ongoing-phishing-attacks-on-trezor-users-edd840b17304">marketing purposes</a>), and the leak happened there?</p></li></ul><p>I can answer the first question. I sent the first message using address #2 on 8th December 2022. <strong>So it seems the leak happened between 2022-12-08 and 2023-07-04.</strong></p><p>Also, I know <a href="https://haveibeenpwned.com/">Have I Been Pwned</a> doesn&#8217;t report my email as leaked. I checked the same day I wrote this post.</p><p>I don&#8217;t know other answers. But I wonder how many people noticed this too. If you were affected, please leave a comment below.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.pawelpokrywka.com/p/ledger-card-was-there-a-data-leak/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.pawelpokrywka.com/p/ledger-card-was-there-a-data-leak/comments"><span>Leave a comment</span></a></p><h2>My data leaked - what now?</h2><p>Unfortunately, if your data leaks, you can&#8217;t <em>leak it back</em>. It helps if you provide disposable addresses, but your main address will leak someday too. As always you need to be careful with incoming mail.</p><h2>That&#8217;s it</h2><p>Thank you for reading this short post.</p><p>For interested parties, I pasted the headers of the message and the first part of the text below. I obfuscated my email address and some other data which may potentially lead to revealing private information.</p><pre><code>Delivered-To: address-2@obfuscated.com
Received: by 2002:ab3:1c15:0:b0:238:9402:e3c6 with SMTP id u21csp4866874lth;
        Tue, 4 Jul 2023 03:00:09 -0700 (PDT)
X-Google-Smtp-Source: APBJJlGIpdLNd8AIX7qcHMNUTlkl5SwX0AIeWFPH3NbG0NmWonNOfJbO6NP308UQD2NXNBzLQOO5
X-Received: by 2002:a17:902:d501:b0:1b8:3936:7b64 with SMTP id b1-20020a170902d50100b001b839367b64mr20459348plg.1.1688464809144;
        Tue, 04 Jul 2023 03:00:09 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1688464809; cv=none;
        d=google.com; s=arc-20160816;
        b=vppot55BTC0Nh7GIdbYXbKkW+isDHpv7D0N4QQeYwg6qUShM6SncDiiDxRpZGylRNB
         vYll7SyfV7nMe1RkojIwcsGocbl6o8FGgQVgj/sMqZ7bIJNWu0wx+mkQRYOZ5VD/j5pC
         eHPFaD4AadeMlQTtWBrqeZx6lRovpHPBrXJnFQ7BriNOfbINnuxgQgHuAnt9vP8As/Rm
         oij0SvOVoOsXW0wRWOFiWebZ+jmGRUMNWRmkLSsAGnSSAcC7x3+VStBjpg9KMDH37iLr
         WL5MJ7IvbnzmooomKMDeVwrUEKUFVEULpELb7LCF9lM6qAas9bz4XNn8rtgQ0doIfuxh
         mH8A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=feedback-id:from:list-unsubscribe:subject:reply-to:mime-version
         :date:message-id:to:dkim-signature;
        bh=8yLsdori4r6GtMEEET+tAfTrVGhEDhyYgbLw94d8CEQ=;
        fh=tDNHxWpIqxviIVEMkK8CTTH5nJteJnWyRzljgxDe6kw=;
        b=Oh3dOJKFdCq5hF0TPRn4pTSwnLdpqhkQbu8ePsrpsa2942ygYm8oqKn8vo1FTIHAqC
         OGWcB6odmBIZxTnE2UktQ13Cxhn7sIWvoxJh4OpGDiF2VmQrvYXvyjrJvAb/xQnVNxYj
         b8YZIK4Q9JTKIhLllhAA2P0Tvo9jY9maEBpz4bs/oq1lFenOrDcuVFwKsJM0AFVtNsBC
         7zjsqMzyPEnVwAeTG1XDr7SgQeq84TESIG/M5j5icR2s40qktBUGIjYnkpCnH5XtW84C
         68W4+/h6Ph2g3gD+t2ze/Fbeg7jdVJfyczvXSUR4/P5YvB4dxeJPvvbq/vZsqPYFnYx6
         qKeg==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@anrkprotocol.com header.s=scph0623 header.b=qQ7u47oI;
       spf=pass (google.com: domain of msprvs1=1954918sqetfe=bounces-280172@sparkpostmail.com designates 192.174.87.92 as permitted sender) smtp.mailfrom="msprvs1=1954918SQEtfE=bounces-280172@sparkpostmail.com"
Return-Path: &lt;msprvs1=1954918SQEtfE=bounces-280172@sparkpostmail.com&gt;
Received: from mta-174-87-92.smtp-out.sparkpostmail.com (mta-174-87-92.smtp-out.sparkpostmail.com. [192.174.87.92])
        by mx.google.com with ESMTPS id kb14-20020a170903338e00b001b6ae9f8bb1si12371885plb.75.2023.07.04.03.00.08
        for &lt;address-2@obfuscated.com&gt;
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 04 Jul 2023 03:00:09 -0700 (PDT)
Received-SPF: pass (google.com: domain of msprvs1=1954918sqetfe=bounces-280172@sparkpostmail.com designates 192.174.87.92 as permitted sender) client-ip=192.174.87.92;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@anrkprotocol.com header.s=scph0623 header.b=qQ7u47oI;
       spf=pass (google.com: domain of msprvs1=1954918sqetfe=bounces-280172@sparkpostmail.com designates 192.174.87.92 as permitted sender) smtp.mailfrom="msprvs1=1954918SQEtfE=bounces-280172@sparkpostmail.com"
X-MSFBL: OWV7igvEEXPJb+7ZJrrlYsThoPLaO1ot/hRxyPVy+gU=|eyJtZXNzYWdlX2lkIjo iNjQ5Y2E1ZWRhMzY0YTExMDVjOWQiLCJzdWJhY2NvdW50X2lkIjoiMCIsImN1c3R vbWVyX2lkIjoiMjgwMTcyIiwidGVuYW50X2lkIjoic3BjIiwiciI6ImNsLWNhcmR zLmNvbS4xMi4xMi4yMDIxLnN5c3RlbUBjcnlwdG9uaXgub3JnIn0=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anrkprotocol.com; s=scph0623; t=1688464805; i=@anrkprotocol.com; bh=8yLsdori4r6GtMEEET+tAfTrVGhEDhyYgbLw94d8CEQ=; h=To:Message-ID:Date:Content-Type:Subject:List-Unsubscribe:From:
&#9; From:To:Cc:Subject; b=obfuscated
To: address-2@obfuscated.com
Message-ID: &lt;obfuscated@jp.mta1vrest.cc.prd.sparkpost&gt;
Date: Tue, 04 Jul 2023 10:00:05 +0000
Content-Type: multipart/alternative; boundary="_----MvvyzH+M+eka7ub4N8/3Kw===_61/D9-38980-5ADE3A46"
MIME-Version: 1.0
Reply-To: anrk@anrkprotocol.com
Subject: On-chain card spending, self-custody and beyond! &#128640;
X-Campaign-ID: 7184983
List-Unsubscribe: &lt;https://links.iterable.com/e/encryptedUnsubscribe?obfuscated&gt;,&lt;mailto:unsubscribe+obfuscated@unsubscribe.iterable.com&gt;
From: anrkprotocol &lt;anrk@anrkprotocol.com&gt;
X-Message-ID: obfuscated
X-Feedback-ID: obfuscated:iterable
Feedback-ID: obfuscated:iterable

--_----MvvyzH+M+eka7ub4N8/3Kw===_61/D9-38980-5ADE3A46
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

Connect to your Web3 wallet to an open source wallet network



 &lt;https://anrkprotocol.com/on-chain-transactions/&gt;=E2=80=8A

Connect Your Metamask, Ledger, Phamtom or Web3 Wallet To The X Card And Spe=
nd=20
On-Chain!


We are building anrkprotocol - an open-source wallet network that allows yo=
u=20
to connect your Web3 wallet to our Mastercard, enabling on-chain spending a=
nd=20
giving you complete custody over your assets. With anrkprotocol you keep=20
control of your funds at all times and you eliminate the need for trust in=
=20
custodians or financial institutions. Join Waitlist!=20
&lt;https://anrkprotocol.com/on-chain-transactions/&gt;=20</code></pre><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>Maybe Anrk is legitimate, I haven&#8217;t checked. However, sending marketing messages to email addresses obtained without user consent doesn&#8217;t look fair.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p>To be 100% accurate, I used address #2 by mistake, after realizing it I continued to use address #1 for contacting support. But the most important is I sent a few messages from address #2 and got replies to this address.</p></div></div>]]></content:encoded></item><item><title><![CDATA[How to deanonymize smart contract author]]></title><description><![CDATA[Doxxing Solidity developer for fun and profit]]></description><link>https://www.pawelpokrywka.com/p/how-to-deanonymize-smart-contract-author</link><guid isPermaLink="false">https://www.pawelpokrywka.com/p/how-to-deanonymize-smart-contract-author</guid><dc:creator><![CDATA[Paweł Pokrywka]]></dc:creator><pubDate>Sat, 07 Aug 2021 22:19:35 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!TOcW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6797fe-4c48-45a5-adb2-015eeb64659e_2000x1335.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TOcW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6797fe-4c48-45a5-adb2-015eeb64659e_2000x1335.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TOcW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6797fe-4c48-45a5-adb2-015eeb64659e_2000x1335.jpeg 424w, https://substackcdn.com/image/fetch/$s_!TOcW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6797fe-4c48-45a5-adb2-015eeb64659e_2000x1335.jpeg 848w, https://substackcdn.com/image/fetch/$s_!TOcW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6797fe-4c48-45a5-adb2-015eeb64659e_2000x1335.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!TOcW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6797fe-4c48-45a5-adb2-015eeb64659e_2000x1335.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TOcW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6797fe-4c48-45a5-adb2-015eeb64659e_2000x1335.jpeg" width="1456" height="972" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/ed6797fe-4c48-45a5-adb2-015eeb64659e_2000x1335.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:972,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2728027,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!TOcW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6797fe-4c48-45a5-adb2-015eeb64659e_2000x1335.jpeg 424w, https://substackcdn.com/image/fetch/$s_!TOcW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6797fe-4c48-45a5-adb2-015eeb64659e_2000x1335.jpeg 848w, https://substackcdn.com/image/fetch/$s_!TOcW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6797fe-4c48-45a5-adb2-015eeb64659e_2000x1335.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!TOcW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6797fe-4c48-45a5-adb2-015eeb64659e_2000x1335.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Attribution: Freepik</figcaption></figure></div><p>I came across an article whose author described the process of creating a smart contract and deploying it to the Ethereum mainnet. He also published the source code.</p><p>I didn&#8217;t have experience with smart contract development and blockchain analysis, but after reading the article I began to wonder:</p><blockquote><p>Is it possible to use this public information in order to find Ethereum address of this person?</p></blockquote><p>It would be fun to see how much money he holds ;-)</p><h2>TL;DR</h2><p>Given the smart contract&#8217;s source code it is possible to find it using blockchain analysis. I&#8217;ve used Google Big Query to search for specific function signatures. In the end, I give some hints on how to avoid deanonymization.</p><h2>Disclaimer</h2><p>I don&#8217;t want to disclose the personal details of the smart contract&#8217;s author. Let&#8217;s just call him John. I contacted John and he approved this article before publication.</p><p>Don&#8217;t use the knowledge you got here (or anywhere else) to hurt others.</p><h2>Challenge</h2><p>I can define a challenge as entering unknown territory with a clear goal in mind. In the area of computer security and privacy, this feeling boosts my creativity in problem-solving, forces me to learn new things fast, perform reverse engineering and try to get into the state of mind of a given system creator.</p><p>It gives me the satisfaction of a deep understanding of the system and a thrill, both at the same time. With that motivation, I started researching the problem.</p><h2>Examine the code</h2><p>My first attempt was to check for any hardcoded Ethereum addresses in John&#8217;s code. The common practice is to set contract owner address dynamically during deployment instead of hardcoding it, and it was also the case here. But it costs nothing to check.</p><pre><code>constructor() {
  <strong>owner = msg.sender</strong>; // set owner to address of caller
}</code></pre><h2>Compare bytecode</h2><p>Every smart contract&#8217;s bytecode is available publicly on the blockchain. Therefore my second attempt was to compile John&#8217;s code and then use some tool to compare it with every smart contract on Ethereum.</p><p>I started by finding a way to query the blockchain for the information I wanted. It appears you can&#8217;t search by bytecode in popular blockchain explorers such as <a href="https://etherscan.io/">Etherscan</a> or <a href="https://etherchain.org/">Etherchain</a>. Googling bytecode is not a good idea, because Google doesn&#8217;t allow such large queries.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sCef!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feb7da7a0-3fc4-447c-9004-4ca65a282a0f_1190x426.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sCef!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feb7da7a0-3fc4-447c-9004-4ca65a282a0f_1190x426.png 424w, https://substackcdn.com/image/fetch/$s_!sCef!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feb7da7a0-3fc4-447c-9004-4ca65a282a0f_1190x426.png 848w, https://substackcdn.com/image/fetch/$s_!sCef!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feb7da7a0-3fc4-447c-9004-4ca65a282a0f_1190x426.png 1272w, https://substackcdn.com/image/fetch/$s_!sCef!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feb7da7a0-3fc4-447c-9004-4ca65a282a0f_1190x426.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sCef!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feb7da7a0-3fc4-447c-9004-4ca65a282a0f_1190x426.png" width="1190" height="426" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/eb7da7a0-3fc4-447c-9004-4ca65a282a0f_1190x426.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:426,&quot;width&quot;:1190,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:128278,&quot;alt&quot;:&quot;Google error message saying: The requested URL /... is too large to process. That's all we know.&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Google error message saying: The requested URL /... is too large to process. That's all we know." title="Google error message saying: The requested URL /... is too large to process. That's all we know." srcset="https://substackcdn.com/image/fetch/$s_!sCef!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feb7da7a0-3fc4-447c-9004-4ca65a282a0f_1190x426.png 424w, https://substackcdn.com/image/fetch/$s_!sCef!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feb7da7a0-3fc4-447c-9004-4ca65a282a0f_1190x426.png 848w, https://substackcdn.com/image/fetch/$s_!sCef!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feb7da7a0-3fc4-447c-9004-4ca65a282a0f_1190x426.png 1272w, https://substackcdn.com/image/fetch/$s_!sCef!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feb7da7a0-3fc4-447c-9004-4ca65a282a0f_1190x426.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">If your query is too long, you can <a href="https://www.youtube.com/watch?v=v2FMqtC1x9Y">break Google</a>.</figcaption></figure></div><h2>BigQuery</h2><p>However, I&#8217;ve found Google created a BigQuery public dataset for Ethereum and updates it daily. From the user&#8217;s perspective BigQuery is just a large SQL database similar to Postgresql or Mysql used routinely by developers. Its usage is free (within limits) and there is a web-based query tool called <a href="https://console.cloud.google.com/bigquery">BigQuery Console</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LM1M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd24af2a4-00f5-4155-b532-21d6ca8d6884_2962x1390.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LM1M!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd24af2a4-00f5-4155-b532-21d6ca8d6884_2962x1390.png 424w, https://substackcdn.com/image/fetch/$s_!LM1M!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd24af2a4-00f5-4155-b532-21d6ca8d6884_2962x1390.png 848w, https://substackcdn.com/image/fetch/$s_!LM1M!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd24af2a4-00f5-4155-b532-21d6ca8d6884_2962x1390.png 1272w, https://substackcdn.com/image/fetch/$s_!LM1M!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd24af2a4-00f5-4155-b532-21d6ca8d6884_2962x1390.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LM1M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd24af2a4-00f5-4155-b532-21d6ca8d6884_2962x1390.png" width="1456" height="683" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/d24af2a4-00f5-4155-b532-21d6ca8d6884_2962x1390.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:683,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:394468,&quot;alt&quot;:&quot;Google Cloud Platform screenshot&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Google Cloud Platform screenshot" title="Google Cloud Platform screenshot" srcset="https://substackcdn.com/image/fetch/$s_!LM1M!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd24af2a4-00f5-4155-b532-21d6ca8d6884_2962x1390.png 424w, https://substackcdn.com/image/fetch/$s_!LM1M!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd24af2a4-00f5-4155-b532-21d6ca8d6884_2962x1390.png 848w, https://substackcdn.com/image/fetch/$s_!LM1M!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd24af2a4-00f5-4155-b532-21d6ca8d6884_2962x1390.png 1272w, https://substackcdn.com/image/fetch/$s_!LM1M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd24af2a4-00f5-4155-b532-21d6ca8d6884_2962x1390.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">BigQuery console showing schema of the Ethereum public dataset.</figcaption></figure></div><p>I found it perfect for the job. Looking at schema, there is a <code>contracts</code> table and it contains a <code>bytecode</code> column. To see bytecode related to each one of random 10 transactions made on the last day, I could execute the following SQL statement:</p><pre><code>SELECT bytecode
FROM
  bigquery-public-data.crypto_ethereum.contracts
WHERE
  block_timestamp &gt;
  CAST(DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY) AS TIMESTAMP)
LIMIT 10</code></pre><blockquote><p>Timestamp constrain is optional but recommended. This table is huge. Restricting time interval prevents Google from processing a lot of non-relevant data. I skipped this constrain on my first trials which quickly ate all of my quota.</p></blockquote><p>Knowing the exact bytecode and blog post&#8217;s publication date I could find the contract address by executing the following statement:</p><pre><code>SELECT address
FROM
  bigquery-public-data.crypto_ethereum.contracts
WHERE
  block_timestamp &gt; <strong>{month before post publication date}</strong>
AND
  bytecode = <strong>{compiled bytecode of smart contract}</strong>
LIMIT 10</code></pre><blockquote><p><code>address</code> is a column containing contract address.</p></blockquote><p>Now I only needed the bytecode of this smart contract.</p><h2>Compilation</h2><p>I decided to use a free web-based IDE called <a href="https://remix.ethereum.org/">Remix</a> because it doesn&#8217;t require setting up the development environment.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cbT7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1c4276d-02f4-40a8-866e-ecb45068c9a8_1876x858.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cbT7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1c4276d-02f4-40a8-866e-ecb45068c9a8_1876x858.png 424w, https://substackcdn.com/image/fetch/$s_!cbT7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1c4276d-02f4-40a8-866e-ecb45068c9a8_1876x858.png 848w, https://substackcdn.com/image/fetch/$s_!cbT7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1c4276d-02f4-40a8-866e-ecb45068c9a8_1876x858.png 1272w, https://substackcdn.com/image/fetch/$s_!cbT7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1c4276d-02f4-40a8-866e-ecb45068c9a8_1876x858.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cbT7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1c4276d-02f4-40a8-866e-ecb45068c9a8_1876x858.png" width="1456" height="666" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/d1c4276d-02f4-40a8-866e-ecb45068c9a8_1876x858.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:666,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:200555,&quot;alt&quot;:&quot;Remix IDE screenshot&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Remix IDE screenshot" title="Remix IDE screenshot" srcset="https://substackcdn.com/image/fetch/$s_!cbT7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1c4276d-02f4-40a8-866e-ecb45068c9a8_1876x858.png 424w, https://substackcdn.com/image/fetch/$s_!cbT7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1c4276d-02f4-40a8-866e-ecb45068c9a8_1876x858.png 848w, https://substackcdn.com/image/fetch/$s_!cbT7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1c4276d-02f4-40a8-866e-ecb45068c9a8_1876x858.png 1272w, https://substackcdn.com/image/fetch/$s_!cbT7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1c4276d-02f4-40a8-866e-ecb45068c9a8_1876x858.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Remix IDE with Solidity editor opened.</figcaption></figure></div><p>I&#8217;ve created a <code>.sol</code> file in Remix and pasted the code of the contract. Then I opened <strong>Solidity compiler</strong> tab and set Solidity version to match the version specified in the code. Each file has the following line at the top:</p><pre><code>pragma solidity SPEC</code></pre><blockquote><p>In place of <code>SPEC</code> there is a version specification.</p></blockquote><p>Using the same compiler is important because every version may produce different bytecode and I was trying to generate an exact copy of the bytecode deployed by John.</p><p>The code was compiled successfully, and I was able to get bytecode.</p><h2>Blockchain search</h2><p>To my surprise, SQL query mentioned above didn&#8217;t return any values. I modified <code>WHERE</code> statement to use SQL <code>LIKE</code>, which allows finding partial matches:</p><pre><code><code>bytecode LIKE '%</code><strong><code>{part of compiled bytecode}</code></strong><code>%'</code></code></pre><p>Then I experimented with passing different parts of bytecode. However, there were no meaningful results neither.</p><h2>Optimization</h2><p>Then it hit me. Solidity compiler <a href="https://docs.soliditylang.org/en/latest/internals/optimizer.html">optimizes</a> code, to reduce code size (contract deployment is cheaper) and execution cost (users have to pay less for gas). </p><p>Optimization level is controller by a parameter specified during compilation.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AsYB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F665e1856-4a64-47a8-bd5a-062910497129_1627x958.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AsYB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F665e1856-4a64-47a8-bd5a-062910497129_1627x958.png 424w, https://substackcdn.com/image/fetch/$s_!AsYB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F665e1856-4a64-47a8-bd5a-062910497129_1627x958.png 848w, https://substackcdn.com/image/fetch/$s_!AsYB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F665e1856-4a64-47a8-bd5a-062910497129_1627x958.png 1272w, https://substackcdn.com/image/fetch/$s_!AsYB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F665e1856-4a64-47a8-bd5a-062910497129_1627x958.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AsYB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F665e1856-4a64-47a8-bd5a-062910497129_1627x958.png" width="1456" height="857" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/665e1856-4a64-47a8-bd5a-062910497129_1627x958.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:857,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:126239,&quot;alt&quot;:&quot;Screenshot showing Remix compiler configuration&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Screenshot showing Remix compiler configuration" title="Screenshot showing Remix compiler configuration" srcset="https://substackcdn.com/image/fetch/$s_!AsYB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F665e1856-4a64-47a8-bd5a-062910497129_1627x958.png 424w, https://substackcdn.com/image/fetch/$s_!AsYB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F665e1856-4a64-47a8-bd5a-062910497129_1627x958.png 848w, https://substackcdn.com/image/fetch/$s_!AsYB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F665e1856-4a64-47a8-bd5a-062910497129_1627x958.png 1272w, https://substackcdn.com/image/fetch/$s_!AsYB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F665e1856-4a64-47a8-bd5a-062910497129_1627x958.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Remix compiler configuration showing optimization parameter.</figcaption></figure></div><p>This parameter is a number from 0 to 4294967295. I suspect each number produces a slightly different bytecode.</p><p>I didn&#8217;t know what optimization parameter had been used. I didn&#8217;t want to compile the code and execute SQL queries against the blockchain 4294967296 times. After trying to guess common values few times, I gave up. <strong>There has to be another way.</strong></p><h2>Function signatures</h2><p>I dug into Ethereum dataset. One of the columns in SQL schema got my attention: <code>function_sighashes</code>.</p><p>After some research, I found that, in order for the smart contract&#8217;s functions to be called by users or other smart contracts, there needs to be some kind of mapping between the function name and an address in bytecode where the function logic resides.</p><p>But what if someone likes to use <code>veryLongFunctionNames</code>? Does it mean the name of the function has to be embedded in smart contract bytecode, increasing blockchain size and eating precious gas?</p><p>This may be one of the reasons Ethereum uses the concept called <em>function signature</em>. The function signature is created by hashing the prototype string and discarding anything after the first 4 bytes. The hash algorithm used is Keccak256 which you may know from <a href="https://en.wikipedia.org/wiki/SHA-3">SHA-3</a>. However SHA-3 uses a version with slightly different parameters, therefore the output is different.</p><blockquote><p>For example, to get function signature for a function <code>myFunction</code> which receives 1 argument of type <code>uint256</code>:</p><ol><li><p>Prepare function prototype, let&#8217;s say <code>myFunction(uint256)</code>.</p></li><li><p>Find an online Keccak256 generator (for example <a href="https://hashtools.org/keccak_256.html">this one</a>) and paste the function prototype there.</p></li><li><p>You will get <code>50628c969c386d878aac8a993492e42110c19ba346d377fec055d2d56124b695</code>.</p></li><li><p>Remove anything after the first 4 bytes and add <code>0x</code> prefix to make it clear we are dealing with a hexadecimal number.</p></li><li><p>The result is <code>0x50628c96</code>.</p></li></ol></blockquote><p>Those four bytes along with the mapping method will show you where the function resides in a compiled contract (it is a simplification to make you grasp the general idea, check limitations below).</p><h2>Back to BigQuery</h2><p>I&#8217;ve calculated function signatures for every function of John&#8217;s smart contract. Now I was armed with the information needed to find the address of this contract:</p><pre><code>SELECT address
FROM
  bigquery-public-data.crypto_ethereum.contracts
WHERE
  '<strong>0xf68deb93</strong>' IN UNNEST(function_sighashes)
AND
  block_timestamp &gt; <strong>{month before post publication date}</strong>
LIMIT 10</code></pre><blockquote><p>This simplified example contains only one function signature (<code>0xf68deb93</code>). To find John&#8217;s contract I had to add more of them to the <code>WHERE</code> condition.</p></blockquote><p>Yay! The query gave exactly one result. <strong>Is it the contract address I was looking for?</strong></p><h2>Verification</h2><p>I used <a href="https://etherscan.io/">Etherscan</a> to get more information about this address. Etherscan confirmed this is a contract address and allowed me to decompile it using a build-in online tool. The resulting code looked similar to the original code published by John. <strong>I found it!</strong></p><h2>Limitations</h2><p>Function signatures are extracted from contract bytecode using heuristics. In case the contract&#8217;s bytecode doesn&#8217;t follow conventions, it may be hard or even impossible to obtain function signatures. Therefore some function signatures may not be available in the BigQuery dataset.</p><blockquote><p>For more details, check out <a href="https://cloud.google.com/blog/products/data-analytics/ethereum-bigquery-how-we-built-dataset">how the Ethereum dataset was built</a> and <a href="https://ethereum.stackexchange.com/a/60062">how those heuristics work</a>.</p></blockquote><p>This is how I understand why some function signatures are not available in the dataset. If you have a more accurate explanation, please share it below.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.pawelpokrywka.com/p/how-to-deanonymize-smart-contract-author/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.pawelpokrywka.com/p/how-to-deanonymize-smart-contract-author/comments"><span>Leave a comment</span></a></p><h2>Extracting information</h2><p>Let&#8217;s see what information I can get knowing the contract address.</p><p>The most important data is the Ethereum account address which interacted with the contract. I was able to found it easily in the list of the contract&#8217;s transactions on Etherscan. There was only one, therefore I could safely assume it was the address of John.</p><p>The rest is simple: when you have someone&#8217;s address you can get his entire transactions history and balance. <strong>It&#8217;s like a bank statement, but public.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pLEU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1639a295-3b02-4ab0-a8dd-77869848d878_2408x1904.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pLEU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1639a295-3b02-4ab0-a8dd-77869848d878_2408x1904.png 424w, https://substackcdn.com/image/fetch/$s_!pLEU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1639a295-3b02-4ab0-a8dd-77869848d878_2408x1904.png 848w, https://substackcdn.com/image/fetch/$s_!pLEU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1639a295-3b02-4ab0-a8dd-77869848d878_2408x1904.png 1272w, https://substackcdn.com/image/fetch/$s_!pLEU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1639a295-3b02-4ab0-a8dd-77869848d878_2408x1904.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pLEU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1639a295-3b02-4ab0-a8dd-77869848d878_2408x1904.png" width="1456" height="1151" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/1639a295-3b02-4ab0-a8dd-77869848d878_2408x1904.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1151,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:605660,&quot;alt&quot;:&quot;Screenshot of Etherscan website showing details of Ethereum address&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Screenshot of Etherscan website showing details of Ethereum address" title="Screenshot of Etherscan website showing details of Ethereum address" srcset="https://substackcdn.com/image/fetch/$s_!pLEU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1639a295-3b02-4ab0-a8dd-77869848d878_2408x1904.png 424w, https://substackcdn.com/image/fetch/$s_!pLEU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1639a295-3b02-4ab0-a8dd-77869848d878_2408x1904.png 848w, https://substackcdn.com/image/fetch/$s_!pLEU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1639a295-3b02-4ab0-a8dd-77869848d878_2408x1904.png 1272w, https://substackcdn.com/image/fetch/$s_!pLEU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1639a295-3b02-4ab0-a8dd-77869848d878_2408x1904.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Etherscan showing details of Ethereum address. This particular one belongs to Vitalik Butterin who <a href="https://twitter.com/VitalikButerin/status/1050126908589887488">made it publicly available</a>.</figcaption></figure></div><p>Now I could contact John and tell him the exact amount of Ether he holds. His reaction was worth the time I&#8217;ve put into this task :)</p><blockquote><p>If you like this story then I can send you my future articles right after publication. This is a privacy-oriented blog - there will be <strong>no spam</strong> and you can <strong>unsubscribe anytime</strong>.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.pawelpokrywka.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.pawelpokrywka.com/subscribe?"><span>Subscribe now</span></a></p></blockquote><h2>How to avoid being doxxed on Ethereum?</h2><p>Ethereum transactions are pseudonymous, which means the user performing them is private as long as his address (pseudonym) can&#8217;t be linked to his real identity. John runs a blog, therefore his identity is public. Smart contract source code is also public and linked to the blog. <strong>Therefore anyone who is able to perform the steps I described above, could deanonymize him.</strong></p><p>If you want to deploy a contract which source code is public and associated with you, here are some ideas to make connecting your real identity with your main Ethereum address harder:</p><ul><li><p><strong>obfuscate source code before deployment</strong> (<a href="https://github.com/xf97/BiAn">example obfuscator</a>) - this makes finding the smart contract more difficult,</p></li><li><p><strong>separate contract deployment from contract usage</strong>: deploy contract from address specially generated for this purpose and don&#8217;t use it for anything else - others could see who created the contract, but won&#8217;t be able to easily connect this information with your transactions (which in most cases reveal your financial situation), especially if you follow next advice,</p></li><li><p>if the contract is meant to be used by other people - don&#8217;t be first to use it, wait for others to transact - <strong>hide in a crowd</strong>; break up a transaction into many smaller ones and execute them at irregular intervals from many different, unrelated accounts, preferable with different transaction history; this method is similar to techniques employed by anonymity mixers such as <a href="https://tornado.cash/">Tornado.cash</a>,</p></li><li><p><strong>make sure all addresses you use (for deployment and transactions) are anonymously funded and not linked to your main account.</strong></p><blockquote><p>I plan to write dedicated article about maintaining anonymity on Ethereum blockchain. I will link it here. Subscribe to get it right after publication.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.pawelpokrywka.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.pawelpokrywka.com/subscribe?"><span>Subscribe now</span></a></p></blockquote></li></ul><h2>Final word</h2><p><strong>Thank you</strong> for reading this little deanonymization story, <strong>I hope you enjoyed it :)</strong></p><p>In case you would like to add something, have a question, or found an error, please comment down below.</p><p>Privacy is important. If you think this article will be useful to others, please spread the word.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.pawelpokrywka.com/p/how-to-deanonymize-smart-contract-author?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.pawelpokrywka.com/p/how-to-deanonymize-smart-contract-author?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p>]]></content:encoded></item><item><title><![CDATA[Freeconet: intercepting VoIP calls]]></title><description><![CDATA[Translated by AI to English, originally published on 11 January 2011 in Polish.]]></description><link>https://www.pawelpokrywka.com/p/freeconet-intercepting-voip-calls</link><guid isPermaLink="false">https://www.pawelpokrywka.com/p/freeconet-intercepting-voip-calls</guid><dc:creator><![CDATA[Paweł Pokrywka]]></dc:creator><pubDate>Tue, 11 Jan 2011 11:00:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rjrC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f422f3c-b8eb-47ea-a7b5-04a000ddf5a7_2041x1134.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Translated by AI to English, originally published on 11 January 2011 in Polish.</em></p><h2><strong>2011-01-18 update</strong></h2><p>I received information that the vulnerability had already been known earlier, in July 2008. The issue was discovered by J&#243;zef and described in <a href="https://www.freeconet.pl/forum/viewtopic.php?t=2888">this forum thread</a>.</p><h2><strong>2011-01-12 update</strong></h2><p>On January 12, 2011, Freeconet's management issued an official statement regarding the vulnerability described in this article.</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Freeconet statement</div><div class="file-embed-details-h2">64.3KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.pawelpokrywka.com/api/v1/file/22da4a2a-4f5e-46c1-860c-9e4378c84065.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.pawelpokrywka.com/api/v1/file/22da4a2a-4f5e-46c1-860c-9e4378c84065.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p>The platform owners reacted immediately&#8212;on the day the article was published, the &#8220;Add external operator&#8221; feature was disabled.</p><h2><strong>Introduction</strong></h2><p><a href="https://www.freeconet.pl">Freeconet</a> is a VoIP platform that offers a range of internet telephony services to its users.<br>At the end of September 2010, I discovered a vulnerability that allows an attacker to intercept calls from Freeconet users to numbers chosen by the attacker.<br>The attacker has full control over the calls: they can terminate, record, join, and manipulate them in any way.<br>To demonstrate some of the possible attacks, I created the <a href="https://github.com/pepawel/voiprox">VOIPROX</a> tool (see below).</p><p>Immediately after discovering the vulnerability, I passed detailed information to the platform&#8217;s owner.<br>Unfortunately, despite assurances from Freeconet, the vulnerability was not removed.<br>That&#8217;s why I&#8217;ve decided to publish full details about the issue.<br>I believe in the magic of Full Disclosure&#8212;the vulnerability will be eliminated, and Freeconet users will soon be safe.</p><p>However, after the fix, the platform&#8217;s owner should be urged to investigate whether such abuse has already occurred.<br>If so, the affected individuals&#8212;as well as law enforcement agencies, if necessary&#8212;should be notified.<br>To ensure the credibility of such an investigation, it should be conducted by an external, trusted body, e.g., the <a href="https://www.uke.gov.pl">Urz&#261;d Komunikacji Elektronicznej</a>.</p><p>This matter is also important to me personally, as I use this otherwise innovative and probably the most technologically advanced VoIP platform in Poland.</p><h2><strong>The vulnerability</strong></h2><p>The platform allows you to assign additional phone numbers to a VoIP account&#8212;numbers from external, non-Freeconet operators.<br>The idea is to increase user convenience while reducing call costs.</p><p>Let&#8217;s assume users A and B are registered on Freeconet.<br>User A also has a number from a traditional operator and can associate it with their account.<br>If user B dials that number, the platform sets up an internal network connection, so the call is free.<br>If the number wasn&#8217;t registered, the platform would use traditional telephony, which would result in charges for user B.</p><p>Note: It&#8217;s user A&#8217;s VoIP terminal that rings, not the phone connected to the traditional landline.<br>This issue is typically solved by using a hybrid gateway or a VoIP phone that can handle both IP and traditional line connections.<br>That way, a single device handles both types of calls.</p><p>The external operator definition feature is available in the Freeconet control panel under Configuration &#187; Operators &#187; External.<br>Clicking &#8220;Add external operator&#8221; opens a form where the number and area code are entered in separate fields.<br>Clicking &#8220;Add&#8221; links the number to the account&#8212;provided the number format is correct and it&#8217;s not already linked to another account.</p><p>There might be other validation checks, but it&#8217;s clear a crucial one is missing: verifying the user&#8217;s right to the entered number.<br>An attacker can enter any number&#8212;not owned by them.<br>From then on, <strong>all calls to that number</strong> are no longer routed to the actual owner&#8212;they go directly to the attacker!</p><h2><strong>Scope of the threat</strong></h2><p>Freeconet has between <a href="http://www.freeconet.pl/img/stuff/napisali_o_nas/artykul_263_top_produkt_pomorza.pdf">several thousand</a> and <a href="https://biznesmax.pl/swiat-telekomunikacji-wyroznil-call-ex/">several hundred thousand subscribers</a>, depending on the source.</p><p>I believe the vulnerability has existed since Freeconet launched in <a href="http://www.freeconet.pl/pl/o-firmie">September 2006</a>.<br>So, for over four years, users have been vulnerable to attacks like those described below.</p><h2><strong>Attack scenarios</strong></h2><h4><strong>Denial of Service (DoS)</strong></h4><p>The simplest attack type.<br>The attacker doesn&#8217;t answer calls, hangs up, or simulates a busy line.<br>This effectively blocks access to the targeted number.</p><h4><strong>Eavesdropping</strong></h4><p>As a call is initiated, the attacker starts a parallel call to the same number using traditional telephony (via or outside of Freeconet).<br>Once the recipient answers, the attacker connects the audio streams of both calls and records them.</p><p>The attack is harder to detect if the attacker hides their number or (more difficultly) spoofs the caller&#8217;s number.<br>This way, the callee won&#8217;t notice that the call came from a different number.</p><p>The attacker can then use fragments of the recorded call to construct misleading or self-serving statements&#8212;for example, to carry out the next attack.</p><h4><strong>Call modification</strong></h4><p>This builds upon the eavesdropping attack.<br>The attacker can manipulate the call in real-time&#8212;altering pitch, adding echo, or even injecting their own speech.<br>More advanced versions may target interactive phone systems (IVRs), such as banking lines.</p><p>For example, after the victim passes authentication via phone, the attacker disconnects them and continues the call impersonating the user.</p><h2><strong>How to protect yourself?</strong></h2><p>Until the vulnerability is fixed, users can protect themselves by changing call routing rules to <strong>avoid internal Freeconet calls</strong>.<br>This will increase call costs for calls to other Freeconet users but ensures your calls aren't intercepted.</p><p>To do this, go to Configuration &#187; Calling &#187; Routing and set external routing rules for all calls.</p><h2><strong>VOIPROX tool</strong></h2><p>To demonstrate the vulnerability, I created a tool called VOIPROX (from VoIP proxy&#8212;or, for fun, VoIP rocks!).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rjrC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f422f3c-b8eb-47ea-a7b5-04a000ddf5a7_2041x1134.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rjrC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f422f3c-b8eb-47ea-a7b5-04a000ddf5a7_2041x1134.png 424w, https://substackcdn.com/image/fetch/$s_!rjrC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f422f3c-b8eb-47ea-a7b5-04a000ddf5a7_2041x1134.png 848w, https://substackcdn.com/image/fetch/$s_!rjrC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f422f3c-b8eb-47ea-a7b5-04a000ddf5a7_2041x1134.png 1272w, https://substackcdn.com/image/fetch/$s_!rjrC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f422f3c-b8eb-47ea-a7b5-04a000ddf5a7_2041x1134.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rjrC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f422f3c-b8eb-47ea-a7b5-04a000ddf5a7_2041x1134.png" width="1456" height="809" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4f422f3c-b8eb-47ea-a7b5-04a000ddf5a7_2041x1134.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:809,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:93830,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.pawelpokrywka.com/i/160436037?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f422f3c-b8eb-47ea-a7b5-04a000ddf5a7_2041x1134.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rjrC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f422f3c-b8eb-47ea-a7b5-04a000ddf5a7_2041x1134.png 424w, https://substackcdn.com/image/fetch/$s_!rjrC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f422f3c-b8eb-47ea-a7b5-04a000ddf5a7_2041x1134.png 848w, https://substackcdn.com/image/fetch/$s_!rjrC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f422f3c-b8eb-47ea-a7b5-04a000ddf5a7_2041x1134.png 1272w, https://substackcdn.com/image/fetch/$s_!rjrC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f422f3c-b8eb-47ea-a7b5-04a000ddf5a7_2041x1134.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The tool logs into two SIP accounts&#8212;an input and an output one. It works similarly to a proxy. Incoming calls to the number(s) assigned to the input account (hereafter referred to as intercepted numbers) are received and forwarded to the real recipient via the output account. The incoming call is only answered once the person being called picks up. This prevents a suspicious pause that could alert the caller.</p><p>Each intercepted call is automatically saved to a separate WAV file. While the call is ongoing, the user can interact with it in real time via a simple console.</p><p>VOIPROX was written in Python. I chose this language because the VoIP library I selected is only available for C and Python.</p><p>VOIPROX was written and tested on Linux. However, I see no reason it wouldn't work on other operating systems supported by Python and PJSIP.</p><p>To test the tool conveniently, you'll need a separate VoIP terminal, gateway, or softphone (e.g., the web softphone provided by Freeconet). Note: the softphone must run on a different machine than VOIPROX. VOIPROX requires access to a sound card (even if it doesn&#8217;t use it) and cannot share it with other software.</p><h4><strong>Dependencies</strong></h4><p>Install all dependencies needed to compile PJSIP. You can find detailed instructions <a href="http://trac.pjsip.org/repos/wiki/Getting-Started/Autoconf#Requirements">here</a>. Pay special attention to the ALSA libraries. If they are not detected, VOIPROX will not support local audio.</p><p>Download the PJSIP library (I tested version 1.8.10):</p><pre><code><code>$ wget http://www.pjsip.org/release/1.8.10/pjproject-1.8.10.tar.bz2</code></code></pre><p>Unpack the archive and compile the library without installing it:</p><pre><code><code>$ tar jxf pjproject-1.8.10.tar.bz2
$ cd pjproject-1.8.10
$ ./configure
$ make dep
$ make</code></code></pre><p>Install Python and the necessary packages to compile extensions. You can find all the required information <a href="http://trac.pjsip.org/repos/wiki/Python_SIP/Build_Install#Requirements">here</a>.</p><p>Compile and install the PJSIP extension for Python:</p><pre><code><code>$ cd pjsip-apps/src/python
$ sudo make</code></code></pre><p>Check installation:</p><pre><code><code>$ python -c 'import pjsua' &amp;&amp; echo 'OK'</code></code></pre><h4>VoIP accounts</h4><p>You will need three SIP accounts:</p><ul><li><p><strong>Input account:</strong> Receives calls to one or more intercepted numbers.</p></li><li><p><strong>Output account:</strong> Used by VOIPROX to make calls to actual recipients.</p></li><li><p><strong>Test account:</strong> Used for testing. If you already have a Freeconet account, you can skip creating this one.</p></li></ul><p>Although in theory, the output account can be registered with any VoIP provider, VOIPROX currently supports only Freeconet accounts. You can create all accounts using the Freeconet <a href="https://wizard.freeconet.pl/">registration form</a>.</p><p>Assign a phone number, provide your details, email, and login for each account. You can use the same email for all. To distinguish accounts, include the type in the login (e.g., -in, -out, -test).</p><h4>Account configuration</h4><p>Log in using the credentials sent to your email and configure:</p><ul><li><p><strong>Output account:</strong></p><ul><li><p>Top up your balance: Payments &#187; Top Up.</p></li><li><p>Deactivate Freeconet internal calls (see "How to Protect Yourself").</p></li><li><p>Optionally, hide caller ID: Configuration &#187; Users &#187; Your user &#187; Presentation &#187; Hide.</p></li></ul></li><li><p><strong>Input account:</strong></p><ul><li><p>Configuration &#187; Operators &#187; External &#187; Add external operator.</p></li><li><p>Enter the number to intercept and click Add. For mobile numbers, provide the first three digits (area code) without the leading zero in the first field and the rest in the second.</p></li><li><p>Note: The number must not be from Freeconet.</p></li><li><p><strong>Do not use popular numbers (e.g., company hotlines), as intercepting random calls can have legal consequences. Use your own landline or mobile number.</strong></p></li></ul></li><li><p><strong>Test account:</strong></p><ul><li><p>If you already have a Freeconet VoIP phone, use it for testing and skip ahead.</p></li><li><p>Otherwise, after logging in, use the web client under "Call from Website". Try dialing 901 (for free account status info) or Freeconet&#8217;s support at 801 009 500.</p></li><li><p>If calls don&#8217;t work, try another SIP client. Configuration info is in the email from Freeconet.</p></li><li><p>Do not make test calls from the same machine running VOIPROX. Use a separate VoIP device or run a softphone on another computer.</p></li></ul></li></ul><h4>Launching the program</h4><p>Download VOIPROX:</p><pre><code><code>$ git clone https://github.com/pepawel/voiprox.git
$ cd voiprox</code></code></pre><p>Start VOIPROX with SIP credentials:</p><pre><code><code>$ ./voiprox input_login:password1 output_login:password2</code></code></pre><p>A short sound confirms correct sound card communication.</p><p>If issues occur, run with <strong>-v</strong> for verbose mode.</p><h4>First test</h4><p>Make a call from the test account (on a different device) to the intercepted number set in the input account. The test call is free for the test account but will charge the output account.</p><p>After the call, a <strong>.wav</strong> file will appear in the VOIPROX directory. Congrats&#8212;you&#8217;ve just intercepted your first phone call. ;-)</p><h4>Further capabilities</h4><p>VOIPROX has an interactive console. Type <strong>help</strong> for commands:</p><pre><code><code>&gt;&gt; help
Possible commands:
  list, show       - show all active connections
  disconnect [[caller|callee] [from]] connection
    - disconnect caller or calee from connection given by
      connection id; if caller/callee not given entire
      connection is terminated
  attach [mic|speaker] [to] connection
    - attach local microphone or speaker to given connection;
      if mic/speaker keyword not given both will be attached
  detach [mic|speaker] [from] connection - analogical to attach
  play file.wav [to] connection
                   - play wav file (no spaces allowed in file name)
  help             - show this help
  quit, exit or ^D - terminate all active connections and quit</code></code></pre><p>Call and don&#8217;t hang up. Use the <strong>list</strong> command to see active calls:</p><pre><code><code>&gt;&gt; list
1: 123456789 &gt; 0987654321</code></code></pre><p>Attach mic/speaker:</p><pre><code><code>&gt;&gt; attach to 1</code></code></pre><p>Detach mic to listen only:</p><pre><code><code>&gt;&gt; detach mic from 1</code></code></pre><p>Disconnect the caller to impersonate:</p><pre><code><code>&gt;&gt; attach mic to 1
&gt;&gt; disconnect caller from 1</code></code></pre><p>Play a WAV file:</p><pre><code><code>&gt;&gt; play test.wav to 1</code></code></pre><p>Enjoy&#8212;and play nice!</p><h4>Disclaimer</h4><p>VOIPROX is a proof-of-concept tool. It may contain bugs. I&#8217;ve tested intercepting two calls simultaneously, but not more. Tested on Ubuntu 9.10.</p><p>All calls during development were initiated by me and used only for testing.</p><p>Use VOIPROX at your own risk. Do not break the law. Freeconet logs all connections&#8212;logs may be used as evidence in court.</p><p>I hope bad actors won&#8217;t use this tool. Public release should pressure Freeconet to patch the flaw quickly, denying criminals time to abuse it. Anyone already secretly exploiting it will lose that opportunity.</p>]]></content:encoded></item><item><title><![CDATA[A security flaw in the modem provisioning system of Telekomunikacja Polska]]></title><description><![CDATA[Sent confidentially to Telekomunikacja Polska in October 2004.]]></description><link>https://www.pawelpokrywka.com/p/security-flaw-in-the-modem-provisioning-of-telekomunikacja-polska</link><guid isPermaLink="false">https://www.pawelpokrywka.com/p/security-flaw-in-the-modem-provisioning-of-telekomunikacja-polska</guid><dc:creator><![CDATA[Paweł Pokrywka]]></dc:creator><pubDate>Sun, 23 Apr 2006 10:00:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Va83!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc23ce18-3511-4f55-a5ec-7468c9eefaf7_1369x778.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Sent confidentially to Telekomunikacja Polska in October 2004. Disclosed to the public at the <a href="https://confidence-conference.org/">CONFidence</a> 2006 conference in slide form. Translated from Polish using AI.</em></p><h2>Summary</h2><p>TP Internet DSL, based on ADSL technology, is a service from Telekomunikacja Polska (TP) mainly targeted at businesses. The DSL modem management system contains a serious security flaw. In this post, I will explain how I discovered the flaw, what risks it involves, and propose countermeasures.</p><h2>Background</h2><p>It all started when my DSL modem broke. I had been using TP&#8217;s DSL Internet Access service for a while and was mostly satisfied. The connection was provided by a Siemens Speedstream 5660 ADSL modem. The modem worked well, though it occasionally suffered from stability issues<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. However, one thing always annoyed me: TP didn&#8217;t allow users to configure the modem themselves&#8212;it was password-protected, and neither the customer nor even the technician knew the password.</p><p>TP claimed this restriction was for security reasons<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>. Ironically, it actually compromised security.</p><p>Since the modem broke on a weekend, I knew I&#8217;d be waiting a while for a replacement. A friend lent me a Planet ADSL modem, and I tried configuring it manually. The DSL link connected fine, but I couldn&#8217;t get past the PPP login&#8212;I didn&#8217;t have the username or password, and TP didn&#8217;t provide this information to customers. After some persistence, a helpful technician gave me the PPP credentials, which I greatly appreciated.</p><p>During that call, I learned something interesting: by entering a special service login and password, a script would automatically configure the modem. Unfortunately, this only worked with Speedstream modems, so I had to configure everything manually.</p><h2>How it works</h2><p>The service login and password are a clever trick for installers. The installer resets the modem to factory settings, connects it to the DSL line, and enters the login <em>konfiguracja@konfiguracja</em> with the password <em>konfiguracja</em>. A script then completes the configuration remotely.</p><p>This setup prevents rogue installers from keeping access to modems or sharing it with customers. TP controls a centralized database of logins and passwords, allowing them to enforce strong password policies.</p><p>But as I realized, this special pair of login and password shouldn't be public&#8212;because it can be exploited. And anyone can learn them&#8212;all it takes is carefully watching the technician&#8217;s hands during modem configuration.</p><h2>The experiment begins</h2><p>I began to wonder whether this automation could be used to gain access to the modem.</p><p>I downloaded the <a href="https://www.manualslib.com/manual/846990/Efficient-Networks-Speedstream-5600-Series.html">modem manual</a> from the manufacturer&#8217;s website. After studying it, I concluded that the modem is most likely configured remotely via Telnet, since it has a built-in Telnet server. If I could intercept the Telnet session, I might be able to extract some interesting information. But how? The transmission takes place over the DSL line. A DSL sniffer? It was beyond my reach.</p><p>Eventually, I came up with an idea. An attacker equipped with two DSL modems and some additional hardware can build a network like the one shown below:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Va83!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc23ce18-3511-4f55-a5ec-7468c9eefaf7_1369x778.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Va83!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc23ce18-3511-4f55-a5ec-7468c9eefaf7_1369x778.png 424w, https://substackcdn.com/image/fetch/$s_!Va83!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc23ce18-3511-4f55-a5ec-7468c9eefaf7_1369x778.png 848w, https://substackcdn.com/image/fetch/$s_!Va83!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc23ce18-3511-4f55-a5ec-7468c9eefaf7_1369x778.png 1272w, https://substackcdn.com/image/fetch/$s_!Va83!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc23ce18-3511-4f55-a5ec-7468c9eefaf7_1369x778.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Va83!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc23ce18-3511-4f55-a5ec-7468c9eefaf7_1369x778.png" width="1369" height="778" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc23ce18-3511-4f55-a5ec-7468c9eefaf7_1369x778.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:778,&quot;width&quot;:1369,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79642,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.pawelpokrywka.com/i/160447249?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc23ce18-3511-4f55-a5ec-7468c9eefaf7_1369x778.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Va83!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc23ce18-3511-4f55-a5ec-7468c9eefaf7_1369x778.png 424w, https://substackcdn.com/image/fetch/$s_!Va83!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc23ce18-3511-4f55-a5ec-7468c9eefaf7_1369x778.png 848w, https://substackcdn.com/image/fetch/$s_!Va83!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc23ce18-3511-4f55-a5ec-7468c9eefaf7_1369x778.png 1272w, https://substackcdn.com/image/fetch/$s_!Va83!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc23ce18-3511-4f55-a5ec-7468c9eefaf7_1369x778.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The attacker configures the Planet modem to forward (NAPT) traffic coming from the Internet on administrative ports (Telnet, WWW, SNMP, FTP) to an internal host&#8212;the Speedstream modem. The Speedstream is reset to factory settings&#8212;this enables Telnet access to its configuration. The last step is to set the default route on the Speedstream so that it goes through the Planet modem.</p><p>I entered the service login and password into the Planet modem's PPP configuration, then started a sniffer on my PC...</p><h2>First success</h2><p>After a moment, the Planet modem establishes a connection. It receives an address from the pool of service addresses. After a short while, the attacker notices activity on the Ethernet network. The traffic comes from a provisioning server that initiates a Telnet connection to the Planet modem, which forwards it to the Speedstream modem, allowing interception of the session. After recording and analyzing the transmission, I learned, among other things, confidential information about the modem!</p><pre><code>Type "?" at the command prompt for a list of commands.
Type "help" at the command prompt for general help.
For detailed help on a specific command, type command name
followed by a "?",  for instance, "show ?".

Command-&gt; show

--- General Router Information
 System Mode          - Router
 System Type          - SpeedStream 5660-R:ENI
 System HW Version    - 0
 System Up Time       - 0 Days 0 Hours 22 Minutes 36 Seconds
 Software Version     - 2.3.0(8) Jan 13 2003 09:29:38
 Factory MAC Address  - 00:11:22:33:44:55
 DSL Phy Description  - Motorola 850 SAR Alcatel/RT Adapter
 DSL Phy Version      - 
 DSL Interface State  - Down
 Host Name            - SpeedStream
 Domain Name          - domain.invalid
 IP Gateway           - 10.0.0.2
 Ethernet Interface   - 10.0.0.1/255.0.0.0
 DSL Interface        - /
 RIP Mode             - Disabled
 DNS Server           - Enabled
 DHCP Server          - Enabled
 NAPT Mode            - Enabled
 IP Filter Mode       - Disabled

Command-&gt; set pppauth xxxxxxxx@internetdsl xxxxxxxx
Command-&gt; set napt disable
Command-&gt; set ethip x.x.x.x x.x.x.x

Implement IP changes now? default: n [y,n] n

Changes will not take effect until modem is rebooted!

Command-&gt; set snmpcfg xxxxxxxx a a a 10.10.10.10 10.10.10.10
Command-&gt; set password
Setting user password:

New password : ********
New password : ********

Password updated
Command-&gt; reboot

Are you sure? default: n [y,n] y

System rebooting as requested!!!!</code></pre><p>The provisioning script connects, displays the modem&#8217;s data (using the <strong>show</strong> command), and sets configuration parameters, passwords, and the IP address. Finally, it reboots the modem so the new configuration can be loaded. As a side effect of the reboot, even if the attacker had initiated an administrative session (via Telnet or serial console using the factory password) before the script started configuring the modem, that session would be terminated by the reboot. If the reboot didn&#8217;t occur, the attacker would remain connected and could retrieve the newly set passwords.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a></p><p>For a moment, I wondered why the script ran the <strong>show</strong> command, but the answer quickly became clear: this is how the script identifies the modem to assign it the correct configuration. The only piece of data likely to differ between modems is the MAC address&#8230;</p><h2>The masquerade</h2><p>I wrote and ran a simple Perl script. The script, when hooked up to <strong>inetd</strong> on port 23, emulates the behavior of the modem&#8217;s Telnet server after a factory reset. I set up a network similar to the previous one, but without the Speedstream modem, since it&#8217;s no longer needed.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2CHT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c76f03-dc15-4c60-94f9-af3adbb7a1fd_1210x691.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2CHT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c76f03-dc15-4c60-94f9-af3adbb7a1fd_1210x691.png 424w, https://substackcdn.com/image/fetch/$s_!2CHT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c76f03-dc15-4c60-94f9-af3adbb7a1fd_1210x691.png 848w, https://substackcdn.com/image/fetch/$s_!2CHT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c76f03-dc15-4c60-94f9-af3adbb7a1fd_1210x691.png 1272w, https://substackcdn.com/image/fetch/$s_!2CHT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c76f03-dc15-4c60-94f9-af3adbb7a1fd_1210x691.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2CHT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c76f03-dc15-4c60-94f9-af3adbb7a1fd_1210x691.png" width="1210" height="691" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d5c76f03-dc15-4c60-94f9-af3adbb7a1fd_1210x691.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:691,&quot;width&quot;:1210,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52299,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.pawelpokrywka.com/i/160447249?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c76f03-dc15-4c60-94f9-af3adbb7a1fd_1210x691.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2CHT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c76f03-dc15-4c60-94f9-af3adbb7a1fd_1210x691.png 424w, https://substackcdn.com/image/fetch/$s_!2CHT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c76f03-dc15-4c60-94f9-af3adbb7a1fd_1210x691.png 848w, https://substackcdn.com/image/fetch/$s_!2CHT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c76f03-dc15-4c60-94f9-af3adbb7a1fd_1210x691.png 1272w, https://substackcdn.com/image/fetch/$s_!2CHT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c76f03-dc15-4c60-94f9-af3adbb7a1fd_1210x691.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">A PC configured to impersonate a modem.</figcaption></figure></div><p>To check whether it&#8217;s possible to obtain passwords for any modem, I configured the script to display the MAC address of another existing device.</p><p>Indeed, the provisioning script connected to my script and handed over the configuration data of a different modem!</p><p>I could repeat this experiment successfully using the MAC address of a modem from another city. To obtain confidential configuration data for any modem in Poland, all you need is its MAC address!</p><h2>Packet filter</h2><p>I gained Telnet access to modems to which I had physical access. However, an attempt to log in to a modem in another city failed. Connections to the Telnet port were <em>hanging</em>&#8212;there was no response from the remote modem. Meanwhile, TCP connections to other ports were actively rejected (the modem sent a TCP packet with the RST flag set). This was a clear sign of packet filtering.</p><p>Using the <a href="https://linux.die.net/man/1/tcptraceroute">tcptraceroute</a> tool, I determined where the packets were being filtered. It turned out the filtering was done by the DSLAM located just before the remote modem. A DSLAM (DSL Access Multiplexer) is a <em>central hub</em> to which many DSL modems are connected. It provides connectivity between the modems and the external network. In the case of TP, these are <a href="https://web.archive.org/web/20050208192027/http://www.lucent.com/press/0503/030527.nsa.html">most likely</a> Lucent&#8217;s Stinger devices.</p><p>The packet filters and &#8220;firewalls&#8221; in the operating systems of such devices usually have little in common with professional solutions (like Cisco PIX, GNU/Linux, or *BSD systems). Instead, they function more like add-ons that &#8220;sort of work.&#8221;</p><p>Based on this assumption, one can try to bypass the DSLAM&#8217;s blocking rules. Simple packet filters may, by default, allow all fragmented packets through. I needed to structure the connection attempt to the modem so that at least the initial connection packet is fragmented. For this, I used the <a href="https://www.monkey.org/~dugsong/fragroute/">fragroute</a> tool. It turns out a small patch was necessary because the program doesn&#8217;t fragment packets with the SYN flag set, which are precisely the packets that need to be fragmented.</p><h2>Filter bypassed!</h2><p>The filter allowed the fragmented packets through, and the attacker gained remote access to the modem.</p><p>Another method of bypassing the filter is IP spoofing. For the attack to succeed, one would need to find an inactive IP address that&#8217;s on the DSLAM&#8217;s list of &#8220;trusted&#8221; addresses. These IPs should be searched for &#8220;near&#8221; the IP address of the server running the modem configuration script.</p><p>If such a trusted, inactive IP were found, the attack&#8212;despite the obvious challenge of performing it without feedback&#8212;would be relatively simple because, according to <a href="https://nmap.org/">Nmap</a>, the modem&#8217;s ISN (Initial Sequence Number) generator is predictable:</p><pre><code>Starting nmap x ( http://www.insecure.org/nmap/ ) at xxxx-xx-xx xx:xx CEST
Host x (x.x.x.x) appears to be up ... good.
Initiating SYN Stealth Scan against x (x.x.x.x) at xx:xx
Adding open port 1723/tcp
Adding open port 21/tcp
Adding open port 80/tcp
Adding open port 23/tcp
The SYN Stealth Scan took 6 seconds to scan 1659 ports.
For OSScan assuming that port 21 is open and port 1 is closed and neither are firewalled
Interesting ports on x (x.x.x.x):
(The 1655 ports scanned but not shown below are in state: closed)
PORT     STATE SERVICE
21/tcp   open  ftp
23/tcp   open  telnet
80/tcp   open  http
1723/tcp open  pptp
Device type: firewall|switch|WAP
Running: SonicWall embedded, Enterasys embedded, Cisco embedded
OS details: SonicWall SOHO firewall, Enterasys Matrix E1, or Accelerated Networks VoDSL, or Cisco 360 Access Point
<strong>TCP Sequence Prediction: Class=64K rule
                         Difficulty=1 (Trivial joke)</strong>
IPID Sequence Generation: Incremental

Nmap run completed -- 1 IP address (1 host up) scanned in 12.380 seconds</code></pre><h2>What&#8217;s next?</h2><p>Full access to the modem gives a malicious actor significant capabilities.</p><p>In the simplest case, the attacker could disconnect the subscriber from the Internet by disabling the LAN interface; they could change the modem&#8217;s access password, preventing TP technicians from reaching the device; or they could attempt to break into the subscriber&#8217;s internal network, which until now was protected by the modem&#8217;s NAT.</p><p>There is an officially <a href="http://www.quiezent.com/efficient_ 5660.html">undocumented</a> <strong>SET PRIV</strong> command that provides full access to the operating system (VxWorks). Full system access gives the attacker virtually unlimited possibilities&#8212;they could upload and run any program on the modem. Such a program could turn the modem into a so-called &#8220;zombie&#8221; used in DDoS attacks; it could allow the attacker to <a href="http://www.xs4all.nl/~borkhuis/vxworks/vxsniff.c">eavesdrop on traffic</a> and perform man-in-the-middle (MitM) attacks. Finally, the program could reprogram the modem&#8217;s FLASH memory to the point that it stops functioning entirely and would require service reprogramming.</p><p>The described threats become more serious when one considers the number of modems in use in Poland.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a></p><h2>The problem of obtaining MAC addresses</h2><p>To gain control over a modem, one must know its MAC address. It wasn&#8217;t possible to obtain this address based on the IP of the Speedstream 5660 modem.</p><p>After analyzing a transmission dump between the script and the modem using <a href="https://lcamtuf.coredump.cx/p0f3/">p0f</a>, it turned out that the server running the configuration script most likely operates under Solaris 8.</p><pre><code>p0f - passive os fingerprinting utility, version 2.0.2
(C) M. Zalewski &lt;lcamtuf@coredump.cx&gt;, W. Stearns &lt;wstearns@pobox.com&gt;
p0f: listening (SYN) on 'filtered.dump', 193 sigs (9 generic), rule: 'all'.
80.50.248.71:14396 - Solaris 8 (1) (NAT!) 
  -&gt; 10.0.0.1:23 (distance 8, link: unknown-1472)
[+] End of input file.</code></pre><p>If an attacker were able to gain control of this server, they would also have access to the MAC address database (and most likely passwords and other confidential data as well).</p><p>The server is protected by a firewall that likely performs packet defragmentation, so the previous trick with packet fragmentation wouldn&#8217;t work here. I did not attempt direct intrusion, but I tested the provisioning script by feeding it incorrect input. It proved to be resistant&#8212;at least to the inputs it was tested with.</p><p>While testing the buffer capacity of the remote side, it became clear what kind of firewall was in use. When my program sent a large amount of data, the script on the other side disconnected and closed the connection. The firewall interpreted this as a terminated connection, while my program kept sending data. As a result, the packets sent by the program were reset&#8212;but in a very specific way. The RST packets weren&#8217;t empty&#8212;they contained a payload that was a copy of the packet being reset. This is a known bug in Cisco PIX.</p><p>With other methods blocked, brute-forcing MAC addresses was the remaining option. Of course, it&#8217;s not necessary to scan the entire MAC address space. While there are 2&#8308;&#8312; possible MAC addresses, which might sound discouraging, the first three bytes are identical for all the modems. Additionally, the first half of the fourth byte is often the same. That narrows it down to 2&#178;&#8312; = 268,435,456 possibilities.</p><p>It&#8217;s reasonable to assume that TP purchased modems in batches. Devices from the same batch have almost identical MAC addresses. If the attacker &#8220;hits&#8221; one valid MAC address, finding others from the same batch becomes easy.</p><p>During testing, I observed that TP&#8217;s script has timeouts for modem configuration. If the modem doesn&#8217;t respond within a certain time, the script disconnects and reconnects&#8212;this cycle can repeat multiple times. This behavior can be exploited to speed up password collection.</p><p>With enough time, it would be possible to create a password-harvesting program that intelligently scans MAC addresses and extracts passwords from the database at a rate of one every few seconds&#8212;provided it &#8220;hits&#8221; a valid series. The wait time could be longer if the MAC address is a miss, but likely no more than 2&#8211;3 minutes.</p><h2>New modems</h2><p>After identifying and initially describing the vulnerability, it turned out that, in addition to the Speedstream 5660 modems, TP was also providing subscribers with newer modems&#8212;devices from the same manufacturer, but marked with the model number 5100.</p><p>Like the 5660, the Speedstream 5100 also features a web interface for managing and monitoring the modem. However, unlike the 5660, which protects the entire interface with a password, the 5100 allows users to monitor the modem's status without authentication. This allows subscribers to diagnose connection issues without needing full access.</p><p>The main page of the web interface also includes basic information about the device. From an attacker&#8217;s perspective, the key piece of information is&#8230; the MAC address.</p><h2>The problem of obtaining MAC addresses&#8212;solved</h2><p>This is a major convenience for an attacker. Knowing the IP address of a remote modem is enough to connect to the modem&#8217;s homepage (again using fragmented packets) and retrieve its MAC address.</p><p>An attacker, using a tool to scan all IP ranges assigned to TP and looking specifically for 5100 modems (which are easy to identify remotely), could very quickly collect the MAC addresses of all such modems in Poland. Needless to say, all of the previously described threats also apply to these devices.</p><h2>Default password</h2><p>An attempt to retrieve authentication data for the 5100 using the spoofing script failed. The provisioning script disconnected, just as it does when it receives an invalid response from the modem. It&#8217;s likely because the CLI interface was different.</p><p>To adapt the spoofing script to &#8220;work&#8221; with the 5100, I recreated the test setup&#8212;this time using the newer modem. Analysis of the captured transmission provided the necessary details and revealed an amusing fact: to prevent subscribers from tampering with the configuration, the factory password had been changed. This means even someone with the modem's manual&#8212;including the default password&#8212;cannot gain access to the device after a factory reset.</p><p>Unfortunately, by analyzing the transmission between the script and the modem, an attacker can easily learn this password.</p><h2>Countermeasures</h2><p>It's difficult for me to suggest what actions TP could take to secure the DSL system as I&#8217;m certainly unaware of all its features and the requirements it must meet. I also don't know the system's internal architecture or the capabilities of the devices that comprise it. Still, I will briefly discuss some simple remedies that wouldn't require major changes to the system design.</p><p>The most reliable solution would be to abandon automatic modem configuration entirely. However, I realize this could increase the cost of installing new modems and maintaining existing ones.</p><p>If the packet filters on DSLAMs allow it, a simple measure could be to block fragmented packets. However, this would serve only as a temporary fix, as it doesn&#8217;t prevent credential theft from the central database nor stop the use of those credentials when the attacker has physical access to the modem.</p><p>A more balanced solution might be to limit automatic modem provisioning to a few trusted locations&#8212;for example, one in each major city. In those locations, technicians would configure the modems before installing them at customer premises.</p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>The modem requires that all IP addresses available to the client be used; otherwise, it often "freezes."</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p>TP FAQ, <a href="http://web.archive.org/web/20030720114445/http://internetdsl.pl/pages/technologia.php">question 59</a>.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-3" href="#footnote-anchor-3" class="footnote-number" contenteditable="false" target="_self">3</a><div class="footnote-content"><p>Even the Telnet password, although it isn&#8217;t displayed&#8212;it can only be changed. However, the Telnet and SNMP passwords are the same in TP&#8217;s system, so obtaining one effectively gives access to the other.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-4" href="#footnote-anchor-4" class="footnote-number" contenteditable="false" target="_self">4</a><div class="footnote-content"><p>According to information dated August 29, 2004, published on the website of Telekomunikacja Polska, the DSL Internet Access service from TP is used by <a href="http://www.tp.pl/otp/serwis_prasowy/biuro/show.php?mid=1490">35,000 subscribers</a>.</p></div></div>]]></content:encoded></item></channel></rss>