How can I confirm my current firmware's signature and protect it from exploitation?

I was browsing reddit's network security section and stumbled upon this 0-day attack on my mac's firmware. How could I check the current signature on it and reinstall the OS while being protected from this kind of attack? Credit to the site's author @https://reverse.put.as/2015/05/29/the-empire-strikes-back-apple-how-your-mac-fir mware-security-is-completely-broken/


"It means that you can overwrite the contents of your BIOS from userland and rootkit EFI without any other trick other than a suspend-resume cycle, a kernel extension, flashrom, and root access.

Wait, am I saying Macs EFI can be rootkitted from userland without all the tricks from Thunderbolt that Trammell presented? Yes I am! And that is one **** of a hole :-).

Let me show you how it happens. The following is the flashrom output of a freshly rebooted MacBook Pro Retina 10,1 running the latest EFI firmware available (this is the firmware that was released to “fix” Thunderstrike)."

User uploaded file

"What we can see here is that the flash lockdown is active (FLOCKDN=1) and that the BIOS region is mostly read-only. The hole that is writable is the NVRAM portion that is necessary for setting boot options, crash logs and so on. The addresses where EFI binaries are located is lock down by the flash protections (PR0/PR1). The Dark Jedi attack would allow to unlock these areas and make them writable.

After I close the MacBook and let it sleep for a few seconds (30 seconds or something is best, sometimes it doesn’t work and needs to sleep some extra time), we get the following flashrom output after waking up the machine:"

User uploaded file

"This time we have FLOCKDN=0 and the protected range registers (PR0/PR1) without any contents. The flash is unlocked and now you can use flashrom to update its contents from userland, including EFI binaries. It means Thunderstrike like rootkit strictly from userland.

"Update:

It appears I miscalculated this thing and appears to be an effective 0day. Doesn’t really matter since I always wanted to disclose it and not sell it due to its very powerful nature (and not working in newer machines). Never assume all bugs are shallow.

You might ask if I am into something against Apple judging by the tone of some posts. I am not. I like OS X and I respect Apple security people who I met a few times. My goal is to make OS X better and more secure.


"...How can you mitigate/detect a possible EFI compromise?

You can build a SPI dumper and use Trammell’s software to directly dump the BIOS chip. Then you can compare its contents against the firmware files provided by Apple. I asked Apple to start publishing these files and their signatures so we can have a good baseline to compare against. Hopefully they will do this one day. I built some tools for this purpose but they aren’t public.
This solves the EFI problem but others are left. For example there is SMC. Alex Ionescu made a very interesting presentation about it a few years ago at NoSuchCon. SMC has a very interesting potential for compromise so it’s also something that needs more research. And now we have PoC regarding GPU rootkits. Every single chip that has firmware and somehow talks to the operating system is open for compromise. We need to think different and start a trust chain from hardware to software. Everyone is trying to solve problems starting from software when the hardware is built on top of weak foundations.
Apple has a great opportunity here because they control their full supply chain and their own designs. I hope they finally see the light and take over this great opportunity. Google is trying with Chromebook.

Is physical access required to exploit this bug?

No, there’s no physical access required to exploit this. You can trigger sleep with “sudo pmset sleepnow” (thanks Trammell). And then you just wait to come back from sleep and continue exploitation."

And an interesting post on the matter...

"Would this be bypassed if the system drive was FileVault 2 enabled since you couldn't gain root access on the recovery volume unless you brute forced a password to decrypt the drive?

I'm new to Apple and it seems unless you have both, a firmware password and an encrypted drive (or at least an encrypted drive), your data should be relatively safe from access, just not damage as someone could overwrite if they can get past the firmware password.

No, a Safari remote exploit will allow you to install a EFI rootkit as long there was a sleep before in that session. FileVault2 can't protect anything regarding this attack.




[–]illfatedpupulon 3 points 3 days ago

You can set it to have your keys dumped every time the computer falls asleep. But wake up is very slow."


So I read you can dump it and compare to a stock one. Where would I find this?

BTW, I didnt just post the link because on my last post I was told not to.

MacBook Pro (Retina, 13-inch,Early 2015), Mac OS X (10.0.x)

Posted on Jun 2, 2015 2:21 AM

Reply
1 reply

Jun 2, 2015 10:35 PM in response to shaake

The reason I ask is because my computer seems to force TLSv1 on all websites and wireshark shows a lot of odd traffic on my network. This is almost all stock except for chrome and wireshark which requires the quartz install. Here is my Etrecheck log and any help would be appreciated.


EtreCheck version: 2.2 (132)

Report generated 6/3/15, 12:28 AM

Download EtreCheck from http://etresoft.com/etrecheck


Click the [Click for support] links for help with non-Apple products.

Click the [Click for details] links for more information about that line.


Hardware Information: ℹ️

13" MacBook Pro with Retina display (Early 2015)

MacBook Pro - model: MacBookPro12,1

1 2.7 GHz Intel Core i5 CPU: 2-core

8 GB RAM Not upgradeable

BANK 0/DIMM0

4 GB DDR3 1867 MHz ok

BANK 1/DIMM0

4 GB DDR3 1867 MHz ok

Bluetooth: Good - Handoff/Airdrop2 supported

Wireless: en0: 802.11 a/b/g/n/ac

Battery: Health = Normal - Cycle count = 6 - SN = D865041W3QUFY5G4Q


Video Information: ℹ️

Intel Iris Graphics 6100

Color LCD 2560 x 1600

SAMSUNG 7680 x 4320 @ 30 Hz


System Software: ℹ️

OS X 10.10.3 (14D136) - Time since boot: 0:17:5


Disk Information: ℹ️

APPLE SSD SM0128G disk0 : (121.33 GB)

EFI (disk0s1) <not mounted> : 210 MB

Recovery HD (disk0s3) <not mounted> [Recovery]: 650 MB

Untitled (disk1) / : 120.12 GB (105.62 GB free)

Encrypted AES-XTS Unlocked

Core Storage: disk0s2 120.47 GB Online


USB Information: ℹ️

Apple Internal Memory Card Reader

Broadcom Corp. Bluetooth USB Host Controller


Thunderbolt Information: ℹ️

Apple Inc. thunderbolt_bus


Gatekeeper: ℹ️

Mac App Store and identified developers


Problem System Launch Daemons: ℹ️

[failed] com.apple.mtrecorder.plist


Launch Agents: ℹ️

[loaded] com.google.keystone.agent.plist [Click for support]

[loaded] org.macosforge.xquartz.startx.plist [Click for support]


Launch Daemons: ℹ️

[failed] com.apple.spirecorder.plist

[loaded] com.google.keystone.daemon.plist [Click for support]

[loaded] org.macosforge.xquartz.privileged_startx.plist [Click for support]

[loaded] org.wireshark.ChmodBPF.plist [Click for support]


User Login Items: ℹ️

iTunesHelper Application (/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)


Internet Plug-ins: ℹ️

Default Browser: Version: 600 - SDK 10.10

QuickTime Plugin: Version: 7.7.3


3rd Party Preference Panes: ℹ️

None


Time Machine: ℹ️

Time Machine not configured!


Top Processes by CPU: ℹ️

7% WindowServer

4% firefox(2)

3% fontd(2)

0% taskgated

0% notifyd


Top Processes by Memory: ℹ️

795 MB firefox(2)

574 MB kernel_task

238 MB Dock(2)

188 MB mdworker(14)

164 MB WindowServer


Virtual Memory Information: ℹ️

189 MB Free RAM

7.81 GB Used RAM

0 B Swap Used


Diagnostics Information: ℹ️

Jun 3, 2015, 12:11:36 AM Self test - passed

Jun 1, 2015, 01:09:02 AM /Library/Logs/DiagnosticReports/sharingd_2015-06-01-010902_[redacted].crash

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I confirm my current firmware's signature and protect it from exploitation?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.