gusta-ve/hickok

GitHub: gusta-ve/hickok

一款无依赖的 Python 渗透测试 CLI,集 reverse-shell 管理、PTY 升级和自动化 SQL 注入引擎于一体。

Stars: 0 | Forks: 0

# hickok

hickok — reverse-shell handler & post-exploitation

一个 reverse-shell 处理程序和后渗透控制台。在多个 listener 上捕获 shell,运行命令,升级到完整的 PTY,生成 reverse-shell 单行命令,并端到端地走通一次 SQL 注入 —— 所有这一切都来自一个无依赖的 CLI。 它是手的一半:[**wraith**](https://github.com/gusta-ve/wraith) 握着 A —— 它负责侦察并证明入侵的路径;**hickok** 带来 8 —— 它根据 wraith 捕获的信息采取行动。A 和 8,这就是*死人牌* (dead man's hand)。 [![PyPI](https://img.shields.io/pypi/v/hickok?color=ffb946&label=pypi)](https://pypi.org/project/hickok/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/f40abc4151071132.svg)](https://github.com/gusta-ve/hickok/actions/workflows/ci.yml) [![Release](https://img.shields.io/github/v/release/gusta-ve/hickok?color=ffb946)](https://github.com/gusta-ve/hickok/releases) ![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue) ![MIT](https://img.shields.io/badge/license-MIT-green) - [安装](#install) - [用法](#usage) - [SQL 注入](#sql-injection--hickok-sql) - [桥梁](#the-bridge--hickok-call) - [对决模式](#showdown-mode--hickok-showdown) ## 安装 ``` pipx install hickok ``` 或者通过克隆的代码库安装:`pip install -e .` —— 或者完全不安装直接运行: `PYTHONPATH=src python3 -m hickok`。 ## 用法 listener 是默认命令,因此直接输入 `hickok` 就会开始捕获 shell: ``` hickok # listen on :9001, drop into the console hickok -l 9001,9002 --lhost 10.10.14.7 # multiple listeners, fixed LHOST hickok payloads 10.10.14.7 9001 # print reverse-shell one-liners hickok call # act on wraith's latest run (found on its own) hickok call path/to/findings.json # ...or a specific one hickok sql -u 'http://host/p?id=1' -p id # walk a SQL-injectable parameter hickok hand # lay down the dead man's hand (the reveal) hickok showdown # toggle "showdown mode" — a landed shell plays out ``` 在控制台内部: ``` hickok> sessions list connected shells payloads reverse-shell one-liners for your LHOST cmd 1 id run a command on session 1 upgrade [1] full PTY, sized to your terminal (id optional if only one) interact [1] attach (detach with Ctrl-]) kill [1] drop a session ``` 掉线的 shell 会发出通知(不会出现静默丢失的情况),并且每个会话都会**记录在 transcript** 中,存放在 `~/.local/share/hickok/sessions/` 下,方便你撰写报告。`upgrade` 会启动一个 PTY,*并*将其 `TERM` 和窗口大小与你的终端相匹配,这样一旦你执行 `interact`,`clear`、`vi` 等程序就能正常工作。 ## SQL 注入 — `hickok sql` 通过 SQL 注入遍历数据库 —— 找到入口并将其读取出来。hickok 会校准注入点,对 DBMS 进行指纹识别(SQLite / MySQL / MSSQL / PostgreSQL),并自动选择最快的技术: - **union** — 当页面反映了查询输出时,它会在*一*次请求中读取整个值(通过 `group_concat` 读取整张表)。在 blind 模式下需要大约 1000 次请求的完整遍历,在这里只需少数几次。 - **boolean-blind** — 在其他情况下,它通过 TRUE/FALSE oracle 对每个字符进行二分搜索(当 false 页面几乎没变化时,会强制触发错误)。 - **time-based** — 当*没有任何东西*泄露时(相同页面,没有反射),它通过条件 sleep 进行询问并对响应进行计时。速度慢,但具有普适性。 使用 `--technique union|blind|time` 强制指定一种(默认为 `auto`,优先选择最快的)。 ``` hickok sql -u 'http://host/db?id=1' -p id # or just `hickok sql` to read it # from wraith's latest SQLi finding ``` 进入时,它会打印出 DBMS 以及它能看到的数据库,让你有地方开始挖掘: ``` hickok(sql)> banner DBMS version user / db current user / database databases list databases tables list tables columns a table's columns dump
dump its rows query "