Breaking the x86 Instruction Set

Black Hat9 HN recommenders · 2017–2022
381K views · talk · evergreen · Uploaded 2017-08-31

Christopher Domas presents at Black Hat 2017 how page fault analysis and processor fuzzing can exhaustively search the x86 instruction set. The talk uncovers undocumented instructions and hardware bugs and shows limits of disassemblers.

HN recommends it as a clever, entertaining and easy-to-follow talk on finding hidden x86 instructions with the Sandsifter tool.

Watch on YouTube

17 comments from Hacker News

@AceJohnny22017 · in “IDA: What's new in 7.00”

> I trust its disassembler (especially for mainstream languages) more than almost any other disassembler Might I suggest Christopher Domas' Black Hat talk "Breaking the x86 ISA", along the way of which he demonstrates the limitations of all disassemblers out there, including IDA's :) Talk: [VIDEO] Slides: [LINK] Paper: [LINK]

RecommendsView on HN
@zilitor2017 · in “I'm Testifying to Congress about Data Breaches – What Should I Say?”

Data Breach Transparency - At a minimum, their should be a penalty that grows from the time the breach was learned to when they disclose it publicly. - There should also be penalities for not being transparent about what exact data was leaked for what users. Social Security Number - SSN is similar to a password- you want to keep it hidden, and if it leaked, you should change it. However, we can't change it. Perhaps it should be considered more as a password? User Data Rights - People should know what personal data companies have on them. A good example of this is Equifax storing peoples home addresses- this could be disclosed. On the other hand, a it is probably fine to exclude other types of data, such as an advertiser storing your zip code- people probably don't care as much. - Should people have a right to have certain kinds of data (e.g. SSN) removed from websites? Adoption from USA Nutrition Label - Is it a good idea to mandate companies disclose the security they use? For example, at one time reddit had their passwords stored as plaintext and they got hacked. Disclosing basic security hygiene (e.g. password storage) somewhere standardized in the website would make it much less outrageous. Technology Improvement - Certain technologies enable hackers more than others. SQL seems to enable a lot of hacking. Should we discourage it? - Get rid of Intel ME technologies - [LINK] - Get rid of Intel hidden instructions - [VIDEO] - Get rid of Simon and Speck - [LINK] - What is "be

@anfractuosity2018 · in “Ask HN: What’s your favorite talk from 2017?”

One of my favourite talks I watched was "Low Cost Non-Invasive Biomedical Imaging - An Open Electrical Impedance Tomography Project" [LINK] As it presented an interesting technique I'd never heard of before, along with an implementation. Also I thought the 'Breaking the x86 Instruction Set' talk was extremely clever - [VIDEO]

RecommendsView on HN
@DyslexicAtheist2018 · in “Ask HN: What’s your favorite talk from 2017?”

my favorite were: - How the reputation economy is creating data-driven conformity [LINK] - DEF CON 25 (2017) - Weaponizing Machine Learning [LINK] - BlackHat 2017: Breaking the x86 Instruction Set [VIDEO]

RecommendsView on HN
@FLUX-YOU2018 · in “Reading privileged memory with a side-channel”

I do also wonder if some speculative prediction / branching stuff can be controlled through undocumented CPU instructions: [VIDEO]

@ohaal2018 · in “A CPU bug with undocumented opcodes, possibly Intel (scroll to p. 155)”

Related talk (relevant part starts at 38:43) [VIDEO] Quote from the talk: I don't want to make it sound like the sky is falling. This was found on one very esoteric processor that is not used in widespread production. I think it's mostly interesting from an academic perspective that we have a tool that is able to find these kinds of things now.

@nnnate2018 · in “Ask HN: What are some of the best technical talks you've heard?”

Breaking the x86 Instruction Set by Christopher Domas. [VIDEO] I found it easy to follow and pretty entertaining.

RecommendsView on HN
@jchw2019 · in “A Complete Formal Semantics of x86-64 User-Level Instruction Set Architecture”

There was a really good Blackhat talk a year or two ago in a sort of similar vein: they developed an approach to iterate and find undocumented opcodes. [VIDEO] The software they developed is called Sandsifter.

RecommendsView on HN
@mmcloughlin2019 · in “Destroying x86_64 instruction decoders with differential fuzzing”

Great project and write-up. I'm reminded of a couple other projects. MC Hammer project for LLVM tests round-trip properties of the ARM assembler. [LINK] Sandsifter x86 fuzzer. [LINK] [VIDEO]

@caleb-allen2020 · in “Undocumented CPU behavior: analyzing undocumented opcodes on Intel x86-64 (2018) [pdf]”

This was also linked elsewhere but a security researcher was able to identify a significant number of undocumented instructions: [VIDEO]

@tyingq2020 · in “XuanTie C906 based Allwinner RISC-V processor to power $12 Linux SBC's”

"I thought you were saying that the use of microcode would complicate verification of the hardware." I do think that microcode opens up the possibility of subtle injections to follow code/hardware paths you might not easily predict. A really good talk on reverse engineering an ISA implementation: [VIDEO]

RecommendsView on HN
@dnautics2020 · in “Cosmopolitan Libc: build-once run-anywhere C library”

xoreaxeaxeax's videos about how to systematically parse the asm space of x86 really hit home to me how bad the encoding is. [VIDEO]

@BlackLotus892021 · in “Undocumented x86 instructions in Intel CPUs that can modify microcode”

There was an interesting black hat talk about automatically finding undocumented instructions. [0] Interesting comment on twitter to the instruction of the original post[1] [0] [VIDEO] [1] [LINK]

RecommendsView on HN
@gbrown_2021 · in “How many x86 instructions are there? (2016)”

How about undocumented instructions? Sandsifter[1] is an interesting project and the video from BlackHat[2] is a good watch. There's also a previous discussion of it on HN[3]. [1] [LINK] [2] [VIDEO] [3] [LINK]

RecommendsView on HN
@skunkworker2021 · in “A Silly Anti-Disassembly Trick”

I would be really interested to see how often malicious software utilized undocumented opcodes that disassemblers incorrectly interpret and thus lead a security researcher down a rabbit hole while the actual opcode does something different. Like the 66e9xxxxxxxx and 66e8xxxxxxxx opcodes in x86_64 [1] If my understanding is correct, Stuxnet incorporated bytecode for the PLCs in S7comm, a protocol that was not open at the time. Though this is different then including undocumented opcodes for the system being targeted directly. [1] [VIDEO]

@brokenmachine2021 · in “Undocumented x86 instructions to control the CPU at the microarchitecture level [pdf]”

I watched a super interesting Black Hat video on youtube that talked about discovering secret instructions on CPUs by iterating over each bit of opcodes until you get an illegal instruction, and thereby discovering if an opcode is valid or not. He set up a room full of PCs running his code and had hardware to auto-reset them when they crashed. [VIDEO]

RecommendsView on HN
@LinuxBender2022 · in “Ask HN: Do you worry about CPU backdoors like IME?”

What are the implications of such hardware on user security? Threat persistence, i.e. persistent rootkits, persistent remote monitoring if one has privs to tickle the CPU instructions that give access. It is just a matter of time before there are public tools for script kiddies to manage the OS within the CPU. Here [1] is an example of someone slowly making progress decoding all the undocumented instructions and here is a talk with a brief overview of the tools. [2] This is not specific to Intel's ME but it is the way people will eventually tame/exploit that beast in my opinion. There are more recent talks that get deeper into security rings in the CPU. This video [3] more related to your question but not specific to ME however can be used to access ME and much more. If this appears to difficult and time consuming just know that some folks out there have the documentation for the undocumented instructions. You may find some tools on github and other public repos for disabling ME. Use with care. Test on an identical model of system that is at the same firmware/BIOS and same model of CPU as those tools can brick your CPU. As @rocket_surgeron stated, one can buy CPU's with ME disabled but that will not disable the "God Mode" referenced in [3]. [1] - [LINK] [2] - [VIDEO] [3] - [LINK]