<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ross marks</title>
	<atom:link href="https://rossmarks.uk/blog/feed/" rel="self" type="application/rss+xml" />
	<link>https://rossmarks.uk/blog</link>
	<description>Blog</description>
	<lastBuildDate>Tue, 28 Oct 2025 23:34:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
<site xmlns="com-wordpress:feed-additions:1">38909578</site>	<item>
		<title>PwnPad Review</title>
		<link>https://rossmarks.uk/blog/pwnpad-review/</link>
					<comments>https://rossmarks.uk/blog/pwnpad-review/#respond</comments>
		
		<dc:creator><![CDATA[Ross Marks]]></dc:creator>
		<pubDate>Tue, 28 Oct 2025 23:34:07 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">https://rossmarks.uk/blog/?p=2018</guid>

					<description><![CDATA[A friend sent me a link to the “PwnPad” correctly thinking I would be interested. I got in touch with the creator (RoboGR00t) to see how I could get one, if there were kits available or a tindie link etc. &#8230; <a href="https://rossmarks.uk/blog/pwnpad-review/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p>A friend sent me a link to the “PwnPad” correctly thinking I would be interested. I got in touch with the creator (RoboGR00t) to see how I could get one, if there were kits available or a tindie link etc. He said he had one spare if I could solder it up, unfortunately postage to UK was crazy expensive! so we came to an arrangement that a colleague of his would post it to me from UK as they were in the country in a couple of months. We stayed in touch, swapped stories, pentester chat, became friends. A couple of months passed, I had forgotten about this cool toy, then one day it arrived!</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/pwnpadtshirt.png" rel="lightbox[2018]"><img fetchpriority="high" decoding="async" width="1024" height="460" data-attachment-id="2019" data-permalink="https://rossmarks.uk/blog/pwnpad-review/pwnpadtshirt/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/pwnpadtshirt.png" data-orig-size="2520,1132" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="pwnpad+tshirt" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/pwnpadtshirt-300x135.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/pwnpadtshirt-1024x460.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/pwnpadtshirt-1024x460.png" alt="" class="wp-image-2019" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/pwnpadtshirt-1024x460.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/pwnpadtshirt-300x135.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/pwnpadtshirt-768x345.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/pwnpadtshirt-1536x690.png 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/pwnpadtshirt-2048x920.png 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/pwnpadtshirt-500x225.png 500w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>Along with a sick T-shirt. So thank you mystery poster, it&#8217;s much appreciated.</p>



<p>All of this is to say I was given it to try, play with give feedback, but no-one has asked me to write this, I&#8217;m simply doing it because someone might be interested on my thoughts? maybe?&nbsp;</p>



<p>It took me far too long to get this put together and flashed due to other projects taking priority, but I got there eventually!&nbsp;</p>



<h2 class="wp-block-heading">About</h2>



<p>This is a small device based off of the famous arduino chip (Atmega328P) to teach/learn hardware hacking skills. It starts with beginner challenges, basic skills all hardware pentesters should have and quickly ramps up to some more niche or obscure skills.</p>



<p>There are jumpers that when bridged correlate to a binary number to select the challenge that is loaded. Reading the description from the github will help direct you with what the goal(s) are for the selected challenge.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-7.png" rel="lightbox[2018]"><img decoding="async" width="534" height="476" data-attachment-id="2020" data-permalink="https://rossmarks.uk/blog/pwnpad-review/image-36/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-7.png" data-orig-size="534,476" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-7-300x267.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-7.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-7.png" alt="" class="wp-image-2020" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-7.png 534w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-7-300x267.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-7-337x300.png 337w" sizes="(max-width: 534px) 100vw, 534px" /></a></figure>
</div>


<p>There were some issues, but these are things that will be easy to fix by updating documentation or code. There was an issue with the reset button and jumpers but I believe these have been fixed in V2.</p>



<p>Once I&#8217;d built it and flashed the firmware it was a lot of fun to complete. My solutions can be read <a href="https://rossmarks.uk/git/0xRoM/12Sec_CTF_v1">HERE</a>. Warning, spoilers are there!</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>I think this has two main use cases:</p>



<p><strong>Self study </strong>&#8211; If you get one and build it there is very little hand holding, a basic “this is what you are trying to do” and you will have to go and learn what that is or how to do it, then put that theory into practice to get the flag.</p>



<p><strong>Teaching aid </strong>&#8211; This is where I think it would be most beneficial. When a more experienced tester can walk through this with a junior and be able to answer questions along the way. Each challenge could be a separate lesson so each session a new skill is learnt.</p>



<p>The codebase and challenge selection system mean it&#8217;s super easy to add challenges and I expect more will be added in the future. The challenges that exist currently are good to learn the basics of hardware hacking, the 90% of of things you&#8217;d typically look to do. I haven&#8217;t seen V2 board, but I have heard it fixes some of the hardware problems V1 had (not that they were game breaking, just a little annoying)</p>



<p>I dont know when V2 will be released, but when it is I highly recommend getting one and having a play. I guess the github would be the best place to look for updates, <a href="https://github.com/twelvesec/PwnPad/" target="_blank" rel="noreferrer noopener">HERE</a> is a link.</p>



<p>Again I&#8217;d like to give a massive thanks to RoboGR00T for making this awesome thing and chatting all things nerdy with me <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br>Thanks again to mystery poster, without you I never would have got to play with this</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://rossmarks.uk/blog/pwnpad-review/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2018</post-id>	</item>
		<item>
		<title>Cheap EMFI Mapping</title>
		<link>https://rossmarks.uk/blog/cheap-emfi-mapping/</link>
					<comments>https://rossmarks.uk/blog/cheap-emfi-mapping/#respond</comments>
		
		<dc:creator><![CDATA[Ross Marks]]></dc:creator>
		<pubDate>Sun, 05 Oct 2025 15:30:57 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<guid isPermaLink="false">https://rossmarks.uk/blog/?p=1995</guid>

					<description><![CDATA[Continuing my glitching experiments I have got EMFI attacks working (part 1), I wanted to improve them. The next step is to identify the best place to perform these attacks by mapping what happens when you glitch different areas of &#8230; <a href="https://rossmarks.uk/blog/cheap-emfi-mapping/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p>Continuing my glitching experiments I have got EMFI attacks working (<a href="https://rossmarks.uk/blog/faultycat-introduction/">part 1</a>), I wanted to improve them. The next step is to identify the best place to perform these attacks by mapping what happens when you glitch different areas of the chip.</p>



<p>The code and supplementary resources for this blog can be found in my git <a href="https://rossmarks.uk/git/0xRoM/Hardware">here</a>. in the &#8220;/plotter&#8221; folder.</p>



<p>To start this experiment you will need an X/Y gantry to move the glitching device. I found <a href="https://www.aliexpress.com/item/1005008600591337.html" target="_blank" rel="noreferrer noopener">this</a> cheap plotter on aliexpress:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image.png" rel="lightbox[1995]"><img decoding="async" width="1024" height="352" data-attachment-id="1996" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/image-29/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image.png" data-orig-size="1264,435" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-300x103.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-1024x352.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-1024x352.png" alt="" class="wp-image-1996" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-1024x352.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-300x103.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-768x264.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-500x172.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image.png 1264w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>A couple of weeks and what arrived was:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250818_145022-scaled.jpg" rel="lightbox[1995]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="1998" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/20250818_145022/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250818_145022-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="20250818_145022" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250818_145022-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250818_145022-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250818_145022-1024x461.jpg" alt="" class="wp-image-1998" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250818_145022-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250818_145022-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250818_145022-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250818_145022-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250818_145022-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250818_145022-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<figure class="wp-block-image size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_081720-2-scaled.jpg" rel="lightbox[1995]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="2008" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/20250819_081720-3/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_081720-2-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1755591440&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;400&quot;,&quot;shutter_speed&quot;:&quot;0.02&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="20250819_081720" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_081720-2-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_081720-2-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_081720-2-1024x461.jpg" alt="" class="wp-image-2008" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_081720-2-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_081720-2-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_081720-2-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_081720-2-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_081720-2-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_081720-2-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>No instructions or anything, I asked the seller but they were silent!<br>I eventually found the following two sites:<br><a href="https://www.generativehut.com/post/ly-drawbot-a-70-pen-plotter" target="_blank" rel="noreferrer noopener">generativehut </a>&amp; <a href="https://hannahilea.com/blog/ly-drawbot-setup/" target="_blank" rel="noreferrer noopener">hannahilea</a><br>These has instructions which were similar but not quite perfect. Using both of those and the pdf in the zip file on one of those sites (which I have backed up in the git repo as &#8220;LY plotter.zip&#8221;) I managed to get the thing built and running:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_133735-scaled.jpg" rel="lightbox[1995]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="2000" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/20250819_133735/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_133735-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="20250819_133735" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_133735-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_133735-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_133735-1024x461.jpg" alt="" class="wp-image-2000" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_133735-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_133735-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_133735-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_133735-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_133735-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250819_133735-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250820_133248-scaled.jpg" rel="lightbox[1995]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="2001" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/20250820_133248/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250820_133248-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="20250820_133248" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250820_133248-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250820_133248-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250820_133248-1024x461.jpg" alt="" class="wp-image-2001" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250820_133248-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250820_133248-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250820_133248-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250820_133248-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250820_133248-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250820_133248-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>I tested it with <a href="https://lasergrbl.com" target="_blank" rel="noreferrer noopener">LaserGRBL</a>  on Windows to make it draw some pictures with a pen to confirm it was working as intended. It was! Later a &#8220;stepper motor driver&#8221; broke, turns out you can buy these super cheap from amazon. This machine&#8217;s brains are an arduino with a CNC shield attached. Most likely both clones, but I have no idea of what to look for to check that and dont really care, as long as it works!</p>



<p>I then recreated my origional EMP holder to fit both the plotter and the stand. This can be downloaded from <a href="https://www.thingiverse.com/thing:7163230" target="_blank" rel="noreferrer noopener">thingiverse</a>. </p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/Cura.png" rel="lightbox[1995]"><img loading="lazy" decoding="async" width="1024" height="773" data-attachment-id="2003" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/cura/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/Cura.png" data-orig-size="1120,846" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Cura" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/Cura-300x227.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/Cura-1024x773.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/Cura-1024x773.png" alt="" class="wp-image-2003" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/Cura-1024x773.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/Cura-300x227.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/Cura-768x580.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/Cura-397x300.png 397w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/Cura.png 1120w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>The backplate screws to the plotter. With some M5 nuts and bolts the holder slides over the backplate and is held in place with the bolts:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250823_160743-scaled.jpg" rel="lightbox[1995]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="2002" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/20250823_160743/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250823_160743-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1755965263&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;160&quot;,&quot;shutter_speed&quot;:&quot;0.02&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="20250823_160743" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250823_160743-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250823_160743-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250823_160743-1024x461.jpg" alt="" class="wp-image-2002" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250823_160743-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250823_160743-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250823_160743-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250823_160743-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250823_160743-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/20250823_160743-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>At this point I wanted to see if I could move the plotter from linux and python as being able to control this programmatically was paramount to this working. It turns out the way they had created this machine it used stepper motors to move X and Y but a servo to move Z which used the G-Code usually used to control the spindle speed to change the height. The simple program &#8220;plotter_gui.py&#8221; looked as follows:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-1.png" rel="lightbox[1995]"><img loading="lazy" decoding="async" width="442" height="308" data-attachment-id="2004" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/image-30/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-1.png" data-orig-size="442,308" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-1-300x209.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-1.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-1.png" alt="" class="wp-image-2004" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-1.png 442w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-1-300x209.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-1-431x300.png 431w" sizes="auto, (max-width: 442px) 100vw, 442px" /></a></figure>
</div>


<p>It worked a treat! apart from &#8220;set home&#8221; which worked for the duration of the program, but I couldn&#8217;t get it to store the current location as 0,0 on the plotter, so every time I closed the program or restarted the plotter it got reset (this was never solved and didn&#8217;t cause much of an issue). The next program created was &#8220;plotterStepperMaker.py&#8221;:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-2.png" rel="lightbox[1995]"><img loading="lazy" decoding="async" width="668" height="558" data-attachment-id="2005" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/image-31/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-2.png" data-orig-size="668,558" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-2-300x251.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-2.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-2.png" alt="" class="wp-image-2005" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-2.png 668w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-2-300x251.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-2-359x300.png 359w" sizes="auto, (max-width: 668px) 100vw, 668px" /></a></figure>
</div>


<p>With this program you move the plotter to one corner (think of it in 3d space) click &#8220;Set A&#8221; then move to the opposite corner and &#8220;Set B&#8221;. Then set the increment values you want to glitching to occur between and &#8220;Save Step Values&#8221;. It is now ready to save the json file which contains this configuration.</p>



<p>I also gave it some command line options to:</p>



<ol class="wp-block-list">
<li>Return a count of the amount of steps for a given config file</li>



<li>Return the closest position for given co-ordinates</li>



<li>Return the co-ordinates for given step</li>
</ol>



<p>This looked like:</p>



<pre class="brush: bash; gutter: false; first-line: 1">
$&gt; python3 plotterStepperMaker.py -f plotter_test.json -count
18

$&gt; python3 plotterStepperMaker.py -f plotter_test.json -xyz &#039;{&quot;x&quot;:0.0,&quot;y&quot;:0.0,&quot;z&quot;:0.0}&#039;
1

$&gt; python3 plotterStepperMaker.py -f plotter_test.json -n 1
{&quot;x&quot;: 0.0, &quot;y&quot;: 0.0, &quot;z&quot;: 0.0}

$&gt; python3 plotterStepperMaker.py -f plotter_test.json -n 2
{&quot;x&quot;: 1.0, &quot;y&quot;: 0.0, &quot;z&quot;: 0.0}

$&gt; python3 plotterStepperMaker.py -f plotter_test.json -n 3
{&quot;x&quot;: 2.0, &quot;y&quot;: 0.0, &quot;z&quot;: 0.0}

$&gt; python3 plotterStepperMaker.py -f plotter_test.json -n 4
{&quot;x&quot;: 0.0, &quot;y&quot;: 1.0, &quot;z&quot;: 0.0}

$&gt; python3 plotterStepperMaker.py -f plotter_test.json -n 5
{&quot;x&quot;: 1.0, &quot;y&quot;: 1.0, &quot;z&quot;: 0.0}

$&gt; python3 plotterStepperMaker.py -f plotter_test.json -n 6
{&quot;x&quot;: 2.0, &quot;y&quot;: 1.0, &quot;z&quot;: 0.0}

$&gt; python3 plotterStepperMaker.py -f plotter_test.json -n 7
{&quot;x&quot;: 0.0, &quot;y&quot;: 2.0, &quot;z&quot;: 0.0}

$&gt; python3 plotterStepperMaker.py -f plotter_test.json -n 8
{&quot;x&quot;: 1.0, &quot;y&quot;: 2.0, &quot;z&quot;: 0.0}

$&gt; python3 plotterStepperMaker.py -f plotter_test.json -n 9
{&quot;x&quot;: 2.0, &quot;y&quot;: 2.0, &quot;z&quot;: 0.0}

$&gt; python3 plotterStepperMaker.py -f plotter_test.json -n 10
{&quot;x&quot;: 0.0, &quot;y&quot;: 0.0, &quot;z&quot;: 40.0}
</pre>



<p>It was finally time to do some glitching. As I&#8217;m sure everyone expected I decided to test this against the trusty ATTiny85. The setup looked like this:</p>



<figure class="wp-block-image size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/setup.png" rel="lightbox[1995]"><img loading="lazy" decoding="async" width="1024" height="480" data-attachment-id="2009" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/setup/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/setup.png" data-orig-size="2340,1096" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="setup" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/setup-300x141.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/setup-1024x480.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/setup-1024x480.png" alt="" class="wp-image-2009" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/setup-1024x480.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/setup-300x141.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/setup-768x360.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/setup-1536x719.png 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/setup-2048x959.png 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/setup-500x234.png 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<ol class="wp-block-list">
<li>Plotter</li>



<li>EMFI glitching tool</li>



<li>ATTiny85 chip being tested</li>



<li>ESP8266 to power the device being tested</li>



<li>Tigard to read/write UART to the device</li>



<li>Laptop doing all the computing</li>
</ol>



<p>If you want to perform this cheaper I&#8217;d recommend getting a &#8220;<a href="https://github.com/newaetech/chipshouter-picoemp">PicoEMP</a>&#8220;. The last time I saw these for sale they were around $60. Instead of the Tigard there are super cheap USB->UART interfaces for a couple of dollars on aliexpress or amazon.</p>



<p>I programmed the ESP8266 so it connects to my wifi and has 2 endpoints &#8220;/on&#8221; and &#8220;/off&#8221;. These turn the power on and off, this is so each time we glitch the device it is reset into a known state.</p>



<p>Since we know how the target reacts we can use this to determine each plot point. If it responds &#8220;incorrect password&#8221; we know nothing happened, if it responds with the startup message we know the glitch restarted the device. Anything else and we can conclude that it caused the device to glitch or do something weird (the goal).</p>



<p>I created a <a href="https://rossmarks.uk/git/0xRoM/glitch-o-bolt">glitch-o-bolt</a> config file / script &#8220;ConfigPlotterGen.py&#8221;.</p>



<p>Which works in the following way:</p>



<ul class="wp-block-list">
<li>Connect to the plotter and get the details from the json file and amount of loops we set to glitch </li>



<li>Move the plotter to the next step</li>



<li>Restart the device</li>



<li>Send a password and at the same time attempt a glitch</li>



<li>Record the result, if there are more steps then go back up to &#8220;move the device&#8221;</li>



<li>Log all the results to a file </li>



<li>Print the results to the screen</li>



<li>Generate both an ASCII and PNG map</li>



<li>Calculate the best place to glitch to add to the map</li>
</ul>



<p>The first time I got it working it looks like:</p>



<pre class="brush: bash; gutter: false; first-line: 1">
[stats] loop 3/3, place 19/20
[moving to] - {&#039;x&#039;: 63.0, &#039;y&#039;: -93.0, &#039;z&#039;: 40.0}
[turning off device]
[turning on device]
System ready
Generated password: jZ2Q8sYJ
[FaultyCat arming]
[FaultyCat sending pulse]
[sending password]
System ready
Generated password: jZ2Q8sYJ
[FaultyCat disarming]
[result] 1
[stats] loop 3/3, place 20/20
[moving to] - {&#039;x&#039;: 65.0, &#039;y&#039;: -93.0, &#039;z&#039;: 40.0}
[turning off device]
[turning on device]
System ready
Generated password: jZ2Q8sYJ
[FaultyCat arming]
[sending password]
[FaultyCat sending pulse]
System ready
Generated password: jZ2Q8sYJ
[FaultyCat disarming]
[result] 1
[end time] 03/10/2025 10:51
[time elapsed] 00:06:23
[results saved] /tmp/glitching_results.csv
[step 1] nothing=3 crash=0 glitch=0 x=57.0 y=-99.0 z=40.0
[step 2] nothing=0 crash=0 glitch=3 x=59.0 y=-99.0 z=40.0
[step 3] nothing=0 crash=0 glitch=3 x=61.0 y=-99.0 z=40.0
[step 4] nothing=0 crash=3 glitch=0 x=63.0 y=-99.0 z=40.0
[step 5] nothing=0 crash=3 glitch=0 x=65.0 y=-99.0 z=40.0
[step 6] nothing=1 crash=0 glitch=2 x=57.0 y=-97.0 z=40.0
[step 7] nothing=0 crash=0 glitch=3 x=59.0 y=-97.0 z=40.0
[step 8] nothing=0 crash=3 glitch=0 x=61.0 y=-97.0 z=40.0
[step 9] nothing=0 crash=3 glitch=0 x=63.0 y=-97.0 z=40.0
[step 10] nothing=0 crash=3 glitch=0 x=65.0 y=-97.0 z=40.0
[step 11] nothing=0 crash=1 glitch=2 x=57.0 y=-95.0 z=40.0
[step 12] nothing=0 crash=2 glitch=1 x=59.0 y=-95.0 z=40.0
[step 13] nothing=0 crash=2 glitch=1 x=61.0 y=-95.0 z=40.0
[step 14] nothing=0 crash=3 glitch=0 x=63.0 y=-95.0 z=40.0
[step 15] nothing=0 crash=3 glitch=0 x=65.0 y=-95.0 z=40.0
[step 16] nothing=0 crash=0 glitch=3 x=57.0 y=-93.0 z=40.0
[step 17] nothing=0 crash=3 glitch=0 x=59.0 y=-93.0 z=40.0
[step 18] nothing=0 crash=3 glitch=0 x=61.0 y=-93.0 z=40.0
[step 19] nothing=0 crash=3 glitch=0 x=63.0 y=-93.0 z=40.0
[step 20] nothing=0 crash=3 glitch=0 x=65.0 y=-93.0 z=40.0
[ASCII map]
3----
211--
23---
.33--
[best glitch] position 7 glitches=3 x=59.0 y=-97.0 z=40.0 score=60
[results map saved] /tmp/glitching_results.png
</pre>



<p>Which generated:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-3.png" rel="lightbox[1995]"><img loading="lazy" decoding="async" width="500" height="400" data-attachment-id="2010" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/image-32/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-3.png" data-orig-size="500,400" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-3-300x240.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-3.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-3.png" alt="" class="wp-image-2010" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-3.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-3-300x240.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-3-375x300.png 375w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a></figure>
</div>


<p>YEY!!!</p>



<p>That working so well I increased the resolution (smaller steps). Heres a video of it in action:</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" class="youtube-player" width="584" height="329" src="https://www.youtube.com/embed/Pe2sbg25bLY?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
</div></figure>



<p>Which produced the following:</p>



<pre class="brush: bash; gutter: false; first-line: 1">
[stats] loop 5/5, place 246/247
[moving to] - {&#039;x&#039;: 65.5, &#039;y&#039;: -93.0, &#039;z&#039;: 40.0}
[turning off device]
[turning on device]
System ready
Generated password: eAgOI62U
[FaultyCat arming]
[sending password]
[FaultyCat sending pulse]
System ready
Generated password: eAgOI62U
[FaultyCat disarming]
[result] 1
[stats] loop 5/5, place 247/247
[moving to] - {&#039;x&#039;: 66.0, &#039;y&#039;: -93.0, &#039;z&#039;: 40.0}
[turning off device]
[turning on device]
System ready
Generated password: eAgOI62U
[FaultyCat arming]
[sending password]
[FaultyCat sending pulse]
System ready
Generated password: eAgOI62U
[FaultyCat disarming]
[result] 1
[end time] 03/10/2025 22:17
[time elapsed] 02:11:56
[results saved] /tmp/glitching_results.csv
[step 1] nothing=5 crash=0 glitch=0 x=57.0 y=-99.0 z=40.0
[step 2] nothing=5 crash=0 glitch=0 x=57.5 y=-99.0 z=40.0
[step 3] nothing=5 crash=0 glitch=0 x=58.0 y=-99.0 z=40.0
[step 4] nothing=3 crash=0 glitch=2 x=58.5 y=-99.0 z=40.0
[step 5] nothing=1 crash=1 glitch=3 x=59.0 y=-99.0 z=40.0
[step 6] nothing=0 crash=2 glitch=3 x=59.5 y=-99.0 z=40.0
[step 7] nothing=0 crash=2 glitch=3 x=60.0 y=-99.0 z=40.0
-snip-
[step 245] nothing=0 crash=5 glitch=0 x=65.0 y=-93.0 z=40.0
[step 246] nothing=0 crash=5 glitch=0 x=65.5 y=-93.0 z=40.0
[step 247] nothing=0 crash=5 glitch=0 x=66.0 y=-93.0 z=40.0
[ASCII map]
2--1------
32-2-1----
221-------
434-2-----
1412-1----
.344-1----
.23421----
[best glitch] position 25 glitches=5 crashes=0 nothing=0 x=59.5 y=-98.5 z=40.0 score=42
[results map saved] /tmp/glitching_results.png
</pre>



<p>Once it finished running it looked like:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-4.png" rel="lightbox[1995]"><img loading="lazy" decoding="async" width="1024" height="639" data-attachment-id="2011" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/image-33/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-4.png" data-orig-size="1560,974" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-4-300x187.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-4-1024x639.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-4-1024x639.png" alt="" class="wp-image-2011" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-4-1024x639.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-4-300x187.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-4-768x480.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-4-1536x959.png 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-4-480x300.png 480w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-4.png 1560w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>Producing the following map:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-5.png" rel="lightbox[1995]"><img loading="lazy" decoding="async" width="1000" height="700" data-attachment-id="2012" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/image-34/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-5.png" data-orig-size="1000,700" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-5-300x210.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-5.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-5.png" alt="" class="wp-image-2012" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-5.png 1000w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-5-300x210.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-5-768x538.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-5-429x300.png 429w" sizes="auto, (max-width: 1000px) 100vw, 1000px" /></a></figure>
</div>


<p>With this we now know the best place to glitch this chip. For a better visual representation I overlaid it on an ATTiny85:</p>



<figure class="wp-block-image size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-6.png" rel="lightbox[1995]"><img loading="lazy" decoding="async" width="815" height="841" data-attachment-id="2013" data-permalink="https://rossmarks.uk/blog/cheap-emfi-mapping/image-35/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-6.png" data-orig-size="815,841" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-6-291x300.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-6.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-6.png" alt="" class="wp-image-2013" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-6.png 815w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-6-291x300.png 291w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/10/image-6-768x793.png 768w" sizes="auto, (max-width: 815px) 100vw, 815px" /></a></figure>



<p>Now that this is all created it&#8217;s a super simple 2 step process.</p>



<ol class="wp-block-list">
<li>Create the configuration file</li>



<li>Start the glitching to create the map</li>
</ol>



<pre class="brush: bash; gutter: false; first-line: 1">
$&gt; python plotterStepperMaker.py -f plotter_test.json 

$&gt; python3 /opt/glitch-o-bolt/glitch-o-bolt.py -c /tmp/ConfigPlotterGen.py 
</pre>



<p>The map generator I&#8217;ve created only does 2D, everything is there for it to easily do 3D, I&#8217;ll leave this as an exercise for the reader.</p>



<p>I hope this helps someone. If I&#8217;ve missed any information or you want me to go more in-depth with any part of this then leave a comment. </p>
]]></content:encoded>
					
					<wfw:commentRss>https://rossmarks.uk/blog/cheap-emfi-mapping/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1995</post-id>	</item>
		<item>
		<title>SSH PAM SSO LDAP</title>
		<link>https://rossmarks.uk/blog/ssh-pam-sso-ldap/</link>
					<comments>https://rossmarks.uk/blog/ssh-pam-sso-ldap/#respond</comments>
		
		<dc:creator><![CDATA[Ross Marks]]></dc:creator>
		<pubDate>Wed, 02 Jul 2025 21:21:20 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://rossmarks.uk/blog/?p=1985</guid>

					<description><![CDATA[OK so this will be a short one, but a nerdy one! I&#8217;m currently creating a load of systems and using a SSO (Single Sign On) solution. So I can make a load of services, webapps and servers, but the &#8230; <a href="https://rossmarks.uk/blog/ssh-pam-sso-ldap/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p>OK so this will be a short one, but a nerdy one! I&#8217;m currently creating a load of systems and using a SSO (Single Sign On) solution. <br>So I can make a load of services, webapps and servers, but the users only need to login once in one place to access everything. It also means there is a single place to update their details or password. <br>From an administration point it&#8217;s so much easier having one place to manage users and their groups rather than have to log in to loads of different systems, setting up accounts, adding to groups in each different system with different settings and places to learn. </p>



<p>The stack so far:</p>



<ul class="wp-block-list">
<li><strong>Keycloak </strong>&#8211; The single sign on solution</li>



<li><strong>389ds </strong>&#8211; Open source LDAP server</li>



<li><strong>Pfsense </strong>&#8211; The router/switch/firewall
<ul class="wp-block-list">
<li><strong>OpenVPN </strong>&#8211; Pfsense VPN plugin which allows auth via LDAP</li>



<li><strong>HA Proxy</strong> &#8211; Pfsense reverse proxy for web applications</li>
</ul>
</li>



<li><strong>JumpBox </strong>&#8211; A Debian server running SSH that we want people to be able to access via SSO</li>
</ul>



<p>Users can login to services (websites, VPN, etc.) which in turn use keycloak using a variety of methods (typically oidc) and keycloak updates 389ds with the users and groups. OpenVPN only supports LDAP authentication and that is why the system has been set up this way. 389ds&#8217;s implementation isn&#8217;t posix (or seemingly a standard way of doing things) so any of the typical Linux LDAP authentication methods just dont work (sssd, nslcd or nss_ldap) or at least they didn&#8217;t for me. Thats when I discovered PAM!</p>



<p>PAM (Pluggable Authentication Modules) is a system in Linux that controls how users log in. You can configure PAM to choose which checks to run and in what order, making it easy to change how login works without changing the programs themselves.</p>



<p>Now thats sounds simple and exactly what I want. It kind of is, however took a few days to really understand and get working. The plan was: when someone tries to log in via SSH, instead of the SSH server dealing with the authentication, it would be sent to my script. This script would then confirm the details via LDAP and act accordingly.</p>



<p>I created the script, got everything set up. And it wouldn&#8217;t work. I tried all sorts, before eventually logging EVERYTHING! Instead of the password, my script was getting: &#8220;\x08\n\r\x7fINCORRECT&#8221;. It turns out PAM does have to do some basic preliminary checks, one of these being &#8220;does this user exist on the system&#8221; &#8211; If the user doesn&#8217;t exist then send &#8220;INCORRECT&#8221;. Apparently it&#8217;s possible to get sssd or others to check this via LDAP first, but I couldn&#8217;t get that working. In light of this, I made the script first check if the user exists, if not, we know it&#8217;s going to get &#8220;incorrect&#8221; &#8211; so create the user account on the local system and disconnect the authentication attempt.</p>



<p>This means the first time a user tries to connect to SSH, if they have an account on the LDAP server it just drops the connection, doesn&#8217;t ask for a password or anything. The next time they try to log in the script will get their password, we can check they belong to the correct group for access and everything will work as we want. <br>Side note: I created the group &#8220;JumpBox&#8221; and if users are a member of that group then they can access the server.</p>



<p>So I guess it&#8217;s time to show you how to create this, it&#8217;s super simple and only requires 3 files:</p>



<h2 class="wp-block-heading">/etc/pam.d/sshd</h2>



<p>This is the PAM config specifically for SSH which tells it the order and types of authentication to use. <br>This configuration allows the user to first try to login with their SSO account, but if that fails it then will try a local account.</p>



<pre class="brush: plain; gutter: false; first-line: 1">
auth    sufficient      /lib/x86_64-linux-gnu/security/pam_python.so /opt/PAM/pam_ldap_user.py
auth    required      pam_unix.so try_first_pass
account required      pam_unix.so
session required      pam_unix.so
</pre>



<h2 class="wp-block-heading">/etc/ssh/sshd_config</h2>



<p>The most important one here is &#8220;KbdInteractiveAuthentication yes&#8221; without this is wont work.</p>



<pre class="brush: plain; gutter: false; first-line: 1">
AuthenticationMethods keyboard-interactive:pam
UsePAM yes
UseDNS no
PasswordAuthentication no
KbdInteractiveAuthentication yes
ChallengeResponseAuthentication yes
UseLogin no
</pre>



<h2 class="wp-block-heading">/opt/PAM/pam_ldap_user.py</h2>



<p>Finally the main script that does all of the PAM LDAP SSO magic</p>



<pre class="brush: python; gutter: false; first-line: 1">
#!/usr/bin/env python3
import ldap
import pwd
import grp
import subprocess
import logging
import os
import sys
import time
from functools import wraps

# === Debug Setup ===
sys.stderr = open(&#039;/var/log/pam_ldap_user.log&#039;, &#039;a&#039;)

# === Config ===
CONFIG = {
    &quot;EMAIL_DOMAIN&quot;: &quot;company.com&quot;,
    &quot;LDAP_SERVER&quot;: &quot;ldap://[LDAP server IP]&quot;,
    &quot;BASE_DN&quot;: &quot;dc=company,dc=com&quot;,
    &quot;BIND_DN&quot;: &quot;cn=[username]&quot;,
    &quot;BIND_PASSWORD&quot;: &quot;[password]&quot;,
    &quot;GROUP_ATTRIBUTE&quot;: &quot;memberOf&quot;,
    &quot;JUMPALLOWED_GROUP&quot;: &quot;JumpBox&quot;,
    &quot;USER_FILTER_TEMPLATE&quot;: &quot;(mail={email})&quot;,
    &quot;LOG_FILE&quot;: &quot;/var/log/pam_ldap_user.log&quot;,
    &quot;ALLOWED_SHELL&quot;: &quot;/bin/bash&quot;,
    &quot;LDAP_TIMEOUT&quot;: 5
}

# === Logging Setup ===
log_format = &#039;%(asctime)s %(levelname)s: %(message)s&#039;
logging.basicConfig(
    filename=CONFIG[&quot;LOG_FILE&quot;],
    level=logging.DEBUG,
    format=log_format
)

def log_entry_exit(func):
    @wraps(func)
    def wrapper(*args, **kwargs):
        log(f&quot;Entering {func.__name__}&quot;)
        try:
            result = func(*args, **kwargs)
            log(f&quot;Exiting {func.__name__}&quot;)
            return result
        except Exception as e:
            log(f&quot;Error in {func.__name__}: {str(e)}&quot;, logging.ERROR)
            raise
    return wrapper

def log(msg, level=logging.INFO):
    logging.log(level, msg)
    print(msg, file=sys.stderr)

def handle_password(password_input):
    try:
        if isinstance(password_input, str):
            return password_input.strip()
        if isinstance(password_input, bytes):
            try:
                return password_input.decode(&#039;utf-8&#039;).strip(&#039;\x00&#039;)
            except UnicodeDecodeError:
                cleaned = password_input.split(b&#039;\x00&#039;)[0]
                return cleaned.decode(&#039;latin1&#039;).strip()
        return str(password_input).strip()
    except Exception as e:
        log(f&quot;Password handling error: {e}&quot;)
        return &quot;&quot;

# === LDAP Functions ===
@log_entry_exit
def initialize_ldap():
    conn = ldap.initialize(CONFIG[&quot;LDAP_SERVER&quot;])
    conn.set_option(ldap.OPT_REFERRALS, 0)
    conn.set_option(ldap.OPT_NETWORK_TIMEOUT, CONFIG[&quot;LDAP_TIMEOUT&quot;])
    conn.protocol_version = ldap.VERSION3
    return conn

@log_entry_exit
def ldap_authenticate_credentials(email, password):
    try:
        conn = initialize_ldap()
        log(f&quot;Service bind with DN: {CONFIG[&#039;BIND_DN&#039;]}&quot;)
        conn.simple_bind_s(CONFIG[&quot;BIND_DN&quot;], CONFIG[&quot;BIND_PASSWORD&quot;])
        
        search_filter = CONFIG[&quot;USER_FILTER_TEMPLATE&quot;].format(email=email)
        log(f&quot;Searching with filter: {search_filter}&quot;)
        result = conn.search_s(
            CONFIG[&quot;BASE_DN&quot;],
            ldap.SCOPE_SUBTREE,
            search_filter,
            []
        )

        if not result:
            log(&quot;User not found&quot;, logging.WARNING)
            return False

        user_dn = result[0][0]
        log(f&quot;Found user DN: {user_dn}&quot;)

        user_conn = initialize_ldap()
        user_conn.simple_bind_s(user_dn, password)
        log(&quot;User bind successful&quot;)
        return True

    except ldap.INVALID_CREDENTIALS:
        log(&quot;Invalid credentials&quot;, logging.ERROR)
        return False
    except ldap.LDAPError as e:
        log(f&quot;LDAP error: {e}&quot;, logging.ERROR)
        return False
    finally:
        try:
            conn.unbind()
        except:
            pass
        try:
            user_conn.unbind()
        except:
            pass


@log_entry_exit
def ldap_check_group(email):
    try:
        conn = initialize_ldap()
        log(f&quot;Service bind with DN: {CONFIG[&#039;BIND_DN&#039;]}&quot;)
        conn.simple_bind_s(CONFIG[&quot;BIND_DN&quot;], CONFIG[&quot;BIND_PASSWORD&quot;])
        
        search_filter = CONFIG[&quot;USER_FILTER_TEMPLATE&quot;].format(email=email)
        log(f&quot;Searching with filter: {search_filter}&quot;)
        result = conn.search_s(
            CONFIG[&quot;BASE_DN&quot;],
            ldap.SCOPE_SUBTREE,
            search_filter,
            [CONFIG[&quot;GROUP_ATTRIBUTE&quot;]]
        )

        if not result:
            log(&quot;User not found&quot;, logging.WARNING)
            return False

        user_attrs = result[0][1]
        groups = user_attrs.get(CONFIG[&quot;GROUP_ATTRIBUTE&quot;], [])
        required_group = f&quot;cn={CONFIG[&#039;JUMPALLOWED_GROUP&#039;]},ou=Groups,{CONFIG[&#039;BASE_DN&#039;]}&quot;

        if isinstance(groups, bytes):
            groups = [groups]

        groups = [g.decode() if isinstance(g, bytes) else g for g in groups]

        if required_group not in groups:
            log(f&quot;User not in required group: {required_group}&quot;, logging.WARNING)
            username = email.split(&#039;@&#039;)[0]
            if local_user_exists(username):
                delete_local_user(username)
            return False

        log(f&quot;User in group: {required_group}&quot;)
        return True

    except ldap.LDAPError as e:
        log(f&quot;LDAP error: {e}&quot;, logging.ERROR)
        return False
    finally:
        try:
            conn.unbind()
        except:
            pass   

# === Local User Management ===
@log_entry_exit
def local_user_exists(username):
    try:
        pwd.getpwnam(username)
        return True
    except KeyError:
        return False

@log_entry_exit
def create_local_user(username):
    try:
        subprocess.run([
            &#039;/usr/sbin/useradd&#039;,
            &#039;-m&#039;,
            &#039;-s&#039;, CONFIG[&quot;ALLOWED_SHELL&quot;],
            &#039;-G&#039;, CONFIG[&quot;JUMPALLOWED_GROUP&quot;],
            username
        ], check=True, capture_output=True, text=True)
        log(f&quot;Created user {username}&quot;)

    except subprocess.CalledProcessError as e:
        log(f&quot;User creation failed: {e.stderr}&quot;, logging.ERROR)
        raise

@log_entry_exit
def delete_local_user(username):
    try:
        subprocess.run([
            &#039;/usr/sbin/userdel&#039;,
            &#039;-r&#039;,
            username
        ], check=True, capture_output=True, text=True)
        log(f&quot;Deleted user {username}&quot;)
    except subprocess.CalledProcessError as e:
        log(f&quot;User deletion failed: {e.stderr}&quot;, logging.ERROR)
        raise

# === PAM Integration ===
def pam_sm_authenticate(pamh, flags, args):
    try:
        user = pamh.get_user()
        if not user:
            log(&quot;No username provided&quot;, logging.ERROR)
            return pamh.PAM_USER_UNKNOWN

        log(f&quot;Authentication attempt for: {user}&quot;)

        if not local_user_exists(user):
            email = f&quot;{user}@{CONFIG[&#039;EMAIL_DOMAIN&#039;]}&quot;
            try:
                # Confirm user is in the correct group before creating local user
                if not ldap_check_group(email):
                    log(f&quot;User {user} not in required group, aborting local user creation.&quot;, logging.WARNING)
                    return pamh.PAM_AUTH_ERR
        
                create_local_user(user)
                os._exit(1)

            except Exception as e:
                log(f&quot;Local user setup failed: {e}&quot;, logging.ERROR)
                return pamh.PAM_AUTH_ERR

        # Display startup message
        #pamh.conversation(pamh.Message(pamh.PAM_TEXT_INFO, &quot;Python PAM starting...&quot;))

        # Prompt for password
        msg = pamh.Message(pamh.PAM_PROMPT_ECHO_OFF, &quot;Enter password: &quot;)
        resp = pamh.conversation(msg)
        password = handle_password(resp.resp)

        if not password:
            log(&quot;Empty password after prompt&quot;, logging.WARNING)
            return pamh.PAM_AUTH_ERR

        email = f&quot;{user}@{CONFIG[&#039;EMAIL_DOMAIN&#039;]}&quot;
        if not ldap_authenticate_credentials(email, password):
            return pamh.PAM_AUTH_ERR

        if not ldap_check_group(email):
            return pamh.PAM_AUTH_ERR


        return pamh.PAM_SUCCESS

    except Exception as e:
        log(f&quot;Authentication error: {e}&quot;, logging.ERROR)
        return pamh.PAM_AUTH_ERR

def pam_sm_setcred(pamh, flags, args):
    return pamh.PAM_SUCCESS

def pam_sm_open_session(pamh, flags, args):
    return pamh.PAM_SUCCESS

def pam_sm_close_session(pamh, flags, args):
    return pamh.PAM_SUCCESS

def pam_sm_acct_mgmt(pamh, flags, args):
    return pamh.PAM_SUCCESS
</pre>



<p>I also wanted to give users sudo access, the user accounts are created with no passwords. but you can enable sudo for the group with no password in the following file:</p>



<h2 class="wp-block-heading">/etc/sudoers.d/jumpbox</h2>



<pre class="brush: plain; gutter: false; first-line: 1">
%JumpBox ALL=(ALL) NOPASSWD: ALL
</pre>



<p>I hope this has been helpful for someone.<br>It&#8217;s probably not best practice, and I&#8217;m sure theres a million different ways to do this, this is just how I solved the problem.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rossmarks.uk/blog/ssh-pam-sso-ldap/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1985</post-id>	</item>
		<item>
		<title>Curious Bolt CTF Level 1</title>
		<link>https://rossmarks.uk/blog/curious-bolt-ctf-level-1/</link>
					<comments>https://rossmarks.uk/blog/curious-bolt-ctf-level-1/#respond</comments>
		
		<dc:creator><![CDATA[Ross Marks]]></dc:creator>
		<pubDate>Tue, 13 May 2025 15:45:59 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<guid isPermaLink="false">https://rossmarks.uk/blog/?p=1941</guid>

					<description><![CDATA[This will contain spoilers for the Level 1 challenge board for use with the curious bolt. you have been warned. So firstly what is the &#8220;Level 1 Challenge Board&#8221;? It is a STM32 based set of 4 challenges to familiarize &#8230; <a href="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p>This will <strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">contain spoilers</mark></strong> for the Level 1 challenge board for use with the curious bolt. you have been warned. So firstly what is the &#8220;Level 1 Challenge Board&#8221;? It is a STM32 based set of 4 challenges to familiarize yourself with glitching attacks, specifically for using the &#8220;curious bolt&#8221; to perform these attacks.<br>Scripts that I created or used will be available in the following git repo: <a href="https://rossmarks.uk/git/0xRoM/Hardware">https://rossmarks.uk/git/0xRoM/Hardware</a><br>Specifically in the following folder: &#8220;/FaultInjection/examples/CuriousBolt/Level-1/&#8221;.<br>The CTF board looks like:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="1024" height="684" data-attachment-id="1942" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-11/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image.png" data-orig-size="1616,1080" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-300x200.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-1024x684.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-1024x684.png" alt="" class="wp-image-1942" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-1024x684.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-300x200.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-768x513.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-1536x1027.png 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-449x300.png 449w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image.png 1616w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>My setup for completing this (curious bolt on the left):</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-1.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="840" height="503" data-attachment-id="1943" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-12/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-1.png" data-orig-size="840,503" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-1-300x180.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-1.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-1.png" alt="" class="wp-image-1943" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-1.png 840w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-1-300x180.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-1-768x460.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-1-500x300.png 500w" sizes="auto, (max-width: 840px) 100vw, 840px" /></a></figure>
</div>


<p></p>



<h4 class="wp-block-heading">Challenge 1</h4>



<p>In this challenge, the flag gets loaded into RAM in plaintext. There should be no way to extract it, as JTAG and SWD have been disabled.</p>



<h5 class="wp-block-heading">Setup</h5>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-2.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="1024" height="676" data-attachment-id="1944" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-13/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-2.png" data-orig-size="1434,947" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-2-300x198.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-2-1024x676.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-2-1024x676.png" alt="" class="wp-image-1944" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-2-1024x676.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-2-300x198.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-2-768x507.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-2-454x300.png 454w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-2.png 1434w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p></p>



<h5 class="wp-block-heading">Notes</h5>



<p>STM32F1 series have a design vulnerability, where the debugging peripheral can only be disabled in software, and not through hardware fuse bits. This means that RAM is still accessible when an attacker can force booting from bootrom or SRAM.</p>



<p>Because RAM is not cleared upon reset, the flag is still there, and it can be obtained by dumping RAM.</p>



<h5 class="wp-block-heading">Solution</h5>



<p>First access screen:</p>



<pre class="brush: plain; gutter: false; first-line: 1">screen /dev/ttyUSB0 115200</pre>



<p>Press “challenge 1 button” to load values into memory.<br>Press and hold &#8220;boot&#8221; button, then press “reset” button.<br>Dump the memory with the following:</p>



<pre class="brush: plain; gutter: false; first-line: 1">$&gt; pyocd commander
0004169:WARNING:board:Generic &#039;cortex_m&#039; target type is selected; 
is this intentional? You will be able to debug but not program flash. 
To set the target type use the &#039;--target&#039; argument or &#039;target_override&#039; option. 
Use &#039;pyocd list --targets&#039; to see available targets types.
Connected to CoreSightTarget [Halted]: 39002200172D343632525544
&gt;&gt;&gt; savemem 0x20000000 20480 sram.dump
Saved 20480 bytes to sram.dump
&gt;&gt;&gt; 
$&gt; strings sram.dump | grep &#039;ctf&#039;
ctf{1139BE4A97D2172E6E39B71EFAD4B30648}</pre>



<h4 class="wp-block-heading">Challenge 2</h4>



<p>In this chall, the flag is protected by a check that is never false:</p>



<pre class="brush: cpp; gutter: false; first-line: 1">   volatile bool check = true;
  uint32_t cnt = 0;
  int i = 0;
  int j;

  while (true) {
    cnt = 0;
    for (i = 0; i &lt; 1000; i++) {
      for (j = 0; j &lt; 1000; j++) {
        cnt++;
        if (!check) {
          // Flag gets printed
        }
      }
    }
    uart_printf(&quot;%u %u %u\r\n&quot;, i, j, cnt);
  }

</pre>



<h5 class="wp-block-heading">Setup</h5>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-3.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="1024" height="740" data-attachment-id="1949" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-14/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-3.png" data-orig-size="1371,991" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-3-300x217.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-3-1024x740.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-3-1024x740.png" alt="" class="wp-image-1949" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-3-1024x740.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-3-300x217.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-3-768x555.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-3-415x300.png 415w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-3.png 1371w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p></p>



<h5 class="wp-block-heading">Notes</h5>



<p>This seems to be the &#8220;hello world&#8221; of hardware glitching. Having done this a few times now I decided to write a small script to automate it. I called it &#8220;glitch-o-matic&#8221; (it can be found in the github repo) however when running it it couldn&#8217;t get a working glitch! Advice in the &#8220;curious supplies&#8221; discord was to bend the wires or try different wires, perhaps hold the button as that causes a little power draw. That was the solution for me. Wanting to understand what was going on out came the scope:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-4.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="800" height="480" data-attachment-id="1952" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-15/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-4.png" data-orig-size="800,480" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-4-300x180.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-4.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-4.png" alt="" class="wp-image-1952" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-4.png 800w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-4-300x180.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-4-768x461.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-4-500x300.png 500w" sizes="auto, (max-width: 800px) 100vw, 800px" /></a></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-5.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="800" height="480" data-attachment-id="1953" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-16/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-5.png" data-orig-size="800,480" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-5-300x180.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-5.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-5.png" alt="" class="wp-image-1953" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-5.png 800w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-5-300x180.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-5-768x461.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-5-500x300.png 500w" sizes="auto, (max-width: 800px) 100vw, 800px" /></a></figure>
</div>


<p>(Top) Not holding the button, (Bottom) Holding the button.</p>



<p>The difference is minimal, but when holding the button the power is off for slightly less time.<br>Now when holding the button and starting the glitch-o-matic:</p>



<pre class="brush: plain; gutter: false; first-line: 1">   ___ _ _ _      _                          _   _    
  / __| (_) |_ __| |_ ___ ___ ___ _ __  __ _| |_(_)__ 
 | (_ | | |  _/ _| &#039; \___/ _ \___| &#039;  \/ _` |  _| / _|
  \___|_|_|\__\__|_||_|  \___/   |_|_|_\__,_|\__|_\__|
╒══════════════╤═══════════╤═════════╤════════════════╕
│ Glitch Len   │ Repeats   │ Delay   │ Elapsed Time   │
╞══════════════╪═══════════╪═════════╪════════════════╡
│ 41 / 43      │ 9 / 30    │ 0 / 30  │ 0d 0h 2m 21s   │
╘══════════════╧═══════════╧═════════╧════════════════╛
[INFO] Received data: 1000 1000 1000000
[INFO] Received data: 1000 1000 1000000
[INFO] Received data: 1000 1000 1000000
[INFO] Received data: 1000 1000 1000000
[INFO] Received data: 1000 1000 1000000
[INFO] Received data: Unreachable point reached, proceeding to print flag:
[INFO] Incrementing trigger repeats: 9
[INFO] Received data: ctf{6F48C055674E751B4A444A3328C00C93DB}
[INFO] Flag: ctf{6F48C055674E751B4A444A3328C00C93DB}
[WARNING] Received &#039;ctf&#039;, exiting...
</pre>



<h5 class="wp-block-heading">Interlude</h5>



<p>The script worked so well it was at this point I decided I would write another script to make using the curious bolt and performing glitching attacks in the future easier, so I came up with a quick design doc:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-6.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="987" height="997" data-attachment-id="1954" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-17/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-6.png" data-orig-size="987,997" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-6-297x300.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-6.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-6.png" alt="" class="wp-image-1954" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-6.png 987w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-6-297x300.png 297w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-6-768x776.png 768w" sizes="auto, (max-width: 987px) 100vw, 987px" /></a></figure>
</div>


<p>I know, that looks crazy useful! so I made it! you can get it here: <a href="https://rossmarks.uk/git/0xRoM/glitch-o-bolt">https://rossmarks.uk/git/0xRoM/glitch-o-bolt</a>. the main idea being you create a config file to define how you want the program to run, the offests for values, the trigger settings, what words to watch for and actions to perform when those words are seen. </p>



<p>Once I had created this it was time for the next challenge, using the next couple of challenges to help refine the app.</p>



<h4 class="wp-block-heading">Challenge 3</h4>



<p>In this challenge, the flag gets printed only when certain bits in external EEPROM memory are cleared (equal to 0).</p>



<p>Simply changing the bits on the EEPROM chip does not work, as an integrity check ensures that data on the chip has not been modified.</p>



<h5 class="wp-block-heading">Setup</h5>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-7.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="1024" height="726" data-attachment-id="1955" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-18/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-7.png" data-orig-size="1404,996" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-7-300x213.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-7-1024x726.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-7-1024x726.png" alt="" class="wp-image-1955" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-7-1024x726.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-7-300x213.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-7-768x545.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-7-423x300.png 423w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-7.png 1404w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p></p>



<p>A quick overview of this: The green wire is using the RX line (which is always high) to push the challenge button so even if the device is glitched to reset it auto starts the correct challenge.<br>The orange line Also goes from the RX to the bolt&#8217;s glitching pin, the purple wire also on that line goes to an input pin on the bolt to monitor it.<br>The SDA pins on the challenge board are also wired up to the input pins on the bolt for monitoring.</p>



<h5 class="wp-block-heading">Notes</h5>



<p>It is now possible to use pulseview to see the SDA data and the glitching line. (This will not work on a raspberry pi which at time of writing has an older version of pulseview that doesnt have the correct &#8220;SUMP compatible&#8221; driver). By setting the SDA line as a falling edge trigger, when the line drops at X time offset perform a glitch for Y duration. This can be monitored in pulseview. The following screenshot demonstrates that with pulsview on top and glitch-o-bolt underneath reading the UART output.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-8.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="1024" height="643" data-attachment-id="1956" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-19/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-8.png" data-orig-size="2093,1315" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-8-300x188.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-8-1024x643.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-8-1024x643.png" alt="" class="wp-image-1956" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-8-1024x643.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-8-300x188.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-8-768x483.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-8-1536x965.png 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-8-2048x1287.png 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-8-477x300.png 477w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>I Used the following to work out the timings and offsets:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-17.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="1024" height="644" data-attachment-id="1975" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-28/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-17.png" data-orig-size="2082,1310" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-17-300x189.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-17-1024x644.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-17-1024x644.png" alt="" class="wp-image-1975" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-17-1024x644.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-17-300x189.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-17-768x483.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-17-1536x966.png 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-17-2048x1289.png 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-17-477x300.png 477w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>Once the offset and duration have been identified rewire it to drop the SDA line instead of the power, which was only in use for something visual to use.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-9.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="1024" height="766" data-attachment-id="1957" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-20/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-9.png" data-orig-size="1337,1000" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-9-300x224.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-9-1024x766.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-9-1024x766.png" alt="" class="wp-image-1957" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-9-1024x766.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-9-300x224.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-9-768x574.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-9-401x300.png 401w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-9.png 1337w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>Then run the glitch as demonstrated below. <br>The top pulseview was from when the power was still wired to glitch, the glitch-o-bolt was run after re-wiring the glitch pin to SDA on the challenge device.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-10.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="1024" height="643" data-attachment-id="1958" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-21/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-10.png" data-orig-size="2160,1356" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-10-300x188.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-10-1024x643.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-10-1024x643.png" alt="" class="wp-image-1958" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-10-1024x643.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-10-300x188.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-10-768x482.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-10-1536x964.png 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-10-2048x1286.png 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-10-478x300.png 478w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p></p>



<h4 class="wp-block-heading">Challenge 4</h4>



<p>In this challenge, the flag is printed by a function that never gets called. Readout protection (RDP) is active, meaning the flash content can’t be dumped, even from JTAG/SWD, the bootloader, or when booted from SRAM.</p>



<h5 class="wp-block-heading">Setup</h5>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-12.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="1024" height="744" data-attachment-id="1961" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-23/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-12.png" data-orig-size="1318,957" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-12-300x218.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-12-1024x744.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-12-1024x744.png" alt="" class="wp-image-1961" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-12-1024x744.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-12-300x218.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-12-768x558.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-12-413x300.png 413w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-12.png 1318w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p></p>



<h5 class="wp-block-heading">Part 1 &#8211; Pulling the firmware</h5>



<p>To pull the firmware we have to use a recently published attack that uses a vulnerability to enable flash access from SRAM-booted code, and then jump into the flag printing function.</p>



<p>This sounds more complicated than it is!</p>



<p>Download the PoC from: <a href="https://github.com/JohannesObermaier/f103-analysis/tree/master/h3">https://github.com/JohannesObermaier/f103-analysis/tree/master/h3</a> This contains the precompiled exploit we want to put into SRAM (rootshell/shellcode.bin)</p>



<p>Use the trick from challenge 1 to upload the PoC shellcode into RAM using pyocd. (&gt;&gt;&gt;load shellcode.bin 0x20000000) Then do a single power glitch to reset, whilst holding BOOT0 and BOOT1 to boot from SRAM.</p>



<p>Connect to the device&#8217;s UART port with BAUD 9600. Once connected push &#8220;d&#8221; to dump the flash contents. I used the logging feature of glitch-o-bolt to to write this to a file. (Chall-4_UART.log in the git repo)</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_dump.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="1024" height="492" data-attachment-id="1962" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/bolt_glitch_chall4_dump/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_dump.png" data-orig-size="2151,1034" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="bolt_glitch_chall4_dump" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_dump-300x144.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_dump-1024x492.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_dump-1024x492.png" alt="" class="wp-image-1962" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_dump-1024x492.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_dump-300x144.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_dump-768x369.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_dump-1536x738.png 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_dump-2048x984.png 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_dump-500x240.png 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p></p>



<h5 class="wp-block-heading">Part 2 &#8211; Reversing the firmware</h5>



<p>I wrote a small script to tidy this log file (tidy_log.py). Open the output of this in ghidra, find all of the strings to work out the function we want to call, take note of it&#8217;s memory address.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-13.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="1024" height="575" data-attachment-id="1963" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-24/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-13.png" data-orig-size="1759,987" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-13-300x168.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-13-1024x575.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-13-1024x575.png" alt="" class="wp-image-1963" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-13-1024x575.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-13-300x168.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-13-768x431.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-13-1536x862.png 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-13-500x281.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-13.png 1759w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p></p>



<p>ARM CPUs can operate in two instruction sets:</p>



<ul class="wp-block-list">
<li>ARM mode: 32-bit instructions</li>



<li>Thumb mode: 16-bit instructions (smaller, more efficient)</li>
</ul>



<p>The Cortex-M3 in STM32F103 only supports Thumb mode, not full ARM mode.</p>



<p>Ghidra reverses in ARM mode, So the address needs to be converted into thumb mode which the device runs.</p>



<p>To get the actual thumb address, you simply clear bit 0. <br>If:<br>&#8211; <strong>ARM address</strong> = 0x08000BA8<br>Then:<br>&#8211; <strong>Thumb address</strong> = 0x08000BA9 (bit 0 cleared)</p>



<p>Now simply patch in some code to the previously used exploit to jump to this memory address. The device still runs on baud rate 115200 so I would recommend adding a delay to give yourself time to switch to the different speed.</p>



<p>The code I used to patch was:</p>



<pre class="brush: cpp; gutter: false; first-line: 1">void readCmd( uint8_t const * const cmd )
{
	void (*chall4)(void) = (void (*)(void))0x08000ba9;
	switch (cmd[0])
	{
		case 0:
			return;
			break;

		/* chall4 function */
		case &#039;p&#039;:
		case &#039;P&#039;:
			writeStr(&quot;time to change baudrate to 115200\r\n&quot;);
			for (volatile uint32_t i = 0; i &lt; 5000000; i++);  // Crude delay
			chall4();
			break;
</pre>



<p>My firmware with patches is in the git in the &#8220;Chall-4-Firmware&#8221; folder. It also has the compiled version &#8220;Shellcode-0xRoM.bin&#8221; if you just want to use that.</p>



<h5 class="wp-block-heading">Part 3 &#8211; Upload and run</h5>



<p>With the new firmware compiled, follow the same steps as &#8220;Part 1&#8221; to get it running on the device and press the &#8220;p&#8221; key to pwn. Naturally I created a config for glitch-o-bolt to make this simpler, with steps to follow and guide the process. It ended up looking like:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_solved.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="1024" height="474" data-attachment-id="1965" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/bolt_glitch_chall4_solved/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_solved.png" data-orig-size="2160,1000" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="bolt_glitch_chall4_solved" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_solved-300x139.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_solved-1024x474.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_solved-1024x474.png" alt="" class="wp-image-1965" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_solved-1024x474.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_solved-300x139.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_solved-768x356.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_solved-1536x711.png 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_solved-2048x948.png 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/bolt_glitch_chall4_solved-500x231.png 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p></p>



<h4 class="wp-block-heading">Extras</h4>



<p>Wanting people to use glitch-o-bolt I created some more configs to demonstrate it&#8217;s use. The first one I made was one to solve &#8220;Challenge 2&#8221; to bruteforce the offsets:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-15.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="1024" height="460" data-attachment-id="1968" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-26/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-15.png" data-orig-size="1186,533" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-15-300x135.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-15-1024x460.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-15-1024x460.png" alt="" class="wp-image-1968" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-15-1024x460.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-15-300x135.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-15-768x345.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-15-500x225.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-15.png 1186w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p></p>



<p>The next one was to brute force the baud rate for unknown UART terminals:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-16.png" rel="lightbox[1941]"><img loading="lazy" decoding="async" width="539" height="538" data-attachment-id="1969" data-permalink="https://rossmarks.uk/blog/curious-bolt-ctf-level-1/image-27/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-16.png" data-orig-size="539,538" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-16-300x300.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-16.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-16.png" alt="" class="wp-image-1969" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-16.png 539w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-16-300x300.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-16-150x150.png 150w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/05/image-16-301x300.png 301w" sizes="auto, (max-width: 539px) 100vw, 539px" /></a></figure>
</div>


<p></p>



<h4 class="wp-block-heading">Conclusion</h4>



<p>The curious bolt is an incredibly useful tool, and I&#8217;ve certainly got the glitching bug. It&#8217;s so much fun! and the challenge board to learn how to use it was a great tool to learn just that. I would 100% recommend this kit to anyone interested in hardware hacking that wants to take the next step into voltage glitching.</p>



<p>Massive thank you to Aleph, for motivating me and helping. Also thanks to Tom for creating this and being patient answering my dumb questions, if anyone else does this I recommend joining the &#8220;curious supplies&#8221; discord as theres lots of help and tips there.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rossmarks.uk/blog/curious-bolt-ctf-level-1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1941</post-id>	</item>
		<item>
		<title>Critically Insecure Router</title>
		<link>https://rossmarks.uk/blog/critically-insecure-router/</link>
					<comments>https://rossmarks.uk/blog/critically-insecure-router/#respond</comments>
		
		<dc:creator><![CDATA[Ross Marks]]></dc:creator>
		<pubDate>Sun, 16 Mar 2025 11:34:12 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">https://rossmarks.uk/blog/?p=1926</guid>

					<description><![CDATA[I wanted to create a hardware pentesting sample report so when clients ask for a sample report I&#8217;m not giving them a web app one and saying &#8220;It&#8217;s like this but different&#8221;. I knew a cheap router from china would &#8230; <a href="https://rossmarks.uk/blog/critically-insecure-router/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p>I wanted to create a hardware pentesting sample report so when clients ask for a sample report I&#8217;m not giving them a web app one and saying &#8220;It&#8217;s like this but different&#8221;. I knew a cheap router from china would likely be insecure and make for a good report, I didn&#8217;t expect just how bad it would be! I bought the following router:</p>



<figure class="wp-block-image size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/aliexpress_listing.png" rel="lightbox[1926]"><img loading="lazy" decoding="async" width="1024" height="424" data-attachment-id="1927" data-permalink="https://rossmarks.uk/blog/critically-insecure-router/aliexpress_listing/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/aliexpress_listing.png" data-orig-size="1270,526" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="aliexpress_listing" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/aliexpress_listing-300x124.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/aliexpress_listing-1024x424.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/aliexpress_listing-1024x424.png" alt="" class="wp-image-1927" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/aliexpress_listing-1024x424.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/aliexpress_listing-300x124.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/aliexpress_listing-768x318.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/aliexpress_listing-500x207.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/aliexpress_listing.png 1270w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>A £6 router! how is that even possible! Anyway, lets get started:</p>



<h3 class="wp-block-heading"><strong>Stage 1: Preparing for Testing</strong></h3>



<p>Before any testing began, the device was examined to confirm it was functioning properly. Network activity was monitored using packet sniffing tools to detect any automatic firmware downloads or suspicious traffic. No unauthorised downloads were detected, suggesting a reasonable initial defence against remote attacks.</p>



<h3 class="wp-block-heading"><strong>Stage 2: Physical Examination</strong></h3>



<p>The device was opened to inspect its internal components. This revealed various chips and debug interfaces that were crucial for deeper analysis. However, the chips had no identifying markings, making it impossible to find datasheets at this stage. Additionally, there was no FCC ID, which further limited available information on the components.</p>



<figure class="wp-block-image size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/pcb_in_case_close-scaled.jpg" rel="lightbox[1926]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="1928" data-permalink="https://rossmarks.uk/blog/critically-insecure-router/pcb_in_case_close/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/pcb_in_case_close-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1732274642&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;320&quot;,&quot;shutter_speed&quot;:&quot;0.02&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="pcb_in_case_close" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/pcb_in_case_close-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/pcb_in_case_close-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/pcb_in_case_close-1024x461.jpg" alt="" class="wp-image-1928" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/pcb_in_case_close-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/pcb_in_case_close-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/pcb_in_case_close-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/pcb_in_case_close-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/pcb_in_case_close-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/pcb_in_case_close-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p></p>



<h3 class="wp-block-heading"><strong>Stage 3: Accessing the Debug Console</strong></h3>



<p>Attention was turned to the RS232 debug port (top right of previous image). By connecting to this port, access was gained to the device’s debug console. This provided valuable insights into its operations and capabilities, revealing potential areas for further testing.</p>



<h3 class="wp-block-heading"><strong>Stage 4: Extracting and Modifying Firmware</strong></h3>



<p>Attempts to access the flash chip’s contents using an inline clip were unsuccessful. The chip was removed from the PCB, and a socket was installed to enable quick removal and replacement for debugging.</p>



<figure class="wp-block-image size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/20250306_062418-scaled.jpg" rel="lightbox[1926]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="1929" data-permalink="https://rossmarks.uk/blog/critically-insecure-router/20250306_062418/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/20250306_062418-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1741242258&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;500&quot;,&quot;shutter_speed&quot;:&quot;0.02&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="20250306_062418" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/20250306_062418-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/20250306_062418-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/20250306_062418-1024x461.jpg" alt="" class="wp-image-1929" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/20250306_062418-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/20250306_062418-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/20250306_062418-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/20250306_062418-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/20250306_062418-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/20250306_062418-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p></p>



<h3 class="wp-block-heading"><strong>Stage 5: Iterative Testing Process</strong></h3>



<p>The testing process was not strictly linear, previous steps were revisited based on new findings. Each discovery influenced the next phase of testing, ensuring a thorough evaluation of the device’s security.</p>



<h3 class="wp-block-heading"><strong>Stage 6: Modifying and Re-Flashing the Firmware</strong></h3>



<p>In one of the final steps, the extracted firmware and bootloader were modified before being re-flashed onto the chip. This confirmed that unauthorised firmware changes were possible, posing a serious security risk. This test was performed last due to the high chance of bricking the device, which could have prevented further testing.</p>



<h2 class="wp-block-heading">Issues Identified</h2>



<p>The most likely aspect to be looked at by an attacker is the web interface as this would typically be the place an attacker has easy access to. The first thing I did after logging in was set the password to a single letter, yup could still log in with that so there is clearly no password policy. I then set it to &#8220;test&#8221;:</p>



<figure class="wp-block-image size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/Screenshot-2025-02-13-104642.png" rel="lightbox[1926]"><img loading="lazy" decoding="async" width="1024" height="413" data-attachment-id="1930" data-permalink="https://rossmarks.uk/blog/critically-insecure-router/screenshot-2025-02-13-104642/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/Screenshot-2025-02-13-104642.png" data-orig-size="1093,441" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screenshot 2025-02-13 104642" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/Screenshot-2025-02-13-104642-300x121.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/Screenshot-2025-02-13-104642-1024x413.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/Screenshot-2025-02-13-104642-1024x413.png" alt="" class="wp-image-1930" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/Screenshot-2025-02-13-104642-1024x413.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/Screenshot-2025-02-13-104642-300x121.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/Screenshot-2025-02-13-104642-768x310.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/Screenshot-2025-02-13-104642-500x202.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/03/Screenshot-2025-02-13-104642.png 1093w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Of course theres no brute-force protection. Even worse, I could just browse to /wizard.html and there was no session checking whatsoever! as long as you know the endpoint you can browse to it and change the routers settings unauthorized. The &#8220;logout&#8221; button simply redirects to &#8220;index.html&#8221; which contains the login form.</p>



<p>It is worth mentioning here that along with the terribly coded/modified files the developer intended you to use to configure the device, lots of old files (oldbakhome.htm, countDownPage_old.htm) and Realtek default debug files and scripts were left on the device and were accessible and usable. Some of these disclosed the development environment used and paths on the dev&#8217;s computers. The device logs all wireless access points in the vicinity and devices that have connected to it including the mac address and device name. It appears these logs have not been wiped before manufacture and include developer devices used when creating and testing this router:</p>



<pre class="brush: plain; gutter: false; first-line: 1">{
	&quot;idx&quot;:	&quot;1&quot;,
	&quot;ip&quot;:	&quot;192.168.0.19&quot;,
	&quot;mac&quot;:	&quot;D6:6D:0F:7D:1C:FA&quot;,
	&quot;type&quot;:	&quot;2&quot;,
	&quot;linkType&quot;:	&quot;white&quot;,
	&quot;osType&quot;:	&quot;2&quot;,
	&quot;name&quot;:	&quot;dongcaikiiPhone&quot;
}, {
	&quot;idx&quot;:	&quot;2&quot;,
	&quot;ip&quot;:	&quot;192.168.0.7&quot;,
	&quot;mac&quot;:	&quot;34:12:F9:72:6A:EA&quot;,
	&quot;type&quot;:	&quot;2&quot;,
	&quot;linkType&quot;:	&quot;white&quot;,
	&quot;osType&quot;:	&quot;1&quot;,
	&quot;name&quot;:	&quot;Honor_10_Lite-648f73255de&quot;
}, {
	&quot;idx&quot;:	&quot;3&quot;,
	&quot;ip&quot;:	&quot;192.168.0.10&quot;,
	&quot;mac&quot;:	&quot;A8:9C:ED:9A:1F:10&quot;,
	&quot;type&quot;:	&quot;2&quot;,
	&quot;linkType&quot;:	&quot;white&quot;,
	&quot;osType&quot;:	&quot;1&quot;,
	&quot;name&quot;:	&quot;MI9-winnie&quot;
}</pre>



<p>If you did want to know the password (perhaps the admin is using it elsewhere on the network) then use the &#8220;backup settings&#8221; feature to read it in plaintext. As demonstrated below you can clearly see the admin username of &#8220;admin&#8221; and the password of &#8220;SuperSecretPassword&#8221;:</p>



<pre class="brush: plain; gutter: false; first-line: 1">$&gt; curl http://192.168.168.1/config.dat | head
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
COMPCS%��6g03��������������   0      0      0 --:--:-- --:--:-- --:--:--     0
�����d������w
100  9721 �$
�_�O��-Rd����00G/d
e��;fg?�j��j|admin����SuperSecretPassword�  ���
0kW��`/#/5/G/
  �O��w/�/�/�/�/�/Z#�f/�/? ?2D?V?Z#��/�?�?�?�?�?�?Z#�p?O▒O *O&lt;ONO`OZ#��?�O@�O�O�O�O�OZ#�zO�_&quot;_4_F_X_j_Z#�k]
 ��TU��T��T��T��T���Q.    
�T��T�T�T�T��R��T        �T
97��T
     �T
�R��T�T�T�T��T�T��R�a!窄R�a!��R�a!���R��R��R�)�p_�oZ#��o�oX%
�x�o�o/z|8|�ZQ,��R�-���R��v��R�-il,m�O�O���O��]�?��?��0�*�&lt;�N�`�r���
21��O�����Џ�����/��Q�K�sLM�@A&lt;�N�`�
USz�Tz�U��W���V x�j�����$��O.x��O.y�p��R�O.wzZ#{=��] |

                                                      S*}~▒�~30▒��1490W�O���▒O��O0 1�/�@0.��.▒�׿��
 ���ƿ▒�&lt;,�</pre>



<p>Speaking of hardcoded passwords they were everywhere. After pulling the unencrypted firmware from the flash chip, it was easy to find JSON files containing credentials, shadow files, private keys, smbpassword file, etc. the hardcoded web app login password and wireless password were on a sicker on the router&#8217;s case. Not that you needed a password for access.</p>



<p>The router had telnet enabled by default. When trying to login with an non-existing username it asked for a password, however when trying to log in as root:</p>



<pre class="brush: plain; gutter: false; first-line: 1">$&gt; telnet 192.168.168.1 23
Trying 192.168.168.1...
Connected to 192.168.168.1.
Escape character is &#039;^]&#039;.

rlx-linux login: admin
Password: 
Login incorrect
rlx-linux login: root
RLX Linux version 2.0
         _           _  _
        | |         | ||_|                 
   _  _ | | _  _    | | _ ____  _   _  _  _ 
  | |/ || |\ \/ /   | || |  _ \| | | |\ \/ /
  | |_/ | |/    \   | || | | | | |_| |/    \
  |_|   |_|\_/\_/   |_||_|_| |_|\____|\_/\_/

For further information check:
http://processor.realtek.com/
# ls
bin   etc   init  mnt   root  tmp   var
dev   home  lib   proc  sys   usr   web</pre>



<p>That is root access without a password enabled by default!</p>



<p>I then tried to modify the firmware and flash it back onto the chip, suprisingly there was a signature checksum that was failing since the firmware had changed, so I attempted to change the bootloader. This was possible however I didnt have time to work out how to either &#8220;NOP-out&#8221; the checksum comparison or work out how to generate a new checksum and put that into the bootloader. By default reading the output from UART the device responds:</p>



<pre class="brush: plain; gutter: false; first-line: 1">Booting...
init_ram

M init ddr ok
DRAM Type: DDR2
	DRAM frequency: 533MHz
	DRAM Size: 128MB
JEDEC id C84017, EXT id 0xc840
found gd25q64
flash vendor: GigaDevice
gd25q64, size=8MB, erasesize=4KB, max_speed_hz=41000000Hz
auto_mode=0 addr_width=3 erase_opcode=0x00000020
=&gt;CPU Wake-up interrupt happen! GISR=89000004 
---Realtek RTL8197F boot code at 2019.04.24-03:30-0700 v3.4.11d-CMCC-pre5 (999MHz)

no sys signature at 00010000!
no sys signature at 00020000!
Jump to image start=0x80a00000...
decompressing kernel:
Uncompressing Linux... done, booting the kernel.</pre>



<p>The text “Pwned by Ross Marks” was modified from the original text “Realtek RTL8197F” in the following UART output by modifying the bootloader and flashing it onto the chip:</p>



<pre class="brush: plain; gutter: false; first-line: 1">Booting...
init_ram
M init ddr ok

DRAM Type: DDR2
        DRAM frequency: 533MHz
        DRAM Size: 128MB
JEDEC id C84017, EXT id 0xc840
found gd25q64
flash vendor: GigaDevice
gd25q64, size=8MB, erasesize=4KB, max_speed_hz=41000000Hz
auto_mode=0 addr_width=3 erase_opcode=0x00000020
=&gt;CPU Wake-up interrupt happen! GISR=89000004 
 
---- Pwned by Ross Marks ---- at 2019.04.24-03:30-0700 v3.4.11d-CMCC-pre5 (999MHz)
no sys signature at 00010000!
no sys signature at 00020000!
Jump to image start=0x80a00000...
decompressing kernel:
Uncompressing Linux... done, booting the kernel.</pre>



<h2 class="wp-block-heading"><strong>Challenges in Reporting the Vulnerabilities</strong></h2>



<p>One of the difficulties I encountered was the inability to obtain any CVE&#8217;s for the security issues I discovered. Normally, CVEs are assigned to known manufacturers and vendors, providing a way to track and address vulnerabilities. However, in this case, I was unable to identify a manufacturer for the device, making it impossible to report these issues through official channels. Without a clear vendor, there is no established process to ensure these flaws are acknowledged or patched, leaving the device vulnerable to exploitation with no accountability.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>The device is not suitable for use and presents a major security risk. The number and severity of the issues mean that it cannot be trusted to protect sensitive information or maintain secure operations. Any organization or individual using this device would be exposing themselves to significant dangers, including data theft, system compromise, or even full control of the device by an attacker. Without urgent fixes, using the device in any professional or critical setting would be highly irresponsible, as it could easily be exploited.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rossmarks.uk/blog/critically-insecure-router/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1926</post-id>	</item>
		<item>
		<title>Side Channel Timing Attack</title>
		<link>https://rossmarks.uk/blog/side-channel-timing-attack/</link>
					<comments>https://rossmarks.uk/blog/side-channel-timing-attack/#respond</comments>
		
		<dc:creator><![CDATA[Ross Marks]]></dc:creator>
		<pubDate>Tue, 11 Feb 2025 10:19:07 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://rossmarks.uk/blog/?p=1915</guid>

					<description><![CDATA[I decided to have a play with some side channel analysis attacks, What seemed like the easiest to attempt is a timing attack, so here is my findings. All the code for this is available at https://rossmarks.uk/git/0xRoM/Hardware in the &#8220;/SideChannel/ATtiny85_Timing_Attack&#8221; &#8230; <a href="https://rossmarks.uk/blog/side-channel-timing-attack/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p>I decided to have a play with some side channel analysis attacks, What seemed like the easiest to attempt is a timing attack, so here is my findings.</p>



<p>All the code for this is available at <a href="https://rossmarks.uk/git/0xRoM/Hardware">https://rossmarks.uk/git/0xRoM/Hardware</a> in the &#8220;/SideChannel/ATtiny85_Timing_Attack&#8221; directory.</p>



<h2 class="wp-block-heading">Setup</h2>



<p>To start with I&#8217;m going to use the trusty ATtiny85, it&#8217;s easy to program and so cheap it doesn&#8217;t matter if I accidentally break one.</p>



<p>I wired it up like so:</p>



<figure class="wp-block-image size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/fritzing.jpg" rel="lightbox[1915]"><img loading="lazy" decoding="async" width="1024" height="577" data-attachment-id="1916" data-permalink="https://rossmarks.uk/blog/side-channel-timing-attack/fritzing/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/fritzing.jpg" data-orig-size="1238,697" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="fritzing" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/fritzing-300x169.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/fritzing-1024x577.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/fritzing-1024x577.jpg" alt="fritzing schematic" class="wp-image-1916" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/fritzing-1024x577.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/fritzing-300x169.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/fritzing-768x432.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/fritzing-500x282.jpg 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/fritzing.jpg 1238w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Walking through this. on the left of the breadboard is the ATtiny85. The wires that go off to the left are TX and RX for UART / serial debugging. To the Right of the ATtiny85 we have 4 buttons for input and right of those we have 2 LED&#8217;s (1 red and 1 green) for output.</p>



<p>Controlling the LED&#8217;s from 1 pin: <a href="https://www.batsocks.co.uk/readme/p_tut_led16.htm">https://www.batsocks.co.uk/readme/p_tut_led16.htm</a><br>Controlling the buttons from 1 pin: <a href="https://www.instructables.com/How-to-Multiple-Buttons-on-1-Analog-Pin-Arduino-Tu/">https://www.instructables.com/How-to-Multiple-Buttons-on-1-Analog-Pin-Arduino-Tu/</a></p>



<p>When it&#8217;s all put together it looked like:</p>



<figure class="wp-block-image size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/breadboard-scaled.jpg" rel="lightbox[1915]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="1919" data-permalink="https://rossmarks.uk/blog/side-channel-timing-attack/breadboard-2/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/breadboard-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1739268481&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;500&quot;,&quot;shutter_speed&quot;:&quot;0.03030303030303&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="breadboard" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/breadboard-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/breadboard-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/breadboard-1024x461.jpg" alt="breadboarded" class="wp-image-1919" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/breadboard-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/breadboard-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/breadboard-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/breadboard-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/breadboard-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2025/02/breadboard-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p> </p>



<h2 class="wp-block-heading">Experiment 1 &#8211; Simple PIN</h2>



<p>First I flashed the code “4_digit.ino” into the ATtiny85 which is very simple.<br>It has a hardcoded 4 digit pin. the user can either push a button (1 to 4) or type over serial the corresponding number. Once 4 digits have been entered it checks each digit one at a time. As soon as a digit it incorrect it exits the checking loop and lights up the red “incorrect” LED. otherwise if the loop completes the green LED flashes.</p>



<p>The pseudocode looks something like:</p>



<pre class="brush: plain; gutter: false; first-line: 1">function checkLogin(input)
	for (n: 1 -&gt; 4)
		if (secret_code[n] != input[n])
			return false
			
	return true;</pre>



<p>The side channel we are monitoring is the time between correct and incorrect passwords.<br>Since the loop is checking each character one at a time as soon as it reaches an incorrect character it exits. This means that an incorrect password will have a quicker response time than a correct one.</p>



<p>If the password is “2323” and we test &#8220;1111&#8221; the program will see the first 1 and exit &#8211; wow that was quick.<br>We then test “2222”, the program checks the first digit (it&#8217;s correct) then checks the second digit (it&#8217;s incorrect) and exits.<br>since that second operation had an additional check it would take a little bit longer we can then infer that the correct first digit is 2.<br>we can then go on to test “2111”, “2222”, “2333” and “2444”, whichever took the longest of these we then have the correct second digit, and so on until we have the entire password.</p>



<p>While it would be possible to wire a device up to each of the buttons and the LED&#8217;s and write some code to manually simulate the button presses and monitor the LED&#8217;s power it was much easier to interact with the serial console as it works just the same.</p>



<p>I then created “4_digit_attack.py” which worked briliantly. It tries the same password X amount of times (default 3) and gets the average response time for that pin before trying the next, this gives a more accurate reading as it takes into account fluctuations in timings.</p>



<p>This worked brilliantly.. so on to the next experiment:</p>



<h2 class="wp-block-heading">Experiment 2 &#8211; Unknown PIN</h2>



<p>As the title suggests I then wanted to make it so I didn&#8217;t know the PIN. For this experiment use the code:<br>multi_digit.ino &#8211; ATtiny85 program.<br>multi_digit_attack.py &#8211; Attacking script.</p>



<p>The main difference here is when the ATtiny85 first boots it generates a PIN with a random length between 4 and 8 digits long.</p>



<p>Running the attacking script I got the following results:</p>




<pre class="brush: plain; gutter: false; first-line: 1">/tmp# python3 multi_digit_attack.py 5
########################################################
# Attempts: 3  -    Delay: 0.8            
# Maximum possible attempts: 60            
# Estimated maximum time: 100.25 seconds 
########################################################
Started at 2025-02-09 00:02:14
Starting sequence identification on port /dev/ttyUSB0 with PIN length 5...
11111 average: 0.0201 seconds - failed, Response Time: 0.0210 seconds
22222 average: 0.0199 seconds - failed, Response Time: 0.0199 seconds
33333 average: 0.0248 seconds - failed, Response Time: 0.0250 seconds
44444 average: 0.0150 seconds - failed, Response Time: 0.0200 seconds
Best digit for position 1: 3 (Average response time: 0.0248 seconds)
31111 average: 0.0256 seconds - failed, Response Time: 0.0255 seconds
32222 average: 0.0301 seconds - failed, Response Time: 0.0298 seconds
33333 average: 0.0253 seconds - failed, Response Time: 0.0260 seconds
34444 average: 0.0260 seconds - failed, Response Time: 0.0253 seconds
Best digit for position 2: 2 (Average response time: 0.0301 seconds)
32111 average: 0.0309 seconds - failed, Response Time: 0.0311 seconds
32222 average: 0.0312 seconds - failed, Response Time: 0.0313 seconds
32333 average: 0.0306 seconds - failed, Response Time: 0.0317 seconds
32444 average: 0.0409 seconds - failed, Response Time: 0.0401 seconds
Best digit for position 3: 4 (Average response time: 0.0409 seconds)
32411 average: 0.0363 seconds - failed, Response Time: 0.0365 seconds
32422 average: 0.0258 seconds - failed, Response Time: 0.0365 seconds
32433 average: 0.0361 seconds - failed, Response Time: 0.0363 seconds
32444 average: 0.0405 seconds - failed, Response Time: 0.0411 seconds
Best digit for position 4: 4 (Average response time: 0.0405 seconds)
32441 average: 0.0416 seconds - failed, Response Time: 0.0412 seconds
32442 average: 0.0412 seconds - failed, Response Time: 0.0415 seconds
32443 average: 0.0474 seconds - correct, Response Time: 0.0478 seconds
32444 average: 0.0409 seconds - failed, Response Time: 0.0401 seconds
Best digit for position 5: 3 (Average response time: 0.0474 seconds)
########################################################
# Identified sequence: 32443
########################################################
Finished at 2025-02-09 00:09:22
Total execution time: 7m 7s</pre>




<p>When the device generated a longer pin:</p>




<pre class="brush: plain; gutter: false; first-line: 1">/tmp# python3 multi_digit_attack.py 8
########################################################
# Attempts: 3  -    Delay: 0.8            
# Maximum possible attempts: 96            
# Estimated maximum time: 161.60 seconds 
########################################################
Started at 2025-02-09 10:37:40
Starting sequence identification on port /dev/ttyUSB0 with PIN length 8...
11111111 average: 0.0182 seconds - failed, Response Time: 0.0183 seconds
22222222 average: 0.0174 seconds - failed, Response Time: 0.0169 seconds
33333333 average: 0.0281 seconds - failed, Response Time: 0.0285 seconds
44444444 average: 0.0183 seconds - failed, Response Time: 0.0183 seconds
Best digit for position 1: 3 (Average response time: 0.0281 seconds)
31111111 average: 0.0273 seconds - failed, Response Time: 0.0284 seconds
32222222 average: 0.0378 seconds - failed, Response Time: 0.0385 seconds
33333333 average: 0.0281 seconds - failed, Response Time: 0.0275 seconds
34444444 average: 0.0277 seconds - failed, Response Time: 0.0272 seconds
Best digit for position 2: 2 (Average response time: 0.0378 seconds)
32111111 average: 0.0380 seconds - failed, Response Time: 0.0385 seconds
32222222 average: 0.0379 seconds - failed, Response Time: 0.0375 seconds
32333333 average: 0.0371 seconds - failed, Response Time: 0.0372 seconds
32444444 average: 0.0481 seconds - failed, Response Time: 0.0473 seconds
Best digit for position 3: 4 (Average response time: 0.0481 seconds)
32411111 average: 0.0471 seconds - failed, Response Time: 0.0468 seconds
32422222 average: 0.0477 seconds - failed, Response Time: 0.0473 seconds
32433333 average: 0.0577 seconds - failed, Response Time: 0.0570 seconds
32444444 average: 0.0480 seconds - failed, Response Time: 0.0470 seconds
Best digit for position 4: 3 (Average response time: 0.0577 seconds)
32431111 average: 0.0577 seconds - failed, Response Time: 0.0574 seconds
32432222 average: 0.0573 seconds - failed, Response Time: 0.0573 seconds
32433333 average: 0.0567 seconds - failed, Response Time: 0.0562 seconds
32434444 average: 0.0772 seconds - failed, Response Time: 0.0770 seconds
Best digit for position 5: 4 (Average response time: 0.0772 seconds)
32434111 average: 0.0677 seconds - failed, Response Time: 0.0670 seconds
32434222 average: 0.0678 seconds - failed, Response Time: 0.0676 seconds
32434333 average: 0.0672 seconds - failed, Response Time: 0.0673 seconds
32434444 average: 0.0773 seconds - failed, Response Time: 0.0773 seconds
Best digit for position 6: 4 (Average response time: 0.0773 seconds)
32434411 average: 0.0990 seconds - correct, Response Time: 0.0983 seconds
32434422 average: 0.0780 seconds - failed, Response Time: 0.0770 seconds
32434433 average: 0.0767 seconds - failed, Response Time: 0.0770 seconds
32434444 average: 0.0774 seconds - failed, Response Time: 0.0768 seconds
Best digit for position 7: 1 (Average response time: 0.0990 seconds)
32434411 average: 0.0980 seconds - correct, Response Time: 0.0984 seconds
32434412 average: 0.0873 seconds - failed, Response Time: 0.0873 seconds
32434413 average: 0.0869 seconds - failed, Response Time: 0.0868 seconds
32434414 average: 0.0876 seconds - failed, Response Time: 0.0870 seconds
Best digit for position 8: 1 (Average response time: 0.0980 seconds)
########################################################
# Identified sequence: 32434411
########################################################
Finished at 2025-02-09 10:50:51
Total execution time: 13m 11s</pre>




<p>A little over 13 mins to crack an 8 digit pin, I think thats pretty good.</p>



<p>The script could be optimized to quit as soon as the response contained “correct” (or the green led comes on) this would greatly reduce the time to crack if a pin had repeating characters at the end, but I wanted to get the pin by just examining the timing.</p>



<p>Thats all for the little experiments I was playing with on the weekend. I hope this has helped someone, I recommend trying it &#8211; it was a lot of fun!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rossmarks.uk/blog/side-channel-timing-attack/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1915</post-id>	</item>
		<item>
		<title>Fault Injection &#8211; Crowbar Glitching</title>
		<link>https://rossmarks.uk/blog/fault-injection-crowbar-glitching/</link>
					<comments>https://rossmarks.uk/blog/fault-injection-crowbar-glitching/#respond</comments>
		
		<dc:creator><![CDATA[Ross Marks]]></dc:creator>
		<pubDate>Sun, 10 Nov 2024 14:11:03 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<guid isPermaLink="false">https://rossmarks.uk/blog/?p=1871</guid>

					<description><![CDATA[All the code for this is available here: https://rossmarks.uk/git/0xRoM/Hardware Fault injection is a technique in hardware penetration testing, used to assess and exploit vulnerabilities within physical devices by intentionally inducing errors or &#8220;faults&#8221; into a system. This enables us to understand &#8230; <a href="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p>All the code for this is available here: <a href="https://rossmarks.uk/git/0xRoM/Hardware">https://rossmarks.uk/git/0xRoM/Hardware</a></p>



<p>Fault injection is a technique in hardware penetration testing, used to assess and exploit vulnerabilities within physical devices by intentionally inducing errors or &#8220;faults&#8221; into a system. This enables us to understand how a device behaves under unexpected conditions, simulating potential attacks and stressors that might occur in real-world scenarios. By manipulating various environmental, electrical, or timing aspects of the hardware—such as introducing voltage spikes, clock glitches, or electromagnetic interference (as demonstrated in the previous blog) — testers can observe whether the device exhibits unintended behaviours, such as bypassing security mechanisms, leaking sensitive data, or revealing exploitable weaknesses.</p>



<h2 class="wp-block-heading">Types of injection / glitching</h2>



<h3 class="wp-block-heading">Traditional Voltage Glitching</h3>



<p>Traditional voltage glitching involves applying short, high-frequency voltage spikes or dips to a device’s power supply to disrupt its operations temporarily. In this approach, testers introduce controlled fluctuations in the power supply to induce faults, usually with the aim of causing the device to skip instructions, bypass security checks, or enter an unstable state. This type of glitching is often achieved by using a pulse generator to inject precise glitches into the power line, making it possible to create repeatable faults that can be tested and analysed. Traditional voltage glitching is widely used in assessing the security of embedded systems, particularly in devices where energy efficiency and cost constraints may leave power regulation vulnerable.</p>



<h3 class="wp-block-heading">Crowbar Glitching</h3>



<p>Crowbar glitching is a more aggressive variant of voltage glitching, where the power line of the device is intentionally shorted to ground for a very brief period, creating a sudden and sharp voltage drop. The “crowbar” technique gets its name from the idea of forcefully dragging the voltage down, similar to using a physical crowbar. Crowbar glitching is typically achieved by momentarily connecting the device’s power rail directly to ground, causing a rapid dip in voltage that can disrupt the device’s operation more intensely than traditional voltage glitches. This method is especially effective in bypassing bootloaders, secure boot processes, or cryptographic routines that might reset or enter a fail-safe mode due to the severe power fluctuation. Crowbar glitching requires careful timing and control, as the intense voltage drop can lead to permanent damage if not precisely applied.</p>



<h3 class="wp-block-heading">Clock Glitching</h3>



<p>Clock glitching involves injecting irregularities into the device’s clock signal, which governs the timing of its operations. By inserting deliberate delays or spikes into the clock pulses, testers can interfere with the synchronisation of processes within the hardware. A successful clock glitch may lead the device to skip instructions, improperly handle data, or even execute commands incorrectly. This is particularly valuable in assessing the resilience of microcontrollers, processors, and digital signal processors that depend on precise timing. For example, skipping an instruction during an authentication sequence might lead to security bypasses. Clock glitching is often used in testing systems with stringent timing requirements, like automotive and industrial controls, to verify that they handle timing disturbances gracefully.</p>



<h3 class="wp-block-heading">Electromagnetic (EM) Fault Injection</h3>



<p>Electromagnetic fault injection uses electromagnetic pulses to induce faults within a device by targeting specific circuits or components without direct electrical contact. By using focused EM pulses, testers can disrupt or interfere with the functioning of nearby circuits, causing unpredictable behaviour. This method is beneficial for identifying vulnerabilities that are challenging to induce with voltage or clock glitches, as EM faults can be targeted at precise areas within a chip or module. It’s especially effective for bypassing security protections in tamper-resistant hardware, such as smart cards and secure elements, where direct access to circuit lines may be restricted. The non-invasive nature of EM injection makes it valuable in scenarios where physical modification of the device is impractical.</p>



<h2 class="wp-block-heading">Why choose crowbar glitching?</h2>



<ul class="wp-block-list">
<li><strong>Higher Disruption Potential</strong>: Crowbar glitching creates a more intense and abrupt voltage drop, which can effectively bypass critical security features, such as bootloaders and authentication routines, that might resist traditional voltage spikes.</li>



<li><strong>Precise Timing Advantage</strong>: The rapid nature of crowbar glitching allows for more targeted timing control, making it easier to disrupt specific instructions or security functions that rely on precise timing sequences.</li>



<li><strong>Increased Chance of Success in Secure Systems</strong>: For secure or tamper-resistant systems designed to handle minor voltage fluctuations, the sharper impact of crowbar glitching may be necessary to induce the desired fault, as traditional glitching might be insufficient.</li>



<li><strong>Targeted Fault Injection</strong>: By focusing the crowbar glitch on the specific chip’s power supply line, testers can induce faults without significantly affecting the power to other components. This selective application is especially useful in multi-component systems, allowing the glitch to focus on a single target chip (such as a microcontroller or secure element) without disturbing the overall system stability.</li>



<li><strong>Bypass Stronger Power Regulation</strong>: Devices with robust voltage regulation circuits are more resilient to traditional glitches. Crowbar glitching’s sudden and intense voltage drop can overwhelm these circuits, making it a viable approach for testing highly secure devices.</li>
</ul>



<p>While crowbar glitching carries a higher risk of damaging components, its ability to induce intense, precisely-timed faults can make it more effective in penetrating advanced security features.</p>



<h2 class="wp-block-heading">How it works</h2>



<p>In the following image the device in the red box is the target device that we are wanting to cause a fault on. The device in the blue box is what we will be using to cause the glitch.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_01_annotated.png" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="917" height="531" data-attachment-id="1872" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/crowbar_example_start_01_annotated/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_01_annotated.png" data-orig-size="917,531" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="crowbar_example_start_01_annotated" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_01_annotated-300x174.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_01_annotated.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_01_annotated.png" alt="" class="wp-image-1872" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_01_annotated.png 917w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_01_annotated-300x174.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_01_annotated-768x445.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_01_annotated-500x290.png 500w" sizes="auto, (max-width: 917px) 100vw, 917px" /></a></figure>
</div>


<p>By connecting the &#8220;source&#8221; and &#8220;drain&#8221; to the power rail and ground of the target device we are able to cause a crowbar glitch. The circuit would look like this:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_02_annotated.png" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="917" height="531" data-attachment-id="1873" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/crowbar_example_start_02_annotated/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_02_annotated.png" data-orig-size="917,531" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="crowbar_example_start_02_annotated" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_02_annotated-300x174.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_02_annotated.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_02_annotated.png" alt="" class="wp-image-1873" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_02_annotated.png 917w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_02_annotated-300x174.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_02_annotated-768x445.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_start_02_annotated-500x290.png 500w" sizes="auto, (max-width: 917px) 100vw, 917px" /></a></figure>
</div>


<p>Under normal operation the power would have the following flow:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_before-1.png" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="934" height="441" data-attachment-id="1875" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/crowbar_example_before-2/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_before-1.png" data-orig-size="934,441" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="crowbar_example_before" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_before-1-300x142.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_before-1.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_before-1.png" alt="" class="wp-image-1875" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_before-1.png 934w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_before-1-300x142.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_before-1-768x363.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_before-1-500x236.png 500w" sizes="auto, (max-width: 934px) 100vw, 934px" /></a></figure>
</div>


<p>When we start to glitch by powering the gate of the mosfet the power follows this flow, temporarily disrupting the power to the chosen component:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_after.png" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="907" height="441" data-attachment-id="1876" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/crowbar_example_after/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_after.png" data-orig-size="907,441" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="crowbar_example_after" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_after-300x146.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_after.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_after.png" alt="" class="wp-image-1876" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_after.png 907w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_after-300x146.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_after-768x373.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/crowbar_example_after-500x243.png 500w" sizes="auto, (max-width: 907px) 100vw, 907px" /></a></figure>
</div>


<p>For my testing I used a &#8220;<a href="https://bolt.curious.supplies/" target="_blank" rel="noreferrer noopener">curious bolt</a>&#8221; (which contains the mosfet controllable via python) and, as I did previously, I will be using the same Attiny85 as the target. Once it was all hooked up, it looked like this with the curious bolt on the left and the target on the breadboard to the right (the black and white wires go to a USB-UART for reading/writing to the serial debug of the chip):</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_setup-scaled.jpg" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="1024" height="507" data-attachment-id="1877" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/attiny_setup/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_setup-scaled.jpg" data-orig-size="2560,1267" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="attiny_setup" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_setup-300x149.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_setup-1024x507.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_setup-1024x507.jpg" alt="" class="wp-image-1877" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_setup-1024x507.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_setup-300x149.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_setup-768x380.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_setup-1536x760.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_setup-2048x1014.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_setup-500x248.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p></p>



<h2 class="wp-block-heading">Initial check</h2>



<p>The first test was just to see if it works, the script was the same as the FaultyCat&#8217;s first example. When the device first starts it outputs &#8220;Initializing&#8230;&#8221; to the serial port. As demonstrated this worked, the script on the left causing the device to restart (on the right)</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_test_01_console.png" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="999" height="140" data-attachment-id="1878" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/attiny_test_01_console/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_test_01_console.png" data-orig-size="999,140" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="attiny_test_01_console" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_test_01_console-300x42.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_test_01_console.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_test_01_console.png" alt="" class="wp-image-1878" style="width:840px;height:auto" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_test_01_console.png 999w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_test_01_console-300x42.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_test_01_console-768x108.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_test_01_console-500x70.png 500w" sizes="auto, (max-width: 999px) 100vw, 999px" /></a></figure>
</div>


<p>Heres how a glitch looks on the oscilloscope:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_01_test.png" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="800" height="480" data-attachment-id="1879" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/attiny_01_test/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_01_test.png" data-orig-size="800,480" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="attiny_01_test" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_01_test-300x180.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_01_test.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_01_test.png" alt="" class="wp-image-1879" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_01_test.png 800w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_01_test-300x180.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_01_test-768x461.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/attiny_01_test-500x300.png 500w" sizes="auto, (max-width: 800px) 100vw, 800px" /></a></figure>
</div>


<p></p>



<h2 class="wp-block-heading">Test 01</h2>



<p>This test was to see if it was possible to use this glitch to change the logic or running of the device without causing it to reset. All it does is create a random number, assign it to two variables, perform some operations on the variables which will still result in the same numbers but introduce a place for a glitch to occur and check the variables match (which they always should). </p>



<p>I could not get this to work, I couldn&#8217;t get the pulse for the glitch to be a short enough amount of time to cause a glitch and not a reset. Tom (one of the main devs/ the creator of the curious bolt?) explained the concept of the &#8220;bypass capacitor&#8221; which is common in electronics to keep the power stable. Put simply:</p>



<p>A bypass capacitor is a small capacitor placed across a power supply line and ground to smooth out fluctuations in voltage and prevent unwanted noise in electronic circuits. It acts as a local reservoir of charge that provides quick bursts of current when there&#8217;s a sudden demand, helping to maintain a stable voltage. When a circuit component, like a transistor or an integrated circuit, switches on and off, it can create small voltage spikes. The bypass capacitor shunts (or &#8220;bypasses&#8221;) these high-frequency signals to ground, preventing them from affecting other parts of the circuit.</p>



<p>Heres how it looks in the fritzing schematic:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_bypass_cap.png" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="917" height="531" data-attachment-id="1883" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/added_bypass_cap/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_bypass_cap.png" data-orig-size="917,531" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="added_bypass_cap" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_bypass_cap-300x174.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_bypass_cap.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_bypass_cap.png" alt="" class="wp-image-1883" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_bypass_cap.png 917w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_bypass_cap-300x174.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_bypass_cap-768x445.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_bypass_cap-500x290.png 500w" sizes="auto, (max-width: 917px) 100vw, 917px" /></a></figure>
</div>


<p>And here it is implemented on my breadboard:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_with_cap.png" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="893" height="522" data-attachment-id="1884" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/number_match_glitch_with_cap/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_with_cap.png" data-orig-size="893,522" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="number_match_glitch_with_cap" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_with_cap-300x175.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_with_cap.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_with_cap.png" alt="" class="wp-image-1884" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_with_cap.png 893w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_with_cap-300x175.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_with_cap-768x449.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_with_cap-500x292.png 500w" sizes="auto, (max-width: 893px) 100vw, 893px" /></a></figure>
</div>


<p>Heres how the power when glitching looks before and after:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/no_decouple_cap_too_quick.png" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="800" height="480" data-attachment-id="1885" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/no_decouple_cap_too_quick/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/no_decouple_cap_too_quick.png" data-orig-size="800,480" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="no_decouple_cap_too_quick" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/no_decouple_cap_too_quick-300x180.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/no_decouple_cap_too_quick.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/no_decouple_cap_too_quick.png" alt="" class="wp-image-1885" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/no_decouple_cap_too_quick.png 800w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/no_decouple_cap_too_quick-300x180.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/no_decouple_cap_too_quick-768x461.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/no_decouple_cap_too_quick-500x300.png 500w" sizes="auto, (max-width: 800px) 100vw, 800px" /></a></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_decouple_cap.png" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="800" height="480" data-attachment-id="1886" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/added_decouple_cap/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_decouple_cap.png" data-orig-size="800,480" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="added_decouple_cap" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_decouple_cap-300x180.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_decouple_cap.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_decouple_cap.png" alt="" class="wp-image-1886" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_decouple_cap.png 800w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_decouple_cap-300x180.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_decouple_cap-768x461.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/added_decouple_cap-500x300.png 500w" sizes="auto, (max-width: 800px) 100vw, 800px" /></a></figure>
</div>


<p>In the second image the device recovers a lot quicker from the sudden power drop, this allowed me to cause the glitch without restarting the device as it spends less time without power!</p>



<p>If you are anything like me then you are probably wondering how that works since typically power goes in one pin and out the other, how does it go backwards? So heres a quick 3 stage process on how that works:</p>



<p><strong>Voltage Difference</strong>: The capacitor has a voltage across it from being charged up by Vcc (one side at Vcc and the other at GND). <br><strong>Glitch Drop:</strong> When the glitch lowers Vcc, the voltage on the capacitor’s Vcc side is suddenly higher than Vcc itself. <br><strong>Automatic Discharge: </strong>Because electricity flows from high voltage to low voltage, the capacitor naturally pushes some of its stored charge back into Vcc to balance things out.</p>



<p>After loads of trial and error and changing timings I got the following:</p>



<figure class="wp-block-image size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_work.png" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="1024" height="179" data-attachment-id="1881" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/number_match_glitch_work/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_work.png" data-orig-size="1170,205" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="number_match_glitch_work" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_work-300x53.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_work-1024x179.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_work-1024x179.png" alt="" class="wp-image-1881" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_work-1024x179.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_work-300x53.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_work-768x135.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_work-500x88.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/number_match_glitch_work.png 1170w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>The script on the left caused the device to glitch even though it seems the numbers appear to be the same! Since the numbers appear to be the same it is most likely that the glitch caused the device to skip over one of the comparisons:</p>



<pre class="brush: c++; gutter: false; first-line: 1">
// Check if the numbers still match after the potential glitch
  int match = 0;
  if (num1FirstDigit == num2FirstDigit) {
    if (num1SecondDigit == num2SecondDigit) {
       match = 1;
    }
  }
  
  if (match == 1) {
    Serial.print(&quot;Numbers match: &quot;); Serial.print(num1); Serial.print(&quot; &quot;); Serial.print(num2); Serial.print(&quot;\r&quot;);
  } else {
    Serial.print(&quot;Glitch detected! Numbers do not match: &quot;);
</pre>



<h2 class="wp-block-heading">Test 02</h2>



<p>This time the device was programmed to do the following:</p>



<ul class="wp-block-list">
<li>Output &#8220;Initializing&#8230;&#8221; when booting</li>



<li>Start all output with &#8220;[-]&#8221; if not logged in or &#8220;[+]&#8221; if access is granted</li>



<li>Reply &#8220;pong&#8221; when sent &#8220;ping&#8221; (to tell if device is alive or has crashed)</li>



<li>Compare user input to password (to log in if anything sent other than &#8220;ping&#8221;)</li>
</ul>



<p>The FaultyCat script to attack the same code was used but butchered to work with the CuriousBolt instead. The timings took so long to find, originally they were hardcoded in the script but it was becoming such a pain I ended up making them parameters to the script <br>(02-pass_match_glitch.py)</p>



<p>After much much tinkering, changing parameters and timings and double/triple checking connections eventually I got the following:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_work.png" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="1024" height="312" data-attachment-id="1887" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/password_glitch_work/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_work.png" data-orig-size="1085,331" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="password_glitch_work" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_work-300x92.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_work-1024x312.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_work-1024x312.png" alt="" class="wp-image-1887" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_work-1024x312.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_work-300x92.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_work-768x234.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_work-500x153.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_work.png 1085w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>YEY the password had successfully been bypassed.<br>Much like when doing this with the FaultyCat sometimes it also vomited junk over the serial port</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_memory_dump.png" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="1024" height="301" data-attachment-id="1888" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/password_glitch_memory_dump/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_memory_dump.png" data-orig-size="1342,395" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="password_glitch_memory_dump" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_memory_dump-300x88.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_memory_dump-1024x301.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_memory_dump-1024x301.png" alt="" class="wp-image-1888" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_memory_dump-1024x301.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_memory_dump-300x88.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_memory_dump-768x226.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_memory_dump-500x147.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/password_glitch_memory_dump.png 1342w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>Well look at that! it&#8217;s echoed the password along with the incorrect one submitted by the script!</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>I think this demonstrates how useful this kind of attack can be. from my experience it&#8217;s more complicated to get working than EM fault injection, however once it&#8217;s dialled in it seems to be a lot more reliable.<br>Learning this and playing with it has been a lot of fun and I have to give a massive thank you to Tom and  Aleph for helping with pointers and tips.</p>



<p>Now that I&#8217;ve got the concepts down it&#8217;s time to try the challenge board that came with the CuriousBolt, it contains 4 challenges! <br>Look how pretty the board is:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/20241029_142024-scaled.jpg" rel="lightbox[1871]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="1889" data-permalink="https://rossmarks.uk/blog/fault-injection-crowbar-glitching/20241029_142024/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/20241029_142024-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1730211624&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;800&quot;,&quot;shutter_speed&quot;:&quot;0.04&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="20241029_142024" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/20241029_142024-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/20241029_142024-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/20241029_142024-1024x461.jpg" alt="" class="wp-image-1889" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/20241029_142024-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/20241029_142024-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/20241029_142024-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/20241029_142024-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/20241029_142024-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/11/20241029_142024-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://rossmarks.uk/blog/fault-injection-crowbar-glitching/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1871</post-id>	</item>
		<item>
		<title>FaultyCat Introduction</title>
		<link>https://rossmarks.uk/blog/faultycat-introduction/</link>
					<comments>https://rossmarks.uk/blog/faultycat-introduction/#respond</comments>
		
		<dc:creator><![CDATA[Ross Marks]]></dc:creator>
		<pubDate>Tue, 22 Oct 2024 14:55:11 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<guid isPermaLink="false">https://rossmarks.uk/blog/?p=1852</guid>

					<description><![CDATA[At the most recent Defcon (32) along with too many badges I purchased a &#8220;FaultyCat&#8221;. A small EMFI injection device. It&#8217;s a remix of the &#8220;PicoEMP&#8221;. Basically you charge up some capacitors (under the red plastic in the below photo), &#8230; <a href="https://rossmarks.uk/blog/faultycat-introduction/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p>At the most recent Defcon (32) along with too many badges I purchased a &#8220;FaultyCat&#8221;. A small EMFI injection device. It&#8217;s a remix of the &#8220;PicoEMP&#8221;. Basically you charge up some capacitors (under the red plastic in the below photo), then when you are ready discharge them through the tip on the right to have a highly targeted EM pulse wherever you direct it (typically over a processor chip). This is just going to be a small blog on how I tested mine, experiments I did to check and learn how it works.<br></p>



<figure class="wp-block-image size-full"><a href="http://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-1-e1729606999761.png" rel="lightbox[1852]"><img loading="lazy" decoding="async" width="960" height="449" data-attachment-id="1853" data-permalink="https://rossmarks.uk/blog/faultycat-introduction/image-10/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-1-e1729606999761.png" data-orig-size="960,449" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-1-e1729606999761-300x140.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-1-e1729606999761.png" src="http://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-1-e1729606999761.png" alt="" class="wp-image-1853" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-1-e1729606999761.png 960w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-1-e1729606999761-300x140.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-1-e1729606999761-768x359.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-1-e1729606999761-500x234.png 500w" sizes="auto, (max-width: 960px) 100vw, 960px" /></a></figure>



<p>All the code for this is available here: <a href="https://rossmarks.uk/git/0xRoM/FaultInjection">https://rossmarks.uk/git/0xRoM/Hardware</a></p>



<h2 class="wp-block-heading">Chip Restarting</h2>



<p>The first thing to do is just get the device to send a pulse and restart the chip.<br>I started by programming an ATtiny85 to simply echo over serial &#8220;Initializing…&#8221; when it first turns on then in a loop &#8220;running&#8221; so we have an indication that the chip isnt dead. </p>



<p>In the repo this is in &#8220;/FaultInjection/examples/FaultyCat/01_simple_restart/&#8221;.</p>



<p>I have previously made a holder for the FaultyCat (<a href="https://thingiverse.com/thing:6753548" target="_blank" rel="noreferrer noopener">https://thingiverse.com/thing:6753548 </a>) and it made this whole project a LOT easier as an important part of this is working out where to position the FaultyCat over the chip. This will take trial and error, just try to move in small increments until you get the result you want.</p>



<p>My setup looked like this:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/setup_annotated.png" rel="lightbox[1852]"><img loading="lazy" decoding="async" width="609" height="1024" data-attachment-id="1854" data-permalink="https://rossmarks.uk/blog/faultycat-introduction/setup_annotated/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/setup_annotated.png" data-orig-size="768,1292" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="setup_annotated" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/setup_annotated-178x300.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/setup_annotated-609x1024.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/setup_annotated-609x1024.png" alt="" class="wp-image-1854" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/setup_annotated-609x1024.png 609w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/setup_annotated-178x300.png 178w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/setup_annotated.png 768w" sizes="auto, (max-width: 609px) 100vw, 609px" /></a></figure>
</div>


<p>The wiki (<a href="https://github.com/ElectronicCats/faultycat/wiki" target="_blank" rel="noreferrer noopener">https://github.com/ElectronicCats/faultycat/wiki</a>) is fairly barebones, however I found it has all that was needed to get this working.</p>



<p>For this example check the &#8220;FaultyCMD&#8221; section of the wiki, it&#8217;s fairly simple, set the config values then send start. I did find that I was unable to change the power level. Move the device to different locations on the chip to find the best place to send the pulse. Once you have it should look as follows:</p>



<figure class="wp-block-image size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/cause_restart.png" rel="lightbox[1852]"><img loading="lazy" decoding="async" width="1003" height="403" data-attachment-id="1855" data-permalink="https://rossmarks.uk/blog/faultycat-introduction/cause_restart/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/cause_restart.png" data-orig-size="1003,403" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="cause_restart" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/cause_restart-300x121.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/cause_restart.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/cause_restart.png" alt="" class="wp-image-1855" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/cause_restart.png 1003w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/cause_restart-300x121.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/cause_restart-768x309.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/cause_restart-500x201.png 500w" sizes="auto, (max-width: 1003px) 100vw, 1003px" /></a></figure>



<p>Where it says &#8220;Initializing&#8230;&#8221; is where the chip restarted due to the FaultyCat zapping the ATtiny85.</p>



<h2 class="wp-block-heading">Number Comparison</h2>



<p>As cool as restarting the chip is, it&#8217;s not very useful. Typically here you would lower the power a little bit at a time until it would no longer restart the chip, but as mentioned before that didnt work for me, instead I moved the FaultyCat to a different location on the ATtiny85 that didnt cause a restart, I also raised the tip in the hope it lost some of the power reaching the chip. The idea of lowering the power so it no longer restarts is in the hope that instead it would mess with the chip but keep it alive, this could be by flipping a bit in memory or causing it to skip an instruction, or some other weird wonderful thing.</p>



<p>For this demo flash &#8220;/FaultInjection/examples/FaultyCat/02_match_numbers/&#8221; onto the ATtiny85. This script generates a random number, sets variable A to that number and variable B to the same number. It then performs some operations on the numbers (to waste time essentially, allowing for a glitch to occur) before checking that A == B, which it always should. As you might expect the following happened:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/no_match_03.png" rel="lightbox[1852]"><img loading="lazy" decoding="async" width="822" height="246" data-attachment-id="1856" data-permalink="https://rossmarks.uk/blog/faultycat-introduction/no_match_03/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/no_match_03.png" data-orig-size="822,246" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="no_match_03" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/no_match_03-300x90.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/no_match_03.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/no_match_03.png" alt="" class="wp-image-1856" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/no_match_03.png 822w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/no_match_03-300x90.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/no_match_03-768x230.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/no_match_03-500x150.png 500w" sizes="auto, (max-width: 822px) 100vw, 822px" /></a></figure>
</div>


<p></p>



<h2 class="wp-block-heading">Password Protection</h2>



<p>Now the real fun begins. To start with you will want to flash &#8220;/FaultInjection/examples/FaultyCat/03_password_check/&#8221; to the ATtiny85. This is another very simple program, it&#8217;s output will start with &#8220;[-]&#8221; if you are not logged in or &#8220;[+]&#8221; if you are. The program will respond &#8220;pong&#8221; if you send it &#8220;ping&#8221; otherwise it presumes your input is a password attempt, which if wrong it will reply with &#8220;Password incorrect&#8221; otherwise you have the correct hardcoded password and it will reply &#8220;Password correct&#8221;. Theres some delays and operations in there to emulate if it was comparing against a hash and having to perform extra operations.</p>



<p>In the &#8220;03_password_check&#8221; folder there is also &#8220;attack.py&#8221; this script is what interacts with the FaultyCat and the ATtiny85 to perform the injection. This is also very basic. It arms the Faultycat, then sends &#8220;ping&#8221; to the chip to ensure it is alive and working as expected. if it gets a &#8220;pong&#8221; response it then sends &#8220;incorrectpassword&#8221; to the chip and very quickly (basically at the same time) a FaultyCat pulse to the chip, it does this 5 times really fast before checking &#8220;ping&#8221; response again. between each password attempt it checks to see if the response is &#8220;correct&#8221; but not &#8220;incorrect&#8221;, if it is then everything stops because we would have gained access.</p>



<p>So now everything is setup and ready to go I run the script and:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_disclose_03-1.png" rel="lightbox[1852]"><img loading="lazy" decoding="async" width="892" height="248" data-attachment-id="1858" data-permalink="https://rossmarks.uk/blog/faultycat-introduction/pass_disclose_03-2/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_disclose_03-1.png" data-orig-size="892,248" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="pass_disclose_03" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_disclose_03-1-300x83.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_disclose_03-1.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_disclose_03-1.png" alt="" class="wp-image-1858" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_disclose_03-1.png 892w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_disclose_03-1-300x83.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_disclose_03-1-768x214.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_disclose_03-1-500x139.png 500w" sizes="auto, (max-width: 892px) 100vw, 892px" /></a></figure>
</div>


<p>Well that was unexpected, as you can see in the right screen, it echoed the password! The theory is, it put the password into memory for comparing, it compared as incorrect, it then tried to put &#8220;password incorrect&#8221; into the same memory location but the FaultyCat made it skip that instruction, the next instruction being to print that memory location, where instead of printing &#8220;incorrect password&#8221; the only thing it could print was the password. Of course this is just a guess.</p>



<p>Eventually it did bypass the comparison and we get:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_correct_01.png" rel="lightbox[1852]"><img loading="lazy" decoding="async" width="992" height="331" data-attachment-id="1859" data-permalink="https://rossmarks.uk/blog/faultycat-introduction/pass_correct_01/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_correct_01.png" data-orig-size="992,331" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="pass_correct_01" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_correct_01-300x100.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_correct_01.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_correct_01.png" alt="" class="wp-image-1859" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_correct_01.png 992w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_correct_01-300x100.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_correct_01-768x256.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pass_correct_01-500x167.png 500w" sizes="auto, (max-width: 992px) 100vw, 992px" /></a></figure>
</div>


<p>YEY we gained access, game over, I win!</p>



<p>I never broke the ATtiny85 throughout these experiments, although sometimes did require it to be disconnected and reconnected, the timer would get hit and everything run crazy fast or just junk getting dumped to the screen. Here is a typical example, you can also see the password in the junk dumped to screen:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/mad_glitch_02.png" rel="lightbox[1852]"><img loading="lazy" decoding="async" width="1024" height="237" data-attachment-id="1860" data-permalink="https://rossmarks.uk/blog/faultycat-introduction/mad_glitch_02/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/mad_glitch_02.png" data-orig-size="1401,324" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="mad_glitch_02" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/mad_glitch_02-300x69.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/mad_glitch_02-1024x237.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/mad_glitch_02-1024x237.png" alt="" class="wp-image-1860" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/mad_glitch_02-1024x237.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/mad_glitch_02-300x69.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/mad_glitch_02-768x178.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/mad_glitch_02-500x116.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/mad_glitch_02.png 1401w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>Overall this was a fun attack and another tool under the belt, I have definitely caught the glitching bug and have some voltage glitching hardware on the way so expect more content around this.</p>



<p>I hope you have learned something from this.<br>Until next time.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rossmarks.uk/blog/faultycat-introduction/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1852</post-id>	</item>
		<item>
		<title>Pacemaker Pwn Pt.1</title>
		<link>https://rossmarks.uk/blog/pacemaker-pwn-pt-1/</link>
					<comments>https://rossmarks.uk/blog/pacemaker-pwn-pt-1/#respond</comments>
		
		<dc:creator><![CDATA[Ross Marks]]></dc:creator>
		<pubDate>Thu, 10 Oct 2024 14:34:17 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<guid isPermaLink="false">https://rossmarks.uk/blog/?p=1820</guid>

					<description><![CDATA[About the base station Before diving straight in and hacking a pacemaker we will start by attacking the base station. The pacemaker talks to the base station, this is a small box that is left beside the bed. At night, &#8230; <a href="https://rossmarks.uk/blog/pacemaker-pwn-pt-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p></p>



<p></p>



<h2 class="wp-block-heading">About the base station</h2>



<p>Before diving straight in and hacking a pacemaker we will start by attacking the base station. The pacemaker talks to the base station, this is a small box that is left beside the bed. At night, this device communicates wirelessly with the pacemaker to collect information like heart rhythms and device performance. It then uploads this data to a remote network that the doctors have access to. This allows the doctor to monitor the patients pacemaker health remotely and check how well it is working without needing to visit the hospital frequently. It&#8217;s a simple way to ensure everything is functioning correctly.</p>



<p>The plan is to hack this device to understand the communication between it and the pacemaker to see it that can be replicated and if the communications are secure. As a side goal it would be interesting to check the following:&nbsp;</p>



<ul class="wp-block-list">
<li>See if the device is secure both physically and in the software implementation</li>



<li>See if there is PII stored on the device</li>



<li>See how it communicates to the remote network and how that is implemented, is it secure?</li>
</ul>



<p></p>



<h2 class="wp-block-heading">OSINT</h2>



<p>One of the first things to check before opening the device is any public documentation, user manuals are available online helping with how to use the device, there are no default credentials in it. Since the device is sold in America and uses radio communications it is required to pass FCC checks, these documents often contain useful information, this device had the following FCC docs: <a href="https://fccid.io/LF524950B" target="_blank" rel="noreferrer noopener">https://fccid.io/LF524950B</a> unfortunately there wasn&#8217;t anything too useful here from a pentester perspective, some of the frequencies are confirmed and there are some internal photos, but that is about it.</p>



<h2 class="wp-block-heading">Hardware tare-down</h2>



<p>Firstly lets see what I got!</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240717_134856-scaled.jpg" rel="lightbox[1820]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="1821" data-permalink="https://rossmarks.uk/blog/pacemaker-pwn-pt-1/20240717_134856/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240717_134856-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1721224137&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;64&quot;,&quot;shutter_speed&quot;:&quot;0.01&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="20240717_134856" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240717_134856-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240717_134856-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240717_134856-1024x461.jpg" alt="" class="wp-image-1821" style="width:840px" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240717_134856-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240717_134856-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240717_134856-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240717_134856-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240717_134856-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240717_134856-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>The handset on top will be for another blog post, this one will only focus on the base.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/botom_redacted.png" rel="lightbox[1820]"><img loading="lazy" decoding="async" width="580" height="1024" data-attachment-id="1822" data-permalink="https://rossmarks.uk/blog/pacemaker-pwn-pt-1/botom_redacted/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/botom_redacted.png" data-orig-size="585,1033" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="botom_redacted" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/botom_redacted-170x300.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/botom_redacted-580x1024.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/botom_redacted-580x1024.png" alt="" class="wp-image-1822" style="object-fit:cover" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/botom_redacted-580x1024.png 580w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/botom_redacted-170x300.png 170w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/botom_redacted.png 585w" sizes="auto, (max-width: 580px) 100vw, 580px" /></a></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/4G-dongle.png" rel="lightbox[1820]"><img loading="lazy" decoding="async" width="1024" height="483" data-attachment-id="1823" data-permalink="https://rossmarks.uk/blog/pacemaker-pwn-pt-1/4g-dongle/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/4G-dongle.png" data-orig-size="2226,1050" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="4G dongle" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/4G-dongle-300x142.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/4G-dongle-1024x483.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/4G-dongle-1024x483.png" alt="" class="wp-image-1823" style="width:840px" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/4G-dongle-1024x483.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/4G-dongle-300x142.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/4G-dongle-768x362.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/4G-dongle-1536x725.png 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/4G-dongle-2048x966.png 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/4G-dongle-500x236.png 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>It did contain a USB 4G modem with a Vodaphone SIM card&nbsp;</p>



<h2 class="wp-block-heading">Security screws</h2>



<p>Getting access to the PCB was a pain as they used a couple of different security screws: standard 6 point t8 torx and a more annoying 5 point with center pin torx (I had to buy specific bits for these!)</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/screws-scaled.jpg" rel="lightbox[1820]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="1824" data-permalink="https://rossmarks.uk/blog/pacemaker-pwn-pt-1/screws/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/screws-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1728424769&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;160&quot;,&quot;shutter_speed&quot;:&quot;0.02&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="screws" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/screws-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/screws-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/screws-1024x461.jpg" alt="" class="wp-image-1824" style="width:840px" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/screws-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/screws-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/screws-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/screws-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/screws-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/screws-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p></p>



<h2 class="wp-block-heading">Component identification</h2>



<p>Now we have this open lets see what parts it&#8217;s using:</p>



<p>PCB Front:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_front.png" rel="lightbox[1820]"><img loading="lazy" decoding="async" width="1024" height="535" data-attachment-id="1825" data-permalink="https://rossmarks.uk/blog/pacemaker-pwn-pt-1/pcb_front/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_front.png" data-orig-size="1489,778" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="pcb_front" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_front-300x157.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_front-1024x535.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_front-1024x535.png" alt="" class="wp-image-1825" style="width:840px" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_front-1024x535.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_front-300x157.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_front-768x401.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_front-500x261.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_front.png 1489w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>PCB Back:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_back.png" rel="lightbox[1820]"><img loading="lazy" decoding="async" width="467" height="705" data-attachment-id="1826" data-permalink="https://rossmarks.uk/blog/pacemaker-pwn-pt-1/pcb_back/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_back.png" data-orig-size="467,705" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="pcb_back" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_back-199x300.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_back.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_back.png" alt="" class="wp-image-1826" style="object-fit:cover" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_back.png 467w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/pcb_back-199x300.png 199w" sizes="auto, (max-width: 467px) 100vw, 467px" /></a></figure>
</div>


<p><strong><u>CPU:</u></strong> AM3703CUS100 &#8211; Texas instruments CPU (ARM Cortex A8 &#8211; 1 core, 32 bit 1GHz)</p>



<p><a href="https://www.mouser.co.uk/ProductDetail/Texas-Instruments/AM3703CUS100?qs=NiBvnJE4bX1%2FGcHuRBSbeg%3D%3D&amp;srsltid=AfmBOoopuQN3VewuYzhL2vaepMRnAsjPJXqthEb8ootkbeZM8PeHV-Az" target="_blank" rel="noreferrer noopener">mouser link</a></p>



<p><strong><u>SDRAM:</u></strong> IYB17 D9LRB &#8211; DRAM MOBILE DDR 1G @ 200MHz</p>



<p><a href="https://www.mouser.co.uk/ProductDetail/Micron/MT46H32M32LFB5-5-ITB?qs=rrS6PyfT74dzWOmBqs6LXw%3D%3D&amp;srsltid=AfmBOor-ndwen9p7FwKoQeX0r0PENmn-KyX5CwaJhDDF6BqU-bpzB3tL" target="_blank" rel="noreferrer noopener">mouser link</a></p>



<p><strong><u>USB Interface: </u></strong>SMSC LAN9512-JZX &#8211; IC USB 2 Port Hub Int 10/100 Ethernet</p>



<p><a href="https://www.mouser.co.uk/ProductDetail/Microchip-Technology/LAN9512-JZX?qs=pA5MXup5wxGssqzcygOIXg%3D%3D&amp;srsltid=AfmBOopCF4ujf26YY1FIGL9FBwl4lQrYEtMbysWZNw5VLi0KiSqKGQrK" target="_blank" rel="noreferrer noopener">mouser link</a></p>



<p><strong><u>USB Transciever:</u></strong> T1210b&nbsp;</p>



<p><a href="https://www.ti.com/lit/ds/symlink/tusb1210.pdf" target="_blank" rel="noreferrer noopener">https://www.ti.com/lit/ds/symlink/tusb1210.pdf</a></p>



<p><strong><u>RF Module:</u></strong> Microsemi ZL70473MN &#8211; Low-Power RF Module for Implant Applications</p>



<p><a href="https://www.microchip.com/en-us/product/zl70323" target="_blank" rel="noreferrer noopener">https://www.microchip.com/en-us/product/zl70323</a></p>



<p><strong><u>EEPROM:</u></strong> 24256E &#8211; 256k</p>



<p><a href="https://www.onsemi.com/pdf/datasheet/cat24c256-d.pdf">https://www.onsemi.com/pdf/</a><a href="https://www.onsemi.com/pdf/datasheet/cat24c256-d.pdf" target="_blank" rel="noreferrer noopener">datasheet</a><a href="https://www.onsemi.com/pdf/datasheet/cat24c256-d.pdf">/cat24c256-d.pdf</a></p>



<p><strong><u>SD Card:</u></strong> Sandisk 1GB MicroSD</p>



<h2 class="wp-block-heading">UART discovery and modification</h2>



<p>Recognizing the footprint of the unpopulated component on the PCB as a UART interface I set up the probes to test this theory:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240723_145229-scaled.jpg" rel="lightbox[1820]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="1827" data-permalink="https://rossmarks.uk/blog/pacemaker-pwn-pt-1/20240723_145229/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240723_145229-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1721746349&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;125&quot;,&quot;shutter_speed&quot;:&quot;0.02&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="20240723_145229" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240723_145229-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240723_145229-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240723_145229-1024x461.jpg" alt="" class="wp-image-1827" style="width:840px" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240723_145229-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240723_145229-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240723_145229-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240723_145229-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240723_145229-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240723_145229-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>I was correct and saw data in the terminal, so quickly added a more convenient header:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240730_102801-scaled.jpg" rel="lightbox[1820]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="1828" data-permalink="https://rossmarks.uk/blog/pacemaker-pwn-pt-1/20240730_102801/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240730_102801-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1722335281&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;500&quot;,&quot;shutter_speed&quot;:&quot;0.02&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="20240730_102801" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240730_102801-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240730_102801-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240730_102801-1024x461.jpg" alt="" class="wp-image-1828" style="width:840px" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240730_102801-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240730_102801-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240730_102801-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240730_102801-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240730_102801-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/20240730_102801-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p></p>



<h2 class="wp-block-heading">Software inspection</h2>



<p>I launch screen to record what happens and reset the device. Low and behold a boot log!</p>



<pre class="brush: c++; gutter: false; first-line: 1">
U-Boot SPL 2012.10-rc2 (Jul 09 2019 - 13:47:53)
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img


U-Boot 2012.10-rc2 (Jul 09 2019 - 13:47:53)

OMAP36XX/37XX-GP ES1.2, CPU-OPP2, L3-165MHz, Max CPU Clock 1 Ghz
MDT Vega board + LPDDR/
I2C:   ready
DRAM:  128 MiB
MMC:   OMAP SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Die ID #649a00029a180000015ec3e90401a004
VDD1: 3a, Converted: 1325 [mV]
VDD2: 2c, Converted: 1150 [mV]
Boot MPU rate: 600 mHz
MPU rate switched to: 1000 mHz
reading bootimg.rgb
Hit any key to stop autoboot:  0 
SD/MMC found on device 0
reading uEnv.txt

53 bytes read
Loaded environment from uEnv.txt
Importing environment from mmc ...
Loading file &quot;/boot/uImage&quot; from mmc device 0:2
3128968 bytes read
mmc boot
Booting from mmc ...
## Booting kernel from Legacy Image at 80200000 ...
   Image Name:   MontaVista Linux 6/3.0.3/ti-omap
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3128900 Bytes = 3 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

INIT: version 2.86 booting

Please wait: booting...
mount: sysfs already mounted or /sys busy
mount: according to mtab, sysfs is already mounted on /sys
Starting udev
Root filesystem already ro, not remounting
Caching udev devnodes
Configuring network interfaces... done.
net.ipv4.conf.default.rp_filter = 1
</pre>



<p>I snipped off the end as theres nothing particularly interesting after.<br>Things of note from these boot logs:</p>



<pre class="brush: c++; gutter: false; first-line: 1">
uboot version: U-Boot SPL 2012.10-rc2 (Jul 09 2019 - 13:47:53)
 Image Name:   MontaVista Linux 6/3.0.3/ti-omap
   Image Type:   ARM Linux Kernel Image (uncompressed)
MontaVista Linux 6 .dev-snapshot-20190709 Vega1.2.4p
</pre>



<p>I was also presented with a login prompt, try all kinds of combinations to get root, but no luck, after a while I try the name “medtronic” with no password and am greeted with a shell!<br><br>Theres not much I can do with this account, but as luck would have it:</p>



<pre class="brush: c++; gutter: false; first-line: 1">
medtronic@Vega1:/home/medtronic# cat /etc/passwd
root:$1$X1oVTrRE$Nz6O26Tu0bbCT8uWBjOPz.:0:0:root:/home/root:/bin/sh
daemon:*:1:1:daemon:/usr/sbin:/bin/sh
bin:*:2:2:bin:/bin:/bin/sh
sys:*:3:3:sys:/dev:/bin/sh
sync:*:4:65534:sync:/bin:/bin/sync
games:*:5:60:games:/usr/games:/bin/sh
man:*:6:12:man:/var/cache/man:/bin/sh
lp:*:7:7:lp:/var/spool/lpd:/bin/sh
mail:*:8:8:mail:/var/mail:/bin/sh
news:*:9:9:news:/var/spool/news:/bin/sh
uucp:*:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:*:13:13:proxy:/bin:/bin/sh
www-data:*:33:33:www-data:/var/www:/bin/sh
backup:*:34:34:backup:/var/backups:/bin/sh
list:*:38:38:Mailing List Manager:/var/list:/bin/sh
irc:*:39:39:ircd:/var/run/ircd:/bin/sh
gnats:*:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:*:65534:65534:nobody:/nonexistent:/bin/sh
medtronic::1000:1000:Linux User,,,:/home/medtronic:/bin/sh
messagebus:x:11:11:Linux User,,,:/var/run/dbus:/bin/sh
polkituser:x:12:16:polkituser:/var/run/polkit:/bin/sh
</pre>



<p>YES a root password hash!</p>



<pre class="brush: c++; gutter: false; first-line: 1">
root:$1$X1oVTrRE$Nz6O26Tu0bbCT8uWBjOPz.:0:0:root:/home/root:/bin/sh
</pre>



<p>I give this to a few mates with better cracking rigs than me and no-one was able to crack it, if anyone reading this is able to I&#8217;d be interested to know what the password is.</p>



<h2 class="wp-block-heading">Getting root</h2>



<p>With the “medtronic” account being fairly locked down and no obvious method to root I decided to look into the SD card, plugging it into my windows host I saw it contained 4 partitions, 3 of which didn&#8217;t work (will investigate later) but one did! the “boot” partition. In this partition it had uEnv.txt which appeared to have uboot options, I tried the obvious by adding “init=/bin/sh” as usual, but when booting the device with the SD card reinstalled there was no root shell.</p>



<p>I then try the SD card in a linux machine and can see all 4 partitions.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image.png" rel="lightbox[1820]"><img loading="lazy" decoding="async" width="1024" height="611" data-attachment-id="1830" data-permalink="https://rossmarks.uk/blog/pacemaker-pwn-pt-1/image-9/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image.png" data-orig-size="1068,637" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-300x179.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-1024x611.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-1024x611.png" alt="" class="wp-image-1830" style="width:840px" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-1024x611.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-300x179.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-768x458.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image-500x298.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/10/image.png 1068w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>Partitions:</p>



<p><strong>app</strong> &#8211; encrypted blob<br><strong>boot</strong> &#8211; accessible, boot image and config files<br><strong>data</strong> &#8211; encrypted blob<br><strong>root</strong> &#8211; linux filesystem</p>



<p>Now I could edit /etc/passwd on the “Root” SD card filesystem, I changed medtronic to user / group 0, reinstalled the SD card, booted the system and logged in with “medtronic” with no password and was greeted with:</p>



<pre class="brush: c++; gutter: false; first-line: 1">
root@Vega1:/home/medtronic# id
uid=0(root) gid=0(root) groups=0(root)
root@Vega1:/home/medtronic# uname -a
Linux Vega1.2.4p 3.0.3.ti-omap3-beagle-2.6.29 #19 PREEMPT Tue Jul 9 13:57:40 CDT 2019 armv7l unknown
</pre>



<p>Woop Woop I now have root access to the device!</p>



<h2 class="wp-block-heading">Further software analysis</h2>



<p>Although the “data” and “app” folders are encrypted at rest, now with a root shell they are browsable like normal directories. I was expecting some PII, but there was not on this device I bought from ebay, I&#8217;m not sure if that&#8217;s because none is stored on it in these encrypted folders or because I got a previously unused device. Either way there wasn&#8217;t much interesting in these encrypted folders, some apps and some config files but nothing of note!</p>



<p>The device did have some interesting processes that auto-start in boot, I have yet to reverse them but that would definitely be the next course of action.:</p>



<pre class="brush: c++; gutter: false; first-line: 1">
/usr/bin/mono /usr/lib/mono/2.0/mono-service.exe -l:/var/run/tc.pid TcpIpTCService.exe
/opt/medtronic/bin/audiod
/opt/medtronic/bin/inputd
/opt/medtronic/bin/lcdd
/opt/medtronic/bin/nvmemoryd
/opt/medtronic/bin/swupdated
</pre>



<p>linenum and linpeas were run to find some interesting things that have yet to be explored. There were some hardcoded URL&#8217;s and IP addresses in network config files. </p>



<h1 class="wp-block-heading">Encryption key</h1>



<p>The file “/home/root/.ecryptfs/sig-cache.txt” contains “d3dc25a49f392a16”. This has to do with the encrypted folders on the SD card and shows they are encrypted with eCryptfs (a stacked filesystem for Linux).</p>



<p>Lets get that key!</p>



<pre class="brush: c++; gutter: false; first-line: 1">
root@Vega1:/home/medtronic# keyctl show
Session Keyring
       -3 --alswrv      0     0  keyring: _ses
       
root@Vega1:/home/medtronic# keyctl list @us
1 key in keyring:
337948780: --alswrv     0    -1 keyring: _uid.0

root@Vega1:/home/medtronic# keyctl list @s
keyring is empty

root@Vega1:/home/medtronic# keyctl list 337948780
1 key in keyring:
537071990: --alswrv     0     0 user: d3dc25a49f392a16

root@Vega1:/home/medtronic# keyctl describe 537071990
537071990: als-rvalswrv------------     0     0 user: d3dc25a49f392a16

root@Vega1:/home/medtronic# keyctl read 537071990
740 bytes of data in key:
04000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 0a000000 00000000
40000000 02000000 83f76744 ade8641a 8e3a3385 c8498324 46f2babd 5772bb44
43e99124 743abf61 927eee05 1a90db98 14426bc1 b004644d 4124a072 89fe8808
b517ca8f 744319ec 64336463 32356134 39663339 32613136 00001122 33445566
77000000
</pre>



<p>Lets double check the encrypted file systems:</p>



<pre class="brush: c++; gutter: false; first-line: 1">
root@Vega1:/home/medtronic# mount | grep ecryptfs
/data on /data type ecryptfs (rw,relatime,ecryptfs_fnek_sig=d3dc25a49f392a16,ecryptfs_sig=d3dc25a49f392a16,ecryptfs_cipher=aes,
    ecryptfs_key_bytes=16,ecryptfs_passthrough,ecryptfs_unlink_sigs)
/opt on /opt type ecryptfs (rw,relatime,ecryptfs_fnek_sig=d3dc25a49f392a16,ecryptfs_sig=d3dc25a49f392a16,ecryptfs_cipher=aes,
    ecryptfs_key_bytes=16,ecryptfs_passthrough,ecryptfs_unlink_sigs)
</pre>



<p>With that you can now mount the file systems on your own linux host.</p>



<h2 class="wp-block-heading">Future plans</h2>



<p>This blog is getting long, but at least shows a starting point, and overview of the device and how to get root. Next steps would be reversing the apps, specifically the ones automatically started that seem custom to the device. A deep dive into the OS to look for hard coded keys or backdoors (busybox is notorious for these). It would be good to see how it communicates to the handset (I suspect via bluetooth and use the 4g dongle to talk to the backend &#8211; this needs confirming though). The handset also needs reversing as that is a separate device with it&#8217;s own processor etc.</p>



<p>Overall this has been fun, and I hope you have enjoyed this and learnt something.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rossmarks.uk/blog/pacemaker-pwn-pt-1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1820</post-id>	</item>
		<item>
		<title>GL iNet 300M Fun (Pt.3)</title>
		<link>https://rossmarks.uk/blog/gl-inet-300m-fun-pt-3/</link>
					<comments>https://rossmarks.uk/blog/gl-inet-300m-fun-pt-3/#respond</comments>
		
		<dc:creator><![CDATA[Ross Marks]]></dc:creator>
		<pubDate>Wed, 31 Jan 2024 11:49:12 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://rossmarks.uk/blog/?p=1762</guid>

					<description><![CDATA[I recently stumbled across these cute little boards on amazon and HAD to get some, without a project in mind. I quickly decided these would make an awesome little hardware backdoor/implant, and it just so happens I have a little &#8230; <a href="https://rossmarks.uk/blog/gl-inet-300m-fun-pt-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p>I recently stumbled across these cute little boards on amazon and HAD to get some, without a project in mind.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/amazon_listing.png" rel="lightbox[1762]"><img loading="lazy" decoding="async" width="1024" height="571" data-attachment-id="1763" data-permalink="https://rossmarks.uk/blog/gl-inet-300m-fun-pt-3/amazon_listing-4/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/amazon_listing.png" data-orig-size="1178,657" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="amazon_listing" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/amazon_listing-300x167.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/amazon_listing-1024x571.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/amazon_listing-1024x571.png" alt="" class="wp-image-1763" style="width:538px;height:auto" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/amazon_listing-1024x571.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/amazon_listing-300x167.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/amazon_listing-768x428.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/amazon_listing-500x279.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/amazon_listing.png 1178w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>I quickly decided these would make an awesome little hardware backdoor/implant, and it just so happens I have a little device I&#8217;ve been messing with for a while now. </p>



<p>So far in Pt.1 and 2 we have:</p>



<ul class="wp-block-list">
<li>Identified debug ports on the router&#8217;s PCB</li>



<li>Connected to UART to get a root shell</li>



<li>Added external headers to easily access the UART</li>



<li>Identified GPIO on the PCB</li>



<li>Added a &#8220;backdoor&#8221; via the GPIO by flashing the password in morse using an LED</li>
</ul>



<p>The plan was to squash the ESP32 in the router&#8217;s case, leech off of the devices power and interface with the already discovered UART. I would access this from the ESP32&#8217;s onboard wifi in AP mode.</p>



<p>It was easy to find the pins needed to interface with UART and give it power.<br></p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/pinout.jpg" rel="lightbox[1762]"><img loading="lazy" decoding="async" width="960" height="420" data-attachment-id="1764" data-permalink="https://rossmarks.uk/blog/gl-inet-300m-fun-pt-3/pinout/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/pinout.jpg" data-orig-size="960,420" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="pinout" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/pinout-300x131.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/pinout.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/pinout.jpg" alt="" class="wp-image-1764" style="width:608px;height:auto" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/pinout.jpg 960w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/pinout-300x131.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/pinout-768x336.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/pinout-500x219.jpg 500w" sizes="auto, (max-width: 960px) 100vw, 960px" /></a></figure>
</div>


<p>So it requires 5v to run, I probed around the router&#8217;s PCB until I found a 5v source</p>



<figure class="wp-block-image size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_061933-scaled.jpg" rel="lightbox[1762]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="1765" data-permalink="https://rossmarks.uk/blog/gl-inet-300m-fun-pt-3/20240131_061933/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_061933-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1706681973&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;1250&quot;,&quot;shutter_speed&quot;:&quot;0.04&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="20240131_061933" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_061933-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_061933-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_061933-1024x461.jpg" alt="" class="wp-image-1765" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_061933-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_061933-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_061933-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_061933-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_061933-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_061933-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>It was fairly easy to wire up using a PCB using the previous UART headers added and the new 5v source.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_132251-scaled.jpg" rel="lightbox[1762]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="1766" data-permalink="https://rossmarks.uk/blog/gl-inet-300m-fun-pt-3/20240130_132251/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_132251-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1706620971&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;1600&quot;,&quot;shutter_speed&quot;:&quot;0.058823529411765&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="20240130_132251" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_132251-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_132251-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_132251-1024x461.jpg" alt="" class="wp-image-1766" style="width:840px;height:auto" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_132251-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_132251-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_132251-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_132251-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_132251-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_132251-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<figure class="wp-block-image size-large is-resized"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_230920-scaled.jpg" rel="lightbox[1762]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="1767" data-permalink="https://rossmarks.uk/blog/gl-inet-300m-fun-pt-3/20240130_230920/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_230920-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1706656161&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;800&quot;,&quot;shutter_speed&quot;:&quot;0.04&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="20240130_230920" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_230920-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_230920-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_230920-1024x461.jpg" alt="" class="wp-image-1767" style="width:840px;height:auto" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_230920-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_230920-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_230920-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_230920-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_230920-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240130_230920-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>I found a webserver library and modified the example code to send and receive to the UART</p>



<pre class="brush: c++; gutter: false; first-line: 1">
/*
  WebSerialLite Demo AP
  ------
  This example code works for both ESP8266 &amp; ESP32 Microcontrollers
  WebSerial is accessible at 192.168.4.1/webserial URL.

  Author: HomeboyC
*/
#include &lt;Arduino.h&gt;
#if defined(ESP8266)
  #include &lt;ESP8266WiFi.h&gt;
  #include &lt;ESPAsyncTCP.h&gt;
#elif defined(ESP32)
  #include &lt;WiFi.h&gt;
  #include &lt;AsyncTCP.h&gt;
#endif
#include &lt;ESPAsyncWebServer.h&gt;
#include &lt;WebSerialLite.h&gt;

AsyncWebServer server(80);

const char* ssid = &quot;uartbackdoor&quot;; // Your WiFi AP SSID 
const char* password = &quot;uartbackdoor&quot;; // Your WiFi Password


/* Message callback of WebSerial */
void recvMsg(uint8_t *data, size_t len){
  WebSerial.println(&quot;Received Data...&quot;);
  String d = &quot;&quot;;
  for(int i=0; i &lt; len; i++){
    d += char(data[i]);
  }
  Serial1.println(d);
  WebSerial.println(d);
}

void setup() {
    Serial.begin(9600);
    Serial1.begin(115200,SERIAL_8N1, 4,5); //int8_t rxPin=4, int8_t txPin=5 
    WiFi.softAP(ssid, password);

    IPAddress IP = WiFi.softAPIP();
    Serial.print(&quot;AP IP address: &quot;);
    Serial.println(IP);
    // WebSerial is accessible at &quot;&lt;IP Address&gt;/webserial&quot; in browser
    WebSerial.begin(&amp;server);
    /* Attach Message Callback */
    WebSerial.onMessage(recvMsg);
    server.begin();
}

void loop() {

  if (Serial1.available()) {
    char receivedData[2]; // Assuming the received data is a single character
    receivedData[0] = Serial1.read();
    receivedData[1] = &#039;\0&#039;; // Null-terminate the string
    WebSerial.printf(&quot;%s&quot;, receivedData); // Print the string
  }
    
}
</pre>



<p>On my phone I connected to the wifi access point running on the ESP32 and browse to the webserver endpoint:</p>



<figure class="wp-block-image aligncenter size-large is-resized"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_see_wifi.png" rel="lightbox[1762]"><img loading="lazy" decoding="async" width="462" height="1024" data-attachment-id="1770" data-permalink="https://rossmarks.uk/blog/gl-inet-300m-fun-pt-3/phone_see_wifi/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_see_wifi.png" data-orig-size="584,1295" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="phone_see_wifi" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_see_wifi-135x300.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_see_wifi-462x1024.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_see_wifi-462x1024.png" alt="" class="wp-image-1770" style="width:270px;height:auto" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_see_wifi-462x1024.png 462w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_see_wifi-135x300.png 135w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_see_wifi.png 584w" sizes="auto, (max-width: 462px) 100vw, 462px" /></a><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_webui.png" rel="lightbox[1762]"><img loading="lazy" decoding="async" width="462" height="1024" data-attachment-id="1771" data-permalink="https://rossmarks.uk/blog/gl-inet-300m-fun-pt-3/phone_webui/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_webui.png" data-orig-size="584,1295" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="phone_webui" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_webui-135x300.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_webui-462x1024.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_webui-462x1024.png" alt="" class="wp-image-1771" style="width:270px;height:auto" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_webui-462x1024.png 462w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_webui-135x300.png 135w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/phone_webui.png 584w" sizes="auto, (max-width: 462px) 100vw, 462px" /></a></figure>



<p>It works, but wow that&#8217;s ugly. So I decided to scrap the webserver idea and instead run a telnet server that can be connected to through putty or any other means. I don&#8217;t want to re-invent the wheel and figured someone must have done this before&#8230; turns out they had, with some minor modification the new code became:</p>



<pre class="brush: c++; gutter: false; first-line: 1">
#include &lt;WiFi.h&gt;

const char* ssid = &quot;uartbackdoor&quot;; // Your WiFi AP SSID 
const char* password = &quot;uartbackdoor&quot;; // Your WiFi Password

WiFiServer Server(23);
WiFiClient Client;

void setup() {
  int8_t i;
  
  Serial.begin(115200);
  Serial1.begin(115200,SERIAL_8N1, 4,5); //int8_t rxPin=4, int8_t txPin=5 
  Serial.print(&quot;\nSetting up Access Point...&quot;);
  
  // Configure Access Point
  WiFi.softAP(ssid, password);
  
  Serial.println(&quot; Access Point set up.\nLocal IP address: &quot; + WiFi.softAPIP().toString());
  
  Server.begin();
  Server.setNoDelay(true);
  Serial.print(&quot;Ready! Use port 23 to connect.&quot;);
}

void loop() {
  delay(200);
  
  if (Server.hasClient()) {
    Client = Server.available();
    if (!Client) Serial.println(&quot;available broken&quot;);
    Serial.print(&quot;New client: &quot;);
    Serial.println(Client.remoteIP());
  }

  if (Client &amp;&amp; Client.connected()) {
    if (Client.available()) {
      while (Client.available()) {
        Serial1.write(Client.read());
      }
    }
  } else if (Client) {
    Client.stop();
  }

  if (Serial1.available()) {
    size_t len = Serial1.available();
    char sbuf[len];
    Serial1.readBytes(sbuf, len);
    if (Client &amp;&amp; Client.connected()) {
      Client.write(sbuf, len);
    }
  }
}
</pre>



<p>lets connect to it&#8217;s wifi and see if it works:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/telnet_working.png" rel="lightbox[1762]"><img loading="lazy" decoding="async" width="1024" height="570" data-attachment-id="1776" data-permalink="https://rossmarks.uk/blog/gl-inet-300m-fun-pt-3/telnet_working/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/telnet_working.png" data-orig-size="2022,1125" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="telnet_working" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/telnet_working-300x167.png" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/telnet_working-1024x570.png" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/telnet_working-1024x570.png" alt="" class="wp-image-1776" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/telnet_working-1024x570.png 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/telnet_working-300x167.png 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/telnet_working-768x427.png 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/telnet_working-1536x855.png 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/telnet_working-500x278.png 500w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/telnet_working.png 2022w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p>OK that looks a lot better! after playing around running some commands it works brilliantly.<br>To finish up I flashed the firmware onto an ESP32 without headers and soldered it to the router&#8217;s PCB. This  was then all squashed back into the router case and no-one would be any the wiser!</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_101045-scaled.jpg" rel="lightbox[1762]"><img loading="lazy" decoding="async" width="1024" height="461" data-attachment-id="1777" data-permalink="https://rossmarks.uk/blog/gl-inet-300m-fun-pt-3/20240131_101045/" data-orig-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_101045-scaled.jpg" data-orig-size="2560,1153" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.8&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;SM-G981B&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1706695845&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;5.4&quot;,&quot;iso&quot;:&quot;640&quot;,&quot;shutter_speed&quot;:&quot;0.03030303030303&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="20240131_101045" data-image-description="" data-image-caption="" data-medium-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_101045-300x135.jpg" data-large-file="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_101045-1024x461.jpg" src="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_101045-1024x461.jpg" alt="" class="wp-image-1777" srcset="https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_101045-1024x461.jpg 1024w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_101045-300x135.jpg 300w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_101045-768x346.jpg 768w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_101045-1536x692.jpg 1536w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_101045-2048x922.jpg 2048w, https://rossmarks.uk/blog/blog-shizz/uploads/2024/01/20240131_101045-500x225.jpg 500w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Overall this was a fun proof-of-concept but ultimately a terrible backdoor. It requires the attacker to be within range of the ESP32&#8217;s wifi (fairly short distance) and is incredibly obvious since the user will be looking for available networks anyway to find the router&#8217;s name.</p>



<p>It could be improved by having the ESP32 in client mode connect to a known network (possibly the attackers mobile in hotspot mode). A better idea would be having the ESP32 pull the wireless details from the router via UART then in client mode connect to the router&#8217;s wifi and send the UART over the internet to an attackers C&amp;C server.</p>



<p>Even if these improvements were made if anyone looked in the device it would be obvious that something was wrong, a stealthier backdoor would be hardcoding a reverse shell in the router&#8217;s software.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rossmarks.uk/blog/gl-inet-300m-fun-pt-3/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1762</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced (Page is feed) 
Lazy Loading (feed)

Served from: rossmarks.uk @ 2026-04-02 14:15:38 by W3 Total Cache
-->