Posted By: May28th2018 | Sep 8th @ 9:13 PM
page 1 of 1
Comments: 19 | Views: 755
May28th2018
May28th2018
May 28th, 2018

For years, DRM schemes for both games and media have counted on the OS and CPU protecting certain parts of the memory.

 

http://citp.princeton.edu/memory/code/

 

Today, thanks to research done at Princeton, we can say goodbye to OS driven memory protection.
The software "USB / PXE Imaging Tools" can be downloaded, installed to a USB stick and that will dump all the memory out of the RAM after a reboot to the USB device via your first boot choice in the BIOS.

 

The dump is similar to the dd command in bash where it is dumping raw memory to your USB device.

Once you have the memory dump on the key, you can grep through it or use "strings" to grab the string you are looking for.

This also defeats file encryption schemes of any kind.

 

Once you power down your computer or reboot, your memory does not re-instantiate itself immediately. It takes several seconds or minutes for the memory to clear. It's similar to zero formating your hard drive. The sectors will retain an electromagnetic signature unless written over, even if the partition table has changed.

 

Yeah, it's a long known issue, though generally not something that is particularly useul in any sort of exploit, due to needing physical access to the machine. This sort of thing was pretty much the driving factor behind the creation of TPM chips and the Palladium-like idea that strong encryption needed to happen at the hardware level since it could, theoretically at least, protect against this and other techniques (like snooping directly onto the CPU lines).

CannotResolveSymbol
CannotResolveSymbol
{insert caption here}

Neat.

 

This just reinforces the fact that, if a malicious user has physical access to a computer, it's already compromised.

Dodo
Dodo
I'm your creativity creator™ :)

Simple fix. Include code into the BIOS to zero fill the RAM during POST. Takes less than a second. Wink

blowdart
blowdart
Peek-a-boo

True this is a cold boot attack (and sod all to do with DRM, Unbuntu is fudding again), which is why "This also defeats file encryption schemes of any kind." is not exactly accurate.

 

TPM based encryption is still vulnerable to this because the keys are loaded into RAM on boot without user intervention, unless it has two factor decryption (for example a hardware/USB key).

 

In addition sleep, as opposed to powering down or hibernate keeps the keys in RAM as well. Hibernate only works if encrypted volumes are dismounted.

 

There's a spec called TCG Platform Reset Attack Mitigation Specification which blanks memory on POST if the OS hasn't been shut down cleanly. Of course if you lock the BIOS with a password and never boot off external devices, well, then none of this would work.

He's not totally fudding about the DRM.

 

This would allow people to dump the memory running at the time of having something like PowerDVD start playing a blu-ray to get the latest decryption code. Currently you need to do a memory dump using something like SoftIce which can be detected as running and circumvented or prevented by application, with this there is no way or prevent people who own the machine from using it.

 

Yes it requires you to have ownership of the physical box to use but if we're talking about people that are trying to crack or liberate software/DRM-protected IP then it is still now a valid attack vector for them.

blowdart
blowdart
Peek-a-boo

Tools to dump memory whilst an OS is running have been around for YEARS. SoftIce was a great one, and detection code can of course be beaten as well.

 

The Princeton suff is specifically for cold boot attacks and the detection of common public/private key pairs in cold booted machines. It's overkill for DRM.

Dodo
Dodo
I'm your creativity creator™ :)

Not to mention that dumping application or machine memory for DRM cracking is completely unnecessary. If the application playing the content is able to play it, it can just as well be converted to a format without DRM protection by directing the output elsewhere.

 

You can also access the whole system memory from special elevated applications or FireWire devices (mandated by IEEE 1394) and scan for the wanted content on the fly without turning the machine off.

GoddersUK
GoddersUK
I CAN has cheezburger and you CAN'T has stop me!

Of course if you lock the BIOS with a password and never boot off external devices, well, then none of this would work.

 

Except of course the attacker has physical access to the machine and hence the magical CMOS reset jumper on the mainboard Smiley

 

It also can't protect against brute force... (looks at an OEM that sells PCs to a market where not giving people access to the BIOS is essential that uses their own name as password... (I won't post which here because I might be out of a summer job if I did, suffice to say that I don't know this through my work, but through "other" methods when I used to encounter their computers on a daily basis))

msemack
msemack
Embedded Systems Guy

In the old days, BIOSes used to (indirectly) guard against this sort of attack.  Way back when, BIOSes used to do a Power On Self Test (POST) that tested various parts of the system (processor, RAM, etc).  The test patterns written to RAM would effectively scrub it.

 

As the years went by, people wanted faster boot times, so the amount of "testing" during POST has been trimmed down.  These days, a pretty severely broken system can still boot past POST.  Any kind of serious memory testing has been omitted from the default startup sequence.  Most BIOSes still have a menu option to enable some memory testing (Quick Boot, Extended Memory Testing, Test Memory Above 1MB, etc).

 

Some BIOSes can (and still do) have code in them that can foil such attacks:  RAM size detection.  During startup, BIOSes used to automatically figure out the size of the attached memory modules by writing special patterns into memory, checking for repeats, and used this to determine rows/columns, etc.  This has the side-effect of clobbering anything left over in memory.  It wasn't foolproof though.  The algorthim didn't always crush every byte in memory.  And it was also usually skipped during a warm reboot.  (Most of the older Award BIOSes use this memory-sizing method.)

 

In newer systems, there is a more standardized way of determining the memory module size/speed.  It is called Serial Presence Detect (SPD).  Basically, there is a tiny (~128byte) EEPROM on each memory module that specifies the brand/size/speed of the memory module.  The BIOS reads the SPD EEPROMs on each modules to figure out the BIOS size.  This eliminates the need to write to memory (bye-bye to the scrubbing effect).  Most modern AMI and Phoneix BIOSes use this method.

 

For reference, we added added a "RAM Scrub" option to a BIOS for one of our products.  It added ~8 seconds to the boot time to do a one-pass scrub 512MB of memory.  Obviously more RAM would take longer to scrub.

 

Unfortunately, the BIOS scrubber doesn't guard against the attack of someone yanking power from the system and pulling out the memory modules.  The attacker could then insert the modules into a non-scrubbing motherboard and read the RAM contents.  If they were really clever, the could have some custom hardware to read it with zero BIOS interaction (FPGA or specialized procesor board with a DIMM socket).  There are some primitive ways to guard against this, though (e.g. Epoxy the memory modules in place). 

 

Dodo
Dodo
I'm your creativity creator™ :)

msemack said:
For reference, we added added a "RAM Scrub" option to a BIOS for one of our products.  It added ~8 seconds to the boot time to do a one-pass scrub 512MB of memory.  Obviously more RAM would take longer to scrub.

8 seconds? What kind of RAM was that?

I have 12GB of DDR3 RAM in my machine. Writing 0 bytes to all of it should take about 0.28 seconds at a memory bandwidth of 43GB/s.

Also, even though you could yank out the memory modules, you surely can't do that very fast and only one at a time. Enough time to flush all the other modules. Also, those memory yankers usually freeze the DIMMs, and memory modules get hot (mine have 60-70C on a regular basis) a sudden drop in temperature could be detected and memory could be flushed.

Zero-filling the memory once is enough to prevent future readouts. The 0 bit signal has high voltage where as the 1 bit uses low voltage. Voltage differences on the high voltage readout could just as well originate from VRM pulses.

msemack
msemack
Embedded Systems Guy

~8 seconds was for 512MB of DDR memory at 333MHz.  Of course faster memory would go quicker, but its still going to take at least a few seconds on machine with "normal" quantities of RAM.  For maximum security, the scrub operation should be executed very early in POST (immediately after the memory controller was initializated), and before the processor L1/L2 caches are online, so it goes pretty slow.  Even with caching enabled, the scrub is one of the most cache-unfriendly memory operations you can do.  (Besides, the processor caching undermines some of the security aspect.)

 

Triggering the scrub on a temperature change isn't bulletproof.  The attacker can yank the power and then hit it with the freeze spray.

 

You could probably rig something up that does a scrub on a sudden temperature change, but it's non-trivial.  Most temperature monitoring chips have an "alarm" pin for when the thermal values exceed certain thresholds.  You could use this to trigger a System Management Interrupt. The SMI handler could contain the scrub routine.  Unfortunately, "rate of change" is usually not an alertable condition.  You'd need to have a timer-driven SMI routine to "tune" itself to the average operating temperature of the DIMMs.  I think there are also some issues with trying to get the SMI routines to manipulate memory outside of their address space.

 

All of this requires a custom BIOS (source code access, not "hax0rs" who found a copy of CBROM).  And probably custom hardware too (unless you can find a motherboard that happens to have the signals hooked up exactly as you want).

 

I neglected to mention one other option:  Surface-mounted memory, no DIMMs.  In a system with BGA memory chips mounted to the board, it is pretty much impossible to remove them without damaging them.  (Unless you hit them with a heat gun, which would probably wipe the chip anyway.)

 

[Our systems have the memory chips mounted directly to the board for shock/vibration issues.  The fact it guards against this attack is just a bonus.]

 

For more traditional PC hardware, a tamper-proof case coupled with a scrubbing BIOS will do a lot to mitigate the problem.

ManipUni
ManipUni
Proving QQ for 5 years!

Spider clips over the memory modules... You can clone the memory without shutting the system down or powering it off. You would need some special kit to do it but it could be done... Less hassle than a few of the other suggestions here.

ManipUni
ManipUni
Proving QQ for 5 years!

Sure you can. You also aren't tapping the bus, you're tapping the chips themselves.

msemack
msemack
Embedded Systems Guy

Spider Clips and a Logic Analyzer will let you listen in on memory transactions that are happening (e.g the OS reads something from memory, or writes something to memory).  You wouldn't be able to see any memory accesses that are serviced by the CPU cache, though.

 

Also, you wouldn't be able to arbitrarily read/write locations in memory.  You wouldn't be able to generate your own memory clocks/commands.  If you did, you would contend with the signals coming from the northbridge memory controller, and probably end up corrupting RAM contents (system crash).  This would prevent you from doing a full dump of memory.

 

That said, just listening to the memory transactions may be sufficient.  If the goal is to listen for an encryption key, it's bound to be in the datastream somewhere.  You just have to be listening at the right time.  If the key is frequently accessed, it's probably in the CPU cache, and therefore you wouldn't see it.  If you have the clips attached when the program starts up, you should be able to get it though.

 

Spider Clips would be tricky to attach to a running laptop with an SO-DIMM (half the signals are on the underside of the module).  You could probably do it with a steady hand.

 

msemack
msemack
Embedded Systems Guy

"Whether the DIMMs are epoxied to the sockets or whether they are soldered in makes no difference. You can create a multi-pronged soldering tip that desolders all of the pins at the same time after freezing the memory.Then reattach it to a waiting socket that will accept the pins."

 

Not if the memory chips are BGA.  (Note that I explicitly said BGA.)  BGA components don't have exposed pins.  You can't use a soldering iron to get at it.  You need a heat gun or a reflow oven.

http://en.wikipedia.org/wiki/Ball_grid_array

 

(BTW, just to be clear, I'm talking about the memory chips themselves soldered to the board, no DIMM at all.)

 

page 1 of 1
Comments: 19 | Views: 755
Microsoft Communities