Re:AES Finder – the utility to find AES keys in running proc...
by makomk on Sunday September 06, 2020 @12:33PM
(#24392515)
Yeah, it's a trick that's been around for a while. The thing that makes it a little fiddly is that the various ways to store a key schedule, especially for decryption - it could be in either order, and there's some optimization to do with whether InvMixColumn is pre-applied to the values that I can't remember the details of. I actually had a fork of the classic aeskeyfind that added some of these tricks, though apparently it's broken at higher compiler optimizations now and I probably need to look into that: https://github.com/makomk/aeskeyfind Could just have used this instead if I'd known about it.
Re:AES Finder – the utility to find AES keys in running proc...
by dunham on Sunday September 06, 2020 @01:02PM
(#24392769)
Also sqlite3's encryption seems to be a byte swapped AES.
E.g. look for a byte swapped AES key schedule in dropbox process memory and you should find its sqlite3 encryption key.
Re:AES Finder – the utility to find AES keys in running proc...
by hinkley on Sunday September 06, 2020 @01:40PM
(#24393094)
Shouldn’t there be a way to relocate the bits so that the L1 and L2 caches are still happy but the data structures aren’t contiguous? Is the main problem that they are all malloced sequentially?
Re:AES Finder – the utility to find AES keys in running proc...
by EE84M3i on Sunday September 06, 2020 @02:17PM
(#24393414)
What do you mean by "problem"? Are you talking about obfuscation?
Re:AES Finder – the utility to find AES keys in running proc...
by hinkley on Sunday September 06, 2020 @02:39PM
(#24393588)
> looking for an expanded set of round keys[2] using their expected layout in memory
The problem is predictability of the layout, right? The layout is chosen for throughput, but CPU caches can cope well with some nonlinear layouts.
Re:AES Finder – the utility to find AES keys in running proc...
by EE84M3i on Sunday September 06, 2020 @03:23PM
(#24393926)
Keys having an expected layout in memory is not a problem, nor is being able to dump encryption keys from process memory if you have access to it. That's the security model these processes operate in.
Processes could conceivably put keys in memory in a non-standard way that is more difficult to write a tool to scan for, but the fact that they don't is not a problem, and even if they did it would not make it impossible to write a tool.
Re:AES Finder – the utility to find AES keys in running proc...
by panpanna on Sunday September 06, 2020 @05:21PM
(#24394771)
The point is that if we could move the pieces of key schedule around freely it would increase the complexity of the tool significantly since it will have to match each potential block against a number of other potential blocks.
[1]: https://github.com/MantechUser/aes-finder/blob/master/aes-fi... [2]: https://en.wikipedia.org/wiki/AES_key_schedule