{
  "schema": "aidefend-secureflow-metadata-v1",
  "flow_id": "aidefend-research-sf0081-comfyui-custom-node-cryptomining-proxy-botnet",
  "title": "ComfyUI Botnet: Custom-Node Execution, Malicious Installs and Reinfection",
  "subtitle": "Existing executable nodes and alternative Manager installation routes converge on the payload; persistence and monetization are separate capabilities.",
  "summary": "Censys investigated a campaign targeting internet-exposed ComfyUI, a node-based interface for image-generation workflows. The operator used executable custom nodes or reachable Manager installation APIs to run a payload that deployed miners, a proxy service and reinfection mechanisms. Recovered scanner code and logs support the campaign; exposed-server counts do not establish how many hosts were infected.",
  "reviewed": true,
  "import_status": "curated-research",
  "ai_layers": [
    "ai-infrastructure"
  ],
  "risk_impact": [
    "system-compromise-rce",
    "resource-hijacking-cost"
  ],
  "affected_components": [
    "ComfyUI /object_info and /prompt APIs",
    "Code-capable third-party custom nodes",
    "ComfyUI-Manager installation APIs",
    "Python package setup.py and file-backed startup artifacts",
    "XMRig, lolMiner and Hysteria v2 payload functions"
  ],
  "source_research": {
    "provider": "Censys",
    "primary_url": "https://censys.com/blog/comfyui-servers-cryptomining-proxy-botnet/",
    "published": "2026-04-06",
    "note": "Primary campaign analysis of recovered operational code and logs. Artifact capabilities, scanner claims and observed effects remain distinct. ATLAS annotations are analyst curation, not an official ATLAS case."
  },
  "attack_steps": [
    {
      "id": "find-server",
      "title": "Find an internet-exposed ComfyUI server",
      "zhTitle": "尋找公開在網際網路的 ComfyUI 伺服器",
      "summary": "The recovered operator scanner searches for exposed ComfyUI deployments. Exposure is not itself proof of compromise.",
      "zhSummary": "取得的攻擊者掃描程式會搜尋對外公開的 ComfyUI 部署；公開暴露本身不等於已遭入侵。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 0,
        "y": 0
      }
    },
    {
      "id": "enumerate-nodes",
      "title": "Enumerate available custom nodes",
      "zhTitle": "列舉可用的自訂節點",
      "summary": "The scanner queries /object_info for code-capable nodes such as FL_CodeNode, SrlEval and EvaluateMultiple. Manager installation is an alternative when suitable nodes are absent.",
      "zhSummary": "掃描程式查詢 /object_info，尋找 FL_CodeNode、SrlEval、EvaluateMultiple 等可執行程式的節點。沒有合適節點時，會改嘗試 Manager 安裝路徑。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 650,
        "y": 0
      }
    },
    {
      "id": "submit-existing",
      "title": "Submit Python through an existing code-capable node",
      "zhTitle": "透過既有可執行節點提交 Python",
      "summary": "When a suitable node is present, an attacker-controlled workflow submitted to POST /prompt executes Python in the ComfyUI process.",
      "zhSummary": "已有合適節點時，攻擊者以 POST /prompt 提交含有自訂 Python 的工作流程，讓 ComfyUI 程序執行。",
      "tactic": "AML.TA0005",
      "technique": "AML.T0050",
      "layout": {
        "x": 1950,
        "y": -1200
      }
    },
    {
      "id": "request-pip",
      "title": "Request the malicious VCS package through Manager pip",
      "zhTitle": "透過 Manager pip 要求安裝惡意儲存庫套件",
      "summary": "In scanner v8.2, a reachable /customnode/install/pip endpoint receives the attacker’s ComfyUI-Shell-Executor repository URL.",
      "zhSummary": "在掃描程式 v8.2 中，攻擊者向可連入的 /customnode/install/pip 端點，提交 ComfyUI-Shell-Executor 儲存庫網址。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 1950,
        "y": 0
      }
    },
    {
      "id": "execute-setup",
      "title": "Execute the malicious package setup.py",
      "zhTitle": "執行惡意套件的 setup.py",
      "summary": "The package’s installation code launches the payload-fetch command. The repository contains no real ComfyUI nodes; installation itself is the malicious execution route.",
      "zhSummary": "套件安裝程式會啟動取得惡意程式的命令。該儲存庫沒有真正的 ComfyUI 節點；安裝本身就是執行惡意程式的路徑。",
      "tactic": "AML.TA0005",
      "technique": "AML.T0050",
      "layout": {
        "x": 2600,
        "y": 0
      }
    },
    {
      "id": "install-code-node",
      "title": "Install a code-capable node through another Manager route",
      "zhTitle": "透過其他 Manager 路徑安裝可執行節點",
      "summary": "If the pip strategy does not succeed and Manager is reachable, the scanner tries git-URL, queue or legacy installation alternatives for node packages. These alternatives are not all prerequisites.",
      "zhSummary": "pip 策略未成功且可連入 Manager 時，掃描程式會嘗試 git 網址、佇列或舊版安裝介面。這些是替代方法，不是全部都必須完成的前置步驟。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 1950,
        "y": 1200
      }
    },
    {
      "id": "reboot-server",
      "title": "Reboot through the Manager API",
      "zhTitle": "透過 Manager API 重新啟動",
      "summary": "After node installation, the scanner requests /manager/reboot and waits for the service to return. The malicious pip setup does not require this reboot to begin execution.",
      "zhSummary": "安裝節點後，掃描程式要求 /manager/reboot，再等待服務恢復。惡意 pip 安裝程式不需要先重新啟動，才開始執行。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 2600,
        "y": 1200
      }
    },
    {
      "id": "submit-installed",
      "title": "Retry the executable-node workflow",
      "zhTitle": "再次提交可執行節點的工作流程",
      "summary": "The scanner retries the original workflow injection after the service returns with the installed node.",
      "zhSummary": "服務帶著安裝的節點恢復後，掃描程式再次提交原本的工作流程注入。",
      "tactic": "AML.TA0005",
      "technique": "AML.T0050",
      "layout": {
        "x": 3250,
        "y": 1200
      }
    },
    {
      "id": "fetch-payload",
      "title": "Download the ghost.sh payload",
      "zhTitle": "下載 ghost.sh 惡意程式",
      "summary": "The execution routes fetch the operator payload, recovered as q11.txt with internal GHOST v5.1 branding. A later q12.txt revision is distinct.",
      "zhSummary": "各條執行路徑下載攻擊者程式；研究人員取得的 q11.txt 內部標為 GHOST v5.1，後續 q12.txt 是另一個版本。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 4550,
        "y": 0
      }
    },
    {
      "id": "run-payload",
      "title": "Run the downloaded payload",
      "zhTitle": "執行下載的惡意程式",
      "summary": "The shell payload runs with the compromised service’s available privileges. The following branches describe recovered capabilities and scanner-installed artifacts, not a required serial sequence on every host.",
      "zhSummary": "shell 惡意程式以遭入侵服務可用的權限執行。後續分支呈現已取得的功能與掃描程式植入的檔案，不表示每台主機都依序執行全部動作。",
      "tactic": "AML.TA0005",
      "technique": "AML.T0050",
      "layout": {
        "x": 5200,
        "y": 0
      }
    },
    {
      "id": "plant-monitor",
      "title": "Plant the disguised performance-monitor node",
      "zhTitle": "植入偽裝的效能監測節點",
      "summary": "Scanner v8.2 writes custom_nodes/comfyui_perf_monitor/__init__.py. Its module-load thread is programmed to fetch and run q11.txt every six hours; this is a reinfection capability.",
      "zhSummary": "掃描程式 v8.2 寫入 custom_nodes/comfyui_perf_monitor/__init__.py。模組載入時建立的執行緒，會設定每六小時重新下載並執行 q11.txt；這是再次感染的功能。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 6500,
        "y": -1200
      }
    },
    {
      "id": "poison-startup",
      "title": "Write the malicious default startup workflow",
      "zhTitle": "寫入惡意預設啟動工作流程",
      "summary": "The recovered scanner attempts to write the exploit workflow to userdata/default/workflows/default.json. Censys describes a restart reinfection path; the exact loading/execution trigger and successful later restart were not independently validated here.",
      "zhSummary": "取得的掃描程式嘗試把攻擊工作流程寫入 userdata/default/workflows/default.json。Censys 將它描述為重新啟動後的再次感染路徑；本次未獨立驗證確切載入與執行條件，也未驗證後續重新啟動成功觸發。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 6500,
        "y": -400
      }
    },
    {
      "id": "run-miners",
      "title": "Deploy CPU or GPU cryptocurrency miners",
      "zhTitle": "部署 CPU 或 GPU 加密貨幣挖礦程式",
      "summary": "The recovered payload uses XMRig for Monero CPU mining and lolMiner for Conflux GPU mining, subject to available host resources.",
      "zhSummary": "取得的惡意程式使用 XMRig 進行 Monero CPU 挖礦，並使用 lolMiner 進行 Conflux GPU 挖礦；實際執行受主機資源限制。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 6500,
        "y": 400
      }
    },
    {
      "id": "run-proxy",
      "title": "Deploy the Hysteria v2 proxy service",
      "zhTitle": "部署 Hysteria v2 代理服務",
      "summary": "The payload installs a proxy service, enrolling compromised infrastructure in an operator-controlled relay network. It is separate from cryptocurrency mining.",
      "zhSummary": "惡意程式安裝代理服務，把遭入侵設備納入攻擊者控制的轉送網路；這與加密貨幣挖礦是分開的功能。",
      "tactic": null,
      "technique": null,
      "layout": {
        "x": 6500,
        "y": 1200
      }
    }
  ],
  "threat_refs": [
    {
      "id": "AML.T0050",
      "name": "Command and Scripting Interpreter"
    }
  ],
  "reader_narrative": {
    "pathCount": 3,
    "topologyNote": "Alternative entry routes; post-compromise branches show recovered capabilities, not proof that every victim ran all of them. Later q12.txt Docker/Redis propagation code is outside this initial-infection graph.",
    "groups": [
      {
        "id": "discovery",
        "kind": "shared",
        "eyebrow": "Shared Discovery",
        "label": "Find and Inspect ComfyUI",
        "summary": "The scanner selects executable-node or Manager routes according to the available surface.",
        "stepIds": [
          "find-server",
          "enumerate-nodes"
        ]
      },
      {
        "id": "existing",
        "kind": "path",
        "eyebrow": "Path A",
        "label": "Existing Executable Node",
        "summary": "A suitable node already exists; no package installation is required.",
        "stepIds": [
          "submit-existing"
        ]
      },
      {
        "id": "pip",
        "kind": "path",
        "eyebrow": "Path B",
        "label": "Malicious pip Installation",
        "summary": "v8.2 can execute setup.py during installation, before any reboot or node retry.",
        "stepIds": [
          "request-pip",
          "execute-setup"
        ]
      },
      {
        "id": "manager",
        "kind": "path",
        "eyebrow": "Path C",
        "label": "Install a Node and Retry",
        "summary": "Other Manager methods are alternatives; installation and reboot precede another workflow submission.",
        "stepIds": [
          "install-code-node",
          "reboot-server",
          "submit-installed"
        ]
      },
      {
        "id": "payload",
        "kind": "converged",
        "eyebrow": "Shared Payload",
        "label": "Download and Run",
        "summary": "The represented routes converge on payload execution.",
        "stepIds": [
          "fetch-payload",
          "run-payload"
        ]
      },
      {
        "id": "persistence",
        "kind": "additional",
        "eyebrow": "Reinfection Artifacts",
        "label": "Custom Node and Startup Workflow",
        "summary": "These artifacts configure later execution; the graph does not assert observed timer/restart events on every victim.",
        "stepIds": [
          "plant-monitor",
          "poison-startup"
        ]
      },
      {
        "id": "monetization",
        "kind": "additional",
        "eyebrow": "Separate Capabilities",
        "label": "Mining and Proxy Service",
        "summary": "CPU/GPU mining and a proxy service are independent functions, not mandatory sequential steps.",
        "stepIds": [
          "run-miners",
          "run-proxy"
        ]
      }
    ]
  }
}
