Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
Pesidious — 使用强化学习和生成对抗网络的恶意软件变异 | Kitploit
工具/GitHubGitHub/cyberforce/pesidious
Payload生成漏洞利用恶意软件分析机器学习AI 安全对抗性攻击
GitHubcyberforce/pesidious

Pesidious

使用强化学习和生成对抗网络的恶意软件变异

查看仓库
1753685年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Logo

使用深度强化学习和GAN进行恶意软件变异

该工具的目的是利用人工智能对恶意软件(仅限PE32格式)样本进行变异,以绕过基于AI的分类器,同时保持其原有功能。过去,该领域已有显著的研究成果,研究人员分别采用强化学习或生成对抗网络作为首选武器来修改恶意软件可执行文件的状态,以欺骗杀毒引擎。我们的解决方案结合了深度强化学习和GAN,以克服单独使用这些方法时面临的一些局限性,如下所示。

Diagram

完整的工具文档请参见此处

安装说明

⚠️ 由于本工具处理恶意软件文件,强烈建议在虚拟机中使用。安装工具后,请确保断开网络连接。

以下步骤将指导您完成所有环境安装。

  1. 安装并设置Python 3.6。

  2. 克隆仓库。

    root@kitploit:~
    git clone https://github.com/CyberForce/Pesidious
    
  3. 进入项目目录。

    root@kitploit:~
    cd Pesidious
    
  4. 使用Python 3.6设置并激活虚拟环境

    建议使用虚拟环境以避免不同应用程序使用的包之间的冲突

  5. 确保已安装并设置pip 8.1.1。

    这是因为较新版本的pip与PyTorch库兼容性不佳。

    root@kitploit:~
    pip install pip==8.1.1
    
  6. 通过安装requirements.txt文件来安装所有必需的库。

    root@kitploit:~
    pip install -r pip_requirements/requirements.txt
    

变异您的恶意软件

GAN的输出已预先存储为(RL_Features/adverarial_imports_set.pk 和 RL_Features/adverarial_sections_set.pk),用于在变异时向恶意软件添加导入和节。

  1. 您可以测试样本分类器以对恶意软件文件进行评分。

    root@kitploit:~
    python classifier.py -d /path/to/directory/with/malware/files
    
  2. 运行 mutate.py Python 脚本来变异您的恶意软件样本。

    root@kitploit:~
    python mutate.py -d /path/to/directory/with/malware/files
    
  3. 变异的恶意软件文件将存储在名为 Mutated_malware 的目录中,格式如下:

    root@kitploit:~
    Mutated_malware/mutated_<name-of-the-file>
    
  4. 恶意软件文件变异后,您可以再次运行分类器对变异后的恶意软件进行评分。

    root@kitploit:~
    python classifier.py -d Mutated_malware/
    

已知问题和修复方法

⚠️ 警告:本部分目前正在建设中。给您带来的不便,我们深表歉意。请继续下一部分。点击此处

  1. pip install -r requirements.txt 报错。

    解决方案:

    root@kitploit:~
    pip install tqdm
    pip install sklearn
    pip install lief
    
  2. 运行 python main_malgan.py 脚本时出现 ModuleNotFoundError: No module named 'tensorboardX' 错误。

    解决方案:

    root@kitploit:~
    pip install tensorboardX
    
  3. 执行 import-append、section-append 时出错(未找到)

    解决方案: 请使用以下命令在终端中赋予这些可执行文件执行权限

    root@kitploit:~
    cd portable-executable/
    chmod 777 project-add-sections/bin/Debug/project-append-section
    chmod 777 project-add-imports/bin/Debug/project-append-imports
    

构建工具

  • PyTorch - 基于Torch库的开源机器学习库。
  • Lief - 跨平台库,可解析、修改和抽象ELF、PE和MachO格式。
  • PE Bliss - 用C++编写的PE库,用于重建PE文件。
  • Gym-Malware - OpenAI gym的恶意软件操作环境。
  • MalwareGAN - 使用GAN生成对抗性恶意软件。

作者

  • Chandni Vaya - X-Force Incident Response, IBM Security - Github
  • Bedang Sen - X-Force Incident Response, IBM Security - Github

致谢

  • Gym-Malware环境:https://github.com/endgameinc/gym-malware。我们对环境进行了修改以添加GAN,并对变异进行了添加/更改/移除,以提高恶意软件的逃避能力并保持功能。
  • Yanming Lai (https://github.com/yanminglai/Malware-GAN) 和
  • Zayd Hammoudeh (https://github.com/ZaydH/MalwareGAN) 对Han和Tan的MalGAN的实现工作对我们理解该架构起到了关键作用。本项目中使用的大部分MalGAN实现都是从Hammoudeh的工作分支而来。

参考文献

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.

下载工具