
该工具的目的是利用人工智能对恶意软件(仅限PE32格式)样本进行变异,以绕过基于AI的分类器,同时保持其原有功能。过去,该领域已有显著的研究成果,研究人员分别采用强化学习或生成对抗网络作为首选武器来修改恶意软件可执行文件的状态,以欺骗杀毒引擎。我们的解决方案结合了深度强化学习和GAN,以克服单独使用这些方法时面临的一些局限性,如下所示。
.png)
完整的工具文档请参见此处
⚠️ 由于本工具处理恶意软件文件,强烈建议在虚拟机中使用。安装工具后,请确保断开网络连接。
以下步骤将指导您完成所有环境安装。
克隆仓库。
git clone https://github.com/CyberForce/Pesidious
进入项目目录。
cd Pesidious
建议使用虚拟环境以避免不同应用程序使用的包之间的冲突
确保已安装并设置pip 8.1.1。
这是因为较新版本的pip与PyTorch库兼容性不佳。
pip install pip==8.1.1
通过安装requirements.txt文件来安装所有必需的库。
pip install -r pip_requirements/requirements.txt
GAN的输出已预先存储为(RL_Features/adverarial_imports_set.pk 和 RL_Features/adverarial_sections_set.pk),用于在变异时向恶意软件添加导入和节。
您可以测试样本分类器以对恶意软件文件进行评分。
python classifier.py -d /path/to/directory/with/malware/files
运行 mutate.py Python 脚本来变异您的恶意软件样本。
python mutate.py -d /path/to/directory/with/malware/files
变异的恶意软件文件将存储在名为 Mutated_malware 的目录中,格式如下:
Mutated_malware/mutated_<name-of-the-file>
恶意软件文件变异后,您可以再次运行分类器对变异后的恶意软件进行评分。
python classifier.py -d Mutated_malware/
⚠️ 警告:本部分目前正在建设中。给您带来的不便,我们深表歉意。请继续下一部分。点击此处
pip install -r requirements.txt 报错。
解决方案:
pip install tqdm
pip install sklearn
pip install lief
运行 python main_malgan.py 脚本时出现 ModuleNotFoundError: No module named 'tensorboardX' 错误。
解决方案:
pip install tensorboardX
执行 import-append、section-append 时出错(未找到)
解决方案: 请使用以下命令在终端中赋予这些可执行文件执行权限
cd portable-executable/
chmod 777 project-add-sections/bin/Debug/project-append-section
chmod 777 project-add-imports/bin/Debug/project-append-imports
Anderson, H., Kharkar, A., Filar, B., Evans, D. and Roth, P. (2018). Learning to Evade Static PE Machine Learning Malware Models via Reinforcement Learning. [online] arXiv.org. Available at: https://arxiv.org/abs/1801.08917.
Docs.microsoft.com. (n.d.). PE Format - Windows applications. [online] Available at: https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#general-concepts.
Fang, Z., Wang, J., Li, B., Wu, S., Zhou, Y. and Huang, H. (2019). Evading Anti-Malware Engines With Deep Reinforcement Learning. [online] Ieeexplore.ieee.org. Available at: https://ieeexplore.ieee.org/abstract/document/8676031 [Accessed 25 Aug. 2019]. https://resources.infosecinstitute.com. (2019).
Malware Researcher’s Handbook (Demystifying PE File). [online] Available at: https://resources.infosecinstitute.com/2-malware-researchers-handbook-demystifying-pe-file/#gref.
Hu, W. and Tan, Y. (2018). Generating Adversarial Malware Examples for Black-Box Attacks Based on GAN. [online] arXiv.org. Available at: https://arxiv.org/abs/1702.05983.