Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
ssh_connectA

Establish an SSH connection to a remote host.

Connect to a remote server for CTF debugging. Supports both key-based and password-based authentication.

Args: host: Remote host address (IP or hostname). port: SSH port number (default: 22). username: SSH username (default: root). key_path: Path to SSH private key file (optional). password: SSH password (optional).

Returns: Connection status message.

ssh_execA

Execute a command on the remote host via SSH.

Run a shell command on the connected remote server and return the combined output including stdout, stderr, and exit code.

Args: command: Shell command to execute on the remote host.

Returns: Formatted string with stdout, stderr, and exit code.

ssh_upload_fileA

Upload a local file to the remote host via SFTP.

Transfer a file from the local machine to the connected remote server.

Args: local_path: Path to the local file to upload. remote_path: Destination path on the remote host.

Returns: Upload confirmation message.

ssh_download_fileA

Download and read a file from the remote host via SFTP.

Retrieve the text content of a file from the connected remote server.

Args: remote_path: Path to the file on the remote host.

Returns: The text content of the remote file.

ssh_disconnectA

Disconnect from the current SSH session.

Close the active SSH connection and release all resources.

Returns: Disconnection confirmation message.

gdb_startA

启动 GDB 调试会话,加载目标二进制程序和可选的 GDB Python 插件。

Args: binary_path: 远程 Linux 上目标二进制文件的绝对路径 plugin_path: 可选,GDB Python 插件脚本路径(如 heap_logger.py)

Returns: GDB 启动输出信息

gdb_runC

在 GDB 中运行目标程序。等同于 GDB 的 'run' 命令。

Returns: run 命令的输出

gdb_continueB

继续执行被暂停的程序。等同于 GDB 的 'continue' 命令。

Returns: continue 命令的输出

gdb_continue_backgroundA

让 GDB 后台继续执行目标程序,立即返回 prompt。

用于请求粒度 heaplog:先设置请求完成断点,然后调用本工具让程序 继续运行;随后发送网络请求,等断点命中后再 heap_end_action。 内部执行: set target-async on continue&

Returns: GDB 对 continue& 的输出。

gdb_interruptA

中断正在运行的程序(发送 Ctrl-C)。用于暂停程序以执行 GDB 命令。

Returns: 中断后的输出

gdb_pauseA

临时暂停正在运行的调试目标,等价于 gdb_interrupt。

用于堆布局过程中在关键包发送后暂停程序,然后调用 gdb_memory / gdb_chunk / gdb_command("x/..") 查看指定内存区域。

注意:本项目大量使用 continue& 让 inferior 后台运行,此时 GDB 已经返回 prompt。对 prompt 发送 Ctrl-C 只会中断 GDB 自身输入,未必 会暂停后台 inferior;因此这里优先执行 GDB 的 interrupt 命令, 只有在 foreground continue 无 prompt 的场景下才回退到 PTY Ctrl-C。

Returns: 暂停后的 GDB 输出。

gdb_restartA

重启目标程序(kill 当前进程后重新 run)。

Returns: 重启后的输出

gdb_stopA

退出 GDB 会话,关闭调试连接。

Returns: 退出确认信息

gdb_commandA

发送任意 GDB/pwndbg 命令并返回输出。

可以执行任何 GDB 命令,如 'info functions', 'break main', 'heap', 'bins' 等。 命令执行后等待 GDB prompt 返回完整输出。

Args: cmd: 要执行的 GDB 命令字符串 timeout: 等待 GDB prompt 返回的秒数,复杂请求的 finish 可调大

Returns: 命令的完整输出

gdb_memoryA

查看指定内存区域,适合模型检查 source/next chunk/victim 附近内容。

会执行 GDB 的 x 命令输出字节和按 word_size 分组的数值。地址支持 表达式/十六进制,如 "0x57eebce8"、"$esp"、"0x57eebce8+0x40"。

Args: address: 起始地址或 GDB 表达式。 size: 查看字节数。 word_size: 分组大小,1/2/4/8;4 对 i386 chunk header 最常用。 pause_first: 若为 True,先 Ctrl-C 暂停目标。 include_bytes: 是否输出 x/Nxb。 include_words: 是否输出 x/Nxw/xg 等分组视图。

Returns: 内存 dump 文本。

gdb_chunkA

查看 glibc malloc chunk header 和附近内存。

对 i386 常用: chunk_addr 指向 chunk header,user 指针通常是 chunk_addr+0x8。工具会打印 prev_size/size 字段、chunk 附近内存, 并可尝试调用 pwndbg 的 malloc_chunk/vis/heap 命令。

Args: chunk_addr: chunk header 地址,例如 source/next chunk 地址。 context: dump 的上下文字节数。 pause_first: 是否先暂停目标。 try_pwndbg: 是否尝试 pwndbg malloc_chunk 命令。

Returns: chunk 信息和内存 dump。

gdb_source_windowB

围绕 SLPParseSrvUrl source chunk 查看溢出相关窗口。

会 dump:

  • source_chunk-before 到 source_chunk+source_size+after 的内存

  • next_chunk = source_chunk + source_size 的 chunk header

Args: source_chunk: source chunk header 地址。 source_size: source 实际 chunk 大小,通常 chunk_sz & ~7,例如 0x40。 before: source 前方查看字节数。 after: next chunk 后方查看字节数。 pause_first: 是否先暂停。

Returns: source/next chunk 周边内存。

gdb_read_outputA

读取 GDB 当前输出缓冲区中的内容。

不等待 prompt,仅读取当前可用的输出。用于查看正在运行程序的输出。

Args: timeout: 等待输出的最大秒数

Returns: 当前缓冲区中的输出内容

heap_begin_actionA

标记一个堆操作阶段的开始。

在发送 payload 到 CTF 程序之前调用此工具。 配合 heap_end_action 使用,记录这一步操作引起的所有堆变化。

Args: action_id: 操作标识符(如 "step_1", "spray_phase", "free_target")

Returns: 确认信息

heap_end_actionA

结束当前请求/堆操作阶段,返回该请求创建的 chunk 记录。

在单个网络请求或单个 connect/close 操作处理完毕、GDB 暂停后调用。 默认输出按请求粒度映射的 heaplog 风格记录,例如: [calloc] nmemb=0x1 size=0x46 total=0x46 user=... chunk_addr=... chunk_sz=... caller=... [malloc] size=0xec user=... chunk_addr=... chunk_sz=... caller=... 同时附带 Raw Delta JSON,供后续自动分析。

Args: event_types: 可选,逗号分隔事件类型/分组过滤,如 "alloc", "free", "malloc,calloc", 留空表示全部。 caller_contains: 可选,按 caller 符号子串过滤,如 "SLPParseSrvUrl"、"SLPBufferAlloc"。 action_contains: 可选,按 action 名称子串过滤。 addr_start: 可选,按 chunk/user 地址范围起点过滤,支持十六进制。 addr_end: 可选,按 chunk/user 地址范围终点过滤,支持十六进制。 around_addr: 可选,查看某地址附近的堆事件。 around_size: around_addr 半径。 limit: 最多返回多少条事件。 include_raw: 是否附带 Raw Delta JSON;调堆风水时可设 False 减少噪声。

Returns: JSON 格式的堆变化增量数据,包含: - action_id: 操作标识 - events: 详细事件列表 - delta: 增量汇总(新分配数、新释放数、详情) - summary: 一行文本摘要 - cumulative: 累计状态

heap_snapshotA

获取完整的堆状态快照。

在关键步骤后调用以验证完整堆布局。 返回所有活跃 chunk 的地址、大小和来源信息。

Args: caller_contains: 可选,按 caller 子串过滤活跃 chunk。 action_contains: 可选,按 action 子串过滤活跃 chunk。 addr_start: 可选,地址范围起点。 addr_end: 可选,地址范围终点。 around_addr: 可选,查看某地址附近的活跃 chunk。 around_size: around_addr 半径。 limit: 最多返回多少条。 include_raw: 是否附带 Raw Snapshot JSON。

Returns: 格式化的堆快照,包含所有活跃 chunk 信息

heap_get_stateB

获取当前堆状态概览(不生成文件,直接从 GDB 获取)。

快速查看当前活跃 chunk 数量和累计统计。

Returns: 堆状态概览文本

heap_query_deltaA

查询最近一次 heap-end 产生的 /tmp/heap_delta.json,可按 caller/地址过滤。

适合只关注布局后的 source 点相关日志,例如:

  • caller_contains="SLPParseSrvUrl"

  • around_addr="0x57eebce8", around_size=0x400

  • event_types="free"

Args: event_types: 逗号分隔类型/分组,如 "alloc", "free", "malloc,calloc"。 caller_contains: caller 符号子串过滤。 action_contains: action 名称子串过滤。 addr_start: 地址范围起点。 addr_end: 地址范围终点。 around_addr: 中心地址。 around_size: 中心地址半径。 limit: 最多返回多少条。 include_raw: 是否附带完整 JSON。

Returns: 过滤后的 heaplog 风格文本。

heap_query_logA

查询 heap_logger 的完整文本日志 /tmp/heaplog.txt,并可按地址/caller/action 过滤。

这个工具用于“只看某一段/某个 source 点附近日志”,不要求当前必须 处于 heap action。heaplog.txt 每行是 JSON 事件。

Args: caller_contains: caller 符号子串过滤。 action_contains: action 名称子串过滤。 text_contains: 原始 JSON 行文本子串过滤。 addr_start: 地址范围起点。 addr_end: 地址范围终点。 around_addr: 中心地址。 around_size: 中心地址半径。 event_types: 类型/分组过滤,如 "malloc,calloc,free"。 last: 返回最后 N 条匹配事件。

Returns: 过滤后的 heaplog 风格文本。

add_probeC

添加条件断点/自动采样 probe。commands 为 JSON 数组,每个元素是 GDB 命令。

remove_probeC

删除 probe。

list_probesB

列出 probe 以及最近命中输出。

heap_bins_jsonB

导出 glibc bin 状态 JSON,包括 fastbins/unsorted/smallbins/largebins。

heap_find_chunkB

查找指定 chunk 地址是否在 bin 中。addr 支持 0x 前缀。

heap_chunk_binC

返回指定 chunk 所属 bin 的简洁描述。

track_chunkB

开始追踪 chunk 地址的 header/bin/memory diff 生命周期。

untrack_chunkD

停止追踪 chunk。

tracked_chunks_statusA

输出已追踪 chunk 的当前 header、bin membership 和最近 diff。

begin_requestC

开始一个网络请求粒度的 heap timeline。

end_requestC

结束请求粒度 timeline;wait_handler_return 参数保留用于上层编排。

request_timelineC

读取请求级 heap timeline。

request_eventsC

按 label 查询请求内 heap 事件,可按 caller/type 过滤。

mem_snapshotC

保存内存快照。

mem_diffC

比较两个内存快照,输出 offset/old/new/u32/ascii。

run_heap_sweepC

Payload sweep 框架。configs 为 JSON list;command_template 可用 {config_json} {out_json} 占位。

ctf_connectB

通过 SSH 端口转发连接远程 CTF 服务。

连接到远程 Linux 上运行的 CTF 程序的网络端口。 通常 CTF 程序通过 socat 或自身绑定到某个端口。

Args: host: CTF 服务在远程机器上的地址(通常是 127.0.0.1) port: CTF 服务端口号

Returns: 连接状态信息和首次接收到的 banner/prompt

ctf_sendA

向 CTF 程序发送数据。

Args: data: 要发送的数据。如果 hex_mode=True,则 data 是十六进制字符串(如 "414243") hex_mode: 是否将 data 当作十六进制字节串处理

Returns: 确认发送的字节数

ctf_sendlineC

向 CTF 程序发送一行数据(自动追加换行符)。

Args: line: 要发送的文本行

Returns: 确认信息

ctf_recvC

接收 CTF 程序的响应数据。

Args: timeout: 等待数据的最大秒数

Returns: 收到的文本数据

ctf_recv_untilA

接收数据直到匹配指定模式。

Args: pattern: 要匹配的文本模式(如 "Choice: ", ">>>", ":") timeout: 等待的最大秒数

Returns: 从开始到匹配模式为止的所有数据

ctf_closeA

关闭与 CTF 程序的连接。

Returns: 关闭确认信息

ctf_menu_actionA

执行一个菜单式交互操作(选择菜单项并填写所有 prompt)。

这是一个组合工具,自动完成:发送菜单选择 → 等待每个 prompt → 填写对应值。 适用于典型的 CTF 堆题菜单交互。

Args: menu_choice: 菜单选项(如 "1" 表示选择第1项) prompts: JSON 数组字符串,每个元素包含 {"prompt": "等待的提示", "value": "要填写的值"} 示例: '[{"prompt": "Size:", "value": "128"}, {"prompt": "Content:", "value": "AAAA"}]'

Returns: 完整的交互过程记录(发送和接收的所有数据)

ida_headless_scanB

用 IDA headless 重新分析 ELF,并输出 JSON 扫描结果。

Args: binary_path: 待分析二进制,默认当前仓库 slpd。 out_path: 输出 JSON 路径。 ida_path: idat.exe 路径;为空时自动选 IDA9.3/9.0/7.7。 timeout_sec: IDA 批处理超时。

ida_find_functionsC

在 IDA 扫描结果中按函数名正则/子串查找函数。

ida_get_pseudocodeC

获取指定函数的反编译伪代码和地址。

ida_get_xrefsC

获取指定函数的 xrefs_to 和 calls_from 摘要。

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Aiyakami/PWN-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server