<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.0.0">Jekyll</generator><link href="https://alicebobandeve.org/feed.xml" rel="self" type="application/atom+xml" /><link href="https://alicebobandeve.org/" rel="alternate" type="text/html" /><updated>2020-08-09T11:45:25-05:00</updated><id>https://alicebobandeve.org/feed.xml</id><title type="html">AliceBobAndEve</title><subtitle>A blog about software security, specifications and fuckups.</subtitle><author><name>Simon Kölsch</name></author><entry><title type="html">Threat Modelling should be part of your developing process</title><link href="https://alicebobandeve.org/blog/best-practices/2020/08/05/threat-modelling-should-be-part-of-your-developoing-process/" rel="alternate" type="text/html" title="Threat Modelling should be part of your developing process" /><published>2020-08-05T00:00:00-05:00</published><updated>2020-08-05T00:00:00-05:00</updated><id>https://alicebobandeve.org/blog/best-practices/2020/08/05/threat-modelling-should-be-part-of-your-developoing-process</id><content type="html" xml:base="https://alicebobandeve.org/blog/best-practices/2020/08/05/threat-modelling-should-be-part-of-your-developoing-process/">&lt;p&gt;How do you build secure software? We won’t answer that question here, but a useful approach to building more secure software is constructing an explicit threat model and updating it on a regular basis. Instead of creating a giant threat diagram start by trying to apply one of the STRIDE frameworks threats to your system. Choosing a threat modelling card of the day may help familiarize yourself with the vocabulary.&lt;/p&gt;

&lt;h2 id=&quot;the-purpose-of-a-threat-modelling&quot;&gt;The purpose of a Threat Modelling&lt;/h2&gt;

&lt;p&gt;Building a system invites of hundreds of possible attack vectors which can even be chained together. The more complex your system gets and the more components your system has, the more vectors you get. The &lt;a href=&quot;https://owasp.org/www-project-top-ten/&quot;&gt;OWASP Top 10&lt;/a&gt; give a glimpse at the top of the iceberg and how diverse these threats are. Usually by gaining experience people tend to mitigate more and more of these threats during the creation of a system. Some of the vectors might be easy to spot (e.g. lack of authentication) and some might be harder to find (chained injection attacks combined with social engineering). For all of them you have to decide if they are in scope or an accepted risk.
From all these vectors we need to pick the right ones and apply mitigation techniques to our system. We have to pick because we are usually limited by time and/or budget. Threat Modelling is a tool for finding threats and documenting your mitigations. It helps you to keep focus and invest your time on the right place.&lt;/p&gt;

&lt;p&gt;A threat model by itself is not defined standard. The form should heavily depend on the audience and can be a written list of paragraphs like &lt;a href=&quot;https://www.vaultproject.io/docs/internals/security&quot;&gt;Vault’s Security Model Documentation&lt;/a&gt; or an list of thousands of questions and answers about your system, to be presented to regulators.&lt;/p&gt;

&lt;p&gt;A popular method is to describe your system with a data flow diagram and try to pin &lt;a href=&quot;https://en.wikipedia.org/wiki/STRIDE_(security)&quot;&gt;STRIDE&lt;/a&gt; oriented threats on the different components. You would then prioritize and act accordingly.&lt;/p&gt;

&lt;p&gt;STRIDE is a mnemonic of Spoofing, Tampering, Repudiation, Information disclosure, Denial of service and Elevation of privilege and was created as a framework at Microsoft. See the original publication &lt;a href=&quot;https://adam.shostack.org/microsoft/The-Threats-To-Our-Products.docx&quot;&gt;“The threats to our products” in this wonderful docx file&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;little-and-often&quot;&gt;Little and often&lt;/h2&gt;

&lt;p&gt;The motivations behind threat modelling can vary a lot. Sometimes you find software projects which have created a giant threat model, maybe with support of a security specialist and that’s it. Giant data flow diagram, hundreds of threats, buried deep in a wiki or special tooling. Most of the time, you won’t get any more secure software with this approach. It might even annoy everyone having to create or work with it.&lt;/p&gt;

&lt;p&gt;Like &lt;a href=&quot;https://twitter.com/jgumbley&quot;&gt;Jim Gumbley&lt;/a&gt; explained in &lt;a href=&quot;https://martinfowler.com/articles/agile-threat-modelling.html#ThreatModellinglittleAndOften&quot;&gt;“A Guide to Threat Modelling for Developers”&lt;/a&gt; why it is so important to start threat modelling ‘little and often’. As mentioned, systems are complex things, so we want to break down their complexity during analysis. Little at a time but focused. Systems change and threats change so this adds the need to do this on a regular basis and it’s much easier with smaller units.&lt;/p&gt;

&lt;p&gt;Finding threats for a system can be crossing out points on a check list but may also be more like a brainstorming session. This might be easy with a “security mindset” background but the real-world knowledge of the system is usually with the people creating and maintaining it.&lt;/p&gt;

&lt;p&gt;To allow a better access to the threats and boost your creativity a little bit, &lt;a href=&quot;https://twitter.com/adamshostack&quot;&gt;Adam Shostack&lt;/a&gt; created the card game &lt;a href=&quot;https://github.com/adamshostack/eop&quot;&gt;“Elevation of Privilege”&lt;/a&gt;. It consists of 78 STRIDE cards which can be applied to your prior created data flow diagram. The game design is influenced by &lt;a href=&quot;https://en.wikipedia.org/wiki/Serious_play&quot;&gt;serious play&lt;/a&gt; principles and focuses on getting actionable items at the end.&lt;/p&gt;

&lt;p&gt;The game is nicely illustrated, shared under &lt;a href=&quot;https://creativecommons.org/licenses/by/3.0/&quot;&gt;CC-BY-3.0&lt;/a&gt; and can be &lt;a href=&quot;https://www.microsoft.com/en-us/download/details.aspx?id=20303&quot;&gt;downloaded for free&lt;/a&gt;. Don’t get distracted by the Microsoft advertisement on 80% of the page.&lt;/p&gt;

&lt;p&gt;Elevation of Privilege with its 78 cards is a nice adaptation of Tarot.&lt;/p&gt;

&lt;h2 id=&quot;the-tarot-card-game&quot;&gt;The Tarot Card Game&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Tarot&quot;&gt;Tarot&lt;/a&gt; card decks evolved from adding additional trump cards to the playing cards arriving in Europe in the 14th century. Over decades a lot of regional card decks and playing variants emerged and some of them are still played today, for example &lt;a href=&quot;https://en.wikipedia.org/wiki/Tarot_card_games&quot;&gt;the French-tarot played with the Tarot Nouveau card deck or Cego played with the Tarock deck&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://playingcarddecks.com/blogs/all-in/debunking-common-myths-about-playing-cards-tarot-cards&quot;&gt;Fortune telling using the tarot decks was popularized during the 18th century&lt;/a&gt;. The &lt;a href=&quot;https://en.wikipedia.org/wiki/Tarot_card_games#/media/File:Taroky_taroky.jpg&quot;&gt;colorful illustrated trump cards&lt;/a&gt; made it easy to build up a esoteric system around them. The trump cards (or great Arcana) are illustrated around the &lt;a href=&quot;https://en.wikipedia.org/wiki/Hero's_journey&quot;&gt;Hero’s Journey narrative&lt;/a&gt;, therefore they are a perfect fit for complex story telling. Other attributions, like an ancient Egypt origin are not backed by any facts and seem more like a magic powder added on top by different mystics.&lt;/p&gt;

&lt;p&gt;It got another popularity boost by the publication of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Rider-Waite_tarot_deck&quot;&gt;Waite/Smith deck by Rider&lt;/a&gt; (a part of Penguin Public House today) around 1910 and the &lt;a href=&quot;https://en.wikipedia.org/wiki/Thoth_tarot_deck&quot;&gt;Thoth deck by Crowley/Harris&lt;/a&gt; in the 1940s, both still in use today.&lt;/p&gt;

&lt;h2 id=&quot;using-tarot-as-entropy-input&quot;&gt;Using Tarot as entropy input&lt;/h2&gt;

&lt;p&gt;Tarot cards can not only be used for esoteric fortune telling but also as a tool for random input. My colleague &lt;a href=&quot;https://twitter.com/mkhl&quot;&gt;@mkhl&lt;/a&gt; did write a perfect short summary of that:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;And I think random input is underappreciated and can help break out of cycles. The value can be in receiving random input, relating it to yourself, and using that to observe something about your internal state you might not otherwise had access to. (&lt;a href=&quot;https://twitter.com/mkhl/status/1277503025112846337&quot;&gt;@mkhl on twitter&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Software development usually consists of repeating cycles and ceremony, be it a simple code-and-evaluate loop or a more formalized process like scheduled development cycles with fixed retrospectives. Sometimes you may find yourself stuck inside your focused area and like going for a (&lt;a href=&quot;http://virtualforest.io/&quot;&gt;virtual&lt;/a&gt;) walk or &lt;a href=&quot;https://en.wikipedia.org/wiki/Rubber_duck_debugging&quot;&gt;rubber duck debugging&lt;/a&gt; can free your thinking, drawing a tarot card, trying to relate it to your problem may also be of help.&lt;/p&gt;

&lt;p&gt;For example, if this isn’t a wonderful visualization of destroying the monolith, I don’t know:&lt;/p&gt;

&lt;picture&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/threatmodel-tarot-600-92d49b.webp 600w, /assets/article-images/threatmodel-tarot-900-92d49b.webp 900w, /assets/article-images/threatmodel-tarot-1200-92d49b.webp 1200w&quot; type=&quot;image/webp&quot; /&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/threatmodel-tarot-600-92d49b.png 600w, /assets/article-images/threatmodel-tarot-900-92d49b.png 900w, /assets/article-images/threatmodel-tarot-1200-92d49b.png 1200w&quot; type=&quot;image/png&quot; /&gt;&lt;img class=&quot;article-image&quot; src=&quot;/assets/article-images/threatmodel-tarot-800-92d49b.png&quot; alt=&quot;Shows a card deck with the illustrated card 'The Tower' on top. The card consists of an abstract drawing with bright flares, a collapsing building, consuming fire and an all seeing eye above. Behind the deck the card of the fool peeks out.&quot; /&gt;&lt;/picture&gt;

&lt;h2 id=&quot;threat-model-card-of-the-day&quot;&gt;Threat Model card of the day&lt;/h2&gt;

&lt;p&gt;In Tarot there is a simple drawing technique called “Card of the day”. You draw a card before or after your day starts and follow your thoughts around it. This matches perfectly with the principle of “many small threat modelling sessions over time are better than one big threat model”.&lt;/p&gt;

&lt;p&gt;Switch the Tarot deck with Adam Shostack’s Elevation of Privilige Card game and you get your daily threat modelling inspiration. Discuss the card, try it to apply it to your system, maybe file a bug or document it as an accepted risk.&lt;/p&gt;

&lt;p&gt;Add it to your daily routine, weekly development cycle or simply from time to time.&lt;/p&gt;

&lt;p&gt;Remember to have fun :)&lt;/p&gt;

&lt;h2 id=&quot;the-threat-oracle&quot;&gt;The Threat Oracle&lt;/h2&gt;

&lt;p&gt;Since the future is today, you don’t have to visit any strange fortune tellers trailer, you can get your Tarot cards drawn by &lt;a href=&quot;https://twitter.com/thelastdeck/&quot;&gt;friendly and strange Twitter bots&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The same is now possible for Daily Threat Modelling card. Beware of the mighty &lt;a href=&quot;https://twitter.com/ThreatOracle&quot;&gt;@ThreatOracle 🐦&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/ThreatOracle/status/1289561367024791552&quot;&gt;&lt;picture&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/threatmodel-oracle-600-a0b77c.webp 600w, /assets/article-images/threatmodel-oracle-900-a0b77c.webp 900w, /assets/article-images/threatmodel-oracle-1188-a0b77c.webp 1188w&quot; type=&quot;image/webp&quot; /&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/threatmodel-oracle-600-a0b77c.png 600w, /assets/article-images/threatmodel-oracle-900-a0b77c.png 900w, /assets/article-images/threatmodel-oracle-1188-a0b77c.png 1188w&quot; type=&quot;image/png&quot; /&gt;&lt;img class=&quot;article-image&quot; src=&quot;/assets/article-images/threatmodel-oracle-800-a0b77c.png&quot; alt=&quot;Screenshot of the ThreatOracle user account on Twitter showing a tweet with a glitched version of the card Three of Tampering: An attacker can take advantage of your custom key exchange or integrity control which you built instead of using standard crypto.&quot; /&gt;&lt;/picture&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s your daily reminder of the evil out there in the interwebs. Currently it draws a card a day from a glitched up version of the Elevation of Privilege deck. No need for manual shuffling and picking cards.
Extending it to the Privacy Suite and adding the &lt;a href=&quot;https://owasp.org/www-project-cornucopia/&quot;&gt;OWASP Cornucopia&lt;/a&gt; deck is work in progress.&lt;/p&gt;</content><author><name>Simon Kölsch</name></author><category term="threat-modelling" /><summary type="html">How do you build secure software? We won’t answer that question here, but a useful approach to building more secure software is constructing an explicit threat model and updating it on a regular basis. Instead of creating a giant threat diagram start by trying to apply one of the STRIDE frameworks threats to your system. Choosing a threat modelling card of the day may help familiarize yourself with the vocabulary.</summary></entry><entry><title type="html">Wifi cracking and pwnagotchi - An AI boosted mobile bettercap tool</title><link href="https://alicebobandeve.org/blog/tools/2019/12/09/Wifi-cracking-and-pwnagotchi/" rel="alternate" type="text/html" title="Wifi cracking and pwnagotchi - An AI boosted mobile bettercap tool" /><published>2019-12-09T00:00:00-06:00</published><updated>2019-12-09T00:00:00-06:00</updated><id>https://alicebobandeve.org/blog/tools/2019/12/09/Wifi-cracking-and-pwnagotchi</id><content type="html" xml:base="https://alicebobandeve.org/blog/tools/2019/12/09/Wifi-cracking-and-pwnagotchi/">&lt;p&gt;During the last few weeks I had a lot of fun with a nice little project called pwnagotchi. It’s an automation frontend for bettercap, can be run on a Pi Zero and enables automated wifi-handshake collection. An AI supports finding better scanning parameters. And it has an adorable face.&lt;/p&gt;

&lt;h2 id=&quot;wifi-handshake-cracking&quot;&gt;Wifi Handshake Cracking&lt;/h2&gt;

&lt;p&gt;Some of the basics: If you want to use a wifi secured by encryption, you need the password or pre-shared-key (PSK) to establish a connection to it. The client (supplicant) connects to the access point (authenticator) using the Extensible Authentication Protocol (&lt;a href=&quot;https://tools.ietf.org/html/rfc3748&quot;&gt;EAP, RFC 3748&lt;/a&gt;).
The packets are interchanged via EAPoL (Extensible Authentication Protocol over Local Area Network) frames between the two participants.&lt;/p&gt;

&lt;p&gt;Establishing a secure wifi connection in an environment where potential attackers may have access to the communication works like most encryption protocols do:
Use some random numbers from both sides, the PSK and generate a temporal key to use (Pairwise-Temporal-Key, PTK). This is necessary because we don’t want every other client who has the PSK to be able to decrypt our communication.&lt;/p&gt;

&lt;p&gt;The parameters for the PTK are the MAC addresses of the supplicant and authenticator, a random generated number from each of them (nonce) and the PSK (in this context usually called Pairwise Master Key or PMK). All of them, except the PMK, are shared via a &lt;a href=&quot;https://en.wikipedia.org/wiki/IEEE_802.11i-2004#Four[6]-way_handshake&quot;&gt;4-way handshake&lt;/a&gt;. Since wifi handshakes are transmitted via air, an attacker could easily sniff these handshakes and try to bruteforce the PMK.&lt;/p&gt;

&lt;h3 id=&quot;bruteforcing-handshakes&quot;&gt;Bruteforcing Handshakes&lt;/h3&gt;

&lt;p&gt;Bruteforcing a 256-Bit key with all possibilities and zero-knowledge would take forever (about &lt;a href=&quot;https://en.wikipedia.org/wiki/Brute-force_attack#Theoretical_limits&quot;&gt;3×10^51 years with fancy supercomputers&lt;/a&gt;). Luckily for the attacker most of the keys are not generated at random and most of the time are human readable. The combination of a poorly chosen passphrase, a sophisticated dictionary/cracker and enough collected handshakes can speed up the recovery of lost passphrases significantly.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.openwall.com/john/&quot;&gt;John the Ripper&lt;/a&gt; has been around for ages and supports a vast majority of common and uncommon used hash formats. Have a look at the &lt;a href=&quot;https://github.com/magnumripper/JohnTheRipper/tree/bleeding-jumbo/src&quot;&gt;source code repository of the Jumbo version&lt;/a&gt; to get an idea of supported formats.&lt;/p&gt;

&lt;p&gt;The self-proclaimed fastest password cracking tool is &lt;a href=&quot;https://hashcat.net/hashcat/&quot;&gt;hashcat&lt;/a&gt; which got more and more popular after the release of its code as open source under the &lt;a href=&quot;https://opensource.org/licenses/MIT&quot;&gt;MIT license&lt;/a&gt;. At the moment it &lt;a href=&quot;https://hashcat.net/hashcat/#features-algos&quot;&gt;supports &amp;gt;220 hash formats&lt;/a&gt; and makes heavy use of GPUs.&lt;/p&gt;

&lt;p&gt;If you want to bruteforce handshakes locally and the keys are not something easy guessable like 123456789 you will need solid hardware with GPU power and a &lt;a href=&quot;https://wpa-sec.stanev.org/?dicts&quot;&gt;nice dictionary collection&lt;/a&gt;. In case you don’t have access to local gaming hardware, AWS offers accelerated computing instances like their &lt;a href=&quot;https://aws.amazon.com/ec2/instance-types/p3/&quot;&gt;P3 instance type&lt;/a&gt; with NVIDIA V100 Tensor Core GPUs.&lt;/p&gt;

&lt;p&gt;Another option is to use distributed cracking services like the &lt;a href=&quot;https://wpa-sec.stanev.org/&quot;&gt;Distributed WPA PSK auditor&lt;/a&gt; or SaaS-Services like &lt;a href=&quot;https://www.onlinehashcrack.com/&quot;&gt;OnlineHashCrack&lt;/a&gt; (which has interesting &lt;a href=&quot;https://www.onlinehashcrack.com/about-pricing.php&quot;&gt;pricing&lt;/a&gt;).&lt;/p&gt;

&lt;h3 id=&quot;pmkid&quot;&gt;PMKID&lt;/h3&gt;

&lt;p&gt;The downside of attacks on the handshakes is that you need to collect them in the first place. This takes a client and time to collect the handshakes, and you may need to convert the data to clean it up on any replay counter measures.&lt;/p&gt;

&lt;p&gt;To make it easier for a client to decide if its own PSK works for a specific wifi, there is a part of the protocol which describes how to publish a list of supported PSKs. For each supported PSK the authenticator generates a Pairwise Master Key Identifier (PMKID):&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;HMAC-SHA1-128(PMK, &quot;PMK Name&quot; | MAC AccessPoint | MAC Station)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Depending on the access point’s configuration, these PMKIDs will be sent unencrypted via the 802.11RSN information element.&lt;/p&gt;

&lt;p&gt;If we try to associate with the access point, we will get the PMK Name and the required MACs with the first part of the handshake. This makes it possible to crack the PMKIDs HMAC-SHA1-128 Hash without any other clients involved.&lt;/p&gt;

&lt;p&gt;This kind of attack was discovered by Jens Steube, one of the hashcat authors, and posted on the &lt;a href=&quot;https://hashcat.net/forum/thread-7717.html&quot;&gt;hashcat forum in 2018, “New attack on WPA/WPA2 using PMKID”&lt;/a&gt;. For another attack example, see &lt;a href=&quot;https://twitter.com/evilsocket&quot;&gt;@evilsockets&lt;/a&gt; blogpost &lt;a href=&quot;https://www.evilsocket.net/2019/02/13/Pwning-WiFi-networks-with-bettercap-and-the-PMKID-client-less-attack/&quot;&gt;“pwning WPA/WPA2 networks with bettercap and the PMKID client-less attack”&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;bettercap&quot;&gt;Bettercap&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://www.bettercap.org/intro/&quot;&gt;Bettercap&lt;/a&gt; is tooling for various MITM / Spoofing attacks on Wifi, Bluetooth or 2,4 Ghz HIDs. It does network host probing, can capture and manipulate traffic and do port scanning. It also has a nice web ui included, if you prefer that over the CLI. It is written in Go by &lt;a href=&quot;https://www.evilsocket.net/&quot;&gt;evilsocket&lt;/a&gt; and provides an easy to use API for further tooling.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://www.bettercap.org/modules/wifi/&quot;&gt;Wifi Stack&lt;/a&gt; supports scanning and automated sniffing and saving key material from 4-way handshakes. It can create fake access points and supports the PKMID association attacks to collect the proper packets.&lt;/p&gt;

&lt;p&gt;Since Deauthentication Management frames are not encrypted, this can be used for &lt;a href=&quot;https://en.wikipedia.org/wiki/Wi-Fi_deauthentication_attack&quot;&gt;another attack&lt;/a&gt;. The attacker notifies the supplicant that he got disconnected from the network. The source of the notification is spoofed, so that the supplicant thinks it is from the authenticator. Most of the time this leads to a reconnect from the supplicant with another 4-way handshake to collect.&lt;/p&gt;

&lt;p&gt;Read more about the other features in the corresponding &lt;a href=&quot;https://www.bettercap.org/modules/&quot;&gt;modules documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;pwnagotchi&quot;&gt;Pwnagotchi&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://pwnagotchi.ai/&quot;&gt;Pwnagotchi&lt;/a&gt; is another project from evilsocket combining bettercaps API with an AI, varying scanning parameters to collect more handshakes. For extra fun: Put it on a &lt;a href=&quot;https://www.raspberrypi.org/products/raspberry-pi-zero/&quot;&gt;Raspberry Pi-Zero&lt;/a&gt;, add an &lt;a href=&quot;https://www.waveshare.com/wiki/2.13inch_e-Paper_HAT&quot;&gt;e-paper screen&lt;/a&gt; and if you want a &lt;a href=&quot;https://www.aliexpress.com/item/32888533624.html&quot;&gt;battery pack&lt;/a&gt;.&lt;/p&gt;

&lt;picture&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/pwnagotchi-axolotl-600-fec601.webp 600w, /assets/article-images/pwnagotchi-axolotl-900-fec601.webp 900w, /assets/article-images/pwnagotchi-axolotl-1200-fec601.webp 1200w&quot; type=&quot;image/webp&quot; /&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/pwnagotchi-axolotl-600-fec601.png 600w, /assets/article-images/pwnagotchi-axolotl-900-fec601.png 900w, /assets/article-images/pwnagotchi-axolotl-1200-fec601.png 1200w&quot; type=&quot;image/png&quot; /&gt;&lt;img class=&quot;article-image&quot; src=&quot;/assets/article-images/pwnagotchi-axolotl-800-fec601.png&quot; alt=&quot;Picture of a raspberry pi with an e-ink display showing a little smiling face, some status information and a text Generating keys, do not turn off.&quot; /&gt;&lt;/picture&gt;

&lt;p&gt;The pwnagotchi will start scanning for wifis, collect handshakes and frames with PMKID and store them on the Pi’s sd-card. You can download the .pcap files via a network connection to your local computer. To get more handshakes it will deauthenticate clients from time to time.&lt;/p&gt;

&lt;picture&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/pwnagotchi-deauth-600-a0ee05.webp 600w, /assets/article-images/pwnagotchi-deauth-900-a0ee05.webp 900w, /assets/article-images/pwnagotchi-deauth-1200-a0ee05.webp 1200w&quot; type=&quot;image/webp&quot; /&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/pwnagotchi-deauth-600-a0ee05.png 600w, /assets/article-images/pwnagotchi-deauth-900-a0ee05.png 900w, /assets/article-images/pwnagotchi-deauth-1200-a0ee05.png 1200w&quot; type=&quot;image/png&quot; /&gt;&lt;img class=&quot;article-image&quot; src=&quot;/assets/article-images/pwnagotchi-deauth-800-a0ee05.png&quot; alt=&quot;Showing the face with sunglasses and a message Just decided that XX:XX needs no Wifi!&quot; /&gt;&lt;/picture&gt;

&lt;p&gt;A web ui shows some status information and the cute little face.&lt;/p&gt;

&lt;p&gt;You could also run it in manual mode, which exposes the underlying bettercap web ui for manual usage.&lt;/p&gt;

&lt;h3 id=&quot;the-ai-part&quot;&gt;The AI part&lt;/h3&gt;

&lt;p&gt;If you try to get many wifi handshakes there are a some parameters you can adjust in order to get better results. These include the signal strength, different timeout and retry values and periods of waiting. We know that we may have found a good configuration if we collect many handshakes. In a scenario with an access point nearby and many access points far away a rule could be to focus on the access points with the better signal strength.&lt;/p&gt;

&lt;p&gt;A neural network can yield pretty good results if you can clearly define some kind of score for achieving what you want. In our case this is simply the count of captured handshakes. If we vary our configuration and get good results, why not keep it for a little while and tweak the parameters. A nice example is &lt;a href=&quot;https://www.youtube.com/watch?v=qv6UVOQ0F44&quot;&gt;SethBling’s MarI/O Machine Learning&lt;/a&gt; implementation. See &lt;a href=&quot;https://www.youtube.com/watch?v=zIkBYwdkuTk&quot;&gt;“Neural Network Learns to Play Snake”&lt;/a&gt; for another great example. According to &lt;a href=&quot;https://pwnagotchi.ai/intro/#how-does-pwnagotchi-work&quot;&gt;pwnagotchi’s Intro&lt;/a&gt;, it uses a &lt;a href=&quot;https://en.wikipedia.org/wiki/Long_short-term_memory&quot;&gt;LSTM network&lt;/a&gt; with Advantage Actor Critic (A2C). Have a look at the link to the wonderful &lt;a href=&quot;https://hackernoon.com/intuitive-rl-intro-to-advantage-actor-critic-a2c-4ff545978752&quot;&gt;“Intro to Advantage Actor Critic” comic&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;https://pwnagotchi.ai/usage/#training-the-ai&quot;&gt;Training the AI&lt;/a&gt; for a more in-depth view of which parameters get changed and how this affects the neural network.&lt;/p&gt;

&lt;picture&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/pwnagotchi-ai-600-fb5736.webp 600w, /assets/article-images/pwnagotchi-ai-900-fb5736.webp 900w, /assets/article-images/pwnagotchi-ai-1200-fb5736.webp 1200w&quot; type=&quot;image/webp&quot; /&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/pwnagotchi-ai-600-fb5736.png 600w, /assets/article-images/pwnagotchi-ai-900-fb5736.png 900w, /assets/article-images/pwnagotchi-ai-1200-fb5736.png 1200w&quot; type=&quot;image/png&quot; /&gt;&lt;img class=&quot;article-image&quot; src=&quot;/assets/article-images/pwnagotchi-ai-800-fb5736.png&quot; alt=&quot;Picture of the face smiling and the message AI ready.&quot; /&gt;&lt;/picture&gt;

&lt;h3 id=&quot;pwnagotchi-hardware&quot;&gt;Pwnagotchi Hardware&lt;/h3&gt;

&lt;p&gt;Since pwnagotchi is a python package installed via pip, you could just run it on your laptop and access the display via a web ui.  Of course it is more fun and a lot more practical to have a dedicated device for it, like the Pi-Zero Configuration mentioned above. The documentation provides an extensive &lt;a href=&quot;https://pwnagotchi.ai/installation/#required-hardware&quot;&gt;hardware guide&lt;/a&gt; with different configurations.&lt;/p&gt;

&lt;p&gt;The Pi is reachable via Bluetooth Tethering or a USB connection. You can use the web ui or login directly &lt;a href=&quot;https://pwnagotchi.ai/configuration/#connect-to-your-pwnagotchi&quot;&gt;via SSH&lt;/a&gt;.&lt;/p&gt;

&lt;picture&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/pwnagotchi-pack-600-cde9d6.webp 600w, /assets/article-images/pwnagotchi-pack-900-cde9d6.webp 900w, /assets/article-images/pwnagotchi-pack-1200-cde9d6.webp 1200w&quot; type=&quot;image/webp&quot; /&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/pwnagotchi-pack-600-cde9d6.png 600w, /assets/article-images/pwnagotchi-pack-900-cde9d6.png 900w, /assets/article-images/pwnagotchi-pack-1200-cde9d6.png 1200w&quot; type=&quot;image/png&quot; /&gt;&lt;img class=&quot;article-image&quot; src=&quot;/assets/article-images/pwnagotchi-pack-800-cde9d6.png&quot; alt=&quot;Picture of a raspberry pi-zero with added e-ink shield and battery pack. Also a small IC RTC is lying around.&quot; /&gt;&lt;/picture&gt;

&lt;h3 id=&quot;pwngrid-and-plugins&quot;&gt;Pwngrid and Plugins&lt;/h3&gt;

&lt;p&gt;pwnagotchi is written in python and can be easily extended with custom &lt;a href=&quot;https://pwnagotchi.ai/plugins/&quot;&gt;plugins&lt;/a&gt;. For gamification there is a running &lt;a href=&quot;https://github.com/evilsocket/pwngrid&quot;&gt;pwngrid&lt;/a&gt; where the units can report found access points and the location country. No private information is transmitted, and if you wanted you could &lt;a href=&quot;https://github.com/evilsocket/pwnagotchi/blob/master/pwnagotchi/plugins/default/grid.py&quot;&gt;inspect the source code&lt;/a&gt; and build the binaries for yourself.&lt;/p&gt;

&lt;p&gt;During the first boot, your pwnagotchi creates a public/private keypair to identify itself. After that in can send and receive small text messages from other units via the grid. Every message is encrypted with the corresponding key, so nobody should be able to decrypt the content.&lt;/p&gt;

&lt;p&gt;The pwngrid provides some &lt;a href=&quot;https://pwnagotchi.ai/stats/&quot;&gt;stats of collected handshakes&lt;/a&gt; and a &lt;a href=&quot;https://pwnagotchi.ai/map/&quot;&gt;country map&lt;/a&gt; for registered units.&lt;/p&gt;

&lt;p&gt;The best way to get an overview of available plugins is to have a look at the &lt;a href=&quot;https://github.com/evilsocket/pwnagotchi/tree/master/pwnagotchi/plugins/default&quot;&gt;plugins folder in the github repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A nice combination are the net-pos and webgpsmap plugins. Net-pos uses the &lt;a href=&quot;https://location.services.mozilla.com/&quot;&gt;Mozilla Location Services&lt;/a&gt; to lookup geopositions. These positions are then shown on a map interface:&lt;/p&gt;

&lt;picture&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/pwnagotchi-webgps-600-b34266.webp 600w, /assets/article-images/pwnagotchi-webgps-900-b34266.webp 900w, /assets/article-images/pwnagotchi-webgps-1200-b34266.webp 1200w&quot; type=&quot;image/webp&quot; /&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/pwnagotchi-webgps-600-b34266.png 600w, /assets/article-images/pwnagotchi-webgps-900-b34266.png 900w, /assets/article-images/pwnagotchi-webgps-1200-b34266.png 1200w&quot; type=&quot;image/png&quot; /&gt;&lt;img class=&quot;article-image&quot; src=&quot;/assets/article-images/pwnagotchi-webgps-800-b34266.png&quot; alt=&quot;A screenshot of a map showing different access points spread out.&quot; /&gt;&lt;/picture&gt;

&lt;p&gt;It can use the connection of your host laptop or bluetooth tethering via mobile phone to get the required internet access.&lt;/p&gt;

&lt;p&gt;Writing your own plugin is straight forward and you can get started by modifying a &lt;a href=&quot;https://github.com/evilsocket/pwnagotchi/blob/master/pwnagotchi/plugins/default/example.py&quot;&gt;provided example&lt;/a&gt;. The running pwnagotchi itself also exposes a &lt;a href=&quot;https://pwnagotchi.ai/api/local/&quot;&gt;http API&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;peers&quot;&gt;Peers&lt;/h3&gt;

&lt;p&gt;For the fun factor, pwnagotchis can announce their presence to other units. If this is enabled meeting other units and making friends may influence the mood of your unit. Here is Axolotl meeting Fuxi:&lt;/p&gt;
&lt;picture&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/pwnagotchi-axolotl-fuxi-600-2f618f.webp 600w, /assets/article-images/pwnagotchi-axolotl-fuxi-900-2f618f.webp 900w, /assets/article-images/pwnagotchi-axolotl-fuxi-1200-2f618f.webp 1200w&quot; type=&quot;image/webp&quot; /&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/pwnagotchi-axolotl-fuxi-600-2f618f.png 600w, /assets/article-images/pwnagotchi-axolotl-fuxi-900-2f618f.png 900w, /assets/article-images/pwnagotchi-axolotl-fuxi-1200-2f618f.png 1200w&quot; type=&quot;image/png&quot; /&gt;&lt;img class=&quot;article-image&quot; src=&quot;/assets/article-images/pwnagotchi-axolotl-fuxi-800-2f618f.png&quot; alt=&quot;Picture of two pwnagotchis next to each other, showing the presence of fuxi and axolotl on their e-ink screen. Axolotls message reads: So many networks.&quot; /&gt;&lt;/picture&gt;

&lt;h3 id=&quot;running-your-own&quot;&gt;Running your own&lt;/h3&gt;

&lt;p&gt;If you intend to run your own pwnagotchi, follow the &lt;a href=&quot;https://pwnagotchi.ai/installation/&quot;&gt;install documentation&lt;/a&gt;. Everything should be straight forward and even without an e-ink display it’s a nice little tool running linux with an wifi chip and bettercap.&lt;/p&gt;

&lt;p&gt;Remember: If you want to capture 5Ghz wifi traffic, you will need an additional USB dongle for your Pi.&lt;/p&gt;

&lt;p&gt;For updates you can follow &lt;a href=&quot;https://twitter.com/pwnagotchi&quot;&gt;@pwnagotchi&lt;/a&gt; on twitter or have a look at the &lt;a href=&quot;https://community.pwnagotchi.ai/&quot;&gt;disqus board&lt;/a&gt; or &lt;a href=&quot;https://www.reddit.com/r/pwnagotchi/&quot;&gt;/r/pwnagotchi&lt;/a&gt;.
For more insights and details on future releases you can fund the author on &lt;a href=&quot;https://www.patreon.com/evilsocket&quot;&gt;patreon&lt;/a&gt;.&lt;/p&gt;</content><author><name>Simon Kölsch</name></author><category term="pwnagotchi" /><category term="bettercap" /><category term="wifi" /><summary type="html">During the last few weeks I had a lot of fun with a nice little project called pwnagotchi. It’s an automation frontend for bettercap, can be run on a Pi Zero and enables automated wifi-handshake collection. An AI supports finding better scanning parameters. And it has an adorable face.</summary></entry><entry><title type="html">2nd Factors, an overview about Fido, OATH and One-Time-Pads</title><link href="https://alicebobandeve.org/blog/standards/2019/11/05/fido2-u2f-oath-yubico-otp-yubikeys/" rel="alternate" type="text/html" title="2nd Factors, an overview about Fido, OATH and One-Time-Pads" /><published>2019-11-05T00:00:00-06:00</published><updated>2019-11-05T00:00:00-06:00</updated><id>https://alicebobandeve.org/blog/standards/2019/11/05/fido2-u2f-oath-yubico-otp-yubikeys</id><content type="html" xml:base="https://alicebobandeve.org/blog/standards/2019/11/05/fido2-u2f-oath-yubico-otp-yubikeys/">&lt;p&gt;I felt like upgrading my Yubikey to a USB-C version and use that opportunity to dive a little bit deeper into the different OTP specs and how I want to use my second factor. Still falling down the rabbit hole, but here is some kind of overview of fido2, u2f, oath-hotp, yubico-otp and others…&lt;/p&gt;

&lt;h2 id=&quot;two-factors-two-channels-and-one-time-passwords&quot;&gt;Two-Factors, Two-Channels and One-Time-Passwords&lt;/h2&gt;

&lt;p&gt;During authentication you usually present one type of credentials to get access to a system. This is called a factor und usually it is something you know, your password for example. To strengthen a login to a system, you could add one or multiple other factors. This could be something you carry with you (a security key), something you are (biometric data), somewhere you are (IP addresses, specific device details which are hard to spoof) or something you do (for example special gestures). After adding a second factor, you are using two or multiple factor authentication.&lt;/p&gt;

&lt;p&gt;To prove that you own a special cryptographic key without exposing it, you would usually present some kind of proof which would be valid for a limited amount of time. This will often be a one-time usable password (OTP), like a generated 6-digit code. The cryptographic key would be stored inside a hardware token or an application of the mobile phone you carry around. It is not just a second PIN you remember.
It would also be possible to use OTPs in an authentication as your primary factor, but static passwords are a common pattern so most of the time they are used as a second factor.&lt;/p&gt;

&lt;p&gt;Two Channel (or Out-Of-Band) authentication is an additional way to strengthen authentication security. If you remember your static password and possess a cryptographic key on the same computer you are trying to authenticate, there is clearly only one channel used. If the second factor is generated on a dedicated device, we use a second channel.
SMS would also be an example for Out-Of-Band authentication, but is not advised by NIST without any counter measures for specific attacks, see Section 5 &lt;a href=&quot;https://pages.nist.gov/800-63-3/sp800-63b.html#sec5&quot;&gt;“Out-of-Band Verifiers” and “Authentication using the Public Switched Telephone Network”&lt;/a&gt; in the Digital Identity Guidelines - Authentication and Lifecycle Management 800-63B.&lt;/p&gt;

&lt;p&gt;While aiming for a multi-factor, out-of-band authentication might be the most secure option, it can bring additional requirements for account/device recovery with it. Creating a backup of a secret should not be possible, so you will need to store additional recovery codes, weakening the security measures. In the end, even adding a simple second factor on the same channel, will increase authentication security over a static password.&lt;/p&gt;

&lt;h2 id=&quot;security-tokens-and-the-yubikeys&quot;&gt;Security Tokens and the YubiKeys&lt;/h2&gt;

&lt;p&gt;Security tokens are usually a piece of hardware which can have multiple features. Since you usually need to possess them, a common usage is as a second factor.&lt;/p&gt;

&lt;p&gt;An example are &lt;a href=&quot;https://www.rsa.com/content/dam/en/data-sheet/rsa-securid-hardware-tokens.pdf&quot;&gt;RSA SecureID Tokens (PDF)&lt;/a&gt; which are often used in an enterprise environment. They provide the user with an OTP which changes every minute. During a multi-factor authentication, it can be used as a second factor because cryptographic keys ensure you must be in possession of the hardware token.
Of course, you have to keep your private keys private to prevent any attacks on the mechanism. In March/2011 &lt;a href=&quot;https://www.sec.gov/Archives/edgar/data/790070/000119312511070159/dex991.htm&quot;&gt;RSA announced publicly an attack against their systems&lt;/a&gt; via &lt;a href=&quot;https://web.archive.org/web/20140216102405/https://blogs.rsa.com/anatomy-of-an-attack/&quot;&gt;spear phishing&lt;/a&gt;, losing some of the private keys. This lead to &lt;a href=&quot;https://www.theregister.co.uk/2011/05/27/lockheed_securid_hack_flap/&quot;&gt;another attack two months later on Lockheed Martin&lt;/a&gt; and maybe other customers.&lt;/p&gt;

&lt;picture&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/rsa-tokens-600-f4609b.webp 600w, /assets/article-images/rsa-tokens-900-f4609b.webp 900w, /assets/article-images/rsa-tokens-1200-f4609b.webp 1200w&quot; type=&quot;image/webp&quot; /&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/rsa-tokens-600-f4609b.png 600w, /assets/article-images/rsa-tokens-900-f4609b.png 900w, /assets/article-images/rsa-tokens-1200-f4609b.png 1200w&quot; type=&quot;image/png&quot; /&gt;&lt;img class=&quot;article-image&quot; src=&quot;/assets/article-images/rsa-tokens-800-f4609b.png&quot; alt=&quot;Picture of five old RSA security tokens (2cm x 6cm) partly with a broken display, layered above each other&quot; /&gt;&lt;/picture&gt;

&lt;p&gt;Another example of a hardware security token is the &lt;a href=&quot;https://www.yubico.com/products/yubikey-hardware/&quot;&gt;YubiKey&lt;/a&gt; from &lt;a href=&quot;https://www.yubico.com/about/about-us/&quot;&gt;Yubico Ltd&lt;/a&gt;. The CTO and one of the founders (&lt;a href=&quot;https://www.yubico.com/about/team/&quot;&gt;Jakob Ehrensvärd&lt;/a&gt;) is part of the team authoring some of the Fido Standards, which we will look into later (U2F and WebAuthn). YubiKeys come in various shapes and different feature sets and support different types of OTPs. With some support of the industry by giving discounts buying a YubiKey (for example &lt;a href=&quot;https://www.yubico.com/2015/10/github-yubico-u2f/&quot;&gt;20% from Github&lt;/a&gt; or &lt;a href=&quot;https://mailman.stanford.edu/pipermail/liberationtech/2015-October/015568.html&quot;&gt;a key for 5$USD&lt;/a&gt;) it became one of the more widely used security tokens outside the enterprise environment.&lt;/p&gt;

&lt;picture&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/yubikey-nano-600-fd1c33.webp 600w, /assets/article-images/yubikey-nano-900-fd1c33.webp 900w, /assets/article-images/yubikey-nano-1200-fd1c33.webp 1200w&quot; type=&quot;image/webp&quot; /&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/yubikey-nano-600-fd1c33.png 600w, /assets/article-images/yubikey-nano-900-fd1c33.png 900w, /assets/article-images/yubikey-nano-1200-fd1c33.png 1200w&quot; type=&quot;image/png&quot; /&gt;&lt;img class=&quot;article-image&quot; src=&quot;/assets/article-images/yubikey-nano-800-fd1c33.png&quot; alt=&quot;Picture of a single yubikey nano which fights completely in a USB-A port&quot; /&gt;&lt;/picture&gt;

&lt;p&gt;There is also a &lt;a href=&quot;https://www.token2.com/shop/product/token2-miniotp-1-card&quot;&gt;credit-card-thin-fancy-e-ink-display-version from Token2&lt;/a&gt; and a whole bunch of other forms and sizes from different manufacturers. In the end, choosing the right one depends on the standards you need support for.&lt;/p&gt;

&lt;p&gt;Using mobile phones as hardware platform for OTP applications has become more and more common over the last years. The following picture shows the Google Authenticator application, supporting OATH-HOTP and OATH-TOTP.&lt;/p&gt;

&lt;picture&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/google-authenticator-600-214fee.webp 600w, /assets/article-images/google-authenticator-900-214fee.webp 900w, /assets/article-images/google-authenticator-1125-214fee.webp 1125w&quot; type=&quot;image/webp&quot; /&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/google-authenticator-600-214fee.png 600w, /assets/article-images/google-authenticator-900-214fee.png 900w, /assets/article-images/google-authenticator-1125-214fee.png 1125w&quot; type=&quot;image/png&quot; /&gt;&lt;img class=&quot;article-image&quot; src=&quot;/assets/article-images/google-authenticator-800-214fee.png&quot; alt=&quot;Picture of the Google Authenticator app on a mobile phone displaying the first 3 numbers of several OTPs. A timer for each OTP indicates the usage of OATH-TOTP.&quot; /&gt;&lt;/picture&gt;

&lt;h2 id=&quot;standards-and-specification-bodies&quot;&gt;Standards and Specification Bodies&lt;/h2&gt;

&lt;p&gt;If we have a look at the currently supported, relevant specifications we can find two main industry consortiums / projects leading the authorships: OATH and Fido.&lt;/p&gt;

&lt;picture&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/fido-oath-overview-600-91cddd.webp 600w, /assets/article-images/fido-oath-overview-900-91cddd.webp 900w, /assets/article-images/fido-oath-overview-1050-91cddd.webp 1050w&quot; type=&quot;image/webp&quot; /&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/fido-oath-overview-600-91cddd.png 600w, /assets/article-images/fido-oath-overview-900-91cddd.png 900w, /assets/article-images/fido-oath-overview-1050-91cddd.png 1050w&quot; type=&quot;image/png&quot; /&gt;&lt;img class=&quot;article-image&quot; src=&quot;/assets/article-images/fido-oath-overview-800-91cddd.png&quot; alt=&quot;Overview of the specs mentioned in the blogpost, grouped into FIDO2 with 2UF, WebAuthN, CTAP, UAF, OATH with HOTP, TOTP and Yubico OTP&quot; /&gt;&lt;/picture&gt;

&lt;p&gt;While OATH is a little bit more mature, most of the current development and changes happen arround the FIDO project.&lt;/p&gt;

&lt;h3 id=&quot;oath---initiative-for-open-authentication&quot;&gt;OATH - Initiative For Open Authentication&lt;/h3&gt;

&lt;p&gt;We can find the “mission statement” directly on the &lt;a href=&quot;https://openauthentication.org/&quot;&gt;OATH consortium homepage&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;[..]an industry-wide collaboration to develop an open reference architecture by leveraging existing open standards for the universal adoption of strong authentication.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The members consist of IBM, Axalto, Gemplus, VeriSign and &lt;a href=&quot;https://openauthentication.org/members/&quot;&gt;a lot of other providers for software or hardware Identity Solutions&lt;/a&gt; on the market. Their main goal is to provide a free-of-cost framework using open standards  by either providing them themsleves or supporting standardization (for example through the &lt;a href=&quot;https://www.ietf.org/about/&quot;&gt;IETF&lt;/a&gt;). They answer a couple of questions about their goals in a &lt;a href=&quot;https://openauthentication.org/wp-content/uploads/2015/09/FAQ2.pdf&quot;&gt;FAQ document (PDF)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Apart from &lt;a href=&quot;https://openauthentication.org/oath-certification/&quot;&gt;a certification of your OATH implementation&lt;/a&gt; there is a &lt;a href=&quot;https://openauthentication.org/specifications-technical-resources/&quot;&gt;list of their technical specifications&lt;/a&gt; containing beside others:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://openauthentication.org/wp-content/uploads/2015/09/ReferenceArchitectureVersion2.pdf&quot;&gt;OATH Reference Architecture V2 (PDF)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;OATH-HOTP (RFC 4226)&lt;/li&gt;
  &lt;li&gt;OATH-TOTP (RFC 6238)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will be looking into the two OTP specifications.&lt;/p&gt;

&lt;h4 id=&quot;oath-hotp-a-hmac-based-otp-algorithm&quot;&gt;OATH-HOTP (A HMAC-Based OTP Algorithm)&lt;/h4&gt;

&lt;p&gt;A “&lt;a href=&quot;https://en.wikipedia.org/wiki/Message_authentication_code&quot;&gt;Message Authentication Code&lt;/a&gt;” is used to verify the authenticity of a message. It can validate if the message really originates from the sender and that nobody tempered with it. Usually there is the requirement to share a secret key between the sender and the recipient to implement the validation. &lt;a href=&quot;https://tools.ietf.org/html/rfc2104&quot;&gt;HMAC (RFC2104)&lt;/a&gt; is an implementation of that idea by using a hashing algorithm.&lt;/p&gt;

&lt;p&gt;During the registration of your token with the authenticator, the secret key is made known to both parties. A hardware token might have a fixed key or can be configured to one. To generate a One-Time-Password, we need a so-called moving factor and our secret key. The moving factor is a changing value which ensures the password is for one time use only. HOTP makes use of a counter for that purpose. Since the authenticator increments this counter only after a successful login, there might be some synchronization issues, if the client generates more tokens without logging in. To solve this problem the authenticator usually uses a “look-ahead window”. This determines how many increments on the counter the authenticator tries when attempting to get back in sync with the OTP generator.&lt;/p&gt;

&lt;p&gt;Side note: &lt;a href=&quot;https://tools.ietf.org/html/rfc4226&quot;&gt;OATH-HOTP (RFC 4226)&lt;/a&gt; uses HMAC-SHA1 which might make you think of the &lt;a href=&quot;http://shattered.io/&quot;&gt;SHA-1 collisions&lt;/a&gt; implemented by the CWI Amsterdam and Google Research in 2017: &lt;a href=&quot;http://shattered.io/static/shattered.pdf&quot;&gt;First collision for full SHA-1 (PDF)&lt;/a&gt;. This is not a problem in this context, since theoretical attacks on SHA-1 are known since 2005 (see &lt;a href=&quot;https://www.schneier.com/blog/archives/2005/02/sha1_broken.html&quot;&gt;Bruce Schneier: SHA1-Broken&lt;/a&gt;), HMAC-SHA1 is not affected by this type of collisions and the HOTP RFC (also from 2005) includes a detailed &lt;a href=&quot;https://tools.ietf.org/html/rfc4226#page-25&quot;&gt;security analysis on SHA1-Attacks&lt;/a&gt;. There are some implementations of OATH-HOTP with other algorithms, but usually HMAC-SHA1 is used.&lt;/p&gt;

&lt;p&gt;Using a simple counter instead of using a real clock as the moving factor reduces a lot of the implementation complexity for a hardware device manufacturer. This way you don’t need to keep anything in-sync with the authenticator, only the counter.&lt;/p&gt;

&lt;h4 id=&quot;oath-totp-a-time-based-one-time-password-algorithm&quot;&gt;OATH-TOTP (A Time-based One-time Password Algorithm)&lt;/h4&gt;

&lt;p&gt;Keeping a counter can be difficult and may need an extremely large sliding window, for example if the authenticator is easily triggered by the user and gets out of sync after a while.&lt;/p&gt;

&lt;p&gt;TOTP specified in &lt;a href=&quot;https://tools.ietf.org/html/rfc6238&quot;&gt;RFC 6238&lt;/a&gt; is a rather small extension of HOTP to prevent this problem. It replaces the static counter value with the current time. To account for latencies during the input or in the network, time is usually down sampled to 30 second slices. To prevent brute force attacks, it is also advisable to rate limit any validation requests.&lt;/p&gt;

&lt;p&gt;By eliminating the counter, it adds the requirement for the authenticator to be in sync with the current time. This may be a problem on hardware, for example due to a low battery voltage and clock drift, but not if a smartphone application is used. Of course, not using dedicated tamperproof hardware may introduce other attack vectors.&lt;/p&gt;

&lt;h4 id=&quot;yubico-otp&quot;&gt;Yubico OTP&lt;/h4&gt;

&lt;p&gt;Yubico OTP seems to make use of the OATH-HOTP Algorithm and adds a YubiKey-ID as a prefix to the OTP for linking it to a specific pre-registered user id. Further parts are encrypted with a shared secret. To get a deeper look you can visit the &lt;a href=&quot;https://developers.yubico.com/OTP/OTPs_Explained.html&quot;&gt;documentation of the format&lt;/a&gt; or their PHP reference implementation &lt;a href=&quot;https://github.com/Yubico/yubikey-val&quot;&gt;yubikey-val on Github&lt;/a&gt;. More information about their opensource implementation can be found on the &lt;a href=&quot;https://developers.yubico.com/yubikey-val/&quot;&gt;yubikey-val developer documentation&lt;/a&gt;. &lt;a href=&quot;https://support.yubico.com/support/solutions/articles/15000006440-accidentally-triggering-otp-codes-with-your-nano-yubikey&quot;&gt;Accidently triggering OTPs&lt;/a&gt; and increasing the counter seems no problem by design because they simply accept the highest value (&lt;a href=&quot;https://github.com/Yubico/yubikey-val/blob/a850489d245c01c0f232db56af8ff0bfaa93fb21/ykval-verify.php&quot;&gt;see the validator implementation)&lt;/a&gt;. To mitigate attacks the counter is stored in the encrypted part of the OTP. It still seems advisable to add bruteforce protection in addition to their &lt;a href=&quot;https://developers.yubico.com/yubikey-ksm/Server_Hardening.html&quot;&gt;server hardening instructions&lt;/a&gt; if you try to run this on your own infrastructure.&lt;/p&gt;

&lt;p&gt;One of the selling points of Yubico OTP is that you can use their YubiCloud SaaS to validate your users OTPs. All YubiKeys come pre-registred with the cloud, which can be verified on their &lt;a href=&quot;https://demo.yubico.com/otp/verify&quot;&gt;demo page&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;[..] To use this your YubiKey must be configured to validate against our YubiCloud service. YubiKeys are shipped with this configuration by default.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This may be interesting if you can make use of the &lt;a href=&quot;https://developers.yubico.com/OTP/Libraries/List_of_libraries.html&quot;&gt;available connector libraries&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://www.yubico.com/products/services-software/yubicloud/&quot;&gt;description on their website&lt;/a&gt; doesn’t come along with many details and the most detailed information I could find is their &lt;a href=&quot;https://www.yubico.com/wp-content/uploads/2017/08/YubiCloud_OTP_ValidationService_1.2_en.pdf&quot;&gt;YubiCloud OTP Validation Service PDF&lt;/a&gt;. A wide range of software supporting the algorithm can be found on their &lt;a href=&quot;https://www.yubico.com/works-with-yubikey/catalog/#protocol=yubico-otp-(one-time-password)&amp;amp;usecase=all&amp;amp;key=all&quot;&gt;Works With page&lt;/a&gt; (also interesting for the other algorithms).&lt;/p&gt;

&lt;h2 id=&quot;fido2&quot;&gt;Fido2&lt;/h2&gt;

&lt;p&gt;Fido2 is a project founded by the &lt;a href=&quot;https://fidoalliance.org/&quot;&gt;Fido Alliance&lt;/a&gt; and the &lt;a href=&quot;https://www.w3.org/Consortium/&quot;&gt;W3C&lt;/a&gt;. Just to get over with the name dropping, fido means: Google, Amazon, Thales, Lenovo, Microsoft, Infineon, VMWare, RSA, Yubico, and a lot of others, see the &lt;a href=&quot;https://fidoalliance.org/members/&quot;&gt;fido member list&lt;/a&gt; for more details.&lt;/p&gt;

&lt;h3 id=&quot;ctap-webauthn-and-uaf&quot;&gt;CTAP, WebAuthN and UAF&lt;/h3&gt;

&lt;p&gt;WebAuthN is &lt;a href=&quot;https://www.w3.org/TR/webauthn/&quot;&gt;“An API for accessing Public Key Credentials”&lt;/a&gt; and a W3C recommendation. It is a browser api accessible via Javascript which can create keypairs and authenticate a user with a previously stored key. Code examples can be found at the &lt;a href=&quot;https://webauthn.guide/#looking-ahead&quot;&gt;WebAuthN Guide&lt;/a&gt;, a demo and more references to implementations can be found at the &lt;a href=&quot;https://webauthn.io/&quot;&gt;WebAuthN Demo Page&lt;/a&gt;.
During the authentication process the client signs a nonce with a key specific for the domain it tries to authenticate to. This makes phishing impossible, since an attacker will operate from another domain name and therefore get a useless signature.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html&quot;&gt;The Client To Authenticator Protocol (CTAP)&lt;/a&gt; is a proposed standard of the fido alliance to make roaming authenticators like a usb security key or a smartphone accessible for clients, for example a web browser. It’s the counterpart for WebAuthN. All the major browsers do support or currently implement CTAP.&lt;/p&gt;

&lt;p&gt;The current state of the CTAP and WebAuthN adoption is summarized at the fido alliance’s posting &lt;a href=&quot;https://fidoalliance.org/fido2/fido2-web-authentication-webauthn/&quot;&gt;“FIDO2: Web Authentication (WebAuthn)”&lt;/a&gt;. It differs depending on the underlying operation system and hardware connection. Support for WebAuthN is available in &lt;a href=&quot;https://caniuse.com/#feat=webauthn&quot;&gt;major browsers&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://fidoalliance.org/specs/fido-uaf-v1.2-rd-20171128/fido-uaf-overview-v1.2-rd-20171128.html#fido-uaf-goals&quot;&gt;Universal Authentification Framework (UAF)&lt;/a&gt; provides a framework for registering a device as an authenticator and use this device instead of a password.&lt;/p&gt;

&lt;p&gt;The fido alliance provides a &lt;a href=&quot;https://fidoalliance.org/specifications/&quot;&gt;“Specification Overview”&lt;/a&gt; with the proper use-cases.&lt;/p&gt;

&lt;h3 id=&quot;u2f-universal-2nd-factor&quot;&gt;U2F (Universal 2nd Factor)&lt;/h3&gt;

&lt;p&gt;U2F is the result of a collaboration between Google, Yubico and the hardware manufacturer NXP Semiconductors. The idea was to push stronger authentication by using a dedicated hardware security key to generate a strong second factor. This makes it possible to use a weak and easy to remember password for your online accounts. The standard laid the groundwork for the others and is now referenced as CTAP 1 and governed by the fido alliance.&lt;/p&gt;

&lt;h2 id=&quot;which-otp-standard-should-i-use&quot;&gt;Which OTP Standard should I use?&lt;/h2&gt;

&lt;p&gt;This will mostly depend on the supported OTP algorithms of the relying parties  you are trying to authenticate with. Most of the online services which support 2FA will give you the possibility to use OATH-TOTP with an application on your mobile phone, such as the &lt;a href=&quot;https://en.wikipedia.org/wiki/Google_Authenticator&quot;&gt;Google Authenticator&lt;/a&gt; or &lt;a href=&quot;https://freeotp.github.io/&quot;&gt;FreeOTP&lt;/a&gt; sponsored by RedHat. Usually the configuration parameters are transferred via a QR code.&lt;/p&gt;

&lt;p&gt;If you are the owner of a YubiKey you will find wide support for Yubico OTP which you might prefer to plain OATH-HOTP. Most of the services offering Yubico OTP will depend on their free cloud service. For me this wasn’t an issue for several years now. Other security keys might just support Fido U2F.&lt;/p&gt;

&lt;p&gt;Other aspects of the fido2 protocols go beyond only OTPs and may be subject of another blogpost.&lt;/p&gt;</content><author><name>Simon Kölsch</name></author><category term="2fa" /><category term="fido2" /><category term="u2f" /><category term="oath" /><category term="oath-hotp" /><category term="oath-totp" /><category term="yubico-otp" /><category term="otp" /><summary type="html">I felt like upgrading my Yubikey to a USB-C version and use that opportunity to dive a little bit deeper into the different OTP specs and how I want to use my second factor. Still falling down the rabbit hole, but here is some kind of overview of fido2, u2f, oath-hotp, yubico-otp and others…</summary></entry><entry><title type="html">Don’t use security questions!</title><link href="https://alicebobandeve.org/blog/best-practices/2019/10/07/dont-use-security-questions/" rel="alternate" type="text/html" title="Don't use security questions!" /><published>2019-10-07T00:00:00-05:00</published><updated>2019-10-07T00:00:00-05:00</updated><id>https://alicebobandeve.org/blog/best-practices/2019/10/07/dont-use-security-questions</id><content type="html" xml:base="https://alicebobandeve.org/blog/best-practices/2019/10/07/dont-use-security-questions/">&lt;p&gt;The railway company Deutsche Bahn just added security questions to their booking application, or at least bothers me to add some. It’s 2019 and we all should know by now, that this kind of measures weaken security. Let’s see why…&lt;/p&gt;

&lt;p&gt;“Security Questions” are one of the more or less common mechanisms trying to improve the security of your online account. It’s an easy way to reauthenticate yourself, should you ever lose your password and get locked out of your account. Usually during account registration you not only get to choose your password, you also get to choose your own personal question and an appropriate answer to it. To prevent users from selecting some apparently dumb and easy to guess question (for example: “What color is the sky?”), they typically can choose from different options.&lt;/p&gt;

&lt;p&gt;In case you get locked out of your account, present your personal “&lt;a href=&quot;https://en.wikipedia.org/wiki/Open_Sesame_(phrase)&quot;&gt;Open Sesame&lt;/a&gt;” and gain again access to reset your password. You might have to prove owning or having access to the e-mail address you registered your account with, but there are often other channels to bypass additional checks. Customer hotlines are one of the examples for this.&lt;/p&gt;

&lt;h2 id=&quot;examples-from-the-deutsche-bahn-app&quot;&gt;Examples from the Deutsche Bahn App&lt;/h2&gt;

&lt;p&gt;“Security Questions” are also called “Shared Secrets” which is a form of static knowledge-based authentication (KBA). Sharing something secret might not sound like a good idea, but it has to be something only you know to keep access to your account secure, right?&lt;/p&gt;

&lt;picture&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/db-app-security-questions-600-27dd43.webp 600w, /assets/article-images/db-app-security-questions-900-27dd43.webp 900w, /assets/article-images/db-app-security-questions-1125-27dd43.webp 1125w&quot; type=&quot;image/webp&quot; /&gt;&lt;source sizes=&quot;(max-width: 600px) 80vw, 500px&quot; srcset=&quot;/assets/article-images/db-app-security-questions-600-27dd43.png 600w, /assets/article-images/db-app-security-questions-900-27dd43.png 900w, /assets/article-images/db-app-security-questions-1125-27dd43.png 1125w&quot; type=&quot;image/png&quot; /&gt;&lt;img class=&quot;article-image&quot; src=&quot;/assets/article-images/db-app-security-questions-800-27dd43.png&quot; alt=&quot;Screenshot of the App displaying the mentioned questions from the article&quot; /&gt;&lt;/picture&gt;

&lt;p&gt;Here are the questions Deutsche Bahn lets you choose from:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What is your mother’s maiden name?&lt;/li&gt;
  &lt;li&gt;What is the number of one of your customer cards or IDs?&lt;/li&gt;
  &lt;li&gt;What is your favorite book?&lt;/li&gt;
  &lt;li&gt;What is your favorite film?&lt;/li&gt;
  &lt;li&gt;What was the name of your first teacher?&lt;/li&gt;
  &lt;li&gt;What was the name of your first best friend?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Wait… what?&lt;/p&gt;

&lt;h2 id=&quot;lets-have-a-closer-look&quot;&gt;Let’s have a closer look&lt;/h2&gt;

&lt;p&gt;I’m pretty sure we can skip figuring out a favorite book or film. We live in a world where you get achievements for completing your social media profile, have some ask-me-anything-via-twitter-aaS and leave a lot of traces in the world wide web.&lt;/p&gt;

&lt;p&gt;It might be pretty easy to figure out a first teacher if you have any kind of online resume or are of course connected to one of the “Did we went to school together” platforms. Sometimes an attacker can connect independent information and link it to you. Who knows that shared secret? You, good friends, your school, your teachers, everyone of the 25 people you went to school with, their parents, maybe the pupils magazine, maybe some archived newspaper article about the great role you played in theatre class. Maybe you didn’t publish this information anywhere online but the attacker can guess your cohort, your school decides to go fully digital and publishes an alumni list without your knowledge and so on.&lt;/p&gt;

&lt;p&gt;You may never answer this question in a conversation, but think of the possibilities of good social engineering? Who knows your mothers maiden name? What about a “lost friend” calling your husband or wife, pretending to search for someone? Will they correct a caller if he mentions a wrong name? If you look at a large user base, how likely is it that an attacker can simply guess the most common surnames? According to &lt;a href=&quot;https://en.wikipedia.org/wiki/German_name#Common_surnames&quot;&gt;Wikipedia the most common German Surnames&lt;/a&gt; are Müller, Schmidt, Schneider, Fischer, Weber, Meyer*, Wagner, Schulz, Becker and Hoffmann. At least five of them match for people in my circle of friends. Attackers might not even target especially you, they could be just be out for fishing.&lt;/p&gt;

&lt;p&gt;A special note about using numbers from “customer cards or IDs”:
Using something like the number of your ID is a pretty bad idea. This information is sometimes used to identify you and should be handled carefully, like a credit card number for example. The difference is that credit card numbers are usually handled according to PCI DSS requirements and not stored in plaintext fields which can be revealed by yourself or the support staff member on the hotline.
Besides that, remember the &lt;a href=&quot;https://info.starwoodhotels.com/&quot;&gt;Marriott / Starwood Security Incident&lt;/a&gt;)?&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Marriott believes that approximately 5.25 million unencrypted passport numbers were included in the information accessed by an unauthorized third party. The information accessed also includes approximately 18.5 million encrypted passport numbers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And yes, in the German version, they call it “Ausweis”, which is usually your passport.&lt;/p&gt;

&lt;p&gt;If your data was leaked through the &lt;a href=&quot;https://en.wikipedia.org/wiki/Ashley_Madison_data_breach&quot;&gt;Ashley Madison breach&lt;/a&gt;, “data” means also &lt;a href=&quot;https://insecurityq.wordpress.com/2015/08/25/insights-into-security-questions-from-ashley-madison/&quot;&gt;your security questions and answers&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;being-a-smartass-about-the-answers&quot;&gt;Being a smartass about the answers&lt;/h2&gt;

&lt;p&gt;You might have thought of something super super secret you are sure nobody will ever guess as your secret answer. Maybe you even made it up, used a book which doesn’t exist or secretly renamed your mother.&lt;/p&gt;

&lt;p&gt;Lucky you, but that’s not the point. The question is if this a good practice which increases security or if this a bad practice which decreases security. It’s not about the one single smart user, it’s about the pattern itself and its usefulness in the broad field.&lt;/p&gt;

&lt;p&gt;Beside that, making things up or even answering with random garbage is like having a second password. Are you sure you will remember it in case you lost your password after some time? If not, you would have to store it in safe place, maybe a password manager. If you have a password manager you could also store the original password in there.&lt;/p&gt;

&lt;h2 id=&quot;what-does-the-nist-say-&quot;&gt;What does the NIST say? 🦊&lt;/h2&gt;

&lt;p&gt;The National Institute of Standards and Technology (NIST) is an US federal agency providing standards, guidelines and best practices around several topcis, IT security included. Besides some questionable ties to the NSA (see &lt;a href=&quot;https://fcw.com/articles/2013/09/06/nsa-nist-standards.aspx&quot;&gt;“What NSA’s influence on NIST standards means for feds&lt;/a&gt; and the debate around SP 800-90) it definitely makes sense to consider their recommendations.&lt;/p&gt;

&lt;p&gt;NIST issues regularly &lt;a href=&quot;https://csrc.nist.gov/glossary/term/NIST-Special-Publication&quot;&gt;“Special Publications”&lt;/a&gt; and around ~ 170 papers prefixed with &lt;a href=&quot;https://csrc.nist.gov/publications/sp800&quot;&gt;800- are focused on computer security&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://pages.nist.gov/800-63-3/sp800-63-3.html&quot;&gt;SP-800-63 Digital Identity Guidelines&lt;/a&gt; focuses among other things on the problem of claiming a virtual identity by linking your real-world identity to it. This comes in different levels and is called Identity Assurance Level. Linking your real-world identity without physical presence, which is what one would try to achieve by security questions, is called &lt;a href=&quot;https://pages.nist.gov/800-63-3/sp800-63a.html#sec2&quot;&gt;IAL2&lt;/a&gt;. They are a way to verify a knowledge based secret (KBV), so we can look up the recommended requirements of SP-800-63 &lt;a href=&quot;https://pages.nist.gov/800-63-3/sp800-63a.html#kbv&quot;&gt;5.3.2 Knowledge-Based Verification Requirements&lt;/a&gt;. Some of the mentioned requirements are:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;b. The CSP SHALL require a minimum of four KBV questions with each requiring a correct answer to successfully complete the KBV step.&lt;/p&gt;

  &lt;p&gt;c. The CSP SHOULD require free-form response KBV questions.[..]&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;g. The CSP SHOULD NOT ask the same KBV questions in subsequent attempts.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;i. The CSP SHALL NOT use KBV questions for which the answers do not change (e.g., “What was your first car?”).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, minimum of 4 questions, free-form, not ask the same questions in subsequent attempts, no static answers. None of the questions qualify for this subset of the guideline.
They are still not a good idea, but at least you should implement them by the recommendations, if you have to. Sounds like a horrible UX experience, but &lt;a href=&quot;https://krebsonsecurity.com/2016/08/united-airlines-sets-minimum-bar-on-security/&quot;&gt;United Airlines roled those out in 2016&lt;/a&gt; and also people over at the &lt;a href=&quot;https://support.apple.com/en-us/HT201485&quot;&gt;UX-Wonder-Factory Apple&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Since these guidelines can get quiet long and complicated NIST maintains a FAQ for some of them. The &lt;a href=&quot;https://pages.nist.gov/800-63-FAQ/&quot;&gt;FAQ for SP-800-63&lt;/a&gt; contains two question about the topic:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://pages.nist.gov/800-63-FAQ/#q-b07&quot;&gt;Is use of knowledge-based authentication permitted?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://pages.nist.gov/800-63-FAQ/#q-b15&quot;&gt;Is it permissible to use sets of questions and answers stored by the subscriber for password reset?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Short answer, no:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Knowledge-based authentication, where the claimant is prompted to answer questions that are presumably known only by the claimant, also does not constitute an acceptable secret for digital authentication.&lt;/p&gt;

  &lt;p&gt;KBA for password reset would leave the account vulnerable to takeover. Alternative authenticators for password reset include lists of look-up secrets and out-of-band device authentication.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But do they really leave your account “vulnerable to takeover”? Let’s see…&lt;/p&gt;

&lt;h2 id=&quot;other-research-and-examples-where-security-questions-screwed-people-over&quot;&gt;Other Research and examples where Security Questions screwed people over&lt;/h2&gt;

&lt;p&gt;There was some research conducted by Stuart Schechter A.J. Brush and Serge Egelman at Microsoft resulting in a paper &lt;a href=&quot;https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/oakland09.pdf&quot;&gt;“It’s no secret - Measuring the security and reliability of authentication via ‘secret’ questions (PDF)”&lt;/a&gt;. 
Quoted directly from the conclusion of the paper:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The security of personal questions appears significantly weaker than passwords. Acquaintances with whom participants reported being unwilling to share their Hotmail passwords were able to guess 17% of answers. For our geographically-homogenous sample, 13% of answers could be guessed by iterating through the five most popular answers of other users. Userwritten questions were no better: roughly half were vulnerable to guessing by either acquaintances or those who had never met the account holder.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Btw. following their own advice may have had spared them a Talk at 2018 Blackhat: &lt;a href=&quot;https://i.blackhat.com/eu-18/Wed-Dec-5/eu-18-Baz-When-Everyones-Dog-Is-Named-Fluffy.pdf&quot;&gt;When everyone’s dog is named Fluffy - Abusing the brand-new security questions in Windows 10 to gain domain-wide persistence (PDF Blackhat Slides).&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If still in doubt, here is a selection of cases which gained a more ore less broader audience,  involving “Security Questions”:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://slate.com/technology/2008/01/why-are-bank-security-questions-so-monstrously-stupid.html&quot;&gt;Slate: Paris Hiltons T-Mobile Account and her favorite’s pet name (2005)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Sarah_Palin_email_hack&quot;&gt;Wikipedia: Sarah Palin’s E-Mail Account (2008)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.latimes.com/archives/la-xpm-2012-jun-05-la-pn-mitt-romneys-personal-email-account-allegedly-hacked-20120605-story.html&quot;&gt;LA Times: Have they no Seamus? Tipster claims hack of Romney email (2012)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.wired.com/2016/09/time-kill-security-questions-answer-lies/&quot;&gt;Wired: Time to Kill Security Questions—or Answer Them With Lies (500 million yahoo accounts with questions)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.kaspersky.com/blog/security-questions-are-insecure/13004/&quot;&gt;KasperskyLabs: How I hacked my Apple ID security questions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Stop using them, use better alternatives like mentioned by the NIST: A pre-defined list of emergency recovery codes or out-of-band communication like a SMS. If you have to implement them, do it according to  the SP-800-63 requirements.&lt;/p&gt;

&lt;p&gt;What better closing then a quote of Bruce Schneiers essay &lt;a href=&quot;https://www.schneier.com/blog/archives/2005/02/the_curse_of_th.html&quot;&gt;“The Curse of the Secret Question”&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Passwords have reached the end of their useful life. Today, they only work for low-security applications. The secret question is just one manifestation of that fact.&lt;/p&gt;
&lt;/blockquote&gt;</content><author><name>Simon Kölsch</name></author><summary type="html">The railway company Deutsche Bahn just added security questions to their booking application, or at least bothers me to add some. It’s 2019 and we all should know by now, that this kind of measures weaken security. Let’s see why…</summary></entry></feed>