<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dustin R. Heart on Medium]]></title>
        <description><![CDATA[Stories by Dustin R. Heart on Medium]]></description>
        <link>https://medium.com/@doctorless?source=rss-c6ed3d1e6341------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ba3idtrT8ETjJwyiuSomZw.png</url>
            <title>Stories by Dustin R. Heart on Medium</title>
            <link>https://medium.com/@doctorless?source=rss-c6ed3d1e6341------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 10:18:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@doctorless/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Thinking Like A Hacker — Part III: At Smart Lock, Your Voice Is Your Password]]></title>
            <link>https://medium.com/@doctorless/thinking-like-a-hacker-part-iii-at-smart-lock-your-voice-is-your-password-2d9638b47dd9?source=rss-c6ed3d1e6341------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d9638b47dd9</guid>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[buffer-overflow]]></category>
            <dc:creator><![CDATA[Dustin R. Heart]]></dc:creator>
            <pubDate>Sun, 20 Aug 2017 07:29:24 GMT</pubDate>
            <atom:updated>2017-08-20T07:29:24.790Z</atom:updated>
            <content:encoded><![CDATA[<p>In <a href="https://medium.com/@drheart/thinking-like-a-hacker-part-i-finding-the-mindset-59991a594f97">Part I</a>, I cover an approach to finding the hacking mindset through looking at your own code. In <a href="https://medium.com/@drheart/thinking-like-a-hacker-part-ii-when-the-backdoor-finds-you-4057378c7f7d">Part II</a>, I approach this discovery through an analysis of an active hacking attempt. Disclaimer: This story (as well as prior stories) is entirely fictional. While I may refer to publicized vulnerabilities in passing, the “discovered” vulnerabilities within the story do not correspond to any actual product.</p><p>Return to the Smart Lock adventures. Theoretical you, having just broken into your home by virtue of exploiting your own product, realize you have some work to do. Of course, just fixing bugs won’t do. You’ve got thousands of stars on GitHub and dozens of pull requests on your issue tracker to review! One pull request stands out as the most interesting next feature: voice mail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*frytsUpkN8Dfox0xEcHEdA.png" /><figcaption>On second thought…</figcaption></figure><blockquote>Feature description: The ability for a visitor to leave a message, either by microphone on the lock, or through the app when in proximity to send a voice message by bluetooth. Messages can be reviewed either on the lock, or through your account on the app.</blockquote><p>Neat.</p><p>Concerned by your own break-in, you decide it wise to consider all possibilities, no matter how esoteric, that may lead this feature back into your home. A few things spark your imagination:</p><ol><li>Too long of a message could run your lock’s local storage out of space. <em>Need to enforce storage limits, or just stream it from the API.</em></li><li>In order to leave a message through the app, the lock will need to broadcast an identifier to local bluetooth devices to associate the message with the lock. <em>Broadcasting the ID of the lock shouldn’t (in theory) lead to compromise, but you already know how well that went for you. Better to have the lock generate a new ID to use to store the message.</em></li><li>While the only way you can get a message to the lock is by proximity, there’s nothing stopping you from getting the ID, then sending whatever you want as a file manually. <em>Got to check the file type of the submitted data. More importantly, it needs to actually check the file, not just the file extension.</em></li></ol><p>Other than those concerns, it seems like a solid PR. You merge it into a new feature branch so you can add your changes, and spin up a test environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3JkbVw0x0dirJBgVMooJZA.png" /></figure><p>So far, so good. You fire up a test copy of your phone app, and leave a voicemail. Playback works successfully. Extra neat. The prospect of sound playback from user-submitted files still gets to you. You’ve seen the lesson learned by others in the industry: always assume user-provided data is hostile. Heck, you <em>were</em> the hostile user data. Time to get creative.</p><p>Buffer overflow exploits are a known type of vulnerability to watch out for. You’ve heard of them in practice, you even jailbroke your phone with one, but you’ve never really employed one of your own crafting before. You’ve vetted everything else about the PR, but the audio playback is being performed through a third-party (albeit open source) application.</p><p>Yet-another Open-source Library for Orchestrating Sound, as WAV or Another Genre — or YOLOSWAG for short (please never name your project this), being the most popular library for, well, orchestrating sound, is the component of choice. Being as popular as it is, it supports a variety of formats, including some rather obscure codecs you’ve never heard of. With this many independently-contributed codecs, there’s got to be one that wasn’t well-written.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*44dxKxmKkMyhy1n8.jpg" /><figcaption>I mean, with a name like that, how could it <strong><em>not </em></strong><em>be secure?</em></figcaption></figure><p>In open source projects and closed source projects alike, developers put a lot of their attention towards features which see the most use. This has a correlation with the areas of attention given to security from these same developers. It’s not a criticism; a balance always has to be struck with limited resources, but it can’t be forgotten, that while developers are putting most of their attention towards improving features and creating value-adds, those wanting to break in will have the easiest time usually in the components that did not receive the same time dedication.</p><p>Looking through the YOLOSWAG commit history, you see that one particular format, Audio to the Eleventh Power (or AAAAAAAAAAA, for short) hasn’t seen any changes since it’s first commit, which was provided by a relatively new, infrequently-active committer. A quick review of the codec’s README indicates the format was made as a senior final project for their CS degree. This <em>compelling</em> backstory granted an approval by the project maintainers to merge it into the master branch.</p><p>In audio file formats, there can be many layers of complexity. Some file formats serve as containers for audio data encoded through a variety of codecs (AIFF and WAV come to mind). Some formats are singular in nature; limited to a specific codec, perhaps lossless, lossy, or no compression measures involved. The greater the complexity, the more possibilities for mistakes, and the harder it becomes for automated pentest tools to find them, if any are being used at all.</p><p>AAAAAAAAAAA, on the other hand, is pretty simple. Lower level languages aren’t your forte, but the simplicity makes it a pretty easy read.</p><pre>static int aaaaaaaaaaa_decode_frame(YOLOSWAGContext* context, unsigned char* data, YOLOSWAGPacket* packet) {<br>    unsigned int frame_size = 0;<br>    char frame[4096] = memset(; // each frame can only be 4096 bytes.<br>    memcpy(&amp;frame_size, data, 4); // copy the first four bytes from the data<br>    <br>    data += 4; // advance the data four bytes</pre><pre>    <strong>memcpy(frame, data, frame_size);</strong> // copy the data into frame</pre><pre>    // ...<br>    // decoding logic on frame occurs here, then creation and assignment of decoded PCM data to the packet.<br>    // ...</pre><pre>    return 0;<br>}</pre><p>“Wait, did that just do what I think it did?”</p><p>Yeah, you got yourself an opportunity for a buffer overflow. The author of AAAAAAAAAAA didn’t bother to check if frame_size was greater than the actual amount of space allotted to frame.</p><p>Of course, there’s a lot of code in the way of getting there. No harm in trying though. You write an audio file in the AAAAAAAAAAA format, using the conversion tools helpfully provided by the YOLOSWAG maintainers. The sound of Tim Allen’s <a href="https://www.youtube.com/watch?v=KnsiZOJjfUg">AUUUGH</a> seems suitable. A test run verifies that the sounds of the 90s are still alive today, even in an audio format written by someone who was too young to have seen it. Time to fire up a hex editor.</p><p>Changing the frame_size value in the last segment of the file to 5000 should do nicely. Adding some extra garbage data at the end to pad the file to the size, you now have your first test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/1*7e8CAbu8sZJkbpmWaSMx2g.png" /><figcaption>This bodes well.</figcaption></figure><p>Sure enough, not only did it segfault, you got no word of a stack smashing warning. A little more tweaking to your audio file so you can rearrange the stack to return to a libc call to write to your serial device (and unlock your lock), and you get this wonderful outcome on your test lock:</p><p><a href="https://streamable.com/s/vuxvg/sqacun">Streamable - free video publishing</a></p><p>After disclosing your findings to the YOLOSWAG team, you decide it best to limit file support to MP3, and execute the player process as a user with severely limited rights.</p><p>AAAAAAAAAAA, indeed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d9638b47dd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thinking Like A Hacker — Part II: When The Backdoor Finds You]]></title>
            <link>https://medium.com/@doctorless/thinking-like-a-hacker-part-ii-when-the-backdoor-finds-you-4057378c7f7d?source=rss-c6ed3d1e6341------2</link>
            <guid isPermaLink="false">https://medium.com/p/4057378c7f7d</guid>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Dustin R. Heart]]></dc:creator>
            <pubDate>Mon, 14 Aug 2017 08:37:06 GMT</pubDate>
            <atom:updated>2017-08-14T08:37:06.694Z</atom:updated>
            <content:encoded><![CDATA[<p>The world of software engineering is the culmination of efforts — teams assembling new works, improving old works, leveraging the byproducts of other teams, internally and externally to the business. The countless number of eyes poring over most of the tools we rely on gives us a sense of comfort; code having been around for over a decade should be bulletproof, right?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w8wUTygI3nDBpE55.jpg" /><figcaption>Ceci n’est pas une porte dérobée. I don’t speak French, but I do speak Google Translate.</figcaption></figure><p>In the less-idyllic real world, we know this isn’t true. Long-standing vulnerabilities in crucial pieces of infrastructure appear every day. At a certain point of making considerations to the components we rely on, a level of acceptable risk has to be determined. We mitigate these risks by instituting firewalls, <a href="https://communities.cisco.com/community/technology/security/ngfw-firewalls/blog/2017/04/14/equation-group-exploit-hits-newer-cisco-asa-juniper-netscreen">hoping that a product with security at its focus will never betray us.</a> We also mitigate these risks by limiting our reliance on other projects, reinventing the wheel where necessary or simply not partaking the next Web 3.0 technology until it is a little more long in the tooth.</p><p>It is often the case that the most unsuspected piece of the architecture is the one that bites us in the end. A great case for this is OpenSSL. It’s frequently taken the brunt of security researchers’ ire in the past few years, but part of this blame comes from the fact that despite it being a project to provide security, few contributors to the project were taking as close an approach towards improving the overall security of the product. Nevertheless, it is used by <a href="http://www.asecurelife.com/heartbleed-bug/">about two thirds of all HTTPS-serving websites.</a></p><p>In <a href="https://medium.com/@drheart/thinking-like-a-hacker-part-i-finding-the-mindset-59991a594f97">Part I</a>, I spoke from a white box perspective. I have no desire to explicitly train would-be hackers, and there are far better resources to learn from if that is your aim. However, it is not always the case that you will have 100% introspection into all that inhabits your application’s ecosystem. Never mind the level of effort required even if all software used by your project were open source, but generally speaking, there will be components involved for which you simply do not have access to the code. A great example for this is the myriad of graphics, wireless and other hardware drivers used on otherwise open source environments.</p><p>So let’s revisit the first scenario from Part I. I’m going to pick on Larry’s e-commerce site again. Larry’s learned his lesson this time, and had his code thoroughly reviewed. No more vulnerabilities in his code, and he’s starting to follow best practices for managing passwords and deployments. He now even has logging on the queries that get executed, <em>just in case</em>. Now that his new and improved site is up and running, he gets to rest easy this weekend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/0*-HhmhuG0Ch9kiPH6.jpg" /><figcaption>Not in my examples, at least.</figcaption></figure><p>To his dismay, he wakes up to a page in the late hours of the evening: “ALL SHOPS DOWN. CUSTOMER DATA GONE.” Larry’s going to have a very bad Sunday. Reviewing the application logs on the logging service’s portal indicates nothing has gone awry, but still, all of the data is gone. Good thing there’s backups, but if it wasn’t his code, then how? Digging a little deeper into the logs, Larry sees that an address from Romania successfully connected to the database, and then executed a DROP. “How could they have gotten the password?” Larry asks himself. Good question.</p><p>Larry RDPs into the webserver and starts up a copy of SSMS. After restoring the database and resetting all passwords, he shuts off connectivity to the database from all addresses but the web servers, a practice he will likely be reminded of on Monday as one that should have always been the case. Letting his boss know everything is back online, he heads back to bed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b1-g4rAKPKwkeZyToTl52Q.png" /><figcaption>Time is an illusion. Bedtime doubly so.</figcaption></figure><p>In our hearts, I think we all knew the story wasn’t going to end here. Larry wakes again to the chorus of panic: “ALL SHOPS DOWN. SITES ARE DEFACED.”</p><p>“You’ve got to be kidding.”</p><p>Once again, Larry opens his laptop, this time to confirm the ecommerce stores are in fact all displaying a banner of hacking domination. Once again, he goes to the logs. Some time not long after he restored the databases, the event logs on the webservers indicate a successful RDP session started from that same Romanian address, using <em>his credentials.</em> Knowing that he certainly didn’t use a password for his account for anything else, the gears start turning as he changes his password. Before anything else though, he issues an emergency redeploy of the webservice, just in case the servers themselves are compromised. Finally, he turns off RDP access to any server but his own address and the office. “Let’s see them work around that one,” he says to himself, just before trying one last time to get some shuteye.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*iEjlw8VHWl4MG_OWMvRuQQ.png" /><figcaption>They worked around that one.</figcaption></figure><p>Realizing that he’s not getting any more sleep this morning, Larry once again looks at the logs, and notices that this time, the site was defaced through editing store items. Swearing up and down there was no way to break the authentication and authorization logic, he looked for patterns. Not all shops had been hacked. Of those that were, all of them had been logged into by the shop account’s administrator since the website was redeployed, followed by the attacker editing their stores as the administrators minutes later. Further, the address of the attacker keeps changing; there’s no way to block them.</p><p>After a heated call with management, Larry once again restores from a backup, and sets up a temporary redirect to an outage page. “These hackers are like magicians. How can they keep doing this?” This time he’s not ruling <em>anything</em> out. Once again, he reviews the logs, looking for anything that could be in error. After about a half hour of pulling out his hair, he notices that the third party emailing service (used to send customers email, and handle mail-based communication with shops) keeps posting service restart messages. Lining up the timestamps, it becomes apparent that the original attack started just a few hours after the email service restarts began. Having a much better idea about the source of the attack, Larry fires up Wireshark in the hopes of watching it in action. Sure enough…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*o7SV2_RpANhV3xFiIUW0Iw.png" /><figcaption>Oh.</figcaption></figure><p>The emailing service, which hasn’t seen updates in years, was using an outdated version of OpenSSL. The mail service API is compromised, sending heartbleed packets back to the service running on the webserver. This means they’ve been reading memory from the server the entire time this attack has been ongoing. It’s how they got the connection string (in memory). It’s how they got the remote desktop credentials (pass the hash attack, in memory). It’s how they got access to every shop administrator who logged in after the redeploy (you guessed it, in memory). After all the efforts of securing the store, Larry was undermined by a third-party component. Had he simply ran a vulnerability scan via a man-in-the-middle testing agent against all services with egress (more importantly, so should have the email service vendor), this would have been detected well in advance.</p><p>Talk about a wake-up call.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4057378c7f7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thinking Like A Hacker — Part I: Finding The Mindset]]></title>
            <link>https://medium.com/@doctorless/thinking-like-a-hacker-part-i-finding-the-mindset-59991a594f97?source=rss-c6ed3d1e6341------2</link>
            <guid isPermaLink="false">https://medium.com/p/59991a594f97</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking-for-defense]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Dustin R. Heart]]></dc:creator>
            <pubDate>Sun, 13 Aug 2017 04:11:47 GMT</pubDate>
            <atom:updated>2017-08-13T08:19:40.887Z</atom:updated>
            <content:encoded><![CDATA[<p>In my <a href="https://medium.com/@drheart/your-company-should-have-a-red-team-67fa8906c4c8">prior article</a>, I encourage leadership at tech companies to adopt an official policy for permitting vulnerability research internally. The focus of this post is to discuss the mindset a team needs to get themselves into when engaging in pentesting. One of the first things I hear when talking to developers about vulnerability discovery is that they find it difficult to approach code (either their own or the code of others) with a malicious mindset. <a href="https://plato.stanford.edu/entries/mencius/#3">Mencius would be proud</a>, but that vastly tips the scale in favor of the bad guys, regardless of their philosophical motivations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*HEgNXnh20V6p7x22QBH_yg.png" /><figcaption>“Your words, alas! would certainly lead all men on to reckon benevolence and righteousness to be calamities.”</figcaption></figure><p>So how does a benevolent mind approach security from an offensive perspective? Perhaps the best route is a little less Mencius, a little more Sun Tzu: know your enemy.</p><h3>Finding The Mindset Through Need: A Locked Front Door</h3><p>Most people know to lock their door when they leave their house; a recognition that while most people are good, there are some who wish to do harm, and they will do so via the easiest avenue. A benevolent mind will often forget to check that the windows are also locked, until they find themselves in a situation where such thoughts need occur — i.e. locking oneself out of their home. To trick yourself into the hacker mentality, it may prove useful to put yourself in a desperate mind if nefarious is not a state you can enter.</p><p>Imagine a scenario where a theoretical developer (We’ll call him Larry) has accidentally deleted the configuration files, and thus the connection strings to the database. “<em>Larry, you did keep this info in a password safe, right?” “Oops.”</em> His custom e-commerce site (note: I’m going to repeatedly pick on e-commerce with examples, as the architecture of these types of sites have a lot of moving pieces with very valuable information) remains happily chugging along, not being one to reload via config changes, but were it to tip over, he’d have a terrible outage. Larry has a copy of the config files for the development environment, which happens to closely mirror the production config, minus the connection strings. Larry also knows that the search feature of his application appends the search term to the query:</p><pre>// This hurt just as much to write as it does to read</pre><pre>SqlDataAdapter searchAdapter = new SqlDataAdapter(<br>    &quot;SELECT item_id, item_title, item_description FROM items &quot; +<br>    &quot;WHERE item_title LIKE &#39;%&quot; + <br>    SearchText + &quot;%&#39; OR item_description LIKE &#39;%&quot; + SearchText +<br>    &quot;%&#39;;&quot;, connection);</pre><p>And lastly, because in this example Larry also isn’t very good at safe database configurations, the DB user in this connection string effectively has superuser privileges. Thus locked out of his house, Larry attempts to open one of your unlocked windows with a search parameter:</p><pre>foo%&#39;; ALTER LOGIN ecomuser WITH PASSWORD = &#39;mynewpass&#39;; --</pre><p>Congratulations, theoretical Larry. You just performed a SQL injection, the number one threat on the <a href="https://www.owasp.org/index.php/Top_10_2013-Top_10">OWASP Top 10</a>. And if he could do it so easily, you can guarantee that someone else can, <em>and probably will</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*NIo3ePut7eovMFppTocBnw.png" /><figcaption>“I was able to restore my application, but…”</figcaption></figure><p>Now this above case was full of many other serious problems (not all inclusive, but in order of decreasing severity):</p><ol><li>The database user used by the application in this example had superuser privileges. This should <em>never</em> be the case. Full stop. The only applications which should have this kind of access are the tools which perform your database migrations, and even so they should also be limited to only having administrative control of the specific databases they <em>need </em>control over. The policy of limiting access granted to the DB user to only what is required for the tasks performed by the application is a fantastic example of <a href="https://en.wikipedia.org/wiki/Principle_of_least_privilege">The Principle of Least Privilege</a>.</li><li>Production deployments are not an automated process. This was evidenced by theoretical Larry mistakenly deleting the config files. Other than opportunity for mistakes, a manual deployment process means the life of production servers are in the direct hands of people, who can also act with <em>malice.</em></li><li>Similar to point 2, there isn’t an immutable, redundant infrastructure for deployments, evidenced by both the manual process for deployments and the fact that deleting a config file on a single server could undermine the application. I’m not so keen on moving everything into cloud services such as AWS (that is a post for another day), but even in locally-hosted environments, there are plenty of ways to have an immutable infrastructure (this is also a post for another day).</li></ol><p>I certainly hope breaking into your real applications will employ more cunning. <a href="https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20170802-ucm">But even the giants regularly fall.</a> <a href="https://blog.sucuri.net/2017/05/sql-injection-vulnerability-joomla-3-7.html">Often.</a> Frequently, developers will avoid the potential for SQL injection by leveraging frameworks to abstract away database access, such as object-relational mapping frameworks or well-vetted data access classes, but turning a blind eye to the risk by assuming safety in third parties can be just as dangerous.</p><h3>Finding The Mindset Through Desperation: This Time An Actual Locked Door</h3><p>Perhaps you <em>do</em> make sure your windows are locked. Perhaps you have a phone-controlled door lock and you will <em>never</em> leave home without your phone. Perhaps even, you wrote the door lock yourself because you can’t trust closed source lock providers (<a href="https://www.wired.com/2013/08/kwikset-smarkey-lock-vulns/">and there’s precedent for that mistrust</a>). Since we’re in the land of theoretical scenarios, let me illustrate this “perfect” envisioning of such a creation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eufnkks2_p0wlOgFYJVAxg.png" /><figcaption>To this day, I still don’t understand how people are willing to connect something as crucial as their front door lock to the Internet, but then again most people don’t cover their laptop camera.</figcaption></figure><p>Your architecture is well-vetted. Your authentication and authorization logic is flawless. All SQL is properly parameterized, every action is logged and auditable. The only open port you have is for HTTPS, and your web client app is wholly separate from your lock API. Good for you! These are all smart choices. Your lock is full of awesome (configurable) features, comparable to commercial products:</p><ul><li>Bluetooth proximity sensor unlocks the door after extended departure</li><li>Ability to query/set lock state from anywhere</li><li>Scheduling to unlock/lock door at set times for expected visitors, such as pet sitters</li><li>Scrollable message on LCD display informs lock state, can greet visitors</li><li>Tiny speaker on lock can also project a welcome message to visitors when door is opened</li></ul><p>All in all, a seriously solid project for someone going at it on their own. You even made it open source, and published the schematics. Your equally-geeky friends also thought it was awesome, and so now they all have one on their homes. It’s a runaway success.</p><p>One of your friends invites you over to their house for a party. You leave your laptop behind, knowing how wild these soirees can get. You open your Smart Lock app on your phone as you step out the door, and after authenticating with Touch ID, press the “LOCK” button, hearing a satisfying deadbolt click. Safe and sound. Time to party. As the night wears on with too many beers deep to leave room for wiser decisions, your friend decides to make margaritas, and so out comes the blender. You’re all far too gone already to notice that just before the ice went in, so too did your precariously perched phone. Add in some tequila, Cointreau, lime, and you’ve got yourself a Smashed Silicon Valley. Serve with umbrella toothpick.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8qouAWznomcw0a3mxt8NFw.png" /><figcaption>‘The secret ingredient is “phone”.’</figcaption></figure><p>The next morning arrives, and both a hangover and dread sets in. Your phone is gone, and your laptop is home. Your friend tells you not to worry, just to log in through your web client you so carefully designed. Your friend means well, but doesn’t know you heed the advice of security professionals and use a password manager for everything — which was on your phone.</p><p>Your authentication/authorization logic is “flawless”; no way you’re going to exploit your way in as yourself. A locksmith in the area is going to cost you at least $300 for a lock so exotic, and you’ll probably still end up with damage to your door. The prospect of knocking out a window becomes appealing. You start to mull over the code in your head. “Maybe there’s something I’ve missed.” Now you’re starting to think like a hacker. Your friend lends you her laptop. Stepping backward through your logic: your goal is to open the lock. The lock is opened with a POST request to /lock/{id}, with a JSON object containing state:</p><pre>{<br>   &quot;state&quot;: &quot;unlocked&quot;,<br>   &quot;message&quot;: &quot;Unlocked&quot;,<br>   &quot;opensound&quot;: &quot;default&quot;<br>}</pre><p>The API first verifies the authorization token, and if the token is not permitted to unlock the lock, then you are rejected with a 401. If only you could remember your authorization header. But then, you remembered something else that controls the lock — a schedule. The scheduler has a specific token that is authorized to unlock <em>any</em> lock, but the API handler for scheduling state changes uses your authorization token to determine the right to change state…</p><pre>[HttpPut(&quot;/lock/{id}/schedules&quot;)]<br>public async Task&lt;IActionResult&gt; AddScheduleToLock(<br>        string id,<br>        [FromBody]ScheduleLock scheduleLock) {</pre><pre>    if (!GetUser().HasRightsToLock(id)) {<br>        return Unauthorized();<br>    } else {<br>        scheduler.publish(new ScheduleLockMessage(<br>            id,<br>            scheduleLock));<br>        return Ok(scheduleLock);<br>    }<br>}</pre><p>At first glance, it doesn’t look promising. Let’s dive into the ScheduleLock class:</p><pre>public class ScheduleLock : Lock {</pre><pre>    public ScheduleLock Clone() {<br>        return (ScheduleLock)this.MemberwiseClone();<br>    }</pre><pre>    public DateTime ScheduleDate { get; set; }</pre><pre>    public Recurrence Recurrence { get; set; }</pre><pre>}</pre><p>You remember upon seeing this through your bleary eyes, that you wanted to future-proof the scheduler for any new features the lock may have, by simply extending the Lock class with a scheduled time. Let’s follow this through to the other side, the scheduler. It’s also the component you remember not being the most well-written. The scheduler has a subscriber to the pubsub queue you set up:</p><pre>public async Task HandleScheduleLockMessage(<br>        ScheduleLockMessage message) {</pre><pre>    if (DateTime.Compare(message.ScheduleLock.ScheduleDate, DateTime.Now) &lt; 0) {<br>        Lock lock = (Lock) message.ScheduleLock;<br>        lock.Id = lock.Id ?? message.LockId;<br>        <br>        if (message.ScheduleLock.Recurrence != Recurrence.Never) {<br>            var newMessage = new ScheduleLockMessage(lock.Id,<br>                message.ScheduleLock.Clone());</pre><pre>            switch (message.ScheduleLock.Recurrence) {<br>                case Recurrence.Monthly:<br>                    newMessage.ScheduleLock.ScheduleDate = <br>                        newMessage.ScheduleLock.ScheduleDate<br>                        .AddMonths(1);<br>                    break;<br>                case Recurrence.Weekly:<br>                    newMessage.ScheduleLock.ScheduleDate =<br>                        newMessage.ScheduleLock.ScheduleDate<br>                        .AddDays(7);<br>                    break;<br>                case Recurrence.Daily:<br>                    newMessage.ScheduleLock.ScheduleDate =<br>                        newMessage.ScheduleLock.ScheduleDate<br>                        .AddDays(1);<br>                    break;<br>            }</pre><pre>            scheduler.publish(newMessage);<br>        }<br>        <br>        DB.Locks.Update(lock);<br>    } else {<br>        scheduler.publish(message); // just re-enqueue it<br>    }<br>}</pre><p>After mulling it over for a few moments, you notice you are assigning the Id property of the Lock if it isn’t <em>already </em>set. Your AddScheduleToLock API handler simply deserializes whatever properties of ScheduleLock are provided to it, and the Id value on the JSON object is <em>never checked. </em>Uh oh.</p><p>In OWASP terms, this falls under #4 of the Top 10: Insecure Direct Object References, by virtue of a <em>Mass Assignment</em> vulnerability.</p><p>Creating a test account, you PUT a schedule on your test lock’s URI, using your home lock’s Id (which you accidentally committed early on in some test code, but later removed) in the JSON:</p><pre>$ curl -X PUT -H &quot;Authorization: Token WW91IGRpZG4ndCB0aGluayBJJ2QgYWN0dWFsbHkgcHV0IGEgcmVhbCB2YWx1ZSBoZXJlLCBkaWQgeW91Pw==&quot; -d &#39;{ &quot;state&quot;: &quot;unlocked&quot;, &quot;id&quot;: &quot;e5ea783d-b32a-4716-8001-89d7e035c2df&quot;, &quot;scheduledate&quot;: &quot;2017-08-12T08:00:00Z&quot;, &quot;recurrence&quot;: &quot;Never&quot; }&#39; https://api.example.com/v1/lock/4ee62a78-0970-4a2f-bd68-0a678944bb6a/schedules -v</pre><pre>*   Trying api.example.com...<br>* TCP_NODELAY set<br>* Connected to api.example.com (0.0.0.0) port 443 (#0)<br>* ALPN, offering http/1.1<br>* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH<br>* successfully set certificate verify locations:<br>*   CAfile: /opt/local/share/curl/curl-ca-bundle.crt<br>CApath: none<br>* TLSv1.2 (OUT), TLS header, Certificate Status (22):<br>* TLSv1.2 (OUT), TLS handshake, Client hello (1):<br>* TLSv1.2 (IN), TLS handshake, Server hello (2):<br>* TLSv1.2 (IN), TLS handshake, Certificate (11):<br>* TLSv1.2 (IN), TLS handshake, Server key exchange (12):<br>* TLSv1.2 (IN), TLS handshake, Server finished (14):<br>* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):<br>* TLSv1.2 (OUT), TLS change cipher, Client hello (1):<br>* TLSv1.2 (OUT), TLS handshake, Finished (20):<br>* TLSv1.2 (IN), TLS change cipher, Client hello (1):<br>* TLSv1.2 (IN), TLS handshake, Finished (20):<br>* SSL connection using TLSv1.2 / ECDHE-ECDSA-AES128-GCM-SHA256<br>* ALPN, server accepted to use http/1.1<br>* Server certificate:<br>*  subject: C=US; ST=Somewhere; L=Somewhere View; O=Example Inc; CN=*.example.com<br>*  start date: Aug  2 19:27:21 2017 GMT<br>*  expire date: Oct 25 19:23:00 2017 GMT<br>*  subjectAltName: host &quot;example.com&quot; matched cert&#39;s &quot;example.com&quot;<br>*  issuer: C=US; O=Example Inc; CN=Example Internet Authority G2<br>*  SSL certificate verify ok.<br>&gt; PUT /v1/lock/4ee62a78-0970-4a2f-bd68-0a678944bb6a/schedules HTTP/1.1<br>&gt; Host: api.example.com<br>&gt; User-Agent: curl/7.53.1<br>&gt; Accept: */*<br>&gt; Content-Length: 132<br>&gt; Content-Type: application/json<br>&gt;<br>* upload completely sent off: 132 out of 132 bytes<br>&lt; <strong>HTTP/1.1 200 OK</strong><br>&lt; Connection: close<br>&lt; Content-type: application/json<br>&lt;<br>* Closing connection 0<br>{&quot;state&quot;:&quot;unlocked&quot;,&quot;id&quot;:&quot;e5ea783d-b32a-4716-8001-89d7e035c2df&quot;, &quot;scheduledate&quot;:&quot;2017-08-12T08:00:00Z&quot;,&quot;recurrence&quot;:&quot;Never&quot;,&quot;message&quot;:null,&quot;opensound&quot;:null}</pre><p>Talk about mixed emotions.</p><p>In Part II, I will discuss the mindset from the perspective of side-channel attacks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59991a594f97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your Company Should Have A Red Team]]></title>
            <link>https://medium.com/@doctorless/your-company-should-have-a-red-team-67fa8906c4c8?source=rss-c6ed3d1e6341------2</link>
            <guid isPermaLink="false">https://medium.com/p/67fa8906c4c8</guid>
            <category><![CDATA[risk-management]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Dustin R. Heart]]></dc:creator>
            <pubDate>Sat, 12 Aug 2017 05:14:15 GMT</pubDate>
            <atom:updated>2017-08-12T05:14:15.090Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uSGYOkkgQ-XVKfdXVOPQjw.png" /></figure><p>In the parlance of the Intelligence Community (IC), there exists the concept of a “Red Team” — an oppositional yet internal force which has the sole purpose of finding weaknesses, in order to assess risk and improve effectiveness at handling risk. In the corporate world, this term is more narrow, in that it typically applies to a team tasked with finding vulnerabilities, both in the software produced within, and the surrounding infrastructure (physical and digital). If you don’t already have one, you should seriously consider starting one. If it is too much to ask to have resources dedicated to this full time, then it should at least be something that an internal team is performing part time, preferably as a blend of members from different engineering teams. The resource cost of not having one may far outweigh the possible financial, reputational, and legal costs — an ounce of prevention, etc. While I write this article with an aim towards tech companies, this isn’t something to be ignored by non-tech industries; even a theoretical paper-only clinic need worry about social engineering, for example.</p><h3>Why Should I Care?</h3><p>As time marches on, hardware gets cheaper, and the Internet grows more deeply connected. Cyberattacks once considered sophisticated a decade ago are now a normal, automated component of an attacker’s arsenal. Today, fuzz testing serves as the method of choice for many bug bounty hunters. Tomorrow, this will likely be just another step in the automated scanners crawling the web on behalf of criminals in attacker-friendly nations. Having a team internally deploying the same tactics without having to worry about detection¹ gives you a greater peace of mind in ensuring the safety of your business.</p><p>Detection concerns aside, a red team also has an advantage that attackers do not always have. Information about your infrastructure: the network map, the equipment used, logs, and especially the <em>source code and application infrastructure </em>all make a potential hacker’s job exponentially easier — and your team has it from the start.</p><p>Don’t read into the above as an implicit approval of security through obscurity. There is little benefit to insider knowledge overall, and assumptions of safety guarantees can make teams more prone to making very costly mistakes. This applies in multiple levels. Many large businesses have internal supporting applications, where the assumption of the application remaining internal has lead to <a href="http://www.zdnet.com/article/anatomy-of-the-target-data-breach-missed-opportunities-and-lessons-learned/">actual data breaches</a>.</p><h3>How Do I Assemble A Red Team?</h3><p>If you don’t already have an active security or risk management team that can take on this role, you can certainly source from within. There are many engineers that are naturally curious, however they may feel fear of retribution either from other team members or their superiors if there is not a written policy allowing this. Conversely, you would not want to grant your employees the right to start digging around wherever they’d like. Having a clear call to action for a pentest team to assemble, with some reasonable guidelines on what constitutes acceptable behavior can go a long way.</p><p>The limits to allowable discovery should be reasonably soft, as long as proper disclosure is made to the right individuals who can record the incident and rectify it. In some sense, this policy should resemble the rules surrounding bug bounty programs many businesses offer. For starters:</p><ol><li>Define the areas of most interest, ranked in priority. This will likely start at your most popular software, down to the components and equipment (if applicable) your applications rely on.</li><li>Define what is out of scope. Production servers with customer data would likely fall under this, as would internal information not related to the product your company offers (like HR records, for example).</li><li>Devise a secure disclosure policy. This can be as simple as walking over to the affected team to let them know and demo a proof of concept, to encrypted reports with a decryption key shared with the affected team. In larger companies, it can be riskier to use ticketing systems with all-employee access, as an unscrupulous employee can walk out the door armed with this information.</li><li>Optionally, offer rewards based on the severity of the vulnerability.</li></ol><p>There is naturally going to be a lot of variance for your implementation, as every company has their own distinct no-go zones, and sometimes those can even have overlap with their own product if they are <a href="https://newrepublic.com/article/115349/dogfooding-tech-slang-working-out-glitches">dogfooding</a> (and if you can, you should!).</p><p>Unlike WarGames, the only winning move <strong><em>is</em></strong> to play.</p><p>[1] Bear in mind, there are considerations to make if your infrastructure is hosted in third party services; most require disclosure upfront about automated scans and penetration testing, and that you do so at a time <em>scheduled in advance</em>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67fa8906c4c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building A Rust Phone, Part 1: Picking the Platform]]></title>
            <link>https://medium.com/@doctorless/building-a-rust-phone-part-1-picking-the-platform-f4004ee5bce4?source=rss-c6ed3d1e6341------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4004ee5bce4</guid>
            <category><![CDATA[cell-phones]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[rust]]></category>
            <dc:creator><![CDATA[Dustin R. Heart]]></dc:creator>
            <pubDate>Wed, 11 Jan 2017 08:13:43 GMT</pubDate>
            <atom:updated>2017-01-11T08:13:43.449Z</atom:updated>
            <content:encoded><![CDATA[<p>In <a href="https://medium.com/@drheart/building-a-rust-phone-part-0-justifications-a3a8547f415b#.4j0ygnpt6">Part 0</a>, I cover the justifications behind building a custom cellphone. In short, security cannot be guaranteed in the current offerings. I picked Rust as a language due to it being able to still work well at a low level, but has a more concise (read: fewer bugs) syntax than C and has better memory safety than C and C++. Before I jump into my (mis)adventures in <em>actually writing code</em>, there’s still one more aspect to consider — the hardware.</p><p>As mentioned in the prior article, I intend to base the phone on the Rust OS project, <a href="http://www.redox-os.org/">Redox</a>. If you’ve already participated in the project, or at least tried running it on your own hardware, you’d know it is still in its early days, and cannot run with full hardware support on much of anything. Knowing this, I’d have to still implement my own drivers for whatever hardware I choose, and potentially have to write my own bootloader, and any additional supporting assembly code if, say, an ARM processor was chosen. There are a lot of development ARM boards out there, most notably the Raspberry Pi. I think it’s great for certain purposes, but it’s computational power leaves something to be desired when compared to higher end phones. I’m not just wanting to build a custom cellphone for hobbyist use — I’m wanting it to be a reasonable replacement for my day-to-day phone — an iPhone 6+.</p><p>As part of the research I conducted in Part 0, I realized very quickly SoC solutions that merge the AP and BP are incredibly dangerous, and are entirely unauditable, and while some phones (like mine) <em>do</em> physically separate the two components, literally the only guarantee that can be made by manufacturers to the inaccessibility of hardware (either directly or indirectly) to the BP is through <em>code</em>, which coincidentally, still can’t be fully audited (at best), or is completely unavailable (at worst). This is because, there does not exist a modern cell phone that has a physical (important distinction; code doesn’t count) killswitch to the baseband processor. Worse still, more and more manufacturers are making it impossible to remove (or replace) the battery, and so on top of the inherent danger of the BP (especially in SoC implementations), there’s the additional risk of power potentially being available to the BP and other hardware, even if the phone is “off”.</p><h3>Hardware Requirements</h3><p>So for the hardware, I’ve got five major goals:</p><ol><li>Find a way to adequately <strong>separate the BP from the rest of the hardware</strong> (preferably with a killswitch)</li><li><strong>All hardware must be</strong> <strong>supported</strong> <strong>with open source drivers </strong>on Linux, so that there exists a reference for implementation on Redox (with a caveat, in that these drivers either must be separate from the Linux codebase with a compatible license for Redox, or I must keep the codebase of the driver implementation separate from Redox to avoid my contributions to Redox being responsible for poisoning the license with GPL’d code (if unfamiliar with the GPL, either look at the <a href="https://www.gnu.org/licenses/gpl-faq.html">FAQ</a> or the <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html">GPL (v2, for Linux)</a> itself. While some would argue that the vast difference in implementations should warrant no concern for license poisoning, there have been enough court cases over licensing issues explicitly involving the GPL that I would rather keep it separate if any concern <em>could</em> exist, and wait for someone more qualified (a lawyer specialized in software licenses) to comment.</li><li><strong>I don’t want to slave my life away by making the challenge more difficult.</strong> Since I’m intending on basing the software on Redox, I’d really rather not want to put more effort into simply porting it to a different architecture than what it currently supports.</li><li><strong>The hardware must be competitive for performance with my current phone</strong>. And if I want to do that, I’ve got to match (or beat!) its specs:<br> <br><strong>CPU+GPU</strong>: Apple A8 — 1.4GHz Dual Core ARM (ARMv8A instruction compatible, 64KB[data]+64KB[instruction] L1 cache[per core], 1MB L2 cache[shared], and a 4MB L3 cache [SoC-wide]), plus a 4 core PowerVR GX6450 (according to AnandTech)<br><strong>RAM</strong>: 1 GB LPDDR3<br><strong>Baseband Processor: </strong>Qualcomm MDM9625M (note that while this processor is physically separate from the CPU, it is virtually unable to be guaranteed [by the public] that it cannot obtain access to other hardware components besides the portion of memory it is supposed to)<br><strong>WiFi: </strong>2.4GHz + 5GHz 802.11a/b/g/n/ac<br><strong>Bluetooth:</strong> 4.2<br><strong>Storage:</strong> 128GB<br><strong>USB: </strong>2.0<br><strong>Screen:</strong> 5.5&quot; IPS (1920x1080) Capacitive Touch Screen<br><strong>Battery: </strong>2915 mAh<br><strong>Camera:</strong> 8MP back, 1.2MP front</li><li><strong>The complete device must be reasonably portable as a cellphone. </strong>This is arguably the toughest problem out of the lot. I’m not saying I expect it’s going to be as slim as my current phone. Even lots of hobbyist development boards are excluded by this requirement either due to their shape or power needs. It’s not a replacement if I have to be stuck to an AC plug, carry around a 12 V car battery, or look like this guy:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WPLRx0DVQrBIKC4PxgfWRA.png" /><figcaption>I’m a dedicated, paranoid hobbyist, but I still don’t want to be <strong><em>that</em></strong> <strong>guy</strong> on the metro.</figcaption></figure><p>I began the search by looking for a BP that was either easily removable (in a non-destructive manner), or could easily have a physical on/off switch put in place. In other words, it wasn’t going to be soldiered onto a board. While some offerings were available with a GPIO connector, I found this odd due to the bandwidth of data transfer over GPIO relative to the speed of LTE. I2C LTE modules exist, but it is far too low level, abstraction-wise, to be safe. The only other kind of bus that had available modules which also had sufficient bandwidth was USB, and as noted in Part 0, there are concerns with DMA attacks with that option. I left out a good deal of explanation behind how DMA attacks work, and how to prevent them in the prior article, because for one, adequately explaining it would be an article or two in of itself, and two, I had hoped that there may be a reasonable alternative to a USB device, but in reality, it seems to very expediently solve my need for a higher-level abstraction with a very obvious killswitch (unplug it). So without writing an article within an article, the TL;DR to preventing DMA attacks from USB on a hardware level is to ensure your processor has a form of IOMMU which supports interrupt remapping (let alone have an IOMMU at all).</p><h3>Narrowing It Down</h3><p>A number of ARM development boards definitely cropped up, but most of them lacked in processing power to match my current environment, or was intended for other purposes to the point where the formfactor became unreasonable. I was rather excited after finding the MediaTek X20 development board, until digging into the deep, poorly-translated documentation revealed a dormant BP inside the SoC, along with other concerning elements. A similar experience was found with the very limited number of qualifying ARM boards.</p><p>x86? The thought of a strapping a laptop equivalent to my head to answer a call didn’t sound enticing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rU1G6bJ_JydSZlcEzhpgPQ.png" /><figcaption>This is unreasonable.</figcaption></figure><p>I kept searching for options, with some very exotic (read: difficult to support) processors, but kept coming to the same conclusion: x86 isn’t so bad. In fact, there are some small form factors, such as Intel’s NUC. And the Atom is pretty power efficient. But other than platforms that were <em>too limited,</em> like Edison and Galileo, options seemed out of reach — the Compute Card announced at CES isn’t available yet, and the docking station’s internals aren’t public yet, so waiting may not even be worth it. But then I remembered this sleeper car of a device: the Intel Compute Stick!</p><p>Here’s the specs on the lowest-end model of the latest (Q1 2016, sadly, but it is latest) iteration, the STK1AW32SC:</p><p><strong>CPU: </strong>Intel Atom x5-Z8330 Processor — 1.92GHz quad-core, 24KB(data)+32KB(instruction) L1 Cache (per core), 2MB L2 Cache (shared)<br><strong>GPU: </strong>Intel HD Graphics 400<br><strong>RAM: </strong>2GB DDR3L-1600<br><strong>WiFi: </strong>2.4GHz + 5GHz 802.11a/b/g/n/ac<br><strong>Bluetooth:</strong> 4.2<br><strong>Storage:</strong> onboard 32GB, microSD slot allows up to an additional 128GB<br><strong>USB: </strong>1 USB 3.0, 1 USB 2.0<br><strong>Video Out: </strong>HDMI 1.4b<br><strong>Power In: </strong>5V, 3A max current<br><strong>Price: </strong>$129</p><p>Perfect.</p><h3>Finding What Remains</h3><p>This leaves us with needing to fill in the gaps: a touchscreen, a battery, and either one or two cameras (sticking with one for now), and of course, the baseband processor (plus necessary RF components).</p><p>While the world of touchscreens is somewhat of a mixed bag, many of the screens in cellphones take in some form of MIPI DSI or eDP connector, and even more fortuitous for someone wanting to start a project like this now, Toshiba has brought an HDMI to DSI chip (TC358870XBG) to market. Due to this, there is now a flood of excellent 1080P and 1440P screens in handheld sizes that I can use with this project, ranging from $100–200. At this point, however, I’m nowhere near ready to start implementing input for a digitizer or a camera, so I’ll leave that for a later article.</p><p>As for the battery, there exist many “power banks” on the market which can provide a 5V/3A output, some rated upwards of 30,000 mAh, all within very portable sizes. Again, there is little point in obtaining this yet, as I’m nowhere near ready to start taking this outside. Similarly, many USB BPs exist on the market, some of which have Linux drivers. This too, shall wait for another day.</p><p>Next up is Part 2: Attempting to Boot.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4004ee5bce4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Rust Phone, Part 0: Justifications]]></title>
            <link>https://medium.com/@doctorless/building-a-rust-phone-part-0-justifications-a3a8547f415b?source=rss-c6ed3d1e6341------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3a8547f415b</guid>
            <category><![CDATA[cell-phones]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[rust]]></category>
            <dc:creator><![CDATA[Dustin R. Heart]]></dc:creator>
            <pubDate>Mon, 09 Jan 2017 07:03:10 GMT</pubDate>
            <atom:updated>2017-01-09T07:03:10.747Z</atom:updated>
            <content:encoded><![CDATA[<p>If you were to ask the entirety of people who know me what is one attribute that stands out about myself, they will say that, without a shadow of a doubt, I am the most paranoid person they know — and for good reason. Since I can remember using a computer, I was always figuring out new ways to break things from a security perspective. This tendency never ended, although now I work from a white hat perspective. My philosophy of “if it can be broken, it must” didn’t stop at a digital boundary. Physical security matters just as much to me and the lines have blurred much in the last decade, a great deal in part thanks to our reliance on cellphones. As I will explain below, there is not a single cellphone on the market that can be trusted. And so, I set out to build my own, with a design that makes security the highest priority. For the time being, I plan on using and extending the Rust OS, Redox.</p><h3>If It Can Be Broken, It Must</h3><p>I’m not going to bore with a CV of prior exploits. In fact, almost all of my security work has been performed through private disclosure to software vendors, or at my place at employment, both of which do not leave much for a public trail. Even so, it’s not news to anyone that the technological infrastructure of our modern world is incredibly fragile, a byproduct of two incredibly mistaken beliefs:</p><p>First, the reliance on open source in that it merely being open means all the eyes that look at it have the best intentions, and of those that do, their intention is to hone in on the potential vulnerabilities that lie within. OpenSSL has in recent history proven this multiple times, enough to induce a major fork — LibreSSL.</p><p>Second, and conversely, that the <em>iron-clad </em>guarantees of commercial support better guarantee the security of enterprise proprietary solutions. This too has had its fair share of recent incidents, such as the Equation Group leak.</p><p>And this only covers the software side. What about hardware? With respect alone to the baseband processor (BP) in every cellphone, <a href="http://www.osnews.com/story/27416/The_second_operating_system_hiding_in_every_mobile_phone">there</a> <a href="http://boingboing.net/2016/07/20/baseband-vulnerability-could-m.html">are</a> <a href="https://events.ccc.de/congress/2011/Fahrplan/attachments/2022_11-ccc-qcombbdbg.pdf">innumerable</a> <a href="https://www.usenix.org/system/files/conference/woot12/woot12-final24.pdf">reports</a> about the concerning state of affairs. To save you a click or two, the problem in BPs boils down to this: the myriad of technologies required to properly handle all the communication standards for cellphones for even a single provider is complex, patent encumbered, and expensive. Every BP provider must have their hardware <em>and</em> software certified by the FCC, which in of itself is prohibitively expensive for any open solution to emerge (at the very least, legally). No manufacturer wants to lose what little edge their incremental developments gain them, so both the software and hardware remains closed, and as sourced above, ripe for the picking of hackers, especially on the state level.</p><p>So here we are, in a situation where every BP is a fragile black box, where only those willing to break the law (or in some cases, are above the law) are the ones able to truly avoid it, or take advantage of it. Worse still, we not only blindly trust these providers, we fully accept that they include these processors in a single chip solution that merges the application processor (AP) with it, with varying degrees of largely unauditable levels of separation. Assuming (which is probably safe, despite my own paranoia saying otherwise) that manufacturers are honest about how they separate BPs from APs in SoC offerings, most of them are using a form of USB which resides inside the chip: HSIC. For simplicity, assume it is the same thing. The problem with USB is that while all versions of USB prior to 3.1 do not support DMA directly, it is entirely possible through faulty design that such a possibility <em>does</em> exist where the USB controller could be hacked, which resides at a level where DMA <em>could</em> be performed, meaning that even with best intentions and industry standard levels of separation, it is entirely possible for the best-engineered SoC AP/BP solutions to allow for BP access to memory not intended to be seen by the BP. That scares me, <em>and it should scare you too.</em></p><p>With no visibility to the actions or actual communications with a BP from cell networks, and their sheer willingness to connect to whatever will talk to it (else, Stingrays would not be effective), from a security-minded perspective where <strong>if it can be broken, it must</strong>, a stark, disturbing reality emerges: no modern cellphone is safe, and you can (and should) assume that any interface, camera, microphone, GPS, storage, memory, etc. can be accessed remotely by the BP without your knowledge at any time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3a8547f415b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>