Skip to main content

CLI harness for Godzilla Security Testing Tool

Project description

cli-anything-godzilla

English | 简体中文

🚀 Generated by CLI-Anything | Optimized by @fengchenzxc


English

CLI harness for Godzilla Security Testing Tool.

Note: This is a standalone CLI tool that works with the original Godzilla GUI tool.

Features

  • ✅ Complete project management (create, open, save, info)
  • ✅ Shell management (add, list, update, remove, test connection)
  • ✅ Short ID support (all shell commands support short IDs)
  • ✅ C2 Profile management (load and validate)
  • ✅ Interactive REPL mode with friendly UI
  • ✅ JSON output mode for AI agent integration
  • ✅ Compatible with original Godzilla project database

Installation

Prerequisites

  • Python 3.12+ (tested with Python 3.12.8)
  • Java Runtime Environment (JRE) 11+
  • Godzilla JAR file (Godzilla15.jar)

Install the CLI

# From PyPI (when published)
pip install cli-anything-godzilla

# Or install locally for development
git clone https://github.com/fengchenzxc/cli-anything-godzilla.git
cd cli-anything-godzilla
pip install -e .

Verify Installation

which cli-anything-godzilla
cli-anything-godzilla --help

Usage

Start Interactive REPL Mode

# Start with no arguments (enter REPL mode)
cli-anything-godzilla

# Or specify a project
cli-anything-godzilla -p /path/to/project

Project Management

# Create a new project
cli-anything-godzilla project new -n "My Project" -d "Project description"

# Open an existing project
cli-anything-godzilla project open /path/to/project

# Show project information
cli-anything-godzilla project info

# List all projects
cli-anything-godzilla project list

# Close current project
cli-anything-godzilla project close

Shell Management

# Add a shell
cli-anything-godzilla shell add -u http://target.com/shell.jsp -p password

# List all shells
cli-anything-godzilla shell list

# Get shell details (supports short ID)
cli-anything-godzilla shell get 31f09e27

# Test shell connectivity (supports short ID)
cli-anything-godzilla shell test 31f09e27

# Update shell configuration
cli-anything-godzilla shell update 31f09e27 --remark "Updated remark"

# Remove a shell (supports short ID)
cli-anything-godzilla shell remove 31f09e27

# Export shells
cli-anything-godzilla shell export shells.json

# Import shells
cli-anything-godzilla shell import shells.json

C2 Profile Management

# List available profiles
cli-anything-godzilla profile list

# Load a profile
cli-anything-godzilla profile load /path/to/profile.yml

# Validate a profile
cli-anything-godzilla profile validate /path/to/profile.yml

JSON Output Mode

All commands support --json flag for machine-readable output:

cli-anything-godzilla --json shell list
cli-anything-godzilla --json shell get 31f09e27
cli-anything-godzilla --json project info

REPL Commands

When in interactive mode, use these commands:

Command Description
help Show available commands
exit Exit REPL mode
project info Show project information
project list List all projects
shell list List all shells
shell get <id> Get shell details
shell add <url> <password> Add new shell
shell test <id> Test shell connectivity
shell update <id> --remark "xxx" Update shell remark
shell remove <id> Remove shell
profile list List C2 profiles

Configuration

Supported Payload Types

  • JavaDynamicPayload - Java dynamic payload
  • CSharpDynamicPayload - C# dynamic payload
  • PhpDynamicPayload - PHP dynamic payload

Supported Encryption Types

  • xor - XOR encryption
  • aes128 - AES-128 encryption
  • aes256 - AES-256 encryption
  • base64 - Base64 encoding
  • hex - Hexadecimal encoding
  • raw - Raw data
  • rsa - RSA encryption

Running Tests

# Run unit tests
cd /path/to/agent-harness
python3.12 -m pytest cli_anything/godzilla/tests/test_core.py -v

# Run E2E tests
python3.12 -m pytest cli_anything/godzilla/tests/test_full_e2e.py -v -s

# Run with force-installed mode
CLI_ANYTHING_FORCE_INSTALLED=1 python3.12 -m pytest cli_anything/godzilla/tests/ -v -s

简体中文

🚀 CLI-Anything 生成 | 由 @fengchenzxc 优化调优

CLI 命令行工具包,用于哥斯拉(Godzilla)WebShell 管理器的安全测试。

注意: 本项目是一个独立的 CLI 工具,与原版哥斯拉 GUI 工具配合使用。

功能特性

  • ✅ 完整的项目管理(创建、打开、保存、信息)
  • ✅ Shell 管理(添加、查看、更新、删除、测试连接)
  • ✅ 短 ID 支持(所有 shell 命令支持使用短 ID)
  • ✅ C2 Profile 管理(加载和验证)
  • ✅ 交互式 REPL 模式,界面友好
  • ✅ JSON 输出模式(便于 AI 代理集成)
  • ✅ 兼容原版哥斯拉项目数据库

安装

前置要求

  • Python 3.12+ (已测试 Python 3.12.8)
  • Java Runtime Environment (JRE) 11+
  • 哥斯拉 JAR 文件 (Godzilla15.jar)

安装 CLI

# 从 PyPI 安装 (发布后)
pip install cli-anything-godzilla

# 或本地开发安装
git clone https://github.com/fengchenzxc/cli-anything-godzilla.git
cd cli-anything-godzilla
pip install -e .

验证安装

which cli-anything-godzilla
cli-anything-godzilla --help

使用方法

启动交互式 REPL 模式

# 无参数启动(进入 REPL 模式)
cli-anything-godzilla

# 指定项目启动
cli-anything-godzilla -p /path/to/project

项目管理

# 创建新项目
cli-anything-godzilla project new -n "我的项目" -d "项目描述"

# 打开已有项目
cli-anything-godzilla project open /path/to/project

# 查看项目信息
cli-anything-godzilla project info

# 列出所有项目
cli-anything-godzilla project list

# 关闭当前项目
cli-anything-godzilla project close

Shell 管理

# 添加 shell
cli-anything-godzilla shell add -u http://target.com/shell.jsp -p password

# 列出所有 shell
cli-anything-godzilla shell list

# 获取 shell 详情(支持短 ID)
cli-anything-godzilla shell get 31f09e27

# 测试 shell 连接(支持短 ID)
cli-anything-godzilla shell test 31f09e27

# 更新 shell 配置
cli-anything-godzilla shell update 31f09e27 --remark "更新备注"

# 删除 shell(支持短 ID)
cli-anything-godzilla shell remove 31f09e27

# 导出 shell
cli-anything-godzilla shell export shells.json

# 导入 shell
cli-anything-godzilla shell import shells.json

C2 Profile 管理

# 列出可用的 profiles
cli-anything-godzilla profile list

# 加载 profile
cli-anything-godzilla profile load /path/to/profile.yml

# 验证 profile
cli-anything-godzilla profile validate /path/to/profile.yml

JSON 输出模式

所有命令支持 --json 标志,输出机器可读格式:

cli-anything-godzilla --json shell list
cli-anything-godzilla --json shell get 31f09e27
cli-anything-godzilla --json project info

REPL 交互命令

在交互模式下,可使用以下命令:

命令 描述
help 显示可用命令
exit 退出 REPL 模式
project info 显示项目信息
project list 列出所有项目
shell list 列出所有 shell
shell get <id> 获取 shell 详情
shell add <url> <password> 添加新 shell
shell test <id> 测试 shell 连接
shell update <id> --remark "xxx" 更新 shell 备注
shell remove <id> 删除 shell
profile list 列出 C2 profiles

配置

支持的载荷类型

  • JavaDynamicPayload - Java 动态载荷
  • CSharpDynamicPayload - C# 动态载荷
  • PhpDynamicPayload - PHP 动态载荷

支持的加密方式

  • xor - XOR 加密
  • aes128 - AES-128 加密
  • aes256 - AES-256 加密
  • base64 - Base64 编码
  • hex - 十六进制编码
  • raw - 原始数据
  • rsa - RSA 加密

运行测试

# 运行单元测试
cd /path/to/agent-harness
python3.12 -m pytest cli_anything/godzilla/tests/test_core.py -v

# 运行 E2E 测试
python3.12 -m pytest cli_anything/godzilla/tests/test_full_e2e.py -v -s

# 使用强制安装模式运行测试
CLI_ANYTHING_FORCE_INSTALLED=1 python3.12 -m pytest cli_anything/godzilla/tests/ -v -s

兼容性

  • 可直接打开原版哥斯拉创建的项目(自动生成配置文件)
  • 数据库列名使用 camelCase(与原版哥斯拉保持一致)
  • 支持 HTTP 请求头的 JSON 和纯文本两种格式

Project Structure / 项目结构

cli_anything/godzilla/
├── __init__.py
├── godzilla_cli.py      # Main CLI entry point / CLI 主入口
├── core/
│   ├── __init__.py
│   ├── project.py       # Project management / 项目管理
│   ├── shell.py         # Shell management / Shell 管理
│   ├── profile.py       # C2 Profile management / C2 Profile 管理
│   └── database.py      # Database operations / 数据库操作
├── utils/
│   ├── __init__.py
│   ├── godzilla_backend.py  # Godzilla JAR integration / 哥斯拉 JAR 集成
│   └── repl_skin.py         # REPL interface / REPL 界面
└── tests/
    ├── TEST.md          # Test plan and results / 测试计划和结果
    ├── test_core.py     # Unit tests / 单元测试
    └── test_full_e2e.py # E2E tests / E2E 测试

License / 许可证

MIT License


Disclaimer / 免责声明

English: This tool is for authorized security testing and research purposes only. Unauthorized use is illegal.

中文: 本工具仅供安全研究和授权测试使用。使用本工具进行未经授权的测试是非法的。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cli_anything_godzilla-1.0.7.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cli_anything_godzilla-1.0.7-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file cli_anything_godzilla-1.0.7.tar.gz.

File metadata

  • Download URL: cli_anything_godzilla-1.0.7.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cli_anything_godzilla-1.0.7.tar.gz
Algorithm Hash digest
SHA256 a5c9be92659581c3a90515ec9fbb3551340e5974c5f72353a99ce5b06931ae24
MD5 ba41b7a163912366c8325ae916807f28
BLAKE2b-256 cd084f045c42c13ae3ffc86506eb549302921a40f2388d31fc0aa539e78611fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for cli_anything_godzilla-1.0.7.tar.gz:

Publisher: release.yml on fengchenzxc/cli-anything-godzilla

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cli_anything_godzilla-1.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for cli_anything_godzilla-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 76e78961557ad6dfe0f6d0b1baababa6fdd28f3b54e52b62eac42ab5ddc03cf0
MD5 1d7283613b143024e400b10655c83eac
BLAKE2b-256 77f15d4d8aa9987c4102857db8659ef3a4045a3f5914289660d1f32ea7cec07a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cli_anything_godzilla-1.0.7-py3-none-any.whl:

Publisher: release.yml on fengchenzxc/cli-anything-godzilla

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page