[{"content":"While on an assessment for a client I needed a way to intercept certain HTTP API calls and dynamically generate a response while allowing other calls to go through to the real application\u0026rsquo;s servers. I came across an extension for BurpSuite that allowed the user to select specific API calls to intercept and reply with static content, but I needed the ability to dynamically generate responses, so I added that functionality to the extension and published my changes. The extension now supports redirecting any HTTP request to any other URL, or replying to the call based on the contents of a file, or generating a response either by piping the content of the call to a program or by calling the program as a CGI script.\nI spoke about and demo\u0026rsquo;d this extension at ToorCon 21. You can find my slides here.\nYou can find the original repository for the extension here and my updated fork on my work Github.\n","permalink":"https://polansky.co/projects/burphttpmock/","summary":"\u003cp\u003eWhile on an assessment for a client I needed a way to intercept certain HTTP API calls and dynamically generate a response while allowing other calls to go through to the real application\u0026rsquo;s servers. I came across an extension for \u003ca href=\"https://portswigger.net/burp\"\u003eBurpSuite\u003c/a\u003e that allowed the user to select specific API calls to intercept and reply with \u003cem\u003estatic\u003c/em\u003e content, but I needed the ability to \u003cem\u003edynamically\u003c/em\u003e generate responses, so I added that functionality to the extension and published my changes. The extension now supports redirecting any HTTP request to any other URL, or replying to the call based on the contents of a file, or generating a response either by piping the content of the call to a program or by calling the program as a \u003ca href=\"https://en.wikipedia.org/wiki/Common_Gateway_Interface\"\u003eCGI\u003c/a\u003e script.\u003c/p\u003e","title":"Burp HTTP Mock"},{"content":"As a fan of DEF CON\u0026rsquo;s #badgelife, I was ecstatic to have the opportunity to contribute as part of my employment at ISE. ISE runs the IoT Village at DEF CON and at other conferences, and we wanted to have our own badge\u0026hellip; an effort which I unfortunately couldn\u0026rsquo;t see to completion while I was there.\nIn the meantime, I worked with the marketing team at ISE to create this, the IoT Village official SAO. It features artwork by ISE\u0026rsquo;s talented \u0026lsquo;social media guy\u0026rsquo; cum salesman Sam Levin. I worked with him to import the artwork into KiCAD, designed the rest of the PCB (it makes an LED glow, very complicated 😉), and oversaw the manufacturing process including cost optimizing the BOM and working with our PCB fabrication house to ensure the quality was up to spec.\nThe SAO debuted in 2018 and has seen several \u0026lsquo;reprints\u0026rsquo;, so keep an eye out for one if you\u0026rsquo;re at a conference with the Village.\n","permalink":"https://polansky.co/projects/iotvillagesao/","summary":"\u003cp\u003eAs a fan of DEF CON\u0026rsquo;s \u003ca href=\"https://www.vice.com/en/article/vbne9a/a-history-of-badgelife-def-cons-unlikely-obsession-with-artistic-circuit-boards\"\u003e#badgelife\u003c/a\u003e, I was ecstatic to have the opportunity to contribute as part of my employment at ISE. ISE runs the \u003ca href=\"https://iotvillage.org\"\u003eIoT Village\u003c/a\u003e at DEF CON and at other conferences, and we wanted to have our own badge\u0026hellip; an effort which I unfortunately couldn\u0026rsquo;t see to completion while I was there.\u003c/p\u003e\n\u003cp\u003eIn the meantime, I worked with the marketing team at ISE to create this, the IoT Village official \u003ca href=\"https://hackaday.com/2019/03/20/introducing-the-shitty-add-on-v1-69bis-standard/\"\u003eSAO\u003c/a\u003e. It features artwork by ISE\u0026rsquo;s talented \u0026lsquo;social media guy\u0026rsquo; cum salesman \u003ca href=\"https://www.linkedin.com/in/samuel-levin-16541294\"\u003eSam Levin\u003c/a\u003e. I worked with him to import the artwork into \u003ca href=\"https://kicad.org/\"\u003eKiCAD\u003c/a\u003e, designed the rest of the PCB (it makes an LED glow, very complicated 😉), and oversaw the manufacturing process including cost optimizing the BOM and working with our PCB fabrication house to ensure the quality was up to spec.\u003c/p\u003e","title":"IoT Village SAO"},{"content":"Much of my job consists of working with BurpSuite, so I find myself regularly needing to write small custom tools for working with it. I publish the ones that I can in the hopes that someone else might find them useful. Here are the ones I\u0026rsquo;ve published so far:\nBurp Extension Maven Archetype \u0026mdash; After writing a couple extensions I got tired of manually instantiating the project structure, so I wrote a Maven archetype that does it for me. One command gets you a project directory with the right imports and a copy of the PortSwigger \u0026ldquo;Hello World\u0026rdquo; demo extension\u0026rsquo;s code ready to modify into whatever you need. Burp Easy Request Saver \u0026mdash; Burp doesn\u0026rsquo;t have a fast way to export the binary contents of requests or responses, so I wrote one. It adds context menu entries to any request that lets you export the request or response headers or body to a file keeping all binary data intact. If you select multiple requests, each gets its own file. Burp2Vegeta \u0026mdash; I was asked by a client to perform load testing on their service to simulate a Denial-of-Service attack. I decided to use Vegeta to perform a classic request flooding attack, but I needed a way to quickly tell it how to send correctly-formatted API requests. As a result I wrote a small Burp extension that exports any request(s) as Vegeta JSON attack definitions to the system clipboard. You can then paste them into an attack definition file and fire away. ","permalink":"https://polansky.co/projects/smallburptools/","summary":"\u003cp\u003eMuch of my job consists of working with \u003ca href=\"https://portswigger.net/burp\"\u003eBurpSuite\u003c/a\u003e, so I find myself regularly needing to write small custom tools for working with it. I publish the ones that I can in the hopes that someone else might find them useful. Here are the ones I\u0026rsquo;ve published so far:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ise-spolansky/burp-extension-maven-archetype\"\u003eBurp Extension Maven Archetype\u003c/a\u003e \u0026mdash; After writing a couple extensions I got tired of manually instantiating the project structure, so I wrote a \u003ca href=\"https://maven.apache.org/\"\u003eMaven\u003c/a\u003e archetype that does it for me. One command gets you a project directory with the right imports and a copy of the PortSwigger \u0026ldquo;Hello World\u0026rdquo; demo extension\u0026rsquo;s code ready to modify into whatever you need.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ise-spolansky/burp-easy-request-saver\"\u003eBurp Easy Request Saver\u003c/a\u003e \u0026mdash; Burp doesn\u0026rsquo;t have a fast way to export the binary contents of requests or responses, so I wrote one. It adds context menu entries to any request that lets you export the request or response headers or body to a file keeping all binary data intact. If you select multiple requests, each gets its own file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ise-spolansky/Burp2Vegeta\"\u003eBurp2Vegeta\u003c/a\u003e \u0026mdash; I was asked by a client to perform load testing on their service to simulate a Denial-of-Service attack. I decided to use \u003ca href=\"https://github.com/tsenart/vegeta\"\u003eVegeta\u003c/a\u003e to perform a classic request flooding attack, but I needed a way to quickly tell it how to send correctly-formatted API requests. As a result I wrote a small Burp extension that exports any request(s) as Vegeta JSON attack definitions to the system clipboard. You can then paste them into an attack definition file and fire away.\u003c/li\u003e\n\u003c/ul\u003e","title":"Misc. Burp Tooling"},{"content":"I made this game in a weekend as a \u0026lsquo;demake\u0026rsquo; of Legend of Zelda for a class using LÖVE, a Lua game engine. The goal of the game is to collect Rupees until the time runs out, using the arrow keys to move. Blue Rupees are worth 5 points.\nYou can find the source code and compiled binaries on Github.\n","permalink":"https://polansky.co/projects/archive/rupeecollector/","summary":"\u003cp\u003eI made this game in a weekend as a \u0026lsquo;demake\u0026rsquo; of \u003cem\u003eLegend of Zelda\u003c/em\u003e for a class using \u003ca href=\"https://love2d.org/\"\u003eLÖVE\u003c/a\u003e, a Lua game engine. The goal of the game is to collect Rupees until the time runs out, using the arrow keys to move. Blue Rupees are worth 5 points.\u003c/p\u003e\n\u003cp\u003eYou can find the source code and compiled binaries on \u003ca href=\"https://github.com/Phyxius/RupeeCollectorClassic\"\u003eGithub\u003c/a\u003e.\u003c/p\u003e","title":"Rupee Collector"},{"content":"This is an old screensaver I wrote to play around with SFML.NET.\n","permalink":"https://polansky.co/projects/archive/mazegensolve/","summary":"\u003cp\u003eThis is an old screensaver I wrote to play around with SFML.NET.\u003c/p\u003e","title":"Maze Generator"},{"content":"This was an assignment for UNM\u0026rsquo;s Design of Large Programs class, meant to demonstrate multithreading concepts in Java. It implements a 10,000 × 10,000 cell Game of Life simulation using an arbitrary number of threads. Several presets are included, and the user interface is designed to be as responsive and scalable as reasonably possible.\nSource is available on Github.\n","permalink":"https://polansky.co/projects/archive/gameoflife/","summary":"\u003cp\u003eThis was an assignment for UNM\u0026rsquo;s Design of Large Programs class, meant to demonstrate multithreading concepts in Java. It implements a 10,000 × 10,000 cell Game of Life simulation using an arbitrary number of threads. Several presets are included, and the user interface is designed to be as responsive and scalable as reasonably possible.\u003c/p\u003e\n\u003cp\u003eSource is available on \u003ca href=\"https://github.com/Phyxius/GameOfLife\"\u003eGithub\u003c/a\u003e.\u003c/p\u003e","title":"Multithreaded Game of Life"},{"content":"My other public projects can be found on my Github Page. A few highlights:\nSort-and-Forward Demonstration: A proof-of-concept of a networking strategy I created during my summer 2014 internship at SPAWAR Systems Center Pacific. This work also resulted in my co-authoring a paper on Systems Engineering, which was presented at the 20th DoD Command and Control Research and Technology Symposium. StarvationEvasion Server: My final project for my Design of Large Programs class was a networked, multiplayer card game written in Java where players control regions of the United States in the future, using climate simulation data to predict the outcomes of global warming. My contribution to the project was to create the server/client communication protocol and to write the server portion of the game. Simple Shell: A simple shell I wrote for my Operating Systems class to demonstrate the use of basic I/O constructs like pipes. Zombie House Game: A simple game I created as part of a three man team, featuring random generation and light raytracing. History Chatbot: A simple chatbot I made for my AI class. It has a small amount of personality and can answer questions about certain historical information by parsing Wikipedia. Markov Chain Text Generator: Generates text using Markov Chains Unnamed Text Adventure: A short text adventure based on the story of Candide, with a disproportionate amount of pop-culture easter eggs. ","permalink":"https://polansky.co/projects/archive/otherprojects/","summary":"\u003cp\u003eMy other public projects can be found on my \u003ca href=\"https://github.com/Phyxius\" rel=\"me\"\u003eGithub Page\u003c/a\u003e. A few highlights:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Phyxius/Sort-and-Forward-Demonstration\"\u003eSort-and-Forward Demonstration\u003c/a\u003e: A proof-of-concept of a networking strategy I created during my summer 2014 internship at SPAWAR Systems Center Pacific. This work also resulted in my co-authoring a \u003ca href=\"/files/papers/spawar-paper.pdf\"\u003epaper\u003c/a\u003e on Systems Engineering, which was presented at the 20\u003csup\u003eth\u003c/sup\u003e DoD Command and Control Research and Technology Symposium.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/castellanos70/StarvationEvasion/\"\u003eStarvationEvasion Server\u003c/a\u003e: My final project for my Design of Large Programs class was a networked, multiplayer card game written in Java where players control regions of the United States in the future, using climate simulation data to predict the outcomes of global warming. My contribution to the project was to create the server/client communication protocol and to write the server portion of the game.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Phyxius/simple-shell\"\u003eSimple Shell\u003c/a\u003e: A simple shell I wrote for my Operating Systems class to demonstrate the use of basic I/O constructs like pipes.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Phyxius/ZombieGame\"\u003eZombie House Game\u003c/a\u003e: A simple game I created as part of a three man team, featuring random generation and light raytracing.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Phyxius/History-Chatbot\"\u003eHistory Chatbot\u003c/a\u003e: A simple chatbot I made for my AI class. It has a small amount of personality and can answer questions about certain historical information by parsing Wikipedia.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Phyxius/markov-string-generation\"\u003eMarkov Chain Text Generator\u003c/a\u003e: Generates text using \u003ca href=\"https://en.wikipedia.org/wiki/Markov_chain\"\u003eMarkov Chains\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Phyxius/Text-Adventure\"\u003eUnnamed Text Adventure\u003c/a\u003e: A short text adventure based on the story of Candide, with a disproportionate amount of pop-culture easter eggs.\u003c/li\u003e\n\u003c/ul\u003e","title":"Other Projects"},{"content":"A friend of mine got a new router/modem for his Verizon 5G home internet, and he noticed the installation tech visiting a hidden UI that wasn\u0026rsquo;t available to him. Naturally, we both thought that was unacceptable and set about hacking the router so we could see what secrets it held. We discovered something interesting: the single box contained two separate Linux systems, running a Frankenstein combination of OpenWRT and Android and communicating across a hidden virtual Ethernet link. We also got some CVEs, including a backdoor password generation system and some good ol\u0026rsquo; unauthenticated command injection.\nYou can find our writeup here: https://github.com/JousterL/SecWriteups/blob/main/Verizon%20LVSKIHP%205G%20Modem/readme.md\nWe included plenty of detail on reverse engineering, so it\u0026rsquo;s worth reading for any budding IoT device hackers as well seasoned veterans.\n","permalink":"https://polansky.co/blog/verizon-router-security-research/","summary":"\u003cp\u003eA \u003ca href=\"https://github.com/JousterL\"\u003efriend of mine\u003c/a\u003e got a new router/modem for his Verizon 5G home internet, and he noticed the installation tech visiting a hidden UI that wasn\u0026rsquo;t available to him. Naturally, we both thought that was unacceptable and set about hacking the router so we could see what secrets it held. We discovered something interesting: the single box contained two separate Linux systems, running a Frankenstein combination of OpenWRT and Android and communicating across a hidden virtual Ethernet link. We also got some CVEs, including a backdoor password generation system and some good ol\u0026rsquo; unauthenticated command injection.\u003c/p\u003e","title":"I Did Some Classic Router Hacking and Found Some Weird Stuff"},{"content":"Keycloak is an open source identity broker that allows you to combine user credentials from different providers (such as Google OAuth, LDAP, GitLab, etc.) as well as locally-stored credentials into a single authentication provider that can integrate with downstream applications using either SAML2.0 or OpenID Connect. I use it in my home lab as a single sign on provider using local accounts (I gave a talk about my setup at BSides Orlando 2020, check it out if you\u0026rsquo;re interested!).\nMy setup leverages local user accounts with WebAuthn for password-less authentication. Users log in by providing their user name, then are prompted by their browser to authenticate using their device\u0026rsquo;s platform authenticator (a built-in security key created using the device\u0026rsquo;s hardware platform). The authentication process requires a biometric or PIN, then provides cryptographic proof to the web application (in this case, Keycloak) that the user is who they say they are, complete with an attestation chain proving the authenticator is legitimate, and that the keys are stored in a hardware-backed non-exportable store. This is an excellent user experience that provides MFA without making users bother with passwords or authenticator apps. Keycloak supports this experience, and it works great with Windows and Android devices. However, Apple\u0026rsquo;s implementation (used in Safari on MacOS and iOS) has two quirks that make it incompatible with Keycloak as of this writing.\nThe Safari (or rather, WebKit, the underlying browser engine) WebAuthn quirks are deliberate, and detailed in their announcement blog post for the feature:\nWebKit will only allow biometrics to be used for authentication if the authentication prompt is the result of a \u0026ldquo;user gesture.\u0026rdquo; In other words, a page that attempts to use WebAuthn on page load will only prompt the user to use their security key, which is not what we want \u0026mdash; a security key is inconvenient and the user verification flow for them is much more awkward than the platform authenticator, plus the expense of actually buying the key. The stated reason for this is to prevent annoying users by constantly prompting them to authenticate (since a cryptographic identity is a pretty darn good tracking vector). The underlying authenticator code (implemented using the Apple Secure Enclave) never increments the signature counter value, leaving it at zero always. The counter is intended to allow detection of cloned authenticators; the intent is that an authenticator will increment the counter on each signature, and a service can track the counter value and fail the authentication if the counter from a given login attempt is lower than the last one it saw. The WebKit blog post recommends using the attestation blob provided by the authenticator to detect clones instead. Unfortunately, those quirks both effect Keycloak\u0026rsquo;s WebAuthn implementation:\nKeycloak\u0026rsquo;s authentication flow uses individual pages for each stage of authentication, and the WebAuthn one issues the authentication request on page load rather than via a button. This triggers WebKit\u0026rsquo;s anti-abuse policy and prevents biometry from being used. Keycloak requires the signature counter to increase on each signature; sending a zero counter value every time will cause every signature after the first to fail with a cryptic error message. Checking the Keycloak log file will be more enlightening, and show an exception related to counter verification. I\u0026rsquo;ve filed bugs (free account required to view) about this to the Keycloak issue tracker, but in the mean time both of these problems can be worked around.\nCustomizing the Keycloak Login Flow Keycloak provides a robust custom theme system that allows you to customize pretty much any part of the user-facing parts of the application, including the various login flow subpages. First, setup Keycloak to use WebAuthn for first and second factor authentication using their guide, then come back to this post.\nWe\u0026rsquo;ll use a custom theme that modifies the login page to require a \u0026ldquo;gesture\u0026rdquo; (specifically, tapping/clicking on a button) to trigger the WebAuthn API, which will satisfy the WebKit anti-abuse measures with as few changes as possible from the default theme. You can find the theme files on my GitHub. Download them, then put the touchid-fix folder into the Keycloak themes/ directory. Then restart Keycloak, and in the admin console change the default login theme to the touchid-fix theme. Instead of it prompting for WebAuthn credentials on load, you\u0026rsquo;ll see a button to press to login instead. It also adds a button to manually report a login failure, which makes it easier to switch to your backup login method if you\u0026rsquo;re on a device that doesn\u0026rsquo;t have WebAuthn setup.\nThis isn\u0026rsquo;t the only thing you\u0026rsquo;ll have to do to make it compatible though. If you leave it here, you\u0026rsquo;ll notice that every authentication attempt after the first fails, which is caused by the counter verification thinking you have a cloned authenticator (since the Apple authenticators never increment the counter).\nHacking Around the Counter Verification While the previous workaround uses intended functionality to customize Keycloak, this second workaround\u0026hellip; is a bit of a hack. Basically, when you login with an authenticator that reports a counter value of n, Keycloak stores the value n+1; the next time you authenticate, it errors if your new counter value is less than n+1. We\u0026rsquo;re going to work around this by using DBMS triggers to reset the counter to zero whenever Keycloak updates it.\nDisclaimer This is a hack. It is not supported functionality, nor is it guaranteed to continue working in the future. It could cause your Keycloak instance to stop working, or introduce a security weakness (beyond the fact that you\u0026rsquo;re disabling a security mechanism explicitly). While I\u0026rsquo;ve been running my install like this for a while with no negative effects as far as I can tell, I make no warranty whatsoever that this won\u0026rsquo;t do something horrible to your install, or cause demons to spew forth from your server. Proceed at your own risk.\nThe Actual Hack You\u0026rsquo;ll need to use a separate database for Keycloak rather than its built-in one. An example docker-compose file to do this can be found in the Keycloak Containers repo. Note that the example file uses a very old version of MySQL that you will have to upgrade for this to work. I use the mysql:latest image, which is bad practice in production but fine for a lab. You need at least version 8.2. You can export your realm, switch to using an external database, then re-import it if you already have users or clients configured. You could also use a different RDBMS, but you\u0026rsquo;ll have to adapt the trigger.\nOnce you\u0026rsquo;ve got Keycloak running using a MySQL database, you\u0026rsquo;ll need to login to the database yourself using the MySQL client. If you use the compose file from above, it\u0026rsquo;s [sudo] docker-compose exec mysql bash, then log in normally using the mysql binary with your password. Once you\u0026rsquo;re at the prompt, select the Keycloak MySQL database (use keycloak;) and then run the following commands:\n1 2 3 4 5 6 7 8 delimiter // create trigger touchid_hack before update on CREDENTIAL for each row begin if NEW.TYPE = \u0026#34;webauthn-passwordless\u0026#34; then set NEW.CREDENTIAL_DATA = regexp_replace(NEW.CREDENTIAL_DATA, \u0026#39;\u0026#34;counter\u0026#34;:[0-9]+\u0026#39;, \u0026#39;\u0026#34;counter\u0026#34;:0\u0026#39;); END IF; END;// This creates a trigger that intercepts writes to the table and replaces the counter value with zero before committing the data. The counter value will be read back on authentication, which since it\u0026rsquo;s zero will always succeed the duplication check.\nAnd that\u0026rsquo;s it. You can now register and use Apple platform authenticators in Keycloak! You also need to set the WebAuthn policy to the appropriate values (ES256 signatures allowed, indirect or no attestation, platform authenticator, user verification not disallowed).\n","permalink":"https://polansky.co/blog/hacking-keycloak-to-support-touchid-faceid-authentication/","summary":"\u003cp\u003e\u003ca href=\"https://www.keycloak.org/\"\u003eKeycloak\u003c/a\u003e is an open source identity broker that allows you to combine user credentials from different providers (such as Google OAuth, LDAP, GitLab, etc.) as well as locally-stored credentials into a single authentication provider that can integrate with downstream applications using either SAML2.0 or OpenID Connect. I use it in my home lab as a single sign on provider using local accounts (I gave a \u003ca href=\"https://polansky.co/files/talks/BSides_Orlando_2020-Perimeterless_Homelabbing.pdf\"\u003etalk\u003c/a\u003e about my setup at \u003ca href=\"https://2020.bsidesorlando.org/#/agenda?day=2\u0026amp;lang=en\u0026amp;sessionId=17525000000045156\"\u003eBSides Orlando 2020\u003c/a\u003e, check it out if you\u0026rsquo;re interested!).\u003c/p\u003e","title":"Hacking Keycloak to Support TouchID/FaceID Authentication"},{"content":"We\u0026rsquo;re getting to the end of the year and I thought I\u0026rsquo;d compile a list of books I read, referenced, perused, or reread this year, with my thoughts on them. Most of my reading for pleasure is fiction (specifically sci-fi or fantasy), but I do also read plenty of security-related or technical material. I\u0026rsquo;m going to split the list into fiction and nonfiction, and each section will be in no particular order.\nNonfiction Understanding Cryptography, by Christof Paar and Jan Pelzl. This was the book that I first learned cryptography from in high school. Windows Internals, Part 1: System architecture, processes, threads, memory management, and more by Pavel Yosifovich et al. This is a deep dive into the internals of the Windows kernel with exhausting detail on how everything works. I won\u0026rsquo;t say it\u0026rsquo;s necessarily a must-read for developers or security professionals, but for those that want to work on code (or exploits) that touch the Windows kernel it definitely is. Principles of Secure Processor Architecture Design by Jakub Szefer. This is a bird\u0026rsquo;s-eye-view of threats and mitigations for secure processors. It\u0026rsquo;s an interesting introduction but isn\u0026rsquo;t overflowing with detail. I found it interesting but didn\u0026rsquo;t leave feeling like I had substantially advanced my skills or knowledge. Building Secure and Reliable Systems by Heather Adkins et al. An introduction to Site Reliability Engineering that I found quite fascinating even if it also made me glad that it wasn\u0026rsquo;t my job per se. Available free online from Google\u0026rsquo;s SRE Site. xchg rax,rax by xorpd. A small volume of assembly \u0026ldquo;poetry\u0026rdquo;. I approached them like puzzles and ended up learning quite a bit about the weird ghosts, demons, and dragons hiding inside the x86-64 ISA. The Theory of Committees and Elections by Duncan Black. I have been fascinated for years by voting systems and this is a somewhat dry but thorough introduction to formally analyzing different voting systems and how they introduce biases and weaknesses into a system. PoC||GTFO 0x20 by Manul Laphroaig et al. A yearly journal of weird hacks, cool tricks, and crazy shenanigans of the hacker variety. 2600 by various authors. The classic hacker quarterly. Flour Water Salt Yeast: The Fundamentals of Artisan Bread and Pizza by Ken Forkish. I always loved baking bread and sweets and the pandemic made me want to get a little more serious about my bread (along with everyone else it seems). Fiction A Wizard of Earthsea by Ursula K LeGuinn. A boy grows into a the world\u0026rsquo;s most powerful wizard, told as if it was an oral history. The Magicians by Lev Grossman. Dysfunctional undergrads learn that even being admitted to a secret magic school can’t solve their problems. Three Parts Dead by Max Gladstone. What if all the incomprehensible legal gibberish in that contract was actually a spell, and the lawyer that wrote it a wizard messing with powers man was not meant to possess? The Laundry Files by Charles Stross. What if all the incomprehensible code in that program was actually a spell, and the programmer that wrote it a wizard messing with powers man was not meant to possess? First few books are Bond pastiches but later ones have their own plot and identity. Kismet by Watts Martin. A genetically\\ modified starfaring freelancer gets stuck between powerful corporations that want to control the future of gene modification. Starship\u0026rsquo;s Mage by Glynn Stewart. Since FTL travel is impossible\u0026hellip; just say A Wizard Did It. Literally. Snow Crash by Neal Stephenson. This was supposed to be a satirical cyberpunk story about VR and hypercapitalism. Now it\u0026rsquo;s just nonfiction. The Dresden Files, by Jim Butcher. What would a wizard do if they lived in modern Chicago? Set up shop as a PI of course! You can skip to number 4 if you find the first one a little rough \u0026mdash; the first three were written without the help of an editor (they were the author\u0026rsquo;s college writing projects). Neuromancer by William Gibson. This book basically defined cyberpunk as a genre. If you read it, you\u0026rsquo;ll almost think it was cliché, it\u0026rsquo;s so much the archetype of all that came later. ","permalink":"https://polansky.co/blog/2020-reading-list/","summary":"\u003cp\u003eWe\u0026rsquo;re getting to the end of the year and I thought I\u0026rsquo;d compile a list of books I read, referenced, perused, or reread this year, with my thoughts on them. Most of my reading for pleasure is fiction (specifically sci-fi or fantasy), but I do also read plenty of security-related or technical material. I\u0026rsquo;m going to split the list into fiction and nonfiction, and each section will be in no particular order.\u003c/p\u003e","title":"My 2020 Reading List"},{"content":"\nDisclaimer: eLearnSecurity is a sponsor of the IoT Village, an ISE-run organization. I received the course and exam for free due to this relationship. eLearnSecurity had an opportunity to review the contents of this article before it was published but it nonetheless represents my genuine opinion.\nThis post first appeared on the ISE Blog\nI recently took the eLearnSecurity Penetration Testing Professional (PTP) course and passed the associated eLearnSecurity Certified Professional Penetration Tester (eCPPTv2) exam. As a security professional I\u0026rsquo;m always on the lookout for new opportunities to improve my skillset and learn new techniques for attacking and defending networks, so I was excited to see what the course had to offer. I already have a few certifications including the Offensive Security Certified Professional (OSCP) and Expert (OSCE), so I have a pretty good background in the topics covered in the course, which include:\nFundamentals of buffer overflow exploits Cryptography and password cracking Fundamentals of network security including reconnaissance, spoofing attacks, post-exploitation, and social engineering Linux and windows exploitation and privilege escalation Basics of web application security including reconnaissance, cross-site scripting, and SQL injection Wi-Fi security and attacks Additionally, buyers of the \u0026ldquo;extreme\u0026rdquo; edition of the course also get access to material covering PowerShell and Ruby scripting for pentesters including use of tools like Metasploit and Empire.\nAbout the Course The material is broken into chapters containing a series of modules delivered in the form of video lectures and PDF slideshows with other files such as tools attached where relevant. The videos combine lecture slides with live demonstrations, and I found the video lecturer easy to follow. The PDFs were useful for review and to skim around to find the information I needed. The material was mostly up-to-date and covered relatively recent versions of the software involved. The only glaring exception is that the exploration of spoofing attacks includes usage of Cain and Abel, which is an ancient tool for performing ARP spoofing and password cracking that\u0026rsquo;s been supplanted by more modern tools such as Responder, Ettercap, and Hashcat. Also, the explanation of buffer overflows focuses on exploitation under extremely favorable circumstances that don\u0026rsquo;t often occur in modern software and operating systems \u0026mdash; namely, exploiting buffer overflows in software with zero exploit mitigations such as W^X or ASLR. However, knowing how to perform a buffer overflow attack in such an environment is kind of a requirement for more advanced techniques like bypassing ASLR with ROP, so it gets a pass from me on that front.1\nPersonally, I already knew perhaps 80 percent of the content due to both my general background as a security professional and specifically due to the certifications I have already achieved. The content new to me mostly consisted of the Ruby and PowerShell modules; I had a working knowledge of both but hadn\u0026rsquo;t ever taken the time to really learn how to use them. I enjoyed following the material to manually write a Metaspoloit module in Ruby and playing with the PowerShell post-exploitation tools it covered.\nLabs Many of the modules have labs associated with them, which take the form of virtual environments containing various hosts intended to provide hands-on practice with the module contents. When you start a lab, the environment is spun up on eLearnSecurity\u0026rsquo;s \u0026ldquo;Hera\u0026rdquo; servers and you are issued OpenVPN credentials which put you on the lab network. Unlike the OSCP, lab networks are dedicated to you, so you never have to worry about someone crashing the box you\u0026rsquo;re trying to exploit or (as happened to me several times during my OSCP labs) finding what you think is the intended way of getting access to a machine only to realize that it was a backdoor left by another student so they could continue where they left off. The labs also come with manuals containing general directions outlining the goal and general intended exploitation path, some hints, and then a full solution manual. This is both a great strength and weakness of the course: unlike the OSCP (whose lab environment is just a bunch of boxes in one big network with no hints or solution manual), the PTP labs felt very targeted and purposeful since each lab was designed to illustrate a specific concept or technique. It even included a few \u0026ldquo;blind pentest\u0026rdquo; labs that drop you in a network with little information and tell you to go nuts à la OSCP. However, those labs were on the small side and I think having a few more boxes and requiring more pivoting steps wouldn\u0026rsquo;t have been amiss, since it\u0026rsquo;s rare in a real pentest for you to attain your goal going through only one or two machines.\nOverall I found the labs to be the best part of the course and they made an excellent practice ground for me to both learn new techniques and refresh my knowledge of older ones before taking on the exam.\nThe Exam The eCPPTv2 exam is a 7-day exam that can be started whenever you want (no scheduling in advance like OffSec\u0026rsquo;s) simply by clicking a button in the eLearnSecurity members area. You immediately receive VPN access and a PDF containing your instructions. The exam emulates a real penetration test: you are given a rough network map, a rough goal (called out as \u0026ldquo;necessary but not sufficient\u0026rdquo; to pass), and told to pwn all the things. After you\u0026rsquo;re done, you have to write a \u0026ldquo;professional quality\u0026rdquo; report detailing your steps to reconnoiter and exploit each host along with all applicable security issues you\u0026rsquo;ve found (even ones that weren\u0026rsquo;t directly exploitable or that just made it easier for you to exploit other weaknesses). The report will be reviewed by eLearn\u0026rsquo;s staff and then you\u0026rsquo;ll either pass or fail; if you fail, you\u0026rsquo;ll receive comments and then have another 7 days of exam time to log back into the lab and try again, correcting any issues in your report or exploiting hosts you missed in the first round.\nI found the exam to be reasonably challenging and a lot of fun. It mapped very well onto the course material; the optional sections (Ruby and PowerShell) weren\u0026rsquo;t tested directly but are definitely helpful to know. A notable difference in the eCPPTv2 exam versus the OSCP exam is that you\u0026rsquo;re expressly permitted to use any tools you want, including automated tools like sqlmap or Metasploit, which better emulates a real penetration test scenario and is frankly just a lot less frustrating than trying to get years-old code off exploit-db to compile. I was done with all the objectives in about 2.5 days, but I can see someone who wasn\u0026rsquo;t as experienced as me taking another couple days to manage it. I thoroughly enjoyed the experience for sure!\nReporting Reporting is a big deal on this exam. You\u0026rsquo;re expected not just to gain access to all the machines, but take good notes and produce a good quality report, including details like an executive summary and a breakdown of discovered issues. It\u0026rsquo;s a good idea to take notes as you go using tools like OneNote or CherryTree, including screenshots of steps, commands used, and any issues you discover. I also recommend building a network diagram as you go, including information like open ports (both inbound and outbound)\u0026mdash;it\u0026rsquo;s helpful during the exam to keep track of where you need to pivot to/from and you can include it in the report to flesh it out. eLearn\u0026rsquo;s reporting guide is somewhat hard to find (it\u0026rsquo;s located here, for reference), but it\u0026rsquo;s very good at walking you through necessary elements of a report. I used a modified version of the template ISE uses when reporting our real engagements to clients, but you can find plenty of examples online, such as this one.\neCPPTv2 vs OSCP This is the million dollar question: how does the eCPPTv2 compare to the OSCP? OSCP is currently one of the more recognized certifications in the industry while eCPPTv2 is still gaining traction, although it\u0026rsquo;s definitely getting there \u0026mdash; many of my contacts at different companies have either heard of their courses or have taken them individually or through a corporate subscription. I found OSCP\u0026rsquo;s exam to be more challenging than eCPPTv2\u0026rsquo;s, though much of that was due to OSCP\u0026rsquo;s 24-hour time limit, which honestly strikes me as artificial difficulty. One other major difference between the two in terms of the exam is eCPPT\u0026rsquo;s explicit permission to use automated tools versus OSCP\u0026rsquo;s ban on them. There\u0026rsquo;s definitely value in knowing how the automated tools work, but in a real world scenario (which both certifications claim to emulate) there\u0026rsquo;s zero chance of me doing anything manually if I can avoid it. The other big difference between the two exams is that the eCPPTv2 exam emulates a realistic network requiring you to pivot and figure out how to get through restrictive firewalls both on ingress and egress, something OSCP doesn\u0026rsquo;t require.\nIn terms of content, the two courses are roughly the same; the main difference is that PTP covers WiFi attacks and PowerShell/Ruby, while the updated OSCP has better coverage of Active Directory attacks. I\u0026rsquo;ve already covered the differences in labs except that I also want to mention that I found the PTP labs to be way faster than the OSCP/E ones. I have a fast internet connection at home but my connection to the OSCP labs was always really high latency and low throughput, while the PTP labs were much snappier. That might be related to my physical location as much as anything on their ends, but it\u0026rsquo;s definitely worth mentioning since it can get pretty painful uploading exploit binaries at speeds measured in tens of kilobits per second.\nSo which one should you take? The easy answer is both\u0026mdash;the two certifications differ enough in covered material and exam style that it makes them almost more complementary than competing. PTP is definitely a lot friendlier with its lab walkthroughs and more lenient exam structure and policy, and it\u0026rsquo;s also a better emulation of a realistic pentest scenario than OSCP. OSCP is a little harder, covers Active Directory better, and is more widely recognized\u0026mdash;you can see examples of general opinion between the two on Google and on charts like this security certification roadmap. That chart is of course just one person\u0026rsquo;s opinion and hardly \u0026lsquo;official\u0026rsquo;, but it does pretty well illustrate the difference in general status between the two. They\u0026rsquo;re also about the same price, though again the actual format of the PTP course is much more generous and user friendly. If I had to pick one, I\u0026rsquo;d say that someone who was entirely new at security would probably have a better time with the PTP course unless they were really itching for a challenge or wanted to get the most recognized certification they possibly can, while the OSCP would be a little better for people with some existing experience. I\u0026rsquo;d also say that you might be well served trying for both, or for doing PTP followed by the newly-updated Penetration Testing eXtreme course, which covers all the material missing from PTP on Active Directory and much more. It\u0026rsquo;s the one I\u0026rsquo;ll be taking next once I have the time.\nIt\u0026rsquo;s worth noting, as an aside, that you can take the eCPPTv2 exam without purchasing the course. If you\u0026rsquo;re an experienced pentester and already have the OSCP you might want to consider that since the exam on its own is about 1/3 the price of the course+exam.\nConclusion Overall I\u0026rsquo;d consider the PTP course and the eCPPTv2 exam to be worth the $1,300 asking price as an entry level certification. For holders of existing certifications like the OSCP, the exam experience is certainly worth it but the material itself may not be worth the asking price. I thoroughly enjoyed the experience and look forward to trying the PTX course and its associated exam.\nBy the way, if you want to learn how to take on challenges like bypassing W^X and ASLR, the CoreLan Exploit Tutorials are really excellent and also free. I also enjoy the MicroCorruption embedded security CTF, whose later levels cover those techniques in an embedded environment.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\n","permalink":"https://polansky.co/blog/elearnsecurity-pen-test-professional-review/","summary":"\u003cp\u003e\u003cimg alt=\"eCPPTv2 Logo\" loading=\"lazy\" src=\"/blog/elearnsecurity-pen-test-professional-review/ecppt_v2_certificate.png\"\u003e\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eDisclaimer: eLearnSecurity is a sponsor of the \u003ca href=\"https://iotvillage.org\"\u003eIoT Village\u003c/a\u003e, an ISE-run organization. I received the course and exam for free due to this relationship. eLearnSecurity had an opportunity to review the contents of this article before it was published but it nonetheless represents my genuine opinion.\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eThis post first appeared on the \u003ca href=\"https://blog.securityevaluators.com/elearnsecurity-pen-test-professional-ptp-review-93929e0613e2\"\u003eISE Blog\u003c/a\u003e\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eI recently took the \u003ca href=\"https://www.elearnsecurity.com/course/penetration_testing/\"\u003eeLearnSecurity Penetration Testing Professional\u003c/a\u003e (PTP) course and passed the associated \u003ca href=\"https://www.elearnsecurity.com/certification/ecpptv2/\"\u003eeLearnSecurity Certified Professional Penetration Tester\u003c/a\u003e (eCPPTv2) exam. As a security professional I\u0026rsquo;m always on the lookout for new opportunities to improve my skillset and learn new techniques for attacking and defending networks, so I was excited to see what the course had to offer. I already have a few certifications including the \u003ca href=\"https://www.offensive-security.com/pwk-oscp/\"\u003eOffensive Security Certified Professional\u003c/a\u003e (OSCP) and \u003ca href=\"https://www.offensive-security.com/awae-oswe/\"\u003eExpert\u003c/a\u003e (OSCE), so I have a pretty good background in the topics covered in the course, which include:\u003c/p\u003e","title":"eLearnSecurity Pen Test Professional (PTP) Review"},{"content":"In my previous article, I laid out a framework for building a modern, hardened OpenVPN server/client configuration. At the end, I noted there were some additional hardening steps that would be nice to take for extra security. In particular:\nUsing an additional static TLS key in the initial TLS handshake to prevent denial-of-service attacks. Storing keys in hardware cryptographic devices to prevent exfiltration. Using multi-factor authentication with time-based one time passwords (TOTP, AKA Google Authenticator) Closing the small security hole created because OpenVPN doesn\u0026rsquo;t by default check that client certificates match client usernames. Instructing OpenVPN to apply additional exploit mitigation measures to itself after initialization. Like the previous article, this will be slightly complicated by the fact that many installations of OpenVPN don\u0026rsquo;t use the community edition server directly, but wrap it in some other interface or appliance. It will likely be impossible to apply the latter two hardening steps in that case, and may also be impossible to perform the first or third depending on what options are exposed. If you use a wrapper or appliance and the security benefits of these additional configuration steps seem like something you want and the appliance doesn\u0026rsquo;t offer the options to do so, check with the support team for the product and see if they\u0026rsquo;re applying them already or if they can expose the relevant options in their interface.\nFrom now on, I will assume you have a working OpenVPN configuration (probably one vaguely like the one I developed in the previous article) and that you have a working knowledge of OpenVPN syntax and general Linux/Unix administration basics. If you haven\u0026rsquo;t read the previous article, you might want to check it out to make sure you haven\u0026rsquo;t missed any of the hardening steps there as well.\nCaveats In general, these steps are relegated to an \u0026ldquo;extra credit\u0026rdquo; article rather than being part of the main one for a combination of reasons:\nNot all of them will be applicable for every user. If you\u0026rsquo;re using a third party gateway, it may not have the option in question, or it may be doing something different internally. Similarly, it may not work at all if you\u0026rsquo;re not running the right OS or lack the requisite hardware. Some of them require substantial environment-specific customization. Some may not be unilateral improvements depending on your specific environment and needs. With those caveats in mind, on to the actual configuration!\nUsing a Static TLS Key in OpenVPN Handshakes As mentioned in the previous article, OpenVPN uses TLS for its control channel. Configured and used correctly, TLS is secure against pretty much all (known) attacks. However, there are a handful of minor flaws to consider:\nBecause authentication occurs after the initial handshake (which requires a small but nonzero amount of computation), an attacker could open thousands of connections at once and consume a large amount of resources including CPU and network. If you use UDP mode (which you should if possible since it\u0026rsquo;s much more performant), there\u0026rsquo;s also a risk of being used as a vector for UDP reflection attacks since the initial UDP TLS packets will not require authentication. The OpenVPN protocol is easily identifiable on network sniffers, firewall logs, and so on. This may be undesirable if you want your VPN usage to be secret from governments, ISPs, etc. TLS in its current form is not quantum-resistant; the elliptic curve Diffie-Hellman key exchange (ECDHE) used in modern TLS relies on the difficulty of certain problems in elliptic curves, which are easily solvable by an advanced quantum computer. As far as anybody knows, no such computer exists currently (nor is one likely to become available in the near future), but if one is eventually produced it could be used to decrypt previously recorded traffic flows. Depending on your threat model, this likely isn\u0026rsquo;t that concerning, but it\u0026rsquo;s worth pointing out. The first flaw is an issue on web services as well, but they typically just implement connection rate limiting to mitigate it. The other two are OpenVPN-specific, since regular HTTPS services don\u0026rsquo;t use UDP and there isn\u0026rsquo;t usually a concern about being identified as using HTTPS.\nSo how do we resolve these flaws? OpenVPN includes the tls-crypt option1, which encrypts and authenticates the entire TLS channel (including the initial packets) with a static, pre-shared symmetric key. Any packets that are not correctly encrypted and authenticated are simply dropped. As long as adversaries don\u0026rsquo;t possess the key, they cannot:\nOpen new connections (resolving the DoS and UDP reflection issues) Decode the otherwise-unencrypted handshake (solving the identification issue) See the underlying ECDHE and use a quantum computer (now or later) to break the ECDHE and decrypt the VPN traffic. This is not a perfect solution\u0026mdash;since the key has to be shared between every party, any client that is compromised or that is malicious can still perform all four of the attacks identified above. If a key was compromised, you would have to rotate the PSK by issuing new configuration files to each client. However, at that point the security of the protocol only degrades to where it would be if the option wasn\u0026rsquo;t used at all, so in such a case it may not be urgently necessary depending on your threat model.\nUsing the tls-crypt Option Using tls-crypt is easy. First, generate an appropriate key by issuing the following command:\n1 openvpn --genkey --secret tls-crypt.key The key will be written to tls-crypt.key. After that, embed it in both your server and client configuration files like so:\n1 2 3 4 # ...other configuration directives above \u0026lt;tls-crypt\u0026gt; # contents of tls-crypt.key go here \u0026lt;/tls-crypt\u0026gt; And that\u0026rsquo;s it! All TLS communication will now be encrypted and authenticated as described above.\nStoring Keys in Hardware Up until now, the hardening steps I\u0026rsquo;ve shown were mostly oriented at preventing breaches. However, it\u0026rsquo;s important to realize that all the hardening in the world won\u0026rsquo;t prevent 100 percent of breaches\u0026mdash;if nothing else, users get phished or have their devices stolen all the time\u0026mdash;so it\u0026rsquo;s almost equally important to consider what happens when a breach occurs. If a user\u0026rsquo;s device is compromised, the attacker will almost certainly be able to exfiltrate their key (since it\u0026rsquo;s just stored in a file), and would probably be able to keylog their username and password. With those two things, the attacker can then access the VPN as that user.\nThere are two was to make achieving that goal more difficult for attackers. The first is to use a one-time password such as via the time-based one time password (TOTP) algorithm, which is discussed below. The other is to store the key not in the configuration profile, but in somewhere that won\u0026rsquo;t allow it to be exfiltrated\u0026mdash;a hardware secure enclave. Modern Windows PCs include a Trusted Platform Module (TPM). Newer Macs include the T2 chip, which has similar functionality, and all modern smartphones include roughly equivalent hardware as well. You can also use Yubikeys or smartcards to store user keys if you want to issue portable tokens rather than keys bound to physical devices. Both cases are applications of Multi-Factor Authentication, combining \u0026ldquo;something you know\u0026rdquo; (a password) with \u0026ldquo;something you have\u0026rdquo; (a physical device).\nFor our purposes, all of the above perform similar functions: they generate, store, and use cryptographic secrets without ever exposing them to the underlying OS. For example, an attacker that compromises a PC will be able to ask the TPM to perform operations such as sign challenges, but will not be able to actually steal the keys; they will have to maintain continuous access to the compromised PC in order to e.g., ask the TPM to sign TLS handshake packets. This is much noisier, dependent on the compromised user actually being online, and is much less convenient for the attacker than simply stealing the key, so it\u0026rsquo;s a massive improvement.\nOpenVPN on Windows supports using the Windows Crypto API to perform cryptographic operations, which means that any certificate available to the system\u0026rsquo;s certificate manager can be used to connect to a VPN endpoint; this includes keys stored on the TPM, or on any smart cards or cryptographic dongles like Yubikeys connected to the system. On Windows and other desktop platforms, OpenVPN additionally supports loading external PKCS#11-compatible modules to perform crypto operations. On Linux, there is a library for using the TPM this way; one could hypothetically be built for macOS and its T2 chip, but as far as I am aware no such module exists as of this writing. As for smartcards, many (but not all!) are supported by the OpenSC project, which includes a PKCS#11 module. It also supports many cryptographic dongles such as Yubikeys.\nCertificate Provisioning Before using a certificate for OpenVPN (or anything else), you of course have to issue it. The process for generating them on a cryptographic dongle is different than normal certificates, since you never actually end up with a file containing the private key.\nFor Windows machines, generating a key and issuing a certificate on the TPM can either be done using Active Directory Certificate Services (ADCS) or manually. To issue it using ADCS, create a template for a TLS client certificate and specify the Microsoft Platform Crypto Provider as the cryptographic provider, then create and issue a certificate as normal. To do so without ADCS (either because you are not using Active Directory or because your OpenVPN CA isn\u0026rsquo;t your ADCS CA), see my other blog post about this topic.\nFor all platforms, using a PKCS#11 smartcard or Yubikey requires installing OpenSC (or another PKCS#11 driver if it doesn\u0026rsquo;t support your hardware) and OpenSSL. The OpenSC PKCS#11 module readme has a walkthrough of how to use to issue OpenSSL commands that interact with PKCS#11 devices.\nUsing Microsoft CryptoAPI Certificates in OpenVPN Once you have issued a certificate and the Microsoft Crypto API is aware of it (either on the TPM, on a smartcard compatible with the default smartcard driver, or on a smartcard with its own CryptoAPI driver you\u0026rsquo;ve installed), you can specify it to OpenVPN using its cryptoapicert option. The option takes a single argument, a \u0026ldquo;select string\u0026rdquo; that tells OpenVPN how to find the certificate; the manual describes how to construct this string:\nTo select a certificate, based on a substring search in the certificate’s subject:\ncryptoapicert \u0026ldquo;SUBJ:Peter Runestig\u0026rdquo;\nTo select a certificate, based on certificate’s thumbprint:\ncryptoapicert \u0026quot;THUMB:f6 49 24 41 01 b4 …\u0026quot;\nThe thumbprint hex string can easily be copy-and-pasted from the Windows Certificate Store GUI.\nUsing PKCS#11 Certificates in OpenVPN While cross-platform, this is unfortunately more complicated.\nFirst, locate the appropriate PKCS#11 module. For OpenSC, you\u0026rsquo;ll want to locate the opensc-pkcs11.so file, which might be in /usr/lib depending on where your distro puts it. On macOS, the brew installation of OpenSC puts it at /usr/local/lib/onepin-opensc-pkcs11.so. On Windows, it goes into the OpenSC installation directory. Use the appropriate value as the argument for the option pkcs11-providers provider.\nSecond, identify the ID of the certificate you want to use. It will vary by device and by PKCS#11 provider, so you can use openvpn --pkcs11-providers /path/to/provider.so --show-pkcs11-ids to list the ones on the system. Then add the option pkcs11-id your_id to the configuration file. There are additional options that you may need or want to configure depending on your use case and hardware such as pin caching and what specifically the OpenVPN program requests from the crypto device, so check the manual out (search for pkcs11 to see the relevant options) and try it them yourself to see what works.\nHardware-Backed Cryptography on Mobile Devices As of this writing, both the community-supported OpenVPN for Android app and the official OpenVPN Connect apps support using the Android Key Store (which is hardware backed on all recent devices) for certificate storage. Simply import a profile with no certificate or private key and the apps will allow you to pick a certificate from the system store to use. The official iOS OpenVPN Connect app works similarly using the iOS certificate store. You can also issue mobile profiles containing SCEP (Simple Certificate Enrollment Profile) information bundled with OpenVPN profiles to iOS devices, which makes VPN provisioning a single step process.\nWhat About the OpenVPN Server? Key compromise on an OpenVPN server would be even worse than on a client, since the attacker would be able to perform a man-in-the-middle all traffic going to or from the server. If you followed the guide in the previous article, they would at least not be able to decrypt past traffic, nor decrypt any future traffic they were not actively intercepting thanks to the forward secrecy offered by ECDHE, but even being able to mount an active man-in-the-middle is bad enough to warrant trying to prevent key compromise. The solution is the same as on the clients\u0026mdash;store the key in a cryptographic device. This is a little tricker on the server side, since most crypto devices are relatively slow. Commercial Hardware Security Modules (HSMs) are usually capable of performing operations at high speeds (especially for RSA at smaller key sizes and for elliptic curve cryptography), so it may be worth using one. They typically have PKCS#11 interfaces, so you can follow the same steps for clients to use them.\nTime-Based One Time Passwords If managing hardware certificates is too much work, another option is to use OpenVPN\u0026rsquo;s challenge plugin functionality, which allows you to specify a library that will issue and validate challenges in addition to users\u0026rsquo; passwords. Users will be prompted for the challenge when the connection is initiated, and possibly when it is renegotiated depending on your settings. One such module is openvpn-totp, which prompts for and validates Time-Based One Time Passwords, which are generated based on a shared secret between the server and client. Users will use a smartphone app such as Google Authenticator (available on Android and iOS) to generate short numeric codes which they will enter when prompted.\nWhen used as in the challenge/response mode (a guide for which is in the README), this module provides multi-factor authentication. \u0026ldquo;Something you know\u0026rdquo; (a password) is combined with \u0026ldquo;something you have\u0026rdquo; (a phone); an attacker likely can compromise a PC and keylog or phish credentials, but it is unlikely that they will be able to also gain access to the phone and steal its TOTP secrets, increasing security.\nIt is also possible to handle this at the directory layer, which is useful if you use a gateway without plugin support. In that case, configure OpenVPN to use your directory, and consult your directory\u0026rsquo;s manual for how to enable it. For instance, OpenLDAP has a TOTP overlay module. Once you have done so, users will have to login by inputting both their TOTP code and their password in the same password field in order to login.\nBinding Certificates to Users When a user connects to the OpenVPN server, it checks certain things about the user:\nIs their certificate valid? That is, are the signatures in the chain valid, was it issued by a trusted CA, does it have the correct Extended Key Usage flags, etc. Is their username and password valid according to whatever authentication mechanism is configured? If you enable strict options checking (recommended, see the previous article), are their options valid? Note one thing it does not check: Does the presented certificate match the user that\u0026rsquo;s using it? Without that check, an attacker may use any certificate (either gained legitimately or compromised) to login as any user provided they know the user\u0026rsquo;s password. To prevent this, you can use the OpenVPN shell script verification option, which causes OpenVPN to run a shell script using environment variables to pass information about the user in order to validate their credentials. The environment variables include information about the certificate (its CN, its serial number, etc.) and the username and password. The following script demonstrates how to check that a user\u0026rsquo;s certificate matches their username:\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 #!/bin/bash # credit to this ServerFault user: https://serverfault.com/a/360399 # username and common_name must be the same to allow access. # users are not allowed to share their cert if [ $username != $common_name ]; then echo \u0026#34;$(date +%Y%m%d-%H%M%S) DENIED username=$username cert=$common_name\u0026#34; \u0026gt;\u0026gt; /var/log/openvpn-access.log exit 1 fi # supply your own validate_username_and_password() function # e.g., check against LDAP using ldapbind if ! validate_username_and_password(); then echo \u0026#34;$(date +%Y%m%d-%H%M%S) DENIED username=$username cert=$common_name\u0026#34; \u0026gt;\u0026gt; /var/log/openvpn-access.log exit 1 fi echo \u0026#34;$(date +%Y%m%d-%H%M%S) GRANTED username=$username cert=$common_name\u0026#34; \u0026gt;\u0026gt; /var/log/openvpn-access.log exit 0 Save the script on the server somewhere, then customize the validate_username_and_password() function to match your environment (e.g., use the command line LDAP tools to check against LDAP, or use a Python script to check against the local PAM subsystem). Then add the following directives to the server:\n1 2 script-security 2 # allow external scripts auth-user-pass-verify /path/to/script.sh via-env Make sure to make the script unreadable to other users if it has any secrets in it, such as those used to bind to an LDAP server.\nAdditional Exploit Mitigations The suggested configuration in the previous article included instructing OpenVPN to drop its privileges to the nobody user/group after initialization. This way, if a security issue in the server was exploited and granted an attacker the ability to execute code or disclose files as the OpenVPN process, the impact of the exploit would be limited. The attacker would only be able to read files that nobody could read and wouldn\u0026rsquo;t be able to interact with the wider system in a meaningful way without a separate escalation-of-privilege vulnerability. However, there\u0026rsquo;s still a reasonably wide attack surface for an attacker to work with in this scenario: They can make network connections, interact with the kernel using any unprivileged system call, and read any world-readable file. In an ideal world, none of these things would be overly concerning since the server wouldn\u0026rsquo;t have any important data left with weak permissions, the internal network the VPN grants access to would be patched and have firewalls in place, the kernel would have no escalation-of-privilege issues, and so on. We however live in a world where none of those things are guaranteed, so we must adopt a defense-in-depth strategy and apply exploit mitigations so as to limit the impact of any security issues.\nChroot-ing OpenVPN Linux has a feature known as chroot (\u0026ldquo;change root\u0026rdquo;) that allows a process to tell the kernel it wants to treat a specific directory as if it was the root directory of the system. In other words, all further file system calls (listing directories, opening files, and so on) will be relative to that directory, and it will no longer be able to access any files outside of it. This is commonly used for bootstrapping a system or rescuing a broken one (for instance, chroot-ing onto a system with a broken kernel from a live disk to reinstall it), but it\u0026rsquo;s also a useful security feature. Applications can chroot themselves into a \u0026lsquo;jail\u0026rsquo; that contains only the files they need, and then if their process is later exploited by an attacker, the attacker will not be able to read or access any other files.\nFor the case of OpenVPN, it\u0026rsquo;s very easy to identify which files need to be in its chroot: none, except any scripts your specific configuration uses. Everything else is only required during initialization (assuming you set the options to persist relevant data in memory), so it isn\u0026rsquo;t necessary to have it available after initialization, when the OpenVPN daemon will chroot itself.\nTo use the relevant option, make a directory (e.g., /etc/openvpn/chroot), place any necessary files in it, and ensure your server contains the following configuration directives:\n1 2 3 persist-key persist-tun chroot /path/to/dir At this point, if the OpenVPN process were to be exploited, the attacker would only have access to any files in that directory. They would however also have access to any system calls an unprivileged user could make, which potentially allows for privilege escalation. To lock that down, a different mitigation is necessary.\nSELinux SELinux (Security Enhanced Linux) is a set of Linux security modules that allow fine-grained access controls to be applied to users and processes. While full configuration of SELinux is out of scope of this article, the CentOS wiki has an excellent introduction, including example policies. Once you have SELinux configured for your system, you can use the reference OpenVPN policy (in the SELinux Reference Policies repository as a base. You apply that policy by the standard SELinux configuration mechanisms, customizing it slightly if you need to grant access to additional calls such as those needed by any custom scripts or plugins. However, for even greater security you can also customize it to be even more restrictive and remove access to system calls and directories not necessary after initialization (such as opening additional sockets), then pass the setcon \u0026lt;context\u0026gt; configuration directive to OpenVPN to instruct it to apply the given policy to itself after initialization. This will of course require customization depending on your environment but will yield the most hardened server possible.\nNote that combining SELinux with chroot is possible, but requires some extra work:\nYou can of course combine [setcon, user and chroot], but please note that since setcon requires access to /proc you will have to provide it inside the chroot directory (e.g. with mount --bind).\nConclusion This concludes our two-part series on OpenVPN hardening. At this point, you should have configured OpenVPN to use modern ciphers and key exchanges, considered using physical security tokens for authentication, reduced the impact of certificate and credential theft, balanced user experience with the need to reduce the presence of credentials in memory, and applied exploit mitigations to the server process so as to reduce the impact of any 0day security issues that affect it.\nRemember to follow all the usual security best practices as well — update your OS’s, configure firewalls, use logging systems, review alerts, and so on. Security is a continuous process, not something you set and forget.\nThis replaces (and is mutually incompatible with) the older tis-auth option, which only prevented the first two attacks since it simply added an HMAC authentication tag to each TLS packet.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\n","permalink":"https://polansky.co/blog/hardening-openvpn-in-2020-extra-credit/","summary":"\u003cp\u003eIn my \u003ca href=\"/blog/hardening-openvpn-in-2020/\"\u003eprevious article\u003c/a\u003e, I laid out a framework for building a modern, hardened OpenVPN server/client configuration. At the end, I noted there were some additional hardening steps that would be nice to take for extra security. In particular:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eUsing an additional static TLS key in the initial TLS handshake to prevent denial-of-service attacks.\u003c/li\u003e\n\u003cli\u003eStoring keys in hardware cryptographic devices to prevent exfiltration.\u003c/li\u003e\n\u003cli\u003eUsing multi-factor authentication with time-based one time passwords (TOTP, AKA Google Authenticator)\u003c/li\u003e\n\u003cli\u003eClosing the small security hole created because OpenVPN doesn\u0026rsquo;t by default check that client certificates match client usernames.\u003c/li\u003e\n\u003cli\u003eInstructing OpenVPN to apply additional exploit mitigation measures to itself after initialization.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eLike the previous article, this will be slightly complicated by the fact that many installations of OpenVPN don\u0026rsquo;t use the community edition server directly, but wrap it in some other interface or appliance. It will likely be impossible to apply the latter two hardening steps in that case, and may also be impossible to perform the first or third depending on what options are exposed. If you use a wrapper or appliance and the security benefits of these additional configuration steps seem like something you want and the appliance doesn\u0026rsquo;t offer the options to do so, check with the support team for the product and see if they\u0026rsquo;re applying them already or if they can expose the relevant options in their interface.\u003c/p\u003e","title":"Hardening OpenVPN in 2020: Extra Credit"},{"content":"This post originally appeared on the ISE Blog.\nSince everyone is working from home for the foreseeable future, corporate IT departments are scrambling to bolster existing VPN solutions or deploy new ones as fast as possible. One of the most popular VPN solutions is OpenVPN, either used directly, or through appliances like the commercial OpenVPN Access Server or third-party VPN gateway products. Some third-party products are not quite upfront about being OpenVPN wrappers, so if you use an SSL VPN Gateway appliance, make sure to double-check the documentation to see if this guide applies to you.\nWhy Hardening OpenVPN is Necessary Most OpenVPN configurations lean heavily on the OpenVPN defaults, which are designed to be widely compatible rather than maximally secure. This is the opposite of what you want on a corporate VPN; since you’re in control of both ends of every connection, you can much more tightly control the clients and can therefore choose options that maximize security. OpenVPN has a pretty staggering amount of them, some of which are deprecated or have subtle security impacts that are not well explained. On top of that, OpenVPN is a pretty old project so there is a lot of advice hanging around on the Internet that is either out of date, incomplete, or just plain wrong. This article aims to be a one stop, up-to-date hardening and configuration guide for OpenVPN in 2020.\nHow to Use This Guide This article will cover a number of hardening options and general best practices broken down into related sections. Each section will include some background, an explanation of the rationale for the specific options it recommends, and a sample configuration snippet that implements it, culminating in a full sample configuration file at the end of the article. If you’re using the OpenVPN community edition (the version that’s available in Linux package managers and on the website), you can copy and paste the directives (customizing as necessary) and build your configuration that way. If you’re using an appliance, consult the manual and the configuration interface to try and find equivalent options and configuration settings. Reading the background and rationale portions of each section can help you find the options in case they’re not named exactly the same way as in the community OpenVPN edition.\nAt the end of the guide, you’ll have an OpenVPN configuration that uses all modern best practices while remaining compatible with all common platforms. There will be a follow-up article after this that gives some points of improvement for extra security depending on your organization’s needs, such as using physical tokens for authentication.\nBasic OpenVPN Configuration OpenVPN operates using a client/server model with the same configuration system used for both. Configuration parameters are passed either through the command line or, more commonly, through a profile file, a plain text file with the .ovpn or .cfg extension. Configuration directives are given one per line, with arguments (if any) for each separated by spaces. Double quotes are used for strings, and lines that begin with # or ; are comments; the OpenVPN manual recommends that # be used for text comments and ; be used to comment out directives, but the two characters are otherwise interchangeable.\nSome options that accept file paths as an argument, such as the client certificate, can be embedded inside the configuration file. This is advantageous since it reduces the number of files you have to manage. To embed them, you can use an XML-like tag such as this:\n1 2 3 \u0026lt;cert\u0026gt; (contents of PEM certificate go here) \u0026lt;/cert\u0026gt; Prerequisites The primary prerequisite for OpenVPN is a public-key infrastructure (PKI). In short, you’ll need a certificate authority and the ability to distribute certificates and keys to servers and clients securely. If you’re running a Windows Active Directory domain, you already have a certificate authority that you can use for this, so talk to your AD admin and see how they can help you. If not, you can use Step, XCA, or the OpenVPN easy-rsa scripts. Be very careful with the CA data, especially if you begin to use it for other purposes than just your OpenVPN setup. The root CA in particular should be stored offline and/or on a hardware security module to prevent theft.\nKey distribution can also be a challenge. Since keys can be embedded in OpenVPN configuration files, one option is to email each user their config file in an encrypted zip file and transmit the password to them in another manner such as SMS, but overall this is something that will have to be decided for each individual environment depending on existing infrastructure and policies. Additionally, if you are running OpenVPN via a wrapper such as the official Access Gateway or a third-party SSL VPN gateway, it may have its own way of distributing this information (e.g., via a web page hosted on the device), but that is out of scope of this article.\nBarebones Configuration If you’re using a VPN appliance, you’re likely not going to be writing these configuration files yourself, but understanding them is helpful to know for debugging purposes.\nHere is the most basic OpenVPN server configuration file:\n1 2 3 4 5 6 7 8 port 1194 #listen on port 1194 (default) proto udp #use UDP dev tun #use a TUN device (layer 3 VPN) ca ca.crt #CA certificate(s) in PEM format cert server.crt #server certificate chain in PEM format key server.key #private key in PEM format dh dh2048.pem11 #2048-bit Diffie-Hellman parameters server 10.8.0.0 255.255.255.0 #use 10.8.0.0/24 for clients Here is the most basic OpenVPN client configuration file:\n1 2 3 4 5 6 7 client #client mode (as opposed to server) dev tun #use a TUN device (layer 3 VPN) proto udp #use UDP remote my-server-1 1194 #the server FQDN or IP and port ca ca.crt #CA certificate(s) in PEM format cert client.crt #client certificate to connect with in PEM format key client.key #private key in PEM format These are taken from the OpenVPN sample configuration files and are missing a number of desirable options (security and non-security related), so check out the sample file or keep reading for more info.\nHardening Steps General Options We’ll start with some general best-practice options and easy hardening steps.\nFirst, you’ll need to decide if you want to use UDP or TCP. Using UDP produces higher throughput and lower latency (as it avoids the TCP Meltdown Problem) but may not work very well on restrictive networks such as coffee shops. Using TCP, particularly over a commonly-used port such as 443 (HTTPS), is much more likely to work on arbitrary networks. Our example will use UDP on the default port (1194), but swapping to, e.g., TCP 443 has no security implications, so feel free. If you do use TCP mode, there is a configuration option to disable TCP packet coalescing, which you should use as it’s unhelpful for VPNs.\nNext, you’ll have to consider whether you want to use TUN or TAP mode. TUN mode is a Layer 3 connection while TAP is a Layer 2 one. In general, use TUN mode — it provides better performance and is the only supported mode on mobile platforms — unless you explicitly need a Layer 2 link such as for carrying Layer 2 broadcast traffic or non-IP protocols for instance.\nOn both server and client:\n1 2 3 4 dev tun # use a TUN device for a layer 3 VPN proto udp #TCP is OK but UDP is better port 1194 # this is the default, you can use any ; socket-flags TCP_NODELAY #if using TCP, uncomment this to reduce latency Some other useful options include: 1) a keepalive directive that periodically sends a ping through the tunnel to ensure that the connection is still live and that any intermediate devices such as firewalls with NAT enabled don’t forget about the connection, 2) a directive to allow clients to roam between IP addresses without dropping their connection (good for e.g., mobile phones switching from Wi-Fi to cellular data), and 3) an option for the server that causes it to reject clients whose options don’t match what it expects. On the server only:\n1 2 3 float #accept authenticated packets from any IP to allow clients to roam keepalive 10 60 #send keepalive pings every 10 seconds, disconnect clients after 60 seconds of no traffic opt-verify #reject clients with mismatched settings Finally, if you embed all secret information such as the server’s private key directly in the connection profile file rather than referring to an external one, you can additionally set:\n1 2 3 4 user nobody group nobody persist-key #keep the key in memory, don\u0026#39;t reread it from disk persist-tun #keep the virtual network device open between restarts This will cause the OpenVPN process to drop all its privileges after starting, which makes it more difficult to attack the rest of the server or escalate privileges if the process is compromised due to successful exploitation of a vulnerability (e.g., an unknown/0day buffer overflow vulnerability). This is unfortunately not feasible to set on clients for a number of reasons, such as lack of support on non-Linux OSs.\nYou’ll note that one thing we did not include is compression. Compression over VPN links is of very minimal benefit since most traffic is either already compressed (such as images or video), or incompressible (encrypted data such as HTTPS connections). On the other hand, compression can, in some circumstances, be used as an Oracle to reveal portions of an encrypted channel like a VPN; this was shown to affect OpenVPN in an attack known as VORACLE. As a result, it’s best to leave it off and allow lower-level protocols to implement compression safely if at all.\nTLS, Ciphers, and Key Exchanges OpenVPN uses TLS for its control channel; the data channel (where your packets actually go) is multiplexed over the same connection but uses a separate cipher and key negotiated over the control channel.\nTLS offers essentially 4 points of configuration:\nProtocol version. The latest TLS version is 1.3, which is a design overhaul that includes radically changing how the next 3 configuration points are negotiated and which ones are available. Key exchange mechanism. This is how the client and server agree on the key they use to encrypt packets to each other. Cipher. The encryption scheme the two parties use to encrypt data (using the key from above). MAC (Message Authentication Code). This is how the two parties ensure that nobody can modify packets in-flight without being detected. In general, you want to use the best possible option for each, taking into account what will be available on your clients. OpenVPN is designed to use either OpenSSL or mbedTLS for cryptography, so the availability of TLS versions, ciphers, and so on are dictated by the version of OpenSSL or mbedTLS in use; in practice, most if not all commonly-used versions use OpenSSL, however. OpenVPN on Linux and some Android clients support TLS 1.3, and the macOS client TunnelBlick supports it with some options, but crucially the Windows client as of this writing does not support it at all. We will, therefore, set TLS 1.3 as a maximum but not the minimum; we’ll use TLS 1.2 as the minimum as it’s the only other secure choice. On both server and client:\n1 2 tls-version-min 1.2 tls-version-max 1.3 or-highest # use the highest available version if 1.3 isn\u0026#39;t available Because of the changes in TLS 1.3, the other three configuration points (Key exchange, cipher, and MAC) will need to be specified twice, once for TLS 1.3, and once for previous versions. However, you’ll want to use essentially the same options for both. The cipher should be either AES in GCM mode, or a newer construction known as ChaCha20-Poly1305. Both options are Authenticated Encryption schemes, which provide both message secrecy and message integrity at the same time, and as a result, are faster and more secure than having a separate integrity mechanism. We recommend a 128-bit key length for AES (as opposed to the default 256-bit one). 256-bit AES is about 40 percent slower than 128-bit AES and isn’t considered to be significantly stronger in practice, so you can take the performance benefit. If that bothers you, feel free to swap to 256-bit instead.\nFor key exchanges, you want to use Ephemeral Elliptic Curve Diffie-Hellman (ECDHE). It’s the fastest and most secure way of doing it, and it’s supported on all up-to-date clients. Most importantly, it provides Forward Secrecy, which means that if a key is compromised (such as because a user lost their device), then the attacker can’t decrypt past traffic. When using ECDHE, clients have to additionally negotiate which elliptic curve to use for key exchange out of a large number of standardized curves chosen by different organizations and with different security properties. A discussion of the relative merits of different curves would require a large amount of background on how elliptic curve cryptography works and is not relevant for this document. Instead, we’ll go with the current NSA recommended curve, which is known as P-384 to NIST and secp384r1 to everyone else.\nFor the MAC, SHA256 is the best compromise between speed and security.\nPutting it all together on both server and client:\n1 2 3 4 5 6 7 8 9 10 11 #data channel cipher cipher AES-128-GCM ncp-disable #don\u0026#39;t negotiate ciphers, we know what we want # TLS 1.3 encryption settings tls-ciphersuites TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256 # TLS 1.2 encryption settings tls-cipher TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256:TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256:TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256:TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 dh none #disable static Diffie-Hellman parameters since we\u0026#39;re using ECDHE ecdh-curve secp384r1 # use the NSA\u0026#39;s recommended curve #this tells OpenVPN which side of the TLS handshake it is tls-server #tls-client on the client Handling Certificate Revocations OpenVPN uses mutual certificate authentication… which means you have to deal with all the complexities that entails.\nFirst off, that means having a way to revoke compromised certificates, which gets very complicated very fast. OpenVPN allows you to specify a CRL (certificate revocation list) file in the configuration, which will contain a list of revoked certificates; connections using those certificates will be rejected. That’s easy to manage on a server since you presumably have ways to access it independently of the VPN, so if you need to revoke a client certificate, you can just log in and add it to the CRL (or preferably develop an automated process for doing so). Managing a CRL on your clients so that you can revoke server certificates is a lot harder since OpenVPN doesn’t have a mechanism akin to OCSP, which would allow the clients to check if a given server certificate is still valid independently. This presents a problem: You either have to manually distribute an updated CRL or configuration profile, or build an automatic updating mechanism; the former is too slow and manual to be of use, and the latter 1) won’t work on mobile platforms, and 2) would typically use resources (such as a file synchronization app or network share) that sit behind a VPN.\nDepending on the level of security appropriate for your use, you could just leave it there and acknowledge the chance that your server could be compromised and its certificate stolen. In that case, the attacker who stole it could perform a man-in-the-middle attack on your clients, potentially compromising them or stealing sensitive data. If that’s unacceptable, you either have to solve the CRL distribution problem, or use an alternative way of limiting the use of stolen certificates; one such alternative is to use short-lived certificates (with a lifetime of one or two days) and renew them automatically. Doing so would mean that a compromised certificate would have a small window of opportunity for use, and an attacker would need to maintain persistent access to a server (which you would hopefully detect and remove) in order to keep getting valid certificates. This could be implemented using ACME and some shell scripting on OpenVPN Community’s server; on third-party gateways, it may or may not be possible depending on what kind of automation is available. In either case, OpenVPN doesn’t offer a mechanism to reload a certificate without restarting the server and disrupting every client in the process. Considering this, some thought will have to be put into how to do this in each environment. The example configuration in this document will simply not handle revocations at all on clients and use a static CRL file on the server.\nOn the server only:\n1 crl-verify /path/to/crlfile Other Certificate Minutiae There’s yet more certificate minutiae to deal with here. First, OpenVPN does not perform verification of certificates beyond checking the certificate is signed by the right CA by default.. For a hardened setup, you need to set it to do 2 additional verifications. First, that the remote certificate is being used for its intended purpose (using the certificates Extended Key Usage flags). Second, that the client is talking to the right server. The first one is supported on both client and server, but the second isn’t easily supported on the server — there isn’t an easy way to check that a user’s certificate matches their username/password, so for the example config we’ll ignore that possibility. In the “Extra Credit” article following this one, we’ll show a skeleton of how to enforce certificate/username matching. For now, use this on the server:\n1 2 remote-cert-tls client #require client certificates to have the correct extended key usage verify-client-cert require #reject connections without certificates For the client to validate the server certificate fully, you’ll need its common name (which should match its intended hostname).\n1 2 remote-cert-tls server verify-x509-name your-server-common-name.example.com name On both of them, set this additional option to require certificates to use modern key sizes and signing algorithms:\n1 tls-cert-profile preferred User Authentication Once a user has established a TLS connection with the server, there is an optional additional authentication step where the user can be asked for a username and password for the server to validate before allowing them to complete the VPN connection. This is highly recommended as it results in multi-factor authentication; the certificate in the profile is “something you have”, and the user’s credentials are “something you know”. The list of usernames and passwords is usually outsourced to another authentication database such as LDAP. This is accomplished using either a binary plugin system or a custom script that is called by OpenVPN for each login attempt, and because of its varied nature we will consider it out of scope for this document. Instead, we will use PAM to authenticate against the server’s local user list as OpenVPN includes a plugin to do just that. On the server:\n1 plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so login On the client, we need to instruct OpenVPN to ask the user for credentials. By default, it will allow the user to save their password to disk, which depending on the platform may not use secure key storage and defeats the purpose of using users’ passwords as MFA since both the key and the password become ‘something you have’ (a file stored on a disk). While your users may not appreciate it very much, you can disable the option to do so. On the client’s configuration for maximum security:\n1 2 auth-nocache #don\u0026#39;t cache credentials in memory setenv ALLOW_PASSWORD_SAVE 0 #disallow saving of passwords Since the connection is renegotiated periodically (either on a timer, or because of network interruptions), this will result in the user being forced to re-enter their password quite often — which leads to a very bad user experience. To combat this, you can instruct the server to send clients a longer-term authentication token that they can use when renegotiating the connection. In other words, during the initial connection the user will enter their password as normal, but future connections (as long as the user doesn’t manually disconnect the VPN) will use the token instead for as long as it’s valid. This can be set up on the server with the following directive:\n1 auth-gen-token 43200 #lifetime of token in seconds; this is 12 hours On the client, you also have to remove the auth-nocache directive since it will prevent the VPN from caching the token.\nThe net result of this configuration is that users will be prompted for credentials when they first connect, and every 12 hours thereafter, but the actual password they use will never be cached on disk or in memory.\nPutting it all together If you’re using OpenVPN community, use this server configuration file as a template:\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 server proto udp port 1194 dev tun # layer 3 vpn \u0026lt;ca\u0026gt; (CA certificate in PEM form) \u0026lt;/ca\u0026gt; \u0026lt;cert\u0026gt; (server certificate in PEM form) \u0026lt;/cert\u0026gt; \u0026lt;key\u0026gt; (private key contents in PEM form) \u0026lt;/key\u0026gt; dh none #don\u0026#39;t use key exchanges with static parameters server 10.8.0.0 255.255.255.0 # use 10.8.0.0/24 for clients float # allow clients to roam keepalive 10 60 #send keepalive pings every 10 seconds, disconnect clients after 60 seconds of no traffic opt-verify #reject clients with mismatched settings user nobody group nobody persist-key #keep the key in memory, don\u0026#39;t reread it from disk persist-tun #keep the virtual network device open between restarts tls-version-min 1.2 tls-version-max 1.3 or-highest # use the highest available version if 1.3 isn\u0026#39;t available #data channel cipher cipher AES-128-GCM ncp-disable #don\u0026#39;t negotiate ciphers, we know what we want # TLS 1.3 encryption settings tls-ciphersuites TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256 # TLS 1.2 encryption settings tls-cipher TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256:TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256:TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256:TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 dh none #disable static Diffie-Hellman parameters since we\u0026#39;re using ECDHE ecdh-curve secp384r1 # use the NSA-\u0026#39;s recommended curve tls-server #be the server side of the TLS handshake crl-verify /path/to/crlfile remote-cert-tls client #require client certificates to have the correct extended key usage verify-client-cert require #reject connections without certificates tls-cert-profile preferred #require certificates to use modern key sizes and signatures plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so login # use PAM for login auth-gen-token 43200 #lifetime of token in seconds; this is 12 hours For clients, use this:\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 client proto udp port 1194 remote your-domain-name.example.com dev tun \u0026lt;ca\u0026gt; (CA certificate in PEM form) \u0026lt;/ca\u0026gt; \u0026lt;cert\u0026gt; (client certificate in PEM form) \u0026lt;/cert\u0026gt; \u0026lt;key\u0026gt; (private key contents in PEM form) \u0026lt;/key\u0026gt; tls-version-min 1.2 tls-version-max 1.3 or-highest # use the highest available version if 1.3 isn\u0026#39;t available #data channel cipher cipher AES-128-GCM ncp-disable #don\u0026#39;t negotiate ciphers, we know what we want # TLS 1.3 encryption settings tls-ciphersuites TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256 # TLS 1.2 encryption settings tls-cipher TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256:TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256:TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256:TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 ecdh-curve secp384r1 # use the NSA-\u0026#39;s recommended curve tls-client #be the client side of the TLS handshake tls-cert-profile preferred #require certificates to use modern key sizes and signatures remote-cert-tls server #require server certificates to have the correct extended key usage verify-x509-name your-domain-name.example.com name auth-nocache #don\u0026#39;t cache credentials in memory setenv ALLOW_PASSWORD_SAVE 0 #disallow saving of passwords Reminder: security best practices are always changing, so some of the recommended options might change in the future. Feel free to give a shout if it needs to be updated!\nExtra Credit In the next article, we’ll cover some ‘extra credit’ topics for extra-hardened configurations such as:\nIncluding an extra static key in the initial TLS connection to prevent denial of service attacks (tls-auth) Using hardware tokens such as Yubikeys, smartcards, or TPMs for holding certificates in order to prevent exfiltration Requiring that client certificates’ common names match the user name that’s authenticating with them Additional anti-exploit measures such as instructing OpenVPN to chroot itself and apply SELinux policies to itself after initialization ","permalink":"https://polansky.co/blog/hardening-openvpn-in-2020/","summary":"\u003cp\u003e\u003cem\u003eThis post originally appeared on the \u003ca href=\"https://blog.securityevaluators.com/hardening-openvpn-in-2020-1672c3c4135a\"\u003eISE Blog\u003c/a\u003e.\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eSince everyone is working from home for the foreseeable future, corporate IT departments are scrambling to bolster existing VPN solutions or deploy new ones as fast as possible. One of the most popular VPN solutions is \u003ca href=\"https://community.openvpn.net/openvpn\"\u003eOpenVPN\u003c/a\u003e, either used directly, or through appliances like the commercial \u003ca href=\"https://openvpn.net/vpn-software-packages/\"\u003eOpenVPN Access Server \u003c/a\u003eor third-party VPN gateway products. Some third-party products are not quite upfront about being OpenVPN wrappers, so if you use an SSL VPN Gateway appliance, make sure to double-check the documentation to see if this guide applies to you.\u003c/p\u003e","title":"Hardening and Configuring OpenVPN in 2020"},{"content":"I got my OSCE exam results today. I passed! 🎉\nThat means it\u0026rsquo;s time to do a retrospective/review blog post like everyone else I guess. Mine will be a little different than the usual ones though. This won\u0026rsquo;t be a study guide \u0026mdash; there are plenty of those, and especially for the OSCE some of them are practically exam spoilers. Instead I\u0026rsquo;d like to talk about where I think the OSCP and OSCE courses and exams fit into today\u0026rsquo;s world.\nThe OSCP Course and Exam The OSCP is OffSec\u0026rsquo;s flagship course for good reason. I took the previous version (before they updated it for Windows 10/Server 2016+) and even then it was everything that it was held up to be. It was challenging, practical, required out-of-the-box thinking, and a ton of fun. I\u0026rsquo;d have recommended the previous version wholeheartedly to anybody at the start (and maybe later) of a career in security. The OSCP exam material varies by try, so you can\u0026rsquo;t just brute-force it. You actually have to learn the material! I was lucky enough to have my employer fund my course and the lab extension I ended up needing, but honestly I\u0026rsquo;d have paid for it myself in a heartbeat. The labs were kind of outdated, but there was a lot of machines to play with and they all required different exploits, with some requiring information or access from other machines. It was a great playground. I\u0026rsquo;ve seen the updated materials and they\u0026rsquo;re even better. If you\u0026rsquo;re at all considering taking the course, you should definitely do it.\nThe OSCE Course and Exam On the other hand, the OSCE course\u0026hellip; is less awesome. You have to solve a little challenge to even be allowed to take it, which was kind of fun. Unfortunately, the actual material is honestly just plain outdated:\nIntroduction The Web Application Angle Cross-Site Scripting Attacks Directory Traversal The Backdoor Angle Backdooring PE files under Windows Vista AV Evasion Advanced Exploitation Techniques MS07-017 \u0026mdash; Dealing with Vista Cracking the Egghunter The 0Day angle Windows TFTP Server \u0026mdash; Case study #1 HP Openview NNM \u0026mdash; Case study #2 The Networking Angle \u0026mdash; Attacking the Infrastructure The web app section is relevant but extremely basic \u0026mdash; if you care about web app security at all you\u0026rsquo;ll get infinitely more out of the PortSwigger Web Security Academy or OffSec\u0026rsquo;s own OSWE. The OSCE material even uses PortSwigger\u0026rsquo;s tools, and the techniques shown on the OSCE material are entirely standard at this point in time. The \u0026ldquo;Backdoor Angle\u0026rdquo; covers techniques that\u0026hellip; don\u0026rsquo;t really work anymore. Modern AV is so much more advanced than what was available at the time the course was written that the evasion techniques they cover is basically useless. The ASLR bypass technique they cover is still good (ish), and egghunters are certainly still useful, but you could totally teach yourself that with some Google searching. The two 0days they cover are a decent enough intro to a full fuzzing/exploit dev cycle, but modern techniques are again way better \u0026mdash; coverage-guided fuzzing gets you much better results much quicker. Finally, the \u0026ldquo;networking angle\u0026rdquo; is an incredibly specific edge case of Cisco misconfiguration that I have no doubt has happened in the past but I\u0026rsquo;d be astonished if it was still a thing that could happen.\nOverall, I\u0026rsquo;d say about half the material has anything resembling relevance in a modern world, and most of that could be learned elsewhere for free. Having it all rolled up into a real course with walkthroughs and demo machines is nice, but isn\u0026rsquo;t worth the cost of admission (maybe if you get your work to pay for it like I did \u0026mdash; thanks, ISE!). I didn\u0026rsquo;t even find the exam that challenging; I had all the flags in under 24 hours, even taking breaks for meals and sleep.\nOther OffSec Courses The OSCP and OSCE aren\u0026rsquo;t the only OffSec courses, of course. I\u0026rsquo;m hoping to take the OSEE next year (assuming everything is back to normal from the current apocalypse) since it covers real modern Windows exploit development. The OSWE, their web app specific course, is less interesting to me personally but I\u0026rsquo;ve heard that it\u0026rsquo;s pretty good (and the exam is apparently quite difficult). OffSec\u0026rsquo;s last course, OSWP has such a small scope and the material \u0026mdash; basic WiFi pentesting \u0026mdash; is so well covered in so many other places that I can\u0026rsquo;t see any value in it at all.\nConclusion In summary: If you don\u0026rsquo;t have the OSCP and you think you might want it, go for it! On the other hand, you should probably skip the OSCE unless you can get someone else to pay.\n","permalink":"https://polansky.co/blog/oscp-osce-2020-retrospective/","summary":"\u003cp\u003eI got my OSCE exam results today. I passed! 🎉\u003c/p\u003e\n\u003cp\u003e\u003cimg alt=\"The OSCE exam pass email\" loading=\"lazy\" src=\"/blog/oscp-osce-2020-retrospective/osce-email.png\"\u003e\u003c/p\u003e\n\u003cp\u003eThat means it\u0026rsquo;s time to do a retrospective/review blog post like everyone else I guess. Mine will be a little different than the usual ones though. This won\u0026rsquo;t be a study guide \u0026mdash; there are plenty of those, and especially for the OSCE some of them are practically exam spoilers. Instead I\u0026rsquo;d like to talk about where I think the OSCP and OSCE courses and exams fit into today\u0026rsquo;s world.\u003c/p\u003e","title":"OSCP \u0026 OSCE in 2020: A Retrospective"},{"content":"I use a MacBook Pro for work, and naturally my job involves a good amount of VM usage. VMWare Fusion is supposed to have good integration with ESXi, allowing you to connect to servers, manage VMs remotely, and transfer them to/from them. I find that the remote management works pretty well, and downloading VMs works most of the time, but I couldn\u0026rsquo;t get uploading them to our ESXi 6.5 host to work; I would always get cryptic errors like Invalid configuration for device '0'. Even exporting the VM to an OVA file and importing it on the web interface wouldn\u0026rsquo;t work. One ticket with VMWare Support later and I finally have the correct import procedure:\nRemove unnecessary devices from the VM such as Bluetooth controllers and printers. You may also have to remove the network adapter and re-add it after import depending on the ESXi host\u0026rsquo;s settings. In the VM settings, under Compatibility, change the Hardware Version to 12; while Version 13 claims to support ESXi 6.5, VMWare support directed me to use 12 instead, and it didn\u0026rsquo;t work until I did. Export the VM as an OVF. Open the exported folder and find the .ovf file. It\u0026rsquo;s an XML file that describes the VM. Open it in your favorite text editor and change the videoRamSizeInKB entry to 128MB (131072). Upload the modified OVF folder to your ESXi host. After that, your VM should be ready to use.\n","permalink":"https://polansky.co/blog/vmware-fusion-esxi-import/","summary":"\u003cp\u003eI use a MacBook Pro for work, and naturally my job involves a good amount of VM usage. VMWare Fusion is \u003cem\u003esupposed\u003c/em\u003e to have good integration with ESXi, allowing you to connect to servers, manage VMs remotely, and transfer them to/from them. I find that the remote management works pretty well, and downloading VMs works most of the time, but I couldn\u0026rsquo;t get uploading them to our ESXi 6.5 host to work; I would always get cryptic errors like \u003ccode\u003eInvalid configuration for device '0'\u003c/code\u003e. Even exporting the VM to an OVA file and importing it on the web interface wouldn\u0026rsquo;t work. One ticket with VMWare Support later and I finally have the correct import procedure:\u003c/p\u003e","title":"Importing VMWare Fusion VMs on ESXi 6.5"},{"content":"Windows 10 ships with two awesome features for users and developers who still work in Linux land. The first is the Windows Subsystem for Linux, which implements a subset of the Linux Kernel\u0026rsquo;s system calls to allow you to run native Linux userland utilities such as bash and friends, and ssh. Windows 10 also includes a native build of OpenSSH, which means you don\u0026rsquo;t even need to use WSL to SSH into your other machines! Unfortunately, neither option has any ssh-agent running by default, so if you have passphrase protected keys (which you should!), then you\u0026rsquo;ll need to enter the passphrase every time you want to use them. Let\u0026rsquo;s fix that!\nFirst, you\u0026rsquo;ll need to decide whether you want to use Pageant or the native SSH Agent. The main reason to use Pageant is if you use putty-cac for interfacing with non-PKCS#11 smart cards and certificates that are only available via the Microsoft CAPI (including the TPM-backed certificates from my previous post)1 2. I find Pageant to be less stable and user-friendly than the traditional SSH agent, but you can use either.\nConfiguring the OpenSSH SSH Agent Optional: Update Native OpenSSH This step is optional. The version of OpenSSH shipped with current builds of Windows 10 (1909 as of this writing) is a few versions out of date, and more importantly was built before Microsoft enabled PKCS#11 support. As a result, if you\u0026rsquo;re using a Yubikey for SSH, you need to do this step.\nFirst, you\u0026rsquo;ll need to remove parts of the preinstalled OpenSSH build as they\u0026rsquo;ll conflict with the new one. Remove the preinstalled OpenSSH build from your PATH by going to the Environment Variables editor under System Properties, selecting PATH under the machine variables, clicking Edit, and deleting the OpenSSH entry. Then, run sc.exe delete ssh-agent in an Administrator command prompt to delete the existing OpenSSH Agent service.\nNow, you have two options for updating. First, you can go to the release page, download, and install it. Make sure you choose to install the SSH Agent if you are given the choice. Alternatively, you can use the Chocolatey package manager, which is my preferred way of doing it because it makes keeping up to date easier. If you go that route, make sure you install with the command choco install openssh -params \u0026quot;/SSHAgentFeature\u0026quot; to tell it to install the SSH Agent.\nEnabling the SSH Agent and Adding Keys Whether or not you choose to update, you need to enable the SSH Agent service as it ships disabled by default. Go to Services, find the ssh-agent (it may also show up as \u0026ldquo;OpenSSH Agent\u0026rdquo;) service, and change its startup setting to Automatic, then start it manually (or reboot). Then you can simply ssh-add your keys. You\u0026rsquo;ll be prompted for the passphrase for them, and then the agent will store the key data in the Windows Registry encrypted with a key derived from your account credentials. After that, you won\u0026rsquo;t need to enter your passphrase anymore!\nPassing the SSH Agent to WSL But what if you want to use WSL\u0026rsquo;s ssh instead of Windows\u0026rsquo;s? The Win32 OpenSSH Agent uses Windows named pipes to talk to ssh.exe, which no WSL process can interact with. You\u0026rsquo;ll need a program to act as a shim between Unix-style sockets and Windows named pipes, and thankfully one exists! Download the latest release, unpack it somewhere you won\u0026rsquo;t accidentally delete it, and create a shortcut to it in SHELL:STARTUP (you can just type that into an Explorer address bar). Then modify the shortcut to include the following command line arguments (at the end of the Target field): -setenv -envname WSL_AUTH_SOCK and run it. This will tell it to export an environment variable named WSL_AUTH_SOCK3 to all new process containing the location of a Unix domain socket it creates; the program acts as a translator between that socket and the Windows OpenSSH Agent\u0026rsquo;s named pipe. Then, add the following line to your .bashrc (or your shell\u0026rsquo;s equivalent):\n1 [ -n ${WSL_AUTH_SOCK} ] \u0026amp;\u0026amp; export SSH_AUTH_SOCK=${WSL_AUTH_SOCK} This will cause the shell to set the $SSH_AUTH_SOCK variable with the location of the translator socket. Once that happens, all the WSL ssh binaries will automatically talk to the Windows OpenSSH Agent. Tada!\nUsing Pageant Instead If you\u0026rsquo;re here, I\u0026rsquo;m going to assume you already have Pageant (putty-cac\u0026rsquo;s or regular) installed and configured how you like, including starting up automatically. This will just explain how to get it to talk to ssh.exe and WSL. For that, you need to use wsl-ssh-pageant. Download the latest release and put it somewhere you won\u0026rsquo;t accidentally delete it, then create a shortcut to it in SHELL:STARTUP (you can just type that into an Explorer address bar). After that, modify the shortcut to include the following command line arguments (at the end of the Target field): --systray --wsl C:\\ssh-agent.sock --winssh ssh-pageant (you can use any path less than 100 characters for the socket file) and run it.\nNow we need to tell ssh.exe and WSL\u0026rsquo;s ssh how to find the Pageant agent shim. For ssh.exe, go to the the Environment Variables editor under System Properties and add a new variable to your user named SSH_AUTH_SOCK, and give it the value \\\\.\\pipe\\ssh-pageant. For WSL ssh, add the following to your .bashrc (or the equivalent for your shell):\n1 export SSH_AUTH_SOCK=/mnt/c/ssh-agent.sock If you put the socket in a different location, change the line to point there (remember to convert the path to one WSL will understand).\nAfter that, you\u0026rsquo;ll be able to use both the native SSH client and the one in WSL with Pageant as your SSH agent.\nThe Microsoft team responsible for handling the Windows port of OpenSSH have indicated they intend to support this, but it was supposed to come \u0026ldquo;by years end\u0026rdquo; in 2016, so ¯\\_(ツ)_/¯\u0026#160;\u0026#x21a9;\u0026#xfe0e;\nThere are at least two (one; two) projects to create PKCS#11-to-CAPI translation layers, but they are both rather dead and I haven\u0026rsquo;t tested them.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\nWe do not export SSH_AUTH_SOCK directly so as to not clobber the Windows one \u0026mdash; ssh.exe doesn\u0026rsquo;t understand Unix-style sockets and wouldn\u0026rsquo;t be able to talk to the SSH Agent if we did.\u0026#160;\u0026#x21a9;\u0026#xfe0e;\n","permalink":"https://polansky.co/blog/a-better-windows-wsl-openssh-experience/","summary":"\u003cp\u003eWindows 10 ships with two awesome features for users and developers who still work in Linux land. The first is the \u003ca href=\"https://docs.microsoft.com/en-us/windows/wsl/faq\"\u003eWindows Subsystem for Linux\u003c/a\u003e, which implements a subset of the Linux Kernel\u0026rsquo;s system calls to allow you to run native Linux userland utilities such as \u003ccode\u003ebash\u003c/code\u003e and friends, and \u003ccode\u003essh\u003c/code\u003e. Windows 10 also includes a native build of \u003ca href=\"https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_overview\"\u003eOpenSSH\u003c/a\u003e, which means you don\u0026rsquo;t even need to use WSL to SSH into your other machines! Unfortunately, neither option has any \u003ccode\u003essh-agent\u003c/code\u003e running by default, so if you have passphrase protected keys (which you should!), then you\u0026rsquo;ll need to enter the passphrase every time you want to use them. Let\u0026rsquo;s fix that!\u003c/p\u003e","title":"A Better Windows 10+WSL SSH Experience"},{"content":"I\u0026rsquo;ve started experimenting with exposing some of my home lab services to the world without needing a VPN. Instead, I use Caddy (which is an excellent web server, and much easier to work with than Nginx) as a reverse proxy with TLS client certificates for authentication. Caddy\u0026rsquo;s built-in Let\u0026rsquo;s Encrypt functionality provides the server certificate, and my internal PKI provides the client certificates. I still want to have 2-factor authentication, though \u0026mdash; a certificate is merely \u0026ldquo;something you have\u0026rdquo;, and I want to require \u0026ldquo;something you know,\u0026rdquo; too. Since all my PCs are recent enough to feature a TPM, I decided to store the keys on said TPM and configure it to require a password before allowing any authentication to take place. I was inspired by Microsoft Hello for Business \u0026mdash; which is really cool and I can\u0026rsquo;t wait to work with it some day \u0026mdash; but using the TPM directly is much lighter weight as no domain controller or Windows AD Domain is needed. The previous iteration of Microsoft\u0026rsquo;s \u0026ldquo;Passwordless Future,\u0026rdquo; TPM-backed virtual smart cards would be exactly what I want, except the docs come with a big ol\u0026rsquo; deprecation warning. Instead, I found how to interact with the base TPM crypto provider to generate certificates.\nWhy use TPM-backed certificates? Normally when you generate a certificate, the full certificate and private key are stored in your user certificate store. This is encrypted with your login password, and you can mark certificates as non-exportable. However, anyone that is able to execute code as your user (e.g., malware), or gains administrative access to the computer can bypass that restriction and steal the certificate and key. Disk encryption (which you should be using) will protect against some ways of doing this, but not all of them. Also, the default certificate store\u0026rsquo;s encryption can be attacked offline, which means anyone with a large AWS budget can probably get into it.\nBy generating the key in the TPM, we solve all of those issues. The TPM stores the key material and does all the cryptographic operations on itself, so the key cannot be stolen. When you supply a password at generation (which is optional but recommended), the TPM also requires that password before performing any operations, providing a second layer of protection. This forms the second factor of 2FA if done properly. The TPM has physical protections in-place to prevent attackers from gaining access to its data through side channels or chip decapping, and it has anti-hammering protections to prevent password brute-forcing. Taken together, this is probably the strongest form of key protection (and therefore, authentication) the average user has access to short of a physical crypto dongle like a Yubikey. Since every relatively recent Intel/AMD processor has a firmware TPM and Microsoft requires some kind of TPM in new Windows machines, you probably have one already! There really isn\u0026rsquo;t a reason not to use this method of storing keys unless you need the key to be long-lived (such as disk or mail encryption certificates).\nA note on what counts as \u0026ldquo;2 Factors\u0026rdquo; If you\u0026rsquo;ve been paying attention, you\u0026rsquo;ll notice that this is not 2 factor authentication as typically understood: the server that validates the credential (Caddy, in my case) is only validating the certificate, which is under normal circumstances a single factor (\u0026ldquo;something you have\u0026rdquo;). The certificate is password-protected (\u0026ldquo;something you know\u0026rdquo;), but the web server doesn\u0026rsquo;t have any way of verifying that \u0026mdash; if you had a valid certificate signed by my CA that wasn\u0026rsquo;t password protected, the server would still accept it. In my small case, the second factor is basically enforced by my personal policy, as I won\u0026rsquo;t issue certificates for this use that I haven\u0026rsquo;t personally verified are protected by hardware security and a PIN/Password in some way (such as via a TPM, smart card, or Yubikey).\nIn an enterprise deployment such as Hello For Business, this is accomplished cryptographically by the provisioning server that signs new certificates. When provisioning a new device, the platform security module provides a certificate signing request as normal. It also provides a statement signed with a burned-in manufacturer key that attests to the certificate\u0026rsquo;s parameters (non-exportability, password protection, etc.). The provisioning server validates this statement before signing the CSR, which allows it to enforce the second factor policy across an entire enterprise. Highly secure applications will addiitonally require this attestation on every authentication request; this isn\u0026rsquo;t really possible with traditional client TLS certificates, so it\u0026rsquo;s traditionally done using Kerberos \u0026mdash; the Kerberos server requires both the credential certificate and the attestation before issuing tickets. The same attestation key can combine with the TPM\u0026rsquo;s Trusted Boot functionality to remotely attest that the system is in a given state, allowing the authentication server to ensure that clients are in a secure state (e.g., using an up-to-date firmware and operating system and configured according to company policy) before granting them access to secure resources.\nHow to generate a TPM-backed certificate Make an INF file with the following (I called mine tpm_csr.inf):\n1 2 3 4 5 6 7 8 9 10 11 [NewRequest] Subject = \u0026#34;CN=shea@polansky.co\u0026#34; ; can be anything, can also be changed when signing Keylength = 2048 ; your TPM may support larger key lengths Exportable = FALSE UserProtected = TRUE MachineKeySet = FALSE ProviderName = \u0026#34;Microsoft Platform Crypto Provider\u0026#34; ProviderType = 1 RequestType = PKCS10 KeyUsage = 0xB0 ; this is a https client certificate, can change when signing FriendlyName = \u0026#34;My super secure certificate\u0026#34; Then issue the command certreq -new -f .\\tpm_csr.inf csr_name.csr. You will get a prompt offering to protect the generated key with a password \u0026mdash; this is the second factor in your 2FA, so I recommend it. After that, sign the certificate request with your enterprise CA (this is out of scope of this blog post, but you probably know how to do this if you\u0026rsquo;ve gotten this far) and import the resulting certificate into your user\u0026rsquo;s certificate store (double click on the crt file and click next a bunch of times) and you\u0026rsquo;ll have a TPM-backed certificate ready for usage.\nWarning: You cannot export this key from the TPM. Ever. If you lose your PC, or if the TPM gets reset accidentally (this can happen if you use multiple operating systems and accidentally try to use it with both, or if the BIOS on your machine is reset), you will lose the key. Ensure that you have an alternate way of accessing anything you protect this way.\nYou can also use this for SSH, by the way, using putty-cac. If you want to integrate it with the built-in Windows SSH tools (either the native Windows port or via WSL), see my next blog post for more information.\n","permalink":"https://polansky.co/blog/tpm-backed-certificates-windows/","summary":"\u003cp\u003eI\u0026rsquo;ve started experimenting with exposing some of my home lab services to the world without needing a VPN. Instead, I use \u003ca href=\"https://caddyserver.com/\"\u003eCaddy\u003c/a\u003e (which is an \u003cem\u003eexcellent\u003c/em\u003e web server, and much easier to work with than Nginx) as a reverse proxy with TLS client certificates for authentication. Caddy\u0026rsquo;s built-in Let\u0026rsquo;s Encrypt functionality provides the server certificate, and my internal PKI provides the client certificates. I still want to have 2-factor authentication, though \u0026mdash; a certificate is merely \u0026ldquo;something you have\u0026rdquo;, and I want to require \u0026ldquo;something you know,\u0026rdquo; too. Since all my PCs are recent enough to feature a TPM, I decided to store the keys on said TPM and configure it to require a password before allowing any authentication to take place. I was inspired by \u003ca href=\"https://docs.microsoft.com/en-us/windows/security/identity-protection/hello-for-business/hello-identity-verification\"\u003eMicrosoft Hello for Business\u003c/a\u003e \u0026mdash; which is really cool and I can\u0026rsquo;t wait to work with it some day \u0026mdash; but using the TPM directly is much lighter weight as no domain controller or Windows AD Domain is needed. The previous iteration of Microsoft\u0026rsquo;s \u0026ldquo;Passwordless Future,\u0026rdquo; TPM-backed \u003ca href=\"https://docs.microsoft.com/en-us/windows/security/identity-protection/virtual-smart-cards/virtual-smart-card-overview\"\u003evirtual smart cards\u003c/a\u003e would be exactly what I want, except the docs come with a big ol\u0026rsquo; deprecation warning. Instead, I found how to interact with the base TPM crypto provider to generate certificates.\u003c/p\u003e","title":"Creating TPM-Backed Certificates on Windows"},{"content":"This post originally appeared on blog.securityevaluators.com\nTwo-Factor Authentication (2FA, also known as Multi-Factor Authentication, or MFA) is all the rage these days, and for good reason. Accounts secured by 2FA are much, much harder to compromise than accounts using only a single factor \u0026mdash; so much more so that you can \u0026mdash; sometimes \u0026mdash; get away with an easier to type and remember (and therefore weaker) password when using it. The most common ways of implementing the second factor are SMS and TOTP (Time-Based One Time Password). When SMS is used, the site sends you a short numerical code via SMS after you enter your password, and you type the code into the site to finish proving your identity. SMS is inconvenient (you have to have your phone on you), and more importantly, SMS is insecure and not recommended, so many sites are moving to TOTP codes instead, which involves using an app to generate codes yourself instead of the site sending them to you. There are a variety of apps that you can use to generate these codes, and some password managers do it too — but you have to be careful: your choice of app could weaken the security benefits provided by TOTP.\nFirst, How Does TOTP Work? TOTP works by having the user scan a QR code with an authenticator app like Google Authenticator when they sign up; the QR code contains the site’s name and location, and a secret key that will be used to generate codes. When the user goes to log-in to the site, the site will ask them for a code, which the authenticator app will generate using the secret key and the time (usually rounded to the nearest minute or half-minute). The server will also generate a code using the same time and key, and if the codes match then it will allow the user to log-in.\nThe Trap For many users, this is still too inconvenient \u0026mdash; they still need to have their phone, and now they need to proactively generate a code instead of just waiting for an SMS message, so password managers have started to offer TOTP generation features. The password manager scans the QR code when the user signs up, and then when they go to log in the password manager can input their username, password, and 2FA code all at once. Super convenient! There’s just one issue: the user just turned their secure two factor authentication method into a single factor \u0026mdash; their password manager. Any malicious actor who gets access to the user’s password manager now has access to both factors needed to log into their accounts.\nOur Recommendation Do use 2FA everywhere you can, but don’t store 2FA codes in password managers. If you want to have a multi-device synchronized authenticator application, use a separate, dedicated application such as Authy (Note that ISE has not assessed the security of Authy at this time and cannot guarantee that it will not leak or expose data), and use a strong password to protect your account that is not stored in your password manager, or any location or service protected by your password manager.\n","permalink":"https://polansky.co/blog/psa-2fa-password-managers/","summary":"\u003cp\u003e\u003cem\u003eThis post originally appeared on \u003ca href=\"https://blog.securityevaluators.com/psa-dont-store-2fa-codes-in-password-managers-77d92608b062\"\u003eblog.securityevaluators.com\u003c/a\u003e\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://en.wikipedia.org/wiki/Multi-factor_authentication\"\u003eTwo-Factor Authentication\u003c/a\u003e (2FA, also known as Multi-Factor Authentication, or MFA) is all the rage these days, and for good reason. Accounts secured by 2FA are much, much harder to compromise than accounts using only a single factor \u0026mdash; so much more so that you can \u0026mdash; \u003ca href=\"https://blog.securityevaluators.com/2fa-not-all-factors-are-created-equal-b36fdcfed212\"\u003esometimes\u003c/a\u003e \u0026mdash; get away with an easier to type and remember (and therefore weaker) password when using it. The most common ways of implementing the second factor are SMS and TOTP (Time-Based One Time Password). When SMS is used, the site sends you a short numerical code via SMS after you enter your password, and you type the code into the site to finish proving your identity. SMS is inconvenient (you have to have your phone on you), and more importantly, SMS is \u003ca href=\"https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin\"\u003einsecure\u003c/a\u003e and not \u003ca href=\"https://pages.nist.gov/800-63-3/sp800-63b.html#pstnOOB\"\u003erecommended\u003c/a\u003e, so many sites are moving to TOTP codes instead, which involves using an app to generate codes yourself instead of the site sending them to you. There are a variety of apps that you can use to generate these codes, and some password managers do it too — but you have to be careful: your choice of app could weaken the security benefits provided by TOTP.\u003c/p\u003e","title":"PSA: Don’t Store 2FA Codes in Password Managers"},{"content":"This post originally appeared on blog.securityevaluators.com\nThe security of a 2FA-protected account is much greater than the security of an account protected by only one factor — in theory. In practice, there is more nuance to it than that. For 2FA, you are trusting the server to enforce the 2FA and not be compromised by hackers or compelled by law enforcement to allow them access to your data; meanwhile a service can be configured to use your password in a way that protects even against hackers or law enforcement. Understanding this nuance requires a deeper understanding of how 2FA works and how it does (or doesn’t!) protect your accounts.\nDemystifying How Two-Factor Authentication Works [skip to next section if you already understand how 2FA works]\nYou\u0026rsquo;ve probably heard it a thousand times by now: “Use 2FA [Two-Factor Authentication] to secure your online accounts and data!” Without 2FA, logging into your bank’s website or your email requires only a single factor, your password. Using 2FA to log-in requires two factors, something you know (i.e. your password), and something you have, like a mobile phone. A password can be copied or read over your shoulder, and your phone can be stolen, but it’s extremely unlikely that an evil third party would be able to do both at the same time.\nWhen you go to log-in to a site you’ve enabled 2FA on, you’ll be asked for your username and password as normal. If the site accepts your credentials, you’ll usually be taken to a different screen that asks you for a short numerical 2FA code. There are two common ways to receive these codes: SMS, and TOTP (Time-Based One Time Password). When you set up SMS-based 2FA, you give the site your phone number, and when you log-in the site will send you the 2FA code over SMS, where you’ll have a short time to enter it before it’s no longer valid. If TOTP is used, setting up 2FA involves scanning a QR Code on your phone using an authenticator app such as Google Authenticator. The QR code contains the name and location of the site, and a secret key that will be used to generate 2FA codes. When you need a code, the app will generate one based on the secret key and the current time (rounded to the minute or half-minute, usually), and when you enter it into the site the server will use its copy of the secret to generate its own code; codes are deterministic, so if you and the server have the same secret and the same time, they’ll match and you’ll be let in.\nAs an aside, the TOTP method is much more secure than SMS — It’s relatively easy to intercept SMS, and NIST recommends against using it if other options are available.\nCan You Trust Two-Factor Authentication Services? Up until this point we’ve discussed passwords and 2FA in the context of authentication, that is, proving to a server that you are who you say you are. You are trusting the server to not let anyone else into your account, but if the server is compromised by hackers or compelled by law enforcement to let them in, all your data can still be stolen. To prevent this, security conscious services use end-to-end encryption (sometimes called zero-knowledge privacy or zero-knowledge encryption), where data is encrypted by you, the client, in a way that even the server cannot understand or decrypt. This most commonly comes up in the case of password managers, where it’s extremely important that hackers not be able to access your password database. The way end-to-end encryption works in the context of a password manager is that your master password (the one you log-in with) is used to compute a long secret key that is in turn used to encrypt the vault; someone who doesn’t know your password can’t compute this key, and therefore cannot decrypt the vault and see your passwords. At least, that’s how good password managers work —if a password manager doesn’t use end-to-end encryption, then anyone who compromises the server can just read your passwords, and 2FA issues are the least of your problems.\nSo how does 2FA work in this context? When you go to log-in, the password manager service’s servers will request a code from you, and won’t send you the encrypted vault to decrypt if you can’t provide a valid code. Note the subtle difference between the way passwords work and the way the second factor works: you’re still relying on the server to enforce the second factor, even though the service is end-to-end encrypted. Your password secures your vault using math — even if the server itself is compromised, an attacker can’t bypass the need to know your password to unlock your vault because the client (i.e., you) performed the encryption that protects it. On the other hand, the second factor (TOTP or SMS) must be enforced by the server; anyone who compromises the server can simply tell it to not enforce the second factor.\nEven if the server isn’t compromised, there are other methods of bypassing the second factor available. Malware could steal the password database off your disk, or even potentially read all your secrets out of your computer’s memory, as shown in research we recently published. Someone could phish or social engineer their way around your 2FA settings, or there could be a bug in the application that lets attackers simply bypass it entirely. Even if none of that happens, the government could simply demand access to your database from the password manager’s servers, or a rogue employee of the password manager service could walk out with a copy of your database. There are a lot of ways 2FA can be bypassed, many of which are extremely application-specific.\nThe Point When you have a zero-knowledge encrypted service like a password manager, you have to treat it as though the password is the only authentication factor. You cannot use a weak password and assume that 2FA will protect you from compromise, because you can’t always rely on 2FA being enforced. Having said that, you should still use 2FA everywhere you can, including your password manager. It’s not much extra work and it’s a lot more secure. You should also definitely use a password manager to create and remember strong, unique passwords — don’t let this article or any other research scare you off.\n","permalink":"https://polansky.co/blog/2fa-not-all-factors-equal/","summary":"\u003cp\u003e\u003cem\u003eThis post originally appeared on \u003ca href=\"https://blog.securityevaluators.com/2fa-not-all-factors-are-created-equal-b36fdcfed212\"\u003eblog.securityevaluators.com\u003c/a\u003e\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eThe security of a 2FA-protected account is much greater than the security of an account protected by only one factor — in theory. In practice, there is more nuance to it than that. For 2FA, you are trusting the server to enforce the 2FA and not be compromised by hackers or compelled by law enforcement to allow them access to your data; meanwhile a service can be configured to use your password in a way that protects even against hackers or law enforcement. Understanding this nuance requires a deeper understanding of how 2FA works and how it does (or doesn’t!) protect your accounts.\u003c/p\u003e","title":"2FA: Not All Factors Are Created Equal"},{"content":"I\u0026rsquo;m a security researcher and engineer. I place a great deal of emphasis on the engineer portion of that description \u0026mdash; I see problems and find solutions, balancing tradeoffs and optimizing for results. My areas of interest include network, systems, and embedded security, as well as network and systems administration/engineering. The bulk of my professional and hobby security work is done in an offensive context, with occasional software development, usually to create tools that support or enable my other skills. My hobbies are playing video and tabletop games, reading sci-fi and fantasy books, cooking and baking, and dabbling in electrical engineering.\nI currently work at Apple as a Staff Security Engineer, where I work as as security tech lead for Health Research. If you participate in reasearch studies using the Research App, I keep your data safe. My areas of focus include application, cloud, and hardware security.\nThis is my personal site, where you can find some information about me, my blog (archived), a list of my projects, my talks, my résumé, and my contact info.\nContact Feel free to contact me with any questions about any of my projects. You can find the source code, and in some cases binaries, on my GitHub page.\nFor sensitive communications, I am available by Signal (linked on the home page). If you prefer email, I have published keys on this site using the Web Key Directory standard, and on the MIT PGP Key Server. This means that for most implementations of PGP my key will be automatically discovered and used, but you can also find a local mirror of my public key here if you wish to download it manually.\n","permalink":"https://polansky.co/about/","summary":"\u003cp\u003eI\u0026rsquo;m a security researcher and engineer. I place a great deal of emphasis on the \u003cem\u003eengineer\u003c/em\u003e portion of that description \u0026mdash; I see problems and find solutions, balancing tradeoffs and optimizing for results. My areas of interest include network, systems, and embedded security, as well as network and systems administration/engineering. The bulk of my professional and hobby security work is done in an offensive context, with occasional software development, usually to create tools that support or enable my other skills. My hobbies are playing video and tabletop games, reading sci-fi and fantasy books, cooking and baking, and dabbling in electrical engineering.\u003c/p\u003e","title":"About"},{"content":"My full résumé is available by request. Highlights:\nExperience Own security for a cloud environment handling more than a petabyte of sensitive health data Lead a program applying frontier LLMs to secure the output of a ≈250-engineer organization, driving AI-powered discovery and remediation of 100+ high/critical severity vulnerabilities Led red team engagements scoped across a major tech company\u0026rsquo;s infrastructure, products, and services Discovered and exploited TEE vulnerabilities, secure boot and code signing bypasses, and URI-to-RCE chains Developed novel vulnerabilities, exploits, and tooling, then partnered with blue teams to detect them Completed a rotation on a malware reverse engineering team Performed design reviews, cryptographic engineering, application security testing, penetration tests, and security consulting for internal teams and Fortune 500 clients Assessed platforms including industrial control systems, cloud environments, embedded hardware, and web and native applications Mentored early-career engineers on developing their skills and attacker mindset Skills AI/LLM tooling: building coding and vulnerability discovery workflows using the Claude Agent SDK Python (primary); C, Java, C#, Bash, x86/ARM assembly, JavaScript, LaTeX Embedded security engineering and exploitation, including secure boot, remote attestation, and TrustZone Native exploitation techniques, modern exploit mitigations and bypasses, and reverse engineering (Ghidra/IDA) Electrical engineering and hardware hacking, including PCB design and layout; licensed amateur radio operator Achievements Two-time DEF CON Black Badge holder: Spy vs Spy and Blacks in Cyber CTFs, with Team pTFS 2nd place in the DEF CON Spy vs Spy CTF and 3rd place in Dungeons at DEF CON (Team pTFS) 1st place, SANS Core NetWars CTF at RSA Conference (solo) Completed the Microcorruption embedded security and reverse engineering CTF Regular speaker at internal and external security and technology conferences Former member of the DEF CON IoT Village Call for Papers review panel Certifications \u0026amp; Training Offensive Security Certified Expert (OSCE) and Professional (OSCP) TEEPwn training on reverse engineering and attacking TrustZone at RingZer0 ","permalink":"https://polansky.co/resume/","summary":"\u003cp\u003eMy full résumé is available by request. Highlights:\u003c/p\u003e\n\u003ch3 id=\"experience\"\u003eExperience\u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003eOwn security for a cloud environment handling more than a petabyte of sensitive health data\u003c/li\u003e\n\u003cli\u003eLead a program applying frontier LLMs to secure the output of a ≈250-engineer organization, driving AI-powered discovery and remediation of 100+ high/critical severity vulnerabilities\u003c/li\u003e\n\u003cli\u003eLed red team engagements scoped across a major tech company\u0026rsquo;s infrastructure, products, and services\u003c/li\u003e\n\u003cli\u003eDiscovered and exploited TEE vulnerabilities, secure boot and code signing bypasses, and URI-to-RCE chains\u003c/li\u003e\n\u003cli\u003eDeveloped novel vulnerabilities, exploits, and tooling, then partnered with blue teams to detect them\u003c/li\u003e\n\u003cli\u003eCompleted a rotation on a malware reverse engineering team\u003c/li\u003e\n\u003cli\u003ePerformed design reviews, cryptographic engineering, application security testing, penetration tests, and security consulting for internal teams and Fortune 500 clients\u003c/li\u003e\n\u003cli\u003eAssessed platforms including industrial control systems, cloud environments, embedded hardware, and web and native applications\u003c/li\u003e\n\u003cli\u003eMentored early-career engineers on developing their skills and attacker mindset\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch3 id=\"skills\"\u003eSkills\u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003eAI/LLM tooling: building coding and vulnerability discovery workflows using the Claude Agent SDK\u003c/li\u003e\n\u003cli\u003ePython (primary); C, Java, C#, Bash, x86/ARM assembly, JavaScript, LaTeX\u003c/li\u003e\n\u003cli\u003eEmbedded security engineering and exploitation, including secure boot, remote attestation, and TrustZone\u003c/li\u003e\n\u003cli\u003eNative exploitation techniques, modern exploit mitigations and bypasses, and reverse engineering (Ghidra/IDA)\u003c/li\u003e\n\u003cli\u003eElectrical engineering and hardware hacking, including PCB design and layout; licensed amateur radio operator\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch3 id=\"achievements\"\u003eAchievements\u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003eTwo-time DEF CON Black Badge holder: \u003ca href=\"https://defcon.org/html/defcon-34/dc-34-contests.html#orga_41451\"\u003eSpy vs Spy\u003c/a\u003e and \u003ca href=\"https://www.blacksincyberconf.com/\"\u003eBlacks in Cyber\u003c/a\u003e CTFs, with \u003ca href=\"https://ptfs.team\"\u003eTeam pTFS\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e2nd place in the DEF CON Spy vs Spy CTF and 3rd place in Dungeons at DEF CON (Team pTFS)\u003c/li\u003e\n\u003cli\u003e1st place, \u003ca href=\"https://www.sans.org/netwars/tournament\"\u003eSANS Core NetWars\u003c/a\u003e CTF at RSA Conference (solo)\u003c/li\u003e\n\u003cli\u003eCompleted the \u003ca href=\"https://microcorruption.com\"\u003eMicrocorruption\u003c/a\u003e embedded security and reverse engineering CTF\u003c/li\u003e\n\u003cli\u003eRegular \u003ca href=\"/talks/\"\u003espeaker\u003c/a\u003e at internal and external security and technology conferences\u003c/li\u003e\n\u003cli\u003eFormer member of the DEF CON \u003ca href=\"https://iotvillage.org/\"\u003eIoT Village\u003c/a\u003e Call for Papers review panel\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch3 id=\"certifications--training\"\u003eCertifications \u0026amp; Training\u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://www.offensive-security.com/ctp-osce/\"\u003eOffensive Security Certified Expert\u003c/a\u003e (OSCE) and \u003ca href=\"https://www.offensive-security.com/pwk-oscp/\"\u003eProfessional\u003c/a\u003e (OSCP)\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://raelize.com/teepwn/\"\u003eTEEPwn\u003c/a\u003e training on reverse engineering and attacking TrustZone at \u003ca href=\"https://www.ringzer0.training/\"\u003eRingZer0\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e","title":"Résumé"},{"content":"I\u0026rsquo;ve given a number of talks at various security and tech conferences. Here are some examples (newest first):\nBSides Orlando 2020 \u0026mdash; Adventures in Perimeterless Homelabbing (2020-11, make sure your PDF reader shows the speaker notes): An overview of \u0026ldquo;perimeterless\u0026rdquo; or \u0026ldquo;zero-trust\u0026rdquo; networking with examples of how to implement it in the real world, first in your lab and then in prod at scale. SCaLE 18x \u0026mdash; Hosting Your Own Media and Other Homelab Shenanigans (2020-03): A 90 minute talk with my friend Morgan Gangwere on our (mis)adventures in homelabbing. Slides are available here. ToorCon 21 \u0026mdash; Mocking HTTP Services with Burp (2019-11): A lightning talk about a Burp extension I wrote for quickly mocking HTTP-based services. Slides are available here, and more information about the extension is available here. I am also a regular participant at an internal lightning talks program. While many of those talks aren\u0026rsquo;t publishable due to NDAs, here are a few that are:\nBeyond /dev/urandom \u0026mdash; The State of Randomness in Linux (2020-08) Common Vulnerability Scoring System (CVSS) (2020-06) Bufferbloat, or why you can\u0026rsquo;t download games and Netflix at the same time (2020-03) WireGuard, VPN of the Future (2020-03) WebAuthn \u0026mdash; Solving Password Fatigue, Phishing, and More (2020-02) ZeroTier \u0026mdash; Reimagining the VPN (2020-01) ","permalink":"https://polansky.co/talks/","summary":"\u003cp\u003eI\u0026rsquo;ve given a number of talks at various security and tech conferences. Here are some examples (newest first):\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"/files/talks/BSides_Orlando_2020-Perimeterless_Homelabbing.pdf\"\u003eBSides Orlando 2020 \u0026mdash; Adventures in Perimeterless Homelabbing\u003c/a\u003e (2020-11, make sure your PDF reader shows the speaker notes): An overview of \u0026ldquo;perimeterless\u0026rdquo; or \u0026ldquo;zero-trust\u0026rdquo; networking with examples of how to implement it in the real world, first in your lab and then in prod at scale.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.socallinuxexpo.org/scale/18x/presentations/workshop-hosting-your-own-media-and-other-homelab-shenanigans\"\u003eSCaLE 18x \u0026mdash; Hosting Your Own Media and Other Homelab Shenanigans\u003c/a\u003e (2020-03): A 90 minute talk with my friend \u003ca href=\"https://zaibatsutel.net/\"\u003eMorgan Gangwere\u003c/a\u003e on our (mis)adventures in \u003ca href=\"https://reddit.com/r/homelab/wiki/introduction\"\u003ehomelabbing\u003c/a\u003e. Slides are available \u003ca href=\"/files/talks/SCaLE_18-Homelab_Shenanigans.pdf\"\u003ehere\u003c/a\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://talks.toorcon.net/toorcon21/talk/JWDKGW/\"\u003eToorCon 21 \u0026mdash; Mocking HTTP Services with Burp\u003c/a\u003e (2019-11): A lightning talk about a \u003ca href=\"https://portswigger.net/burp\"\u003eBurp\u003c/a\u003e extension I wrote for quickly mocking HTTP-based services. Slides are available \u003ca href=\"/files/talks/ToorCon_21-Burp_HTTP_Mock.pdf\"\u003ehere\u003c/a\u003e, and more information about the extension is available \u003ca href=\"/projects/burphttpmock/\"\u003ehere\u003c/a\u003e.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eI am also a regular participant at an internal lightning talks program. While many of those talks aren\u0026rsquo;t publishable due to NDAs, here are a few that are:\u003c/p\u003e","title":"Talks"}]