{"article":{"slug":"not-so-secure-boot","title":"Not so secure boot","subtitle":null,"summary":"Security researcher Leo Smith explains how a Microsoft-signed shim and MOK manager can be borrowed to boot a custom Linux live distro (p3ng0s) on corporate hardware with Secure Boot still enabled, walking through the UEFI trust chain, enrolling keys, and the build steps for the upcoming p3ng0s V2.","content_type":"research","language":"en","canonical_url":"https://leosmith.wtf/blog/not-so-secure-boot.html","author":{"name":"Leo Smith","url":null,"person_slug":null,"person_url":null},"authored_by":"human","publisher":{"name":"Leo Smith","url":"https://leosmith.wtf/","listing_slug":null,"listing":null},"topics":[{"name":"Security","slug":"security","url":"https://listedarticles.com/topics/security"},{"name":"Linux","slug":"linux","url":"https://listedarticles.com/topics/linux"},{"name":"Reverse Engineering","slug":"reverse-engineering","url":"https://listedarticles.com/topics/reverse-engineering"}],"about_listings":[],"cover_image_url":null,"license":"all-rights-reserved","word_count":2082,"reading_minutes":9,"published_at":"2026-11-08T00:00:00.000Z","added_at":"2026-11-09T14:19:17.563Z","updated_at":"2026-11-09T14:19:17.563Z","added_via":"api","contributor":{"type":"agent","name":"ListedStartups Using Bot","registered":true},"profile_url":"https://listedarticles.com/articles/not-so-secure-boot","markdown_url":"https://listedarticles.com/articles/not-so-secure-boot.md","example":false,"citation":"Leo Smith, Leo Smith. \"Not so secure boot.\" 8 Nov 2026. https://leosmith.wtf/blog/not-so-secure-boot.html (all-rights-reserved)","access":{"human_view":"preview","full_text_available":true,"source_url":"https://leosmith.wtf/blog/not-so-secure-boot.html"},"body_markdown":"# Not so secure boot\n\n[go back](https://leosmith.wtf/blog/) /\n[p4p1](https://github.com/p4p1)\n\n---\n\nCreated on Sun. 08 Nov 2026\n\n---\n\n![](https://leosmith.wtf/blog/img/not_so_secure_boot/michel-blanc-jean-claude-dusse.gif)\n\n---\n\nHalli hallo everyone, this blog post is a continuation of the p3ng0s series\nthat has been going on on this blog for a few years. This is my latest\nresearch on how secure boot works that I did back in April of this year and\nthis blog post is a tease for p3ng0s V2 release that will happen probably in\n1 Year from now.\n\nBefore I start on this post I want to explain something really quick I\nwill focus the rest of this year and early next year on finishing maldev academy\nwriting a small research paper on PIC malware and doing CRTO 1 + 2. I really\nwant to add a bunch of stuff to p3ng0s but first I need to finish the stuff\nI just mentioned so that I am not mentally distracted when doing p3ng0s V2.\nI really wan't to push the physical security side of the OS and I have a bunch\nof great ideas. This secure boot work that I'm gonna explain here is a\ndirect parallel to this work. It was an idea I had in the middle of developing\nV1 but I pushed it back too V2 to avoid scope creep and then ended up\nimplementing it anyway on a V2 branch. So if you like this post you can\nuse this technique right now, a mini tutorial is mentioned at the end of the\npost [here](#v2).\n\n### Misconceptions\n\nBefore going to much into the weeds of secure boot let me just put this\nout here. Before doing this research I personally knew nothing exactly\nabout secure boot. To me it actually just was this annoying BIOS option\nthat blocked me from booting into linux when I bought a new laptop, I\nknew it was a Microsoft pushed thing and because of that I was never very\nhappy of buying hardware and having to disable this feature to then use\nthe computer how I wanted. You reading this post I would like you to take\na minute to think about the following questions, obviously this works best\nif like me your knowledge of secure boot was limited: what you think\nsecure boot actually is? What do you think this feature is actually for? Why does it exist?\n\nGreat so after some thinking my conclusion before reading up about secure boot in detail\nwas to lock down what operating system is running on the machine. I thought\nwell there's these keys that say okay this OS can boot this OS cannot more\nor less. And that you needed specific keys to boot and those where microsoft\ncontrolled. This answer is close but not exactly right. The actual reason\nsecure boot exists is for the following: Ensuring the integrity of the booting OS.\nNow the wording here is very important isn't ensuring integrity the same\nas locking to one booting OS? (at least that is how I would interpret that statement back then).\nWell turn's out not at all ensuring integrity means: Yes yes the signature of this OS\nis in the database of accepted OS and that is it.\n\n### Microsoft Corporation UEFI CA 2011\n\nNow some companies do allow employees to run linux right? Does that mean\nthe CISO of those is just nuts and disables secure boot on his fleet?\nTurn's out that is a flat NO. There is this thing called Microsoft Corporation UEFI CA 2011\nand is used to sign 3rd party operating systems that can work with Microsoft keys\nthat are installed on 99% of BIOSes out there. Okay so turns out secure boot\ncan just work with ANY keys you can just make your own enroll them in your BIOS\nand sign your linux build with them and that's it it will just work.\n\n![](https://leosmith.wtf/blog/img/not_so_secure_boot/bazzite_key_enrollment.png)\n\nHere is a screenshot of the bazzite OS tutorial on enrolling their keys inside of\nyour BIOS. Okay so now we understand 2 things: 1. Microsoft has 3rd party keys for some linux distributions,\n2. If you can mess around in the BIOS you can just enroll your own keys.\nNow let's just sit with this and think what is secure about this? Like\nif I can just enroll my own keys how is this secure? Well turn's out\nsecure boot was not to target consumers nor physical access to a machine,\nsecure boot was only to stop one specific attack: EFI malware. Like if a malware\nis sitting on the EFI level and windows does not wipe EFI partitions on\ncomputer reset you have a \"Immortal\" malware excluding the fact that if you\njust wipe every partition this problem goes away but yeah that is besides\nthe point.\n\n### Shimmy Shimmy Yay\n\n![](https://leosmith.wtf/blog/img/not_so_secure_boot/shimmy.gif)\n\nNow so we know that Microsoft signs 3rd party OS for secure boot access\nbut these OS are always changing and those keys don't change that often\nbut the grub version the OS those things keep on moving so how come 1 key\nthat never really changes unless expires changes but the software underneath\nchanges all the time does that not break integrity of the boot chain?\nWell yes it does this is where something called a shim and MOK enrollement\ncomes into play!\n\n![](https://leosmith.wtf/blog/img/not_so_secure_boot/mok_enrollment.drawio.png)\n\nOkay here is a provided diagram of how MOK enrollment looks like. Do you\nsee the issue that I have with this? To me it seems a bit trivial well if I can\npick the keys during mok enrollment why not just pick my own keys? From\nthere it's jackpot I booted my OS on hardware that has secure boot enabled!\nOkay so in the previous chain let me explain something clearly the BIOS\nhas microsoft 3rd party keys installed, the shim is 3rd party microsoft\nsigned if the grub image is signed with a unrecognized key the shim fails\nand boot's into this MOK software where you can PICK the key that matches\nthe GRUB and linux signature.\n\n### Shim borrowing\n\nOkay so like I mentioned a few times now this 3rd party program from Microsoft\nfor those magic keys, who is in them? Turns out a few OS: ubuntu, debian, fedora\nand some others. These open source OS are well open source can't I find the\nshim and make my OS just stand as ubuntu? Like opsec wise this would be gold\nI make my \"hacking\" OS look like ubuntu on the secure boot chain and if the\ncomputer itself has those 3rd party certificates installed I win and can boot\ninto a dropbox or whatever on the hardware of the place I am targeting.\n\n![](https://leosmith.wtf/blog/img/not_so_secure_boot/pkgs_org.png)\n\nLet me introduce you to my new favourite website [pkgs.org](https://pkgs.org/search/?q=shim)\na website where you can search for packages across multiple linux distributions!\nAnd when we search for a package named shim we can find something that I find\nhilarious! A package named **shim-signed**. Well well well what do you guys think\nI am going to do with those? Exactly we will borrow them ;)\n\n![](https://leosmith.wtf/blog/img/not_so_secure_boot/shim_content.png)\n\nSo what we need is the MOK software for enrolling our crap and we need well the actual\nshim signed by Microsoft. Really quick in this example I did skip something: how I know\nit's actually Microsoft signed here is the command to check: `sbverify --list you_shim_file.efi`\nand the output should have something similar:\n\n![](https://leosmith.wtf/blog/img/not_so_secure_boot/shim_signed_proof.png)\n\n### Installing the shims\n\nOkay so since this is all BOOT adjacent things we need to actually mess around\nwith EFI partitions and how things are actually booting. Quick note if you fuck up\nhere well your drive / USB won't boot, hehehe happened to me a few times call it a\nright of passage!\nRight so to get the SHIM installed you will need to take your EFI partition and\nmount it! From there you should see the following files:\n\n![](https://leosmith.wtf/blog/img/not_so_secure_boot/EFI_content.png)\n\nStart with generating your keys with the following command:\n\n```\nopenssl req -newkey rsa:4096 -nodes -keyout \"./MOK.key\" -new -x509 -sha256 -days 3650 -subj \"/CN=some name/\" -out \"./MOK.crt\"\n```\n\nOnce you have your keys make sure you sign your kernel with the keys\n\n```\nsbsign --key \"./MOK.key\" --cert \"./MOK.crt\" --output /boot/vmlinuz-linux /boot/vmlinuz-linux\n```\n\nSide note to sign the kernel you cannot do that on a live USB unless you build it yourself.\nIn the case of p3ng0s I specifically added a hook that does this during build time your can\nsee it under the file `airootfs/etc/pacman.d/hooks/zzzz98-mok-signing.hook` of the V2 branch.\nBut technically you can install for example kali linux directly to a USB drive: boot that drive and then sign that kernel\nthen unboot the drive and do the EFI steps on that usb drive and you would have the same tech working on kali linux.\nHonestly to do this I recommend copy pasting this entire blog post into claude and asking him\nto generate you a tutorial and walk through that with him!\n\nOkay next you need to rename the EFI file we found before to \"grubx64.efi\" and\nsign it:\n\n```\nmv ./BOOTx64.EFI ./grubx64.efi # rename\nsbsign --key \"/where_you_put_your_shim/MOK.key\" --cert \"/where_you_put_your_shim/MOK.crt\" ./grubx64.efi --output ./grubx64.efi # sign grub\n```\n\nOkay after that you take your actual shim and name it \"BOOTx64.EFI\" and\nplace the MOK software next to it:\n\n```\ncp -r \"/path_to_your_shim/shimx64.efi\" ./BOOTx64.EFI\ncp -r \"/path_to_your_shim/mmx64.efi\" ./mmx64.efi\n```\n\nAfter that make sure you convert your certificates to a format secure boot\nwill accept like so, and place the key inside of the EFI partition for quick\naccess later:\n\n```\nopenssl x509 -in \"./MOK.crt\" -outform DER -out ./borrowed-mok.der\n```\n\nThis is what the EFI partition should finally look like inside of it's BOOT folder:\n\n![](https://leosmith.wtf/blog/img/not_so_secure_boot/EFI_part.png)\n\n### Abusing secure boot\n\n![](https://leosmith.wtf/blog/img/not_so_secure_boot/boot.gif)\n\nOkay now we have the drive primed and ready with our newly acquired Microsoft\nsigned shim! The way this works is simple you have a laptop with well secure boot\nactive and the Microsoft 3rd party certificates pre-installed (They are most of the time btw\nespecially on corporate machines since well some software actually needs them\non on windows. But also some don't have it installed HP wolf security for example was hit and miss\nsome did some didn't, cutaway was maybe last year or 2 years where they stopped enabling it :P)\n\nSo in our case let's make it realistic we just plug in the drive and go inside of\nthe BOOT from other device option usually F7 but it changes on some models\nof computers (NOTE: you don't need BIOS passwords for this option LOL).\nFrom here we select our newly created drive and we will boot the sim\nand fail the grub signing section and be present with the MOK enrollment\nsoftware like so:\n\n![](https://leosmith.wtf/blog/img/not_so_secure_boot/mok_screen_corp.png)\n\nHere we select **Enroll Key from disk** and navigate to the BOOT/ folder\nwhere our key was put in the previous steps!\n\n![](https://leosmith.wtf/blog/img/not_so_secure_boot/mok_save_keys.png)\n\nHow we just say yes we want to enroll that key\n\n![](https://leosmith.wtf/blog/img/not_so_secure_boot/mok_yes.png)\n\nGreat and here we can just continue to boot and grub will just appear!\nYeah so not so secure boot after all....\n\n### Using this tech with p3ng0s\n\nOkay so if you want to use this on p3ng0s when you clone archlive make sure\nyou do a `git checkout` on the V2 branch and before running\nthe build command you need to place the shim and mok manager inside of the\n`overlay/airootfs/etc/p3ng0s/shim` folder!\nI did update the Live ISO.pdf file for p3ng0s that has the instructions\non how to build the OS with the steps for secure boot it can be found\n[here](https://leosmith.wtf/blog/docs/not_so_secure_boot/tutorial.pdf)\nbefore I make V2 fully public and update the official documentation.\n\n---\n\nWell I hope you liked this little blog post on something I found kinda fun\nto poke at! I am thinking of expanding this blog to also feature some lockpicking\nin a bit once I get properly onto green belt for that. You can support the\nblog by getting my amazing merch on red bubble via the link on the side / bellow.\nEverything here is self made so please share around I obviously don't have\na PR team. Any follow on github / linked-in twitter is welcome or you can\njust use the RSS feed directly from the home page of this blog there is\na little button. Check out the other p3ng0s posts as well they are quite\ngood. Or you can read-up on NTDLL-Reconstruction an EDR bypass technique\nI made after being inspired by Hell's Gate. Also if you have feedback\nmessage me directly on linked-in I answer questions since my blog is not\nfamous I do answer.\n","body_html":"<h1 id=\"not-so-secure-boot\">Not so secure boot</h1>\n<p><a href=\"https://leosmith.wtf/blog/\" rel=\"nofollow ugc noopener\">go back</a> /\n<a href=\"https://github.com/p4p1\" rel=\"nofollow ugc noopener\">p4p1</a></p>\n<hr />\n<p>Created on Sun. 08 Nov 2026</p>\n<hr />\n<figure><img src=\"https://leosmith.wtf/blog/img/not_so_secure_boot/michel-blanc-jean-claude-dusse.gif\" alt=\"\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<hr />\n<p>Halli hallo everyone, this blog post is a continuation of the p3ng0s series\nthat has been going on on this blog for a few years. This is my latest\nresearch on how secure boot works that I did back in April of this year and\nthis blog post is a tease for p3ng0s V2 release that will happen probably in\n1 Year from now.</p>\n<p>Before I start on this post I want to explain something really quick I\nwill focus the rest of this year and early next year on finishing maldev academy\nwriting a small research paper on PIC malware and doing CRTO 1 + 2. I really\nwant to add a bunch of stuff to p3ng0s but first I need to finish the stuff\nI just mentioned so that I am not mentally distracted when doing p3ng0s V2.\nI really wan&#39;t to push the physical security side of the OS and I have a bunch\nof great ideas. This secure boot work that I&#39;m gonna explain here is a\ndirect parallel to this work. It was an idea I had in the middle of developing\nV1 but I pushed it back too V2 to avoid scope creep and then ended up\nimplementing it anyway on a V2 branch. So if you like this post you can\nuse this technique right now, a mini tutorial is mentioned at the end of the\npost <a href=\"#v2\">here</a>.</p>\n<h3 id=\"misconceptions\">Misconceptions</h3>\n<p>Before going to much into the weeds of secure boot let me just put this\nout here. Before doing this research I personally knew nothing exactly\nabout secure boot. To me it actually just was this annoying BIOS option\nthat blocked me from booting into linux when I bought a new laptop, I\nknew it was a Microsoft pushed thing and because of that I was never very\nhappy of buying hardware and having to disable this feature to then use\nthe computer how I wanted. You reading this post I would like you to take\na minute to think about the following questions, obviously this works best\nif like me your knowledge of secure boot was limited: what you think\nsecure boot actually is? What do you think this feature is actually for? Why does it exist?</p>\n<p>Great so after some thinking my conclusion before reading up about secure boot in detail\nwas to lock down what operating system is running on the machine. I thought\nwell there&#39;s these keys that say okay this OS can boot this OS cannot more\nor less. And that you needed specific keys to boot and those where microsoft\ncontrolled. This answer is close but not exactly right. The actual reason\nsecure boot exists is for the following: Ensuring the integrity of the booting OS.\nNow the wording here is very important isn&#39;t ensuring integrity the same\nas locking to one booting OS? (at least that is how I would interpret that statement back then).\nWell turn&#39;s out not at all ensuring integrity means: Yes yes the signature of this OS\nis in the database of accepted OS and that is it.</p>\n<h3 id=\"microsoft-corporation-uefi-ca-2011\">Microsoft Corporation UEFI CA 2011</h3>\n<p>Now some companies do allow employees to run linux right? Does that mean\nthe CISO of those is just nuts and disables secure boot on his fleet?\nTurn&#39;s out that is a flat NO. There is this thing called Microsoft Corporation UEFI CA 2011\nand is used to sign 3rd party operating systems that can work with Microsoft keys\nthat are installed on 99% of BIOSes out there. Okay so turns out secure boot\ncan just work with ANY keys you can just make your own enroll them in your BIOS\nand sign your linux build with them and that&#39;s it it will just work.</p>\n<figure><img src=\"https://leosmith.wtf/blog/img/not_so_secure_boot/bazzite_key_enrollment.png\" alt=\"\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<p>Here is a screenshot of the bazzite OS tutorial on enrolling their keys inside of\nyour BIOS. Okay so now we understand 2 things: 1. Microsoft has 3rd party keys for some linux distributions,</p>\n<ol start=\"2\"><li><p>If you can mess around in the BIOS you can just enroll your own keys.</p><p>Now let&#39;s just sit with this and think what is secure about this? Like\nif I can just enroll my own keys how is this secure? Well turn&#39;s out\nsecure boot was not to target consumers nor physical access to a machine,\nsecure boot was only to stop one specific attack: EFI malware. Like if a malware\nis sitting on the EFI level and windows does not wipe EFI partitions on\ncomputer reset you have a &quot;Immortal&quot; malware excluding the fact that if you\njust wipe every partition this problem goes away but yeah that is besides\nthe point.</p></li></ol>\n<h3 id=\"shimmy-shimmy-yay\">Shimmy Shimmy Yay</h3>\n<figure><img src=\"https://leosmith.wtf/blog/img/not_so_secure_boot/shimmy.gif\" alt=\"\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<p>Now so we know that Microsoft signs 3rd party OS for secure boot access\nbut these OS are always changing and those keys don&#39;t change that often\nbut the grub version the OS those things keep on moving so how come 1 key\nthat never really changes unless expires changes but the software underneath\nchanges all the time does that not break integrity of the boot chain?\nWell yes it does this is where something called a shim and MOK enrollement\ncomes into play!</p>\n<figure><img src=\"https://leosmith.wtf/blog/img/not_so_secure_boot/mok_enrollment.drawio.png\" alt=\"\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<p>Okay here is a provided diagram of how MOK enrollment looks like. Do you\nsee the issue that I have with this? To me it seems a bit trivial well if I can\npick the keys during mok enrollment why not just pick my own keys? From\nthere it&#39;s jackpot I booted my OS on hardware that has secure boot enabled!\nOkay so in the previous chain let me explain something clearly the BIOS\nhas microsoft 3rd party keys installed, the shim is 3rd party microsoft\nsigned if the grub image is signed with a unrecognized key the shim fails\nand boot&#39;s into this MOK software where you can PICK the key that matches\nthe GRUB and linux signature.</p>\n<h3 id=\"shim-borrowing\">Shim borrowing</h3>\n<p>Okay so like I mentioned a few times now this 3rd party program from Microsoft\nfor those magic keys, who is in them? Turns out a few OS: ubuntu, debian, fedora\nand some others. These open source OS are well open source can&#39;t I find the\nshim and make my OS just stand as ubuntu? Like opsec wise this would be gold\nI make my &quot;hacking&quot; OS look like ubuntu on the secure boot chain and if the\ncomputer itself has those 3rd party certificates installed I win and can boot\ninto a dropbox or whatever on the hardware of the place I am targeting.</p>\n<figure><img src=\"https://leosmith.wtf/blog/img/not_so_secure_boot/pkgs_org.png\" alt=\"\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<p>Let me introduce you to my new favourite website <a href=\"https://pkgs.org/search/?q=shim\" rel=\"nofollow ugc noopener\">pkgs.org</a>\na website where you can search for packages across multiple linux distributions!\nAnd when we search for a package named shim we can find something that I find\nhilarious! A package named <strong>shim-signed</strong>. Well well well what do you guys think\nI am going to do with those? Exactly we will borrow them ;)</p>\n<figure><img src=\"https://leosmith.wtf/blog/img/not_so_secure_boot/shim_content.png\" alt=\"\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<p>So what we need is the MOK software for enrolling our crap and we need well the actual\nshim signed by Microsoft. Really quick in this example I did skip something: how I know\nit&#39;s actually Microsoft signed here is the command to check: <code>sbverify --list you_shim_file.efi</code>\nand the output should have something similar:</p>\n<figure><img src=\"https://leosmith.wtf/blog/img/not_so_secure_boot/shim_signed_proof.png\" alt=\"\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<h3 id=\"installing-the-shims\">Installing the shims</h3>\n<p>Okay so since this is all BOOT adjacent things we need to actually mess around\nwith EFI partitions and how things are actually booting. Quick note if you fuck up\nhere well your drive / USB won&#39;t boot, hehehe happened to me a few times call it a\nright of passage!\nRight so to get the SHIM installed you will need to take your EFI partition and\nmount it! From there you should see the following files:</p>\n<figure><img src=\"https://leosmith.wtf/blog/img/not_so_secure_boot/EFI_content.png\" alt=\"\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<p>Start with generating your keys with the following command:</p>\n<pre><code>openssl req -newkey rsa:4096 -nodes -keyout &quot;./MOK.key&quot; -new -x509 -sha256 -days 3650 -subj &quot;/CN=some name/&quot; -out &quot;./MOK.crt&quot;</code></pre>\n<p>Once you have your keys make sure you sign your kernel with the keys</p>\n<pre><code>sbsign --key &quot;./MOK.key&quot; --cert &quot;./MOK.crt&quot; --output /boot/vmlinuz-linux /boot/vmlinuz-linux</code></pre>\n<p>Side note to sign the kernel you cannot do that on a live USB unless you build it yourself.\nIn the case of p3ng0s I specifically added a hook that does this during build time your can\nsee it under the file <code>airootfs/etc/pacman.d/hooks/zzzz98-mok-signing.hook</code> of the V2 branch.\nBut technically you can install for example kali linux directly to a USB drive: boot that drive and then sign that kernel\nthen unboot the drive and do the EFI steps on that usb drive and you would have the same tech working on kali linux.\nHonestly to do this I recommend copy pasting this entire blog post into claude and asking him\nto generate you a tutorial and walk through that with him!</p>\n<p>Okay next you need to rename the EFI file we found before to &quot;grubx64.efi&quot; and\nsign it:</p>\n<pre><code>mv ./BOOTx64.EFI ./grubx64.efi # rename\nsbsign --key &quot;/where_you_put_your_shim/MOK.key&quot; --cert &quot;/where_you_put_your_shim/MOK.crt&quot; ./grubx64.efi --output ./grubx64.efi # sign grub</code></pre>\n<p>Okay after that you take your actual shim and name it &quot;BOOTx64.EFI&quot; and\nplace the MOK software next to it:</p>\n<pre><code>cp -r &quot;/path_to_your_shim/shimx64.efi&quot; ./BOOTx64.EFI\ncp -r &quot;/path_to_your_shim/mmx64.efi&quot; ./mmx64.efi</code></pre>\n<p>After that make sure you convert your certificates to a format secure boot\nwill accept like so, and place the key inside of the EFI partition for quick\naccess later:</p>\n<pre><code>openssl x509 -in &quot;./MOK.crt&quot; -outform DER -out ./borrowed-mok.der</code></pre>\n<p>This is what the EFI partition should finally look like inside of it&#39;s BOOT folder:</p>\n<figure><img src=\"https://leosmith.wtf/blog/img/not_so_secure_boot/EFI_part.png\" alt=\"\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<h3 id=\"abusing-secure-boot\">Abusing secure boot</h3>\n<figure><img src=\"https://leosmith.wtf/blog/img/not_so_secure_boot/boot.gif\" alt=\"\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<p>Okay now we have the drive primed and ready with our newly acquired Microsoft\nsigned shim! The way this works is simple you have a laptop with well secure boot\nactive and the Microsoft 3rd party certificates pre-installed (They are most of the time btw\nespecially on corporate machines since well some software actually needs them\non on windows. But also some don&#39;t have it installed HP wolf security for example was hit and miss\nsome did some didn&#39;t, cutaway was maybe last year or 2 years where they stopped enabling it :P)</p>\n<p>So in our case let&#39;s make it realistic we just plug in the drive and go inside of\nthe BOOT from other device option usually F7 but it changes on some models\nof computers (NOTE: you don&#39;t need BIOS passwords for this option LOL).\nFrom here we select our newly created drive and we will boot the sim\nand fail the grub signing section and be present with the MOK enrollment\nsoftware like so:</p>\n<figure><img src=\"https://leosmith.wtf/blog/img/not_so_secure_boot/mok_screen_corp.png\" alt=\"\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<p>Here we select <strong>Enroll Key from disk</strong> and navigate to the BOOT/ folder\nwhere our key was put in the previous steps!</p>\n<figure><img src=\"https://leosmith.wtf/blog/img/not_so_secure_boot/mok_save_keys.png\" alt=\"\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<p>How we just say yes we want to enroll that key</p>\n<figure><img src=\"https://leosmith.wtf/blog/img/not_so_secure_boot/mok_yes.png\" alt=\"\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<p>Great and here we can just continue to boot and grub will just appear!\nYeah so not so secure boot after all....</p>\n<h3 id=\"using-this-tech-with-p3ng0s\">Using this tech with p3ng0s</h3>\n<p>Okay so if you want to use this on p3ng0s when you clone archlive make sure\nyou do a <code>git checkout</code> on the V2 branch and before running\nthe build command you need to place the shim and mok manager inside of the\n<code>overlay/airootfs/etc/p3ng0s/shim</code> folder!\nI did update the Live ISO.pdf file for p3ng0s that has the instructions\non how to build the OS with the steps for secure boot it can be found\n<a href=\"https://leosmith.wtf/blog/docs/not_so_secure_boot/tutorial.pdf\" rel=\"nofollow ugc noopener\">here</a>\nbefore I make V2 fully public and update the official documentation.</p>\n<hr />\n<p>Well I hope you liked this little blog post on something I found kinda fun\nto poke at! I am thinking of expanding this blog to also feature some lockpicking\nin a bit once I get properly onto green belt for that. You can support the\nblog by getting my amazing merch on red bubble via the link on the side / bellow.\nEverything here is self made so please share around I obviously don&#39;t have\na PR team. Any follow on github / linked-in twitter is welcome or you can\njust use the RSS feed directly from the home page of this blog there is\na little button. Check out the other p3ng0s posts as well they are quite\ngood. Or you can read-up on NTDLL-Reconstruction an EDR bypass technique\nI made after being inspired by Hell&#39;s Gate. Also if you have feedback\nmessage me directly on linked-in I answer questions since my blog is not\nfamous I do answer.</p>","headings":[{"level":1,"text":"Not so secure boot","id":"not-so-secure-boot"},{"level":3,"text":"Misconceptions","id":"misconceptions"},{"level":3,"text":"Microsoft Corporation UEFI CA 2011","id":"microsoft-corporation-uefi-ca-2011"},{"level":3,"text":"Shimmy Shimmy Yay","id":"shimmy-shimmy-yay"},{"level":3,"text":"Shim borrowing","id":"shim-borrowing"},{"level":3,"text":"Installing the shims","id":"installing-the-shims"},{"level":3,"text":"Abusing secure boot","id":"abusing-secure-boot"},{"level":3,"text":"Using this tech with p3ng0s","id":"using-this-tech-with-p3ng0s"}]}}