查看一个用 python 编写的名为 Locky 的 DGA。这是其中的一部分。
# Shift the dates
modYear = uint32(__ROR4__(modConst1 * (SystemTime.wYear + 0x1BF5), 7))
modYear = uint32(__ROR4__(modConst1 * (modYear + seed + modConst2), 7))
modDay = uint32(__ROR4__(modConst1 * (modYear + (SystemTime.wDay >> 1) + modConst2), 7))
modMonth = uint32(__ROR4__(modConst1 * (modDay + SystemTime.wMonth + modConst3), 7))
# Shift the seed
seed = uint32(__ROL4__(seed, 17))
# Finalize Modifier
modBase = uint32(__ROL4__(pos & 7, 21))
modFinal = uint32(__ROR4__(modConst1 * (modMonth + modBase + seed + modConst2), 7))
modFinal = uint32(modFinal + modConst2)
我理解不同的行为,但我对他们为什么做他们所做的事情有点困惑。是让整个事情尽可能随机,还是在每个位移、乘法等背后有一些具体的想法。你可以在这里找到整个事情:https ://github.com/sourcekris/pyLockyDGA