agentleFS
KxiandaoyanKxiandaoyan/CyberStrikeAI/skills/handoff-persistence-c2/SKILL.md

handoff-persistence-c2

Skill19 starsChanged 2 months agoApache-2.0View on GitHub

CS 内置 C2 没有目标侧自启动和长期维权。Beacon 会话一旦在线,按设置页已保存的下载地址投递运维方在自己维权 C2 上生成好的 Agent,再按主机名+新出现判定上线,然后不再使用该信道。 Use when a CyberStrikeAI Beacon session is online and persistence_c2.payload_url has been saved by the operator; CS only delivers and checks check-in.

The file

Files
SKILL.md

CS Beacon → 自定义维权 C2 交接(人编包+人保存下载地址,CS 投递+验上线)

CS Beacon 只服务「这次评估、CS 还开着」。要留下目标侧长期线:运维方先在自己的维权 C2 上生成/放置好 Agent(回连地址、信道、架构都在那边写死),再把 目标可达的下载地址 填进 CS「设置 → C2 → 自定义维权 C2 交接」并保存。

生成端不在本 Skill。下载地址也不由本 Skill 填写。 禁止调用对方 builder,禁止改 URL。 编包字段(时间窗、全自动轮询、Backup URL 的 JSON/HMAC 格式)写在仓库 README.md 第 4 节,不在这里复述。

前提

  • c2_session get:status 为 active 或 sleeping,hostname 不是空/unknown。
  • persistence_c2_handoff_source(或配置)里已有 payload_url。没有 → 停,请人去设置页保存。
  • 运维方的维权 C2 控制器已配好(地址与账号已存入设置页),Agent 已生成并放到目标可达的位置。

按序做

  1. c2_session get,钉死 session_id、hostname、username、os。
  2. 读已保存的 payload_url / drop_path。不要编、不要改。
    • 操作员在对话里口头给了当次下载地址时:只允许写进黑板 persist/handoff-url-override(upsert_project_fact,confidence=confirmed),投递时它优先于配置里的 URL。仍然禁止模型自己编造或改写任何地址。
  3. persistence_c2_list_agents 拍 baseline(实现会先 refresh)。
  4. c2_task 按该 URL 投递并拉起(HITL)。不要发明隐蔽安装。现网 c2_file 不能上传,不要去调它的 upload。
  5. 在 wait_seconds(默认 180)内每约 15s 再 list。判定:
    • hostname 小写全等(禁止 unknown==unknown)
    • username / OS 能解析时一致
    • 且 (channel,id) 或 agent_uuid 不在 baseline,或 last_seen ≥ 投递时刻
    • 不要要求 last_reply_ago<300(新登记常常还没回过命令,工具会显示 unknown)
  6. 命中 → upsert_project_fact key=persist/handoff-<session_id> confirmed,body 记 g_id/g_uuid/hostname/channel 与 CS session 对上,CS 不再使用该信道。
  7. 停止调用 persistence_c2_。评估继续只用 c2_。

不要做

  • 不要调 c2_task 的 task_type=persist——那是 CS Beacon 自带的临时自启动(cron/bashrc/registry),不可靠且与维权 C2 重复。长期维权一律走本 Skill 的交接,一次交接后停用
  • 没有 Beacon 或没有已保存 URL 就去种
  • 调运维方 C2 的 builder,或让模型填/改下载地址、回连地址
  • 把 persistence_c2_list_agents 当工作通道(它只用来拍 baseline 和验上线)
  • 用 c2_task 打维权 C2 的 agent id;用 CS 的 s_ 去对维权 C2 的 id
  • 把 baseline 里的旧 Agent 当成成功
  • 登记失败后死循环重投

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.