识别SigFlip生成的恶意文件

最近在移植 med0x2e/SigFlip 的过程中发现了一个有意思的点,可以用来作为检测的手段 在 SigFlip 项目的 Detect/Prevent 一节中作者有提到一些检测防御手段 https://docs.microsoft.com/en-us/security-updates/SecurityAdvisories/2014/2915720?redirectedfrom=MSDN Once the patch is installed and proper registry keys are set, No system restarts are required, you only need to restart the Cryptographic Services. The Applocker service will be also restarted as it depends on the cryptographic services.(@p0w3rsh3ll) Yara rule by Adrien; https://twitter.com/Int2e_/status/1330975808941330432 从 SigFlip 源码中,其实也能发现一个点 SigFlip 依赖一串特定的字节来定位shellcode的位置,详见 Native/SigLoader/SigLoader/SigLoader.cpp#L102 和 Native/SigFlip/SigFlip/SigFlip.cpp#L232 1 2 3 4 5 6 7 for (_index = 0; _index < _CertTableSize; _index++) { if (*(_pePtr + _index) == 0xfe && *(_pePtr + _index + 1) == 0xed && *(_pePtr + _index + 2) == 0xfa && *(_pePtr + _index + 3) == 0xce) { printf("[*]: Tag Found 0x%x%x%x%x", *(_pePtr + _index), *(_pePtr + _index+1), *(_pePtr + _index+2), *(_pePtr + _index+3)); _dataOffset = _index + 8; break; } } 1 2 memcpy(_encryptedData, "\xFE\xED\xFA\xCE\xFE\xED\xFA\xCE", 8); crypt((unsigned char*)_data, _dataSize, _key, _keySize, (unsigned char*)_encryptedData + 8); 也就是说我们在证书表中定位到 \xFE\xED\xFA\xCE\xFE\xED\xFA\xCE 这段特征就可以断定它疑似 SigFlip 生成的 payload 了,想要更精准一些可以结合 https://twitter.com/Int2e_/status/1330975808941330432 中提到的长度特征。 ...

十二月 10, 2021 · 2 分钟 ·