Searching for AES Keys
Thanks to Victor Muñoz, radare2 now has support of the algorithm he developed, capable of finding expanded AES keys with /Ca
command. It searches from current seek position up to the search.distance
limit, or until end of file is reached. You can interrupt current search by pressing Ctrl-C
. For example, to look for AES keys in physical memory of your system:
If you are simply looking for plaintext AES keys in your binary, /Ca
will not find them, but you might want to search with is~AES
instead if the programmer left those hints for you:
Other than that, AES keys might show up in different ways in the binary: encrypted, hidden by another encrypting routine, so there's no absolute way other than understanding the binary being analized. For instance, p=e
might give some hints if high(er) entropy sections are found trying to cover up a hardcoded secret. As an example on entropy searching, since radare 3.2.0, there's the possibility to delimit entropy sections for later use like so:
The blocksize is increased to 4096 bytes from the default 100 bytes so that the entropy search /s
can work on reasonably sized chunks for entropy analysis. The sections flags can be applied with the dot operator, ./s*
and then looped through px 32 @@ entropy*
.
Moreover AES keys might be referenced from strings or pointed from the imports, for instance, so the /
and other search-related commands can come in handy in this regard.
最后更新于
这有帮助吗?