可以看出在这个Routine里对启动器传入的数据进行了变换作为shellcode,如果变换后符合要求会通过Apc注入执行shellcode,否则就会打印wrong并清理驱动
回到IoCtr中传递shellcode的地方1400060B0一开始也是有效代码,直到140006151开始一些随机数据,并在前半段有效代码中call eax执行到这个随机数据区域
def decode(buf, chunk, looptime): newbuf = buf[::] idx = looptime - 1 while idx >= 0: idx_chunk = idx % chunk add1 = newbuf[idx_chunk - 1] if idx_chunk == chunk - 1: add2 = newbuf[idx_chunk] * 256 + newbuf[0] else: add2 = newbuf[idx_chunk + 1] * 256 + newbuf[idx_chunk] sumup = add1 + add2 newbuf[idx_chunk] = (sumup >> 8) & 0xff if idx_chunk == chunk - 1: newbuf[0] = sumup & 0xff else: newbuf[idx_chunk + 1] = sumup & 0xff idx -= 1 return newbuf buf231 = [0xEB, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x48, 0x8B, 0xEC, 0xE8, 0x01, 0x00, 0x00, 0x00, 0x90, 0x48, 0x8B, 0xC4, 0x48, 0xC7, 0xC1, 0x10, 0x00, 0x00, 0x00, 0x48, 0x33, 0xD2, 0x48, 0xF7, 0xF1, 0x83, 0xFA, 0x00, 0x75, 0x17, 0x48, 0x8B, 0x04, 0x24, 0x48, 0x89, 0x44, 0x24, 0xF8, 0x48, 0x8B, 0x44, 0x24, 0x08, 0x48, 0x89, 0x04, 0x24, 0x48, 0x8D, 0x64, 0x24, 0xF8, 0x48, 0x8B, 0x0C, 0x24, 0x48, 0x8B, 0x51, 0xDF, 0x48, 0x83, 0xFA, 0x00, 0x74, 0x04, 0x48, 0x89, 0x55, 0x08, 0x48, 0x8B, 0x51, 0xE7, 0x48, 0x83, 0xFA, 0x00, 0x48, 0xBA, 0x2D, 0x7F, 0x6C, 0x43, 0xF6, 0x7F, 0x00, 0x00, 0x48, 0xB8, 0xCE, 0x7F, 0x6C, 0x43, 0xF6, 0x7F, 0x00, 0x00, 0x9C, 0x48, 0x2B, 0xC2, 0x9D, 0x74, 0x17, 0x48, 0x8D, 0x51, 0xDD, 0x48, 0x8D, 0x14, 0x10, 0x48, 0x8B, 0x41, 0xE7, 0x48, 0x8D, 0x04, 0x10, 0x48, 0x8B, 0x49, 0xEF, 0x51, 0xFF, 0xD0, 0x48, 0x8B, 0xE5, 0x5D, 0xC3, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x59, 0x0D, 0x6D, 0x80, 0x3C, 0xA2, 0x78, 0x15, 0x87, 0x16, 0x16, 0x07, 0x26, 0x68, 0x55, 0x7F, 0x12, 0xF1, 0xEF, 0xF9, 0xA1, 0x9C, 0xE8, 0xEA, 0x9C, 0x90, 0xF4, 0x9F, 0x3A, 0xA8, 0x8C, 0x27, 0x47, 0x79, 0xF6, 0xDC, 0x20, 0x7F, 0x86, 0xED, 0x34, 0x7E, 0xF7, 0x1C, 0x55, 0x6B, 0xF6, 0xEF, 0xF2, 0x2A, 0x7A, 0xF0, 0x44, 0x50, 0x8A, 0x9B, 0xE1, 0xC4, 0xE1, 0x45, 0x90, 0x2B, 0x0E, 0xCF, 0xAF] v10 = 0xa1 for inputnum in range(90000, 96001): checkcode = 263 - v10 - 36 newbuf = decode(buf231[4+v10:], checkcode, inputnum) if newbuf[0] == checkcode and newbuf[1] == 0 and newbuf[2] == 0 and newbuf[3] == 0: print 'key', inputnum