<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>security on irq5 test</title><link>https://irq5-7854a1fdb9f4.pages.dev/tag/security/</link><description>Recent content in security on irq5 test</description><language>en-us</language><lastBuildDate>Fri, 02 Jul 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://irq5-7854a1fdb9f4.pages.dev/tag/security/feed/" rel="self" type="application/rss+xml"/><item><title>Using U2F for Door Access Control Systems</title><link>https://irq5-7854a1fdb9f4.pages.dev/2021/07/using-u2f-for-door-access-control-systems/</link><pubDate>Fri, 02 Jul 2021 00:00:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2021/07/using-u2f-for-door-access-control-systems/</guid><description>&lt;p>I was looking at trying to &lt;em>securely&lt;/em> implement a door access control system.
This usually involves some kind of card that you tap at a reader and the door unlocks.&lt;/p>&lt;p>Because it uses NFC, the NFC reader and electronics can be
located safely on the inside, leaving no exposed DIY electronics on the outside for attackers to fiddle around with.
Here&amp;rsquo;s an example project using a 3D-printed enclosure:&lt;/p>&lt;p>&lt;picture>&lt;source srcset=/posts/2021/img/nfc-lock-qtechknow-FFOTW1TI7L6T5HL.jpg.webp type=image/webp>&lt;img src=https://irq5-7854a1fdb9f4.pages.dev/posts/2021/img/nfc-lock-qtechknow-FFOTW1TI7L6T5HL.jpg alt="photo of a DIY NFC door lock found on Instructables.com, with all the electronics &amp; parts on the interior side of the door" width=1620 height=1080>&lt;/picture>&lt;/p>&lt;p>A lot of those DIY projects &lt;em>work&lt;/em>, but they are just not secure:&lt;/p>&lt;ul>&lt;li>&lt;a href=http://www.instructables.com/NFC-Door-Lock-with-the-Qduino-Mini-under-100/ rel=noopener target=_blank class=external>NFC Door Lock With the Qduino Mini &amp;ndash; Instructables.com&lt;/a>&lt;/li>&lt;li>&lt;a href=http://keyduino.forumsactifs.com/t4-nfc-drawer-lock rel=noopener target=_blank class=external>NFC drawer lock&lt;/a>&lt;/li>&lt;li>&lt;a href=https://www.makeuseof.com/tag/diy-smart-lock-arduino-rfid/ rel=noopener target=_blank class=external>DIY Smart Lock with Arduino and RFID&lt;/a>&lt;/li>&lt;/ul>&lt;p>Just look at the code and you will see what I mean.
They generally look like this:&lt;/p>&lt;div class=highlight role=region aria-label="code block" translate=no>&lt;pre tabindex=0 class=chroma>&lt;code class=language-c data-lang=c>&lt;span class=line>&lt;span class=cl>&lt;span class=kt>uint32_t&lt;/span> &lt;span class=n>uid&lt;/span> &lt;span class=o>=&lt;/span> &lt;span class=n>nfc&lt;/span>&lt;span class=p>.&lt;/span>&lt;span class=n>readCardId&lt;/span>&lt;span class=p>();&lt;/span> &lt;span class=c1 translate>// read the card&amp;#39;s unique ID
&lt;/span>&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl>&lt;span class=c1 translate>&lt;/span>&lt;span class=k>if&lt;/span> &lt;span class=p>(&lt;/span>&lt;span class=n>uid&lt;/span> &lt;span class=o>==&lt;/span> &lt;span class=mh>0xAAAAAAAA&lt;/span> &lt;span class=o>||&lt;/span> &lt;span class=n>uid&lt;/span> &lt;span class=o>==&lt;/span> &lt;span class=mh>0xBBBBBBBB&lt;/span> &lt;span class=o>||&lt;/span> &lt;span class=p>...)&lt;/span> &lt;span class=p>{&lt;/span>
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> &lt;span class=n>unlock&lt;/span>&lt;span class=p>();&lt;/span> &lt;span class=c1 translate>// YES!!
&lt;/span>&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl>&lt;span class=c1 translate>&lt;/span>&lt;span class=p>}&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Unfortunately, consumer smart locks like a Yale or Samsung do pretty much the same thing,
without hard-coding UIDs of course.
When you enroll cards, the door lock will simply record the UID and will unlock
when you present a card (or tag) with that UID.
&lt;a href=https://learn.adafruit.com/adafruit-pn532-rfid-nfc/mifare rel=noopener target=_blank class=external>MIFARE Classic cards&lt;/a>
are commonly used for this purpose because they are very inexpensive.
They are factory-programmed with a unique identifier stored in sector 0,
which is read-only.&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2021/07/using-u2f-for-door-access-control-systems/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Data Encryption on Firefox Send</title><link>https://irq5-7854a1fdb9f4.pages.dev/2019/05/data-encryption-on-firefox-send/</link><pubDate>Tue, 14 May 2019 11:59:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2019/05/data-encryption-on-firefox-send/</guid><description>&lt;p>If you haven&amp;rsquo;t heard, &lt;a href=https://send.firefox.com/ rel=noopener target=_blank class=external>Firefox Send&lt;/a> is a service
that solves the problem of sending large attachments without going through email.
It does this in a privacy-preserving manner by encrypting the file in your browser first, before upload.&lt;/p>&lt;p>The concept is simple:&lt;/p>&lt;ol>&lt;li>An encryption key is generated in your browser&lt;/li>&lt;li>Your file is encrypted with that key before being uploaded to the server.&lt;/li>&lt;li>The download URL is returned by the server,
but will only work after the browser appends the secret key to the URL &lt;em>fragment&lt;/em>.&lt;/li>&lt;/ol>&lt;p>Note that URL fragments are never sent to the server.
They are often used for page anchors, and sometimes to keep track of local state in SPA.&lt;/p>&lt;p>This has been made possible through the use of &lt;a href=https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API rel=noopener target=_blank class=external>Web Crypto API&lt;/a> exposed via JavaScript.&lt;/p>&lt;h1 id=technical-details>Technical Details&lt;/h1>&lt;p>The code that powers &lt;a href=https://github.com/mozilla/send rel=noopener target=_blank class=external>Firefox Send is actually open source&lt;/a>,
so you can run your own server, or read the code to figure out exactly how it works.
The encryption details are documented in &lt;a href=https://github.com/mozilla/send/blob/master/docs/encryption.md rel=noopener target=_blank class=external>docs/encryption.md&lt;/a>.&lt;/p>&lt;p>A master key is first generated and from it, a few keys are derived using HKDF SHA-256.
The derived key length depends on its purpose, so for AES-128 encryption, the key will be 128-bit. Oddly though, the Subtle Crypto API returns a a 512-bit key for HMAC SHA-256, which had me stumped for a while.
I wrote some code that you can &lt;a href=https://gist.githack.com/geekman/f9735602f744ebe5fa812f8ba17518c4/raw/webcrypto-hdkf.html rel=noopener target=_blank class=external>try out online&lt;/a>.&lt;/p>&lt;p>Because HKDF is based on a hash algorithm, derived keys are inherently not reversible to obtain the master key from which they were derived (unless the algorithm itself is somehow broken).&lt;/p>&lt;p>3 keys are derived from the master key:&lt;/p>&lt;ol>&lt;li>&lt;strong>Data Encryption key&lt;/strong>. Used to encrypt the actual file contents.&lt;/li>&lt;li>&lt;strong>Authentication key.&lt;/strong> Given to the service and used to authenticate future downloaders.&lt;/li>&lt;li>&lt;strong>Metadata key.&lt;/strong> Used to encrypt the upload manifest (filename and size information) for display.&lt;/li>&lt;/ol>&lt;p>&lt;picture>&lt;source srcset=/posts/2019/img/ffsend-keys.png.webp type=image/webp>&lt;img src=https://irq5-7854a1fdb9f4.pages.dev/posts/2019/img/ffsend-keys.png alt="keys derived in Firefox Send" width=1574 height=491>&lt;/picture>&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2019/05/data-encryption-on-firefox-send/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Crypto-Erasing BitLocker Drives</title><link>https://irq5-7854a1fdb9f4.pages.dev/2018/05/crypto-erasing-bitlocker-drives/</link><pubDate>Thu, 10 May 2018 12:45:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2018/05/crypto-erasing-bitlocker-drives/</guid><description>&lt;p>These days with larger and larger drive capacities, erasing stored data takes longer and longer.
Another problem is also the inability to do so when the time comes, due to bad sectors or hardware failures.
Just because the data is not accessible by you does not mean that
it is also inaccessible to someone else with the know-how.&lt;/p>&lt;p>&lt;strong>&lt;em>Cryptographic erasure&lt;/em> to the rescue!&lt;/strong>&lt;/p>&lt;p>Crypto erase simply erases the encryption key that is used to encrypt the data on your drive.
This is the &lt;a href=https://irq5-7854a1fdb9f4.pages.dev/2014/04/encrypt-all-the-drives/ rel=noopener>primary reason why&lt;/a> I encrypt my drives.&lt;/p>&lt;p>Oddly, I have not found anyone talking about BitLocker crypto erasure or doing it.
The closest I have seen is &lt;a href=https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/manage-bde-forcerecovery rel=noopener target=_blank class=external>&lt;code>manage-bde -forcerecovery&lt;/code>&lt;/a>, which removes all TPM-related key protectors.
This is briefly described in a TechNet article titled &lt;a href=https://technet.microsoft.com/en-us/library/cc512654.aspx rel=noopener target=_blank class=external>BitLocker™ Drive Encryption and Disk Sanitation&lt;/a>.&lt;/p>&lt;p>But what if we are not running Windows?
What if the disk is not a Windows boot drive that is protected by a TPM key protector?&lt;/p>&lt;p>In order to erase the (key) data, we first need to know how the data is stored on disk.
For open-source FDE implementations,
this is easy because the disk format is well-documented,
but BitLocker is not exactly open.&lt;/p>&lt;h1 id=bitlocker-disk-format>BitLocker Disk Format&lt;/h1>&lt;p>BitLocker was first introduced in Windows Vista and has gone through changes since then.
Some changes were made to the format in Windows 7, but has largely remained unchanged through Windows 8 till 10.&lt;/p>&lt;p>For LUKS, it is simple - there is a LUKS header at the start of the disk, followed by the encrypted volume data.
For BitLocker, it is slightly more involved, probably due to backward-compatible design considerations.&lt;/p>&lt;p>The header at the start of the partition is a valid boot sector (or boot block), so not all BitLocker information can be stored within.
Instead, this volume header points to the FVE metadata block where most of the data is kept.
In fact, there are 3 of these for redundancy.
This metadata block is what holds all the key material.&lt;/p>&lt;p>The metadata blocks are spaced (almost) evenly apart,
located near the start of the volume.&lt;/p>&lt;div class=highlight role=region aria-label="code block" translate=no>&lt;pre tabindex=0 class=chroma>&lt;code class=language-fallback data-lang=fallback>&lt;span class=line>&lt;span class=cl># blwipe -offset 0x2010000 bitlocker-2gb.vhd
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl>metadata offset 0: 0x02100000
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl>metadata offset 1: 0x100c8000
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl>metadata offset 2: 0x1e08f000
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl>metadata block 0 (size 65536): parsed OK
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl>metadata block 1 (size 65536): parsed OK
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl>metadata block 2 (size 65536): parsed OK&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The first metadata block &lt;em>usually&lt;/em> begins at &lt;code>0x02100000&lt;/code>.
This illustration depicts the locations for a 2 GB volume:&lt;/p>&lt;p>&lt;picture>&lt;img src=https://irq5-7854a1fdb9f4.pages.dev/posts/2018/img/fve-md-disk-layout.png alt="Diagram of disk layout with FVE metadata blocks marked out" width=1145 height=279>&lt;/picture>&lt;/p>&lt;p>If there are 3 of these blocks, how do we know know which ones contain valid data?&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2018/05/crypto-erasing-bitlocker-drives/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Framework for Writing Flexible Bruteforcers</title><link>https://irq5-7854a1fdb9f4.pages.dev/2017/08/framework-for-writing-flexible-bruteforcers/</link><pubDate>Wed, 30 Aug 2017 01:01:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2017/08/framework-for-writing-flexible-bruteforcers/</guid><description>&lt;p>When writing a bruteforcer, it&amp;rsquo;s easiest to think of it as mapping some kind of
output to a monotonically-increasing number.&lt;/p>&lt;p>Like for one of the solved PlaidCTF question, the answer string was composed from the eight letters &amp;ldquo;plaidctf&amp;rdquo;,
which conveniently is a power of 2, meaning each output character can be represented with 3 bits.
To write a bruteforcer for a string composed of these characters,
you might imagine generating a 3-bit number (i.e. from 0 to 7)
then mapping it to the character set for one output character,
or a 30-bit number if the output string was 10 characters.
Unsurprisingly, this was &lt;a href=https://gist.github.com/geekman/6b749c6dcb6acd6ba1d2/d69f852e30374376ce8a9cd4a65e49c72d4ef991 rel=noopener target=_blank class=external>exactly what I did&lt;/a> for my solver script.
The output string was generated from a &lt;em>BitVector&lt;/em> of &lt;code>171 * 3&lt;/code> bits.&lt;/p>&lt;p>But what if the output was composed of several different pieces that cannot be
represented uniformly as a set of bits?&lt;/p>&lt;p>One solution might be to emulate such a behaviour using an array of integers, like
how I &lt;a href=https://irq5-7854a1fdb9f4.pages.dev/2016/08/labyrenth-2016-write-up-regex/ rel=noopener>modified my solver script in version 2&lt;/a>
to handle a character set of arbitrary length.&lt;/p>&lt;p>In this post, I will walk-through writing a basic, but flexible, bruteforcer
with accompanying code snippets in &lt;a href=https://golang.org/ rel=noopener target=_blank class=external>Go&lt;/a>.&lt;/p>&lt;h1 id=keeping-state>Keeping State&lt;/h1>&lt;p>Continuing on the CTF puzzle, the &lt;em>BitVector&lt;/em> was replaced with an array of &lt;code>Int&lt;/code>s.
Each &lt;code>Int&lt;/code> will represent one character of the output string.
We can thus represent the state like so (for simplicity,
let&amp;rsquo;s limit the output string to 2 characters):&lt;/p>&lt;div class=highlight role=region aria-label="code block" translate=no>&lt;pre tabindex=0 class=chroma>&lt;code class=language-go data-lang=go>&lt;span class=line>&lt;span class=cl>&lt;span class=kd>type&lt;/span> &lt;span class=nx>state&lt;/span> &lt;span class=kd>struct&lt;/span> &lt;span class=p>{&lt;/span>
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> &lt;span class=nx>digit&lt;/span> &lt;span class=p>[&lt;/span>&lt;span class=mi>2&lt;/span>&lt;span class=p>]&lt;/span>&lt;span class=kt>int&lt;/span>
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl>&lt;span class=p>}&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>In order to increment each digit, we can write a function that increments
&lt;code>state.digit&lt;/code> until a certain number, then resets it to zero.&lt;/p>&lt;p>To make it generic, we will write a function that returns another function that
manipulates a digit position, so we don&amp;rsquo;t have to copy &amp; paste the code for
each digit position:&lt;/p>&lt;div class=highlight role=region aria-label="code block" translate=no>&lt;pre tabindex=0 class=chroma>&lt;code class=language-go data-lang=go>&lt;span class=line>&lt;span class=cl>&lt;span class=c1 translate>// returns a function that manipulates the digit at given pos
&lt;/span>&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl>&lt;span class=c1 translate>&lt;/span>&lt;span class=kd>func&lt;/span> &lt;span class=nf>digitManipulator&lt;/span>&lt;span class=p>(&lt;/span>&lt;span class=nx>pos&lt;/span> &lt;span class=kt>int&lt;/span>&lt;span class=p>)&lt;/span> &lt;span class=kd>func&lt;/span>&lt;span class=p>(&lt;/span>&lt;span class=o>*&lt;/span>&lt;span class=nx>state&lt;/span>&lt;span class=p>)&lt;/span> &lt;span class=kt>bool&lt;/span> &lt;span class=p>{&lt;/span>
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> &lt;span class=k>return&lt;/span> &lt;span class=kd>func&lt;/span>&lt;span class=p>(&lt;/span>&lt;span class=nx>s&lt;/span> &lt;span class=o>*&lt;/span>&lt;span class=nx>state&lt;/span>&lt;span class=p>)&lt;/span> &lt;span class=kt>bool&lt;/span> &lt;span class=p>{&lt;/span>
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> &lt;span class=nx>s&lt;/span>&lt;span class=p>.&lt;/span>&lt;span class=nx>digit&lt;/span>&lt;span class=p>[&lt;/span>&lt;span class=nx>pos&lt;/span>&lt;span class=p>]&lt;/span>&lt;span class=o>++&lt;/span>
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> &lt;span class=k>if&lt;/span> &lt;span class=nx>s&lt;/span>&lt;span class=p>.&lt;/span>&lt;span class=nx>digit&lt;/span>&lt;span class=p>[&lt;/span>&lt;span class=nx>pos&lt;/span>&lt;span class=p>]&lt;/span> &lt;span class=o>==&lt;/span> &lt;span class=nx>MAX_NUMBER&lt;/span> &lt;span class=p>{&lt;/span>
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> &lt;span class=nx>s&lt;/span>&lt;span class=p>.&lt;/span>&lt;span class=nx>digit&lt;/span>&lt;span class=p>[&lt;/span>&lt;span class=nx>pos&lt;/span>&lt;span class=p>]&lt;/span> &lt;span class=p>=&lt;/span> &lt;span class=mi>0&lt;/span>
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> &lt;span class=k>return&lt;/span> &lt;span class=kc>true&lt;/span>
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> &lt;span class=p>}&lt;/span>
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> &lt;span class=k>return&lt;/span> &lt;span class=kc>false&lt;/span>
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl> &lt;span class=p>}&lt;/span>
&lt;/span>&lt;/span>&lt;span class=line>&lt;span class=cl>&lt;span class=p>}&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>We will talk more about the boolean return value later.&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2017/08/framework-for-writing-flexible-bruteforcers/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Cracking iTunes Backup Passwords with Hashcat</title><link>https://irq5-7854a1fdb9f4.pages.dev/2017/03/cracking-itunes-backup-passwords-with-hashcat/</link><pubDate>Tue, 07 Mar 2017 01:00:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2017/03/cracking-itunes-backup-passwords-with-hashcat/</guid><description>&lt;p>Following the recent &lt;a href=https://hashcat.net/forum/thread-6225.html rel=noopener target=_blank class=external>announcement of LUKS support in hashcat&lt;/a>,
I noticed that there have been
&lt;a href=https://github.com/hashcat/hashcat/commit/9327475b41d4ac1dde40ba0ef1a9ef097f2b7216 rel=noopener target=_blank class=external>some&lt;/a>
&lt;a href=https://github.com/hashcat/hashcat/commit/07c89833c922bd4980f9bee489fc0d73725380de rel=noopener target=_blank class=external>commits&lt;/a>
to support iTunes Backup passwords as well.&lt;/p>&lt;p>[tweet https://twitter.com/hashcat/status/824713111118684160]&lt;/p>&lt;p>This is only useful if the backup was encrypted by setting a backup password on the iOS device.
If the backup is not encrypted then all the files are in clear and there is nothing to bruteforce.&lt;/p>&lt;p>&lt;strong>The keys used to encrypt the backup are stored in the &lt;em>BackupKeyBag&lt;/em>&lt;/strong>,
which can be found in the &lt;code>Manifest.plist&lt;/code> file.
This keybag is a binary blob, the format of which has already been &lt;a href=http://esec-lab.sogeti.com/static/publications/11-hitbamsterdam-iphonedataprotection.pdf rel=noopener target=_blank class=external>documented by researchers&lt;/a> from Sogeti ESEC Lab.&lt;/p>&lt;p>I have &lt;a href=https://gist.github.com/geekman/0aaa9e4659977a98fc9f36d6887fef37 rel=noopener target=_blank class=external>written a simplified script&lt;/a>
which dumps the &lt;code>BackupKeyBag&lt;/code>.
You will need the Python bindings from
&lt;a href=https://github.com/libimobiledevice/libplist rel=noopener target=_blank class=external>libplist&lt;/a> for the script to work.
If you cannot get it to work, you can try the
&lt;a href=https://github.com/philsmd/itunes_backup2hashcat rel=noopener target=_blank class=external>Perl script from philsmd&lt;/a> instead.&lt;/p>&lt;h1 id=speeding-up-ios-backups>Speeding up iOS Backups&lt;/h1>&lt;p>iOS device backups usually take a while,
depending on how much storage has been used on your device.&lt;/p>&lt;p>The iOS backup process is driven by the device itself, through the &lt;code>BackupAgent&lt;/code> process.
This process treats the host PC like a dumb disk store, by sending it commands&lt;br>like &lt;code>DLMessageCreateDirectory&lt;/code>, &lt;code>DLMessageUploadFiles&lt;/code>, &lt;code>DLMessageRemoveFiles&lt;/code>,
&lt;code>DLMessageGetFreeDiskSpace&lt;/code>, etc. so that it can determine what has been backed up previously
and what to send/update for incremental backups.&lt;/p>&lt;p>&lt;strong>For password cracking, we don&amp;rsquo;t need the entire 64 GB
(or God forbid, 128 GB) of data on the iOS device.&lt;/strong>
We just need the &lt;code>Manifest.plist&lt;/code>, which is typically less than 50 KB.
But because the backup process is controlled by the device and not the PC,
we can&amp;rsquo;t simply ask it to send over that single file.
Sometimes when we setup a VM with
libimobiledevice, we might also not have allocated such a large virtual disk.
Of course when I say &amp;ldquo;we&amp;rdquo;, I really mean &amp;ldquo;I&amp;rdquo;.&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2017/03/cracking-itunes-backup-passwords-with-hashcat/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Paper Shredder Repair</title><link>https://irq5-7854a1fdb9f4.pages.dev/2015/04/paper-shredder-repair/</link><pubDate>Mon, 06 Apr 2015 12:50:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2015/04/paper-shredder-repair/</guid><description>&lt;p>Now is probably a good time to mention that I have a paper shredder.
When I was shopping for a shredder, the basic requirement is that it must be relatively &amp;ldquo;secure&amp;rdquo;.
Straight cut shredders (that produce long straight strips) are definitely &lt;em>not secure&lt;/em>.&lt;/p>&lt;p>Ultimately I settled on the &lt;a href=http://www.amazon.co.jp/dp/B002UKPAEO rel=noopener target=_blank class=external>CARL DS-3000 personal paper shredder&lt;/a>.
The DS-3000 is a cross-cut shredder which produces &amp;ldquo;particles&amp;rdquo; no larger than
2mm x 4.5mm and this meets &lt;a href=//en.wikipedia.org/wiki/Paper_shredder#Types rel=noopener>DIN security level 4&lt;/a>.
These days, the NSA mandates 1mm x 5mm &amp;ldquo;particles&amp;rdquo; for classified documents.&lt;/p>&lt;p>At this point, it&amp;rsquo;s probably helpful to show you what my shredder bin looks like:&lt;/p>&lt;p>&lt;picture>&lt;source srcset=/posts/2015/img/shredder-confetti.jpg.webp type=image/webp>&lt;img src=https://irq5-7854a1fdb9f4.pages.dev/posts/2015/img/shredder-confetti.jpg alt="shredder confetti" width=1024 height=683>&lt;/picture>&lt;/p>&lt;p>From the particles, you can make out various truncated words such as &amp;ldquo;A/C&amp;rdquo;,
&amp;ldquo;exp&amp;rdquo; and the number &amp;ldquo;5&amp;rdquo;, but it&amp;rsquo;s almost impossible to reconstruct any bank
balances or personal information from it.&lt;/p>&lt;p>This particular model was the right balance between my budget and the level of security.
Plus, the shredder is compact enough to sit on your desk.
I bought it in 2009 and I use it every couple of months when I have accumulated
enough material that needs to be destroyed.&lt;/p>&lt;p>I was in the middle of shredding papers when it suddenly stopped working.
Now the shredder does not respond when I stick paper into its slot.
The LED indicator looks dimmer than usual when it is turned on.&lt;/p>&lt;p>But I&amp;rsquo;m not ready to give up on it just yet&amp;mldr;&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2015/04/paper-shredder-repair/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Interesting 31C3 Talks</title><link>https://irq5-7854a1fdb9f4.pages.dev/2015/01/interesting-31c3-talks/</link><pubDate>Fri, 02 Jan 2015 23:55:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2015/01/interesting-31c3-talks/</guid><description>&lt;p>&lt;picture>&lt;source srcset=/posts/2015/img/31c3-logo.png.webp type=image/webp>&lt;img src=https://irq5-7854a1fdb9f4.pages.dev/posts/2015/img/31c3-logo.png alt="31C3 logo 'a new dawn'" width=128 height=151>&lt;/picture>&lt;/p>&lt;p>The 31st Chaos Communication Congress (31C3) ended just 3 days ago, and there were several interesting talks.&lt;/p>&lt;p>They have got live streaming of the event over the web, as well as encourage you to use an external player with RTMP or HLS support. The video streams were very reliable and best of all, it&amp;rsquo;s available in HD.
In comparison, I tried the Apple live event once and it was really crappy. For one, the HLS&lt;sup id=fnref:1>&lt;a href=#fn:1 class=footnote-ref role=doc-noteref>1&lt;/a>&lt;/sup> URL is not publicly available , so someone had to dig that out and post it.
Even after that, the audio stream was (I believe, unintentionally) a mix of both English and Chinese simultaneously.&lt;/p>&lt;p>The 31C3 video recordings were also uploaded very quickly after the event.
This is much quicker than other events such as Black Hat (although as an attendee, you do get a copy of the stuff on a DVD).
A really big kudos to the organizers and the video production team!&lt;/p>&lt;p>If you don&amp;rsquo;t have time to listen to each and every talk, here are a few selected talks that were interesting to me, as well as a short summary to see if it&amp;rsquo;s worth 30 or 60 minutes of your time.&lt;/p>&lt;p>A full list of talks can be found here: &lt;a href=http://media.ccc.de/browse/congress/2014/index.html rel=noopener target=_blank class="external rawurl">http://media.ccc.de/browse/congress/2014/index.html&lt;/a>&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2015/01/interesting-31c3-talks/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Android Internals: Package Verifiers</title><link>https://irq5-7854a1fdb9f4.pages.dev/2014/12/android-internals-package-verifiers/</link><pubDate>Mon, 01 Dec 2014 22:50:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2014/12/android-internals-package-verifiers/</guid><description>&lt;p>Inspired by Nikolay Elenkov&amp;rsquo;s detailed technical posts on &lt;a href=//nelenkov.blogspot.com rel=noopener>Android Explorations&lt;/a>, I decided to dig into the Android source code myself and document the package verification mechanism in Android.&lt;/p>&lt;p>Package verification was introduced in Android 4.2 to allow for apps to be verified or checked &lt;em>before&lt;/em> they are installed.
If you have tried to install a malicious app on a production Android device, you might have seen the following screen, displayed by the verifier:&lt;/p>&lt;p>&lt;picture>&lt;source srcset=/posts/2014/img/android-pkgverify.png.webp type=image/webp>&lt;img src=https://irq5-7854a1fdb9f4.pages.dev/posts/2014/img/android-pkgverify.png alt="screenshot of malicious app install warning" width=900 height=889 class="half noinvert">&lt;/picture>&lt;/p>&lt;p>Android was built in such a way that it tries to be generic for third-parties to implement stuff.
Package verification is a feature that is currently only used and implemented by Google, but it is abstracted in such a way that any manufacturer can implement their own. Documentation and examples on how to do this is almost non-existent, although anyone determined enough can read the Android source code and figure it out for themselves.&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2014/12/android-internals-package-verifiers/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Bruteforcing LUKS Volumes Explained</title><link>https://irq5-7854a1fdb9f4.pages.dev/2014/11/bruteforcing-luks-volumes-explained/</link><pubDate>Wed, 19 Nov 2014 02:01:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2014/11/bruteforcing-luks-volumes-explained/</guid><description>&lt;p>Some weeks back, we were forced to reboot one of our server machines because it stopped responding.
When the machine came back up, we were greeted with a password prompt to decrypt the partition.
No problem, since we always used a password combination (ok, permutation) that consisted of a few words, something along the lines of &amp;ldquo;john&amp;rdquo;, &amp;ldquo;doe&amp;rdquo;, &amp;ldquo;1954&amp;rdquo;, and the server&amp;rsquo;s serial number. Except that it didn&amp;rsquo;t work, and we forgot the permutation rules AND whether we used &amp;ldquo;john&amp;rdquo; &amp;ldquo;doe&amp;rdquo; or &amp;ldquo;jack&amp;rdquo; &amp;ldquo;daniels&amp;rdquo;.&lt;/p>&lt;p>All the search results for bruteforcing LUKS are largely the same &amp;ndash; &amp;ldquo;use &lt;code>cryptsetup luksOpen --test-passphrase&lt;/code>&amp;rdquo;.
In my case, the physical server is in the server room, and I don&amp;rsquo;t want to stand in front of the rack trying to figure all this out. My question is, can I do this offline on another machine? None of those blog entries were helpful in this regard.&lt;/p>&lt;h2 id=the-luks-header>The LUKS Header&lt;/h2>&lt;p>To answer this question, I took a look at the LUKS header. This header is what provides multiple &amp;ldquo;key slots&amp;rdquo;, allowing you to specify up to 8 passwords or key files that can decrypt the volume.
&lt;a href=https://gitlab.com/cryptsetup/cryptsetup rel=noopener target=_blank class=external>cryptsetup&lt;/a> is the standard userspace tool (and library) to manipulate and mount LUKS volumes.
Since LUKS was designed based on TKS1, the &lt;a href=https://gitlab.com/cryptsetup/cryptsetup/-/wikis/TKS1 rel=noopener target=_blank class=external>TKS1 document&lt;/a> referenced by the cryptsetup project was very helpful.
After consulting the documentation &amp; code, I came up with the following diagram that describes the LUKS key verification process:&lt;/p>&lt;p>&lt;picture>&lt;source srcset=/posts/2014/img/luks-encryption-flowchart.png.webp type=image/webp>&lt;img src=https://irq5-7854a1fdb9f4.pages.dev/posts/2014/img/luks-encryption-flowchart.png alt="LUKS encryption flowchart" width=1200 height=396>&lt;/picture>&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2014/11/bruteforcing-luks-volumes-explained/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Encrypt All the Drives</title><link>https://irq5-7854a1fdb9f4.pages.dev/2014/04/encrypt-all-the-drives/</link><pubDate>Tue, 08 Apr 2014 01:50:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2014/04/encrypt-all-the-drives/</guid><description>&lt;p>I have always been an advocate on storage security (all types of security, actually). I like how iOS devices keep all files encrypted, even if you do not set a passcode on the device. They do this to facilitate quick erasure of files on the device &amp;ndash; to erase all the data, they simply wipe the master key.&lt;/p>&lt;p>Erasing magnetic storage media isn&amp;rsquo;t difficult, but it is time-consuming. For solid state media such as SSDs and flash drives, the wear-leveling makes it difficult to ensure that all flash blocks have been securely overwritten. The answer to this is to encrypt everything.&lt;/p>&lt;p>&lt;picture>&lt;img src=https://irq5-7854a1fdb9f4.pages.dev/posts/2014/img/encrypt-all-the-drives.png alt="Encrypt all the drives!! (meme)" width=439 height=327 class=noinvert>&lt;/picture>&lt;/p>&lt;p>Recently I have been busy building a Linux-based NAS and I decided to put this to practice.&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2014/04/encrypt-all-the-drives/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Implementing EAP-SIM at Home</title><link>https://irq5-7854a1fdb9f4.pages.dev/2013/12/implementing-eap-sim-at-home/</link><pubDate>Mon, 23 Dec 2013 00:57:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2013/12/implementing-eap-sim-at-home/</guid><description>&lt;p>EAP-SIM is one of the authentication methods that can be used in an 802.1x or WPA Enterprise network. Specifically, it relies on the user’s SIM card to process a presented challenge. This has been used by some telcos to provide WiFi service without having to maintain a separate set of credentials. However, not all phones support EAP-SIM.&lt;/p>&lt;p>&lt;picture>&lt;source srcset=/posts/2013/img/eap-sim-7433.jpg.webp type=image/webp>&lt;img src=https://irq5-7854a1fdb9f4.pages.dev/posts/2013/img/eap-sim-7433.jpg alt="Phone displaying EAP-SIM as a WiFi authentication method" width=640 height=359>&lt;/picture>&lt;/p>&lt;p>Since I’m already using a RADIUS setup at home, the use of EAP-SIM will eliminate the need to install my CA certs onto each device. But of course, there is still a fair bit of work to do…&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2013/12/implementing-eap-sim-at-home/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Decoding BCARD Conference Badges</title><link>https://irq5-7854a1fdb9f4.pages.dev/2013/04/decoding-bcard-conference-badges/</link><pubDate>Sat, 13 Apr 2013 01:28:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2013/04/decoding-bcard-conference-badges/</guid><description>&lt;p>Last month, I had the opportunity to fly halfway around the world to attend &lt;em>RSA Conference 2013&lt;/em>. Everyone was given a lanyard and badge which contains your information entered during registration. When you visit booths, they can then scan your badge to collect your information and follow up by sending you spam.&lt;/p>&lt;p>&lt;picture>&lt;source srcset=/posts/2013/img/rsa-conf-pass.jpg.webp type=image/webp>&lt;img src=https://irq5-7854a1fdb9f4.pages.dev/posts/2013/img/rsa-conf-pass.jpg alt="RSA conference pass" width=640 height=427>&lt;/picture>&lt;/p>&lt;p>The scanner varies across different booths, but mostly it&amp;rsquo;s an Android device that ran a custom software. Since it had a large NXP logo, let&amp;rsquo;s try to read it with the &lt;a href="https://play.google.com/store/apps/details?id=com.nxp.taginfolite" rel=noopener target=_blank class=external>NFC TagInfo app&lt;/a>. Looks like the tag identifies itself as a NDEF message but the data is gibberish.&lt;/p>&lt;p>&lt;picture>&lt;img src=https://irq5-7854a1fdb9f4.pages.dev/posts/2013/img/bcard_taginfo.png alt="Data in the BCARD as decoded by TagInfo" width=720 height=1034 class="half noinvert">&lt;/picture>&lt;/p>&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2013/04/decoding-bcard-conference-badges/#more">Continue reading…&lt;/a>&lt;/p></description></item><item><title>Fraudulent SSL Certs &amp; Revocation</title><link>https://irq5-7854a1fdb9f4.pages.dev/2011/03/fraudulent-ssl-certs-revocation/</link><pubDate>Thu, 24 Mar 2011 19:51:00 +0000</pubDate><guid>https://irq5-7854a1fdb9f4.pages.dev/2011/03/fraudulent-ssl-certs-revocation/</guid><description>I just read news that fake SSL certificates were issued by Comodo CA, but more interestingly, browser updates were issued to blacklist the certificates. Why this was necessary since we already have a protocol for doing just that?
I found out from this post on the torproject blog that talks about how OCSP is not properly implemented in browsers:
The browsers treat revocation errors as soft errors and a MITM is deadly for revocation.&lt;p>&lt;a href="https://irq5-7854a1fdb9f4.pages.dev/2011/03/fraudulent-ssl-certs-revocation/#more">Continue reading…&lt;/a>&lt;/p></description></item></channel></rss>