Skip to content

armgit / Cairn

Public Imported from GitHub
0

Cairn is a general-purpose AI state-space search engine, validated first on autonomous penetration testing. Sometimes misspelled as Carin.

feat: 自动编译上传 worker 镜像

leixiao14f58b75310d
diff --git a/.github/workflows/build-container-ghcr.yml b/.github/workflows/build-container-ghcr.yml
new file mode 100644
index 0000000..5bd8673
--- /dev/null
+++ b/.github/workflows/build-container-ghcr.yml
@@ -0,0 +1,36 @@
+name: Build And Publish Container
+
+on:
+ workflow_dispatch:
+ push:
+ paths:
+ - "container/**"
+
+permissions:
+ packages: write
+
+jobs:
+ docker:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Log in to GHCR
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Build and push
+ uses: docker/build-push-action@v6
+ with:
+ context: ./container
+ platforms: linux/amd64
+ push: true
+ tags: ghcr.io/${{ github.repository_owner }}/cairn-worker-container:latest
diff --git a/container/Dockerfile b/container/Dockerfile
index 863245d..0caa38f 100644
--- a/container/Dockerfile
+++ b/container/Dockerfile
@@ -1,10 +1,14 @@
-FROM --platform=amd64 kali
+FROM --platform=amd64 kalilinux/kali-rolling:latest
+
+RUN apt update && \
+ apt -y install kali-linux-headless && \
+ apt clean && \
+ rm -rf /var/lib/apt/lists/*
RUN useradd -m -s /bin/bash kali && \
echo "kali ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER kali
-# apt 安装常用工具和安全工具
RUN sudo apt update && \
sudo apt install -y bsdextrautils npm jq iputils-ping sshpass ncat rlwrap \
bloodyad coercer enum4linux-ng pwncat chisel-common-binaries \
@@ -15,14 +19,14 @@ RUN sudo apt update && \
sudo npm install -g @playwright/cli@latest && \
cd /tmp && playwright-cli install
-# 补充安全工具
RUN cd /tmp && \
- wget -q "https://ghfast.top/https://github.com/projectdiscovery/katana/releases/download/v1.5.0/katana_1.5.0_linux_amd64.zip" -O katana.zip && \
- wget -q "https://ghfast.top/https://github.com/projectdiscovery/nuclei/releases/download/v3.7.1/nuclei_3.7.1_linux_amd64.zip" -O nuclei.zip && \
- wget -q "https://ghfast.top/https://github.com/hahwul/dalfox/releases/download/v2.12.0/dalfox-linux-amd64.tar.gz" -O dalfox.tar.gz && \
- wget -q "https://ghfast.top/https://github.com/BishopFox/cloudfox/releases/download/v2.0.1/cloudfox-linux-amd64.zip" -O cloudfox.zip && \
- wget -q "https://ghfast.top/https://github.com/ropnop/kerbrute/releases/download/v1.0.3/kerbrute_linux_amd64" -O kerbrute && \
- git clone --depth 1 "https://ghfast.top/https://github.com/projectdiscovery/nuclei-templates.git" /home/kali/.local/nuclei-templates && \
+ wget -q "https://github.com/projectdiscovery/katana/releases/download/v1.5.0/katana_1.5.0_linux_amd64.zip" -O katana.zip && \
+ wget -q "https://github.com/projectdiscovery/nuclei/releases/download/v3.7.1/nuclei_3.7.1_linux_amd64.zip" -O nuclei.zip && \
+ wget -q "https://github.com/hahwul/dalfox/releases/download/v2.12.0/dalfox-linux-amd64.tar.gz" -O dalfox.tar.gz && \
+ wget -q "https://github.com/BishopFox/cloudfox/releases/download/v2.0.1/cloudfox-linux-amd64.zip" -O cloudfox.zip && \
+ wget -q "https://github.com/ropnop/kerbrute/releases/download/v1.0.3/kerbrute_linux_amd64" -O kerbrute && \
+ nuclei -ut && \
+ git clone --depth 1 "https://github.com/projectdiscovery/nuclei-templates.git" /home/kali/.local/nuclei-templates && \
unzip -q katana.zip katana && sudo mv katana /usr/local/bin/ && \
unzip -q nuclei.zip nuclei && sudo mv nuclei /usr/local/bin/ && \
tar -xzf dalfox.tar.gz && sudo mv dalfox-linux-amd64 /usr/local/bin/dalfox && \
@@ -30,44 +34,28 @@ RUN cd /tmp && \
sudo cp kerbrute /usr/local/bin/ && \
sudo rm -rf /tmp/*
-# 知识库
RUN mkdir -p /home/kali/knowledges && cd /home/kali/knowledges && \
- git clone --depth=1 https://ghfast.top/https://github.com/swisskyrepo/PayloadsAllTheThings.git && \
- git clone --depth=1 https://ghfast.top/https://github.com/swisskyrepo/InternalAllTheThings.git && \
- git clone --depth=1 https://ghfast.top/https://github.com/HackTricks-wiki/hacktricks.git && \
- git clone --depth=1 https://ghfast.top/https://github.com/HackTricks-wiki/hacktricks-cloud.git
-
-# 安装 codex 和 claude-code
-RUN sudo npm install -g @openai/[email protected]
-RUN sudo npm install -g @anthropic-ai/[email protected]
-
+ git clone --depth=1 https://github.com/swisskyrepo/PayloadsAllTheThings.git && \
+ git clone --depth=1 https://github.com/swisskyrepo/InternalAllTheThings.git && \
+ git clone --depth=1 https://github.com/HackTricks-wiki/hacktricks.git && \
+ git clone --depth=1 https://github.com/HackTricks-wiki/hacktricks-cloud.git
-# 下载一些工具
RUN mkdir -p /home/kali/tools && cd /home/kali/tools && \
- wget -q "https://gh-proxy.org/https://github.com/frohoff/ysoserial/releases/download/v0.0.6/ysoserial-all.jar" -O ysoserial.jar && \
- git clone --depth=1 https://ghfast.top/https://github.com/ticarpi/jwt_tool.git && \
- cd jwt_tool && pip3 install -i https://mirrors.ustc.edu.cn/pypi/simple/ -r requirements.txt --break-system-packages
-
+ wget -q "https://github.com/frohoff/ysoserial/releases/download/v0.0.6/ysoserial-all.jar" -O ysoserial.jar && \
+ git clone --depth=1 https://github.com/ticarpi/jwt_tool.git && \
+ cd jwt_tool && pip3 install -i https://mirrors.ustc.edu.cn/pypi/simple/ -r requirements.txt --break-system-packages && \
+ git clone --depth=1 https://github.com/IOActive/jdwp-shellifier.git
-# 下载一些 PoC
RUN mkdir -p /home/kali/pocs && cd /home/kali/pocs && \
- git clone --depth=1 https://gh-proxy.org/https://github.com/iSee857/CVE-PoC.git && \
- git clone --depth=1 https://gh-proxy.org/https://github.com/zhzyker/exphub.git && \
- git clone --depth=1 https://gh-proxy.org/https://github.com/passwa11/2023Hvv_.git && \
- git clone --depth=1 https://gh-proxy.org/https://github.com/Threekiii/Awesome-POC.git
-
-RUN cd /home/kali/pocs && \
- git clone --depth=1 https://gh-proxy.org/https://github.com/vulhub/vulhub.git
-
-RUN cd /home/kali/tools && \
- git clone --depth=1 https://gh-proxy.org/https://github.com/IOActive/jdwp-shellifier.git
-
-# 初始化 nuclei 配置
-RUN nuclei -ut
+ git clone --depth=1 https://github.com/iSee857/CVE-PoC.git && \
+ git clone --depth=1 https://github.com/zhzyker/exphub.git && \
+ git clone --depth=1 https://github.com/passwa11/2023Hvv_.git && \
+ git clone --depth=1 https://github.com/Threekiii/Awesome-POC.git && \
+ git clone --depth=1 https://github.com/vulhub/vulhub.git
-RUN sudo npm install -g @anthropic-ai/[email protected]
+RUN sudo npm install -g @openai/[email protected]
+RUN sudo npm install -g @anthropic-ai/[email protected]
-# 运行时配置
RUN sudo chmod +x /usr/local/bin/kerbrute
RUN mkdir -p /home/kali/.config/nuclei && \
echo >> /home/kali/.config/nuclei/config.yaml && \
@@ -83,7 +71,6 @@ ENV PLAYWRIGHT_MCP_BROWSER=chromium
ENV CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
ENV PYTHONUNBUFFERED=1
-# 配置 agent
COPY ./.agents /home/kali/workspace/.agents
COPY ./.agents /home/kali/workspace/.claude
COPY ./AGENTS.md /home/kali/workspace/AGENTS.md
diff --git a/container/Dockerfile.kali b/container/Dockerfile.kali
deleted file mode 100644
index aa3bcf7..0000000
--- a/container/Dockerfile.kali
+++ /dev/null
@@ -1,7 +0,0 @@
-FROM --platform=amd64 docker.m.daocloud.io/kalilinux/kali-rolling:latest
-
-RUN sed -i 's|http://http.kali.org/kali|http://mirrors.ustc.edu.cn/kali|g' /etc/apt/sources.list && \
- apt update && \
- apt -y install kali-linux-headless && \
- apt clean && \
- rm -rf /var/lib/apt/lists/*
\ No newline at end of file
diff --git a/container/README.md b/container/README.md
index 963e2f9..8ae4b55 100644
--- a/container/README.md
+++ b/container/README.md
@@ -1,4 +1,3 @@
```
-docker build . -f Dockerfile.kali -t kali
-docker build . -t worker_container
+docker build . -t cairn-worker-container
```
\ No newline at end of file