Re:Attack of the week: DUHK
by blauditore on Tuesday October 24, 2017 @11:40AM
(#15542391)
I'm pretty sure there's an age-old comment in the source code like:
// TODO generate key instead of hard-coding itYou mean something like this? https://github.com/nitram509/macaroons.js/blob/master/lib/Cr...
This is almost literally https://xkcd.com/221/
The X9.31 random number generator [in FortiOS] is implemented within a kernel module that exports a Linux character device. At boot time, the init process loads the module and replaces /dev/urandom with a node corresponding to the X9.31 character device.
We reverse-engineered the kernel module providing the X9.31 implementation [...] and found the hard-coded AES key used for the RNG. The hard-coded key was f3b1666d13607242ed061cabb8d46202. The key used in both the firmware dump and virtual appliance was the same. Although the documentation stated that the key was “generated external to the module”, the key is the same one used for the NIST test vectors [14] and appears to have been hard-coded into the source code.