|
5 | 5 | tags: |
6 | 6 | - "*" |
7 | 7 | jobs: |
8 | | - build: |
| 8 | + build_x86: |
9 | 9 | permissions: |
10 | 10 | contents: write |
11 | 11 | continue-on-error: false |
12 | 12 | runs-on: ubuntu-latest |
13 | 13 | steps: |
14 | 14 | - name: Checkout |
15 | 15 | uses: actions/checkout@v4 |
| 16 | + - uses: dtolnay/rust-toolchain@stable |
| 17 | + with: |
| 18 | + toolchain: "nightly-2024-12-31" #we do not trust llvm20 yet |
| 19 | + components: clippy rustfmt |
16 | 20 |
|
17 | | - - uses: taiki-e/install-action@just |
| 21 | + - name: Install the dependencies |
| 22 | + run: | |
| 23 | + sudo apt update |
| 24 | + sudo apt install -y protobuf-compiler |
| 25 | + cargo install bpf-linker |
| 26 | + |
| 27 | + - name: Build tamanoir-ebpf |
| 28 | + run: cd tamanoir-ebpf && cargo build --release |
18 | 29 |
|
19 | | - - uses: cargo-bins/cargo-binstall@main |
| 30 | + - name: Build tamanoir for x86_64 |
| 31 | + run: | |
| 32 | + cargo build -p tamanoir --target x86_64-unknown-linux-gnu --release |
| 33 | + cp target/x86_64-unknown-linux-gnu/release/tamanoir tamanoir-x86_64 |
20 | 34 |
|
| 35 | + - name: Build tamanoir-c2 for x86_64 |
| 36 | + run: | |
| 37 | + cargo build -p tamanoir-c2 --target x86_64-unknown-linux-gnu --release |
| 38 | + cp target/x86_64-unknown-linux-gnu/release/tamanoir-c2 tamanoir-c2-x86_64 |
| 39 | +
|
| 40 | + - name: Build tamanoir-tui for x86_64 |
| 41 | + run: | |
| 42 | + cargo build -p tamanoir-tui --target x86_64-unknown-linux-gnu --release |
| 43 | + cp target/x86_64-unknown-linux-gnu/release/tamanoir-tui tamanoir-tui-x86_64 |
| 44 | +
|
| 45 | + - name: Build hello-world shellcodes for x86_64 |
| 46 | + run: | |
| 47 | + ./tamanoir-c2-x86_64 rce build -c ./assets/payloads/hello -t x86_64 |
| 48 | + ./tamanoir-c2-x86_64 rce build -c ./assets/payloads/xeyes -t x86_64 |
| 49 | + cp $HOME/.tamanoir/bins/tamanoir-rce-hello_x86_64.bin tamanoir-rce-hello_x86_64.bin |
| 50 | + cp $HOME/.tamanoir/bins/tamanoir-rce-xeyes_x86_64.bin tamanoir-rce-xeyes_x86_64.bin |
| 51 | +
|
| 52 | + - name: Persist artifacts |
| 53 | + uses: actions/upload-artifact@v4 |
| 54 | + with: |
| 55 | + name: x86-artifacts |
| 56 | + path: | |
| 57 | + tamanoir-x86_64 |
| 58 | + tamanoir-c2-x86_64 |
| 59 | + tamanoir-tui-x86_64 |
| 60 | + tamanoir-rce-hello_x86_64.bin |
| 61 | + tamanoir-rce-xeyes_x86_64.bin |
| 62 | + |
| 63 | + build_arm: |
| 64 | + permissions: |
| 65 | + contents: write |
| 66 | + continue-on-error: false |
| 67 | + runs-on: ubuntu-24.04-arm |
| 68 | + steps: |
| 69 | + - name: Checkout |
| 70 | + uses: actions/checkout@v4 |
21 | 71 | - uses: dtolnay/rust-toolchain@stable |
22 | 72 | with: |
23 | | - toolchain: nightly |
| 73 | + toolchain: "nightly-2024-12-31" #we do not trust llvm20 yet |
24 | 74 | components: clippy rustfmt |
25 | 75 |
|
26 | 76 | - name: Install the dependencies |
27 | 77 | run: | |
28 | 78 | sudo apt update |
29 | | - sudo apt install -y podman binutils-aarch64-linux-gnu musl-tools |
30 | | - cargo binstall -y cross |
31 | | - cargo binstall -y bpf-linker |
| 79 | + sudo apt install -y protobuf-compiler llvm-19-dev libclang-19-dev clang-19 |
| 80 | + export LD_LIBRARY_PATH=/usr/lib/llvm-19/lib:$LD_LIBRARY_PATH |
| 81 | + cargo install bpf-linker |
| 82 | +
|
32 | 83 |
|
33 | 84 | - name: Build tamanoir-ebpf |
34 | | - run: just build-ebpf |
| 85 | + run: cd tamanoir-ebpf && cargo build --release |
35 | 86 |
|
36 | | - - name: Build tamanoir-proxy for arm64 musl |
| 87 | + - name: Build tamanoir for arm64 |
37 | 88 | run: | |
38 | | - CROSS_CONTAINER_ENGINE=podman cross build -p tamanoir-proxy --target aarch64-unknown-linux-musl --release |
39 | | - cp target/aarch64-unknown-linux-musl/release/tamanoir tamanoir-aarch64-unknown-linux-musl |
| 89 | + cargo build -p tamanoir --target aarch64-unknown-linux-gnu --release |
| 90 | + cp target/aarch64-unknown-linux-gnu/release/tamanoir tamanoir-aarch64 |
40 | 91 |
|
41 | | - - name: Build tamanoir-proxy for x86_64 musl |
| 92 | + - name: Build tamanoir-C2 for arm64 |
42 | 93 | run: | |
43 | | - CROSS_CONTAINER_ENGINE=podman cross build -p tamanoir-proxy --target x86_64-unknown-linux-musl --release |
44 | | - cp target/x86_64-unknown-linux-musl/release/tamanoir tamanoir-x86_64-unknown-linux-musl |
| 94 | + cargo build -p tamanoir-c2 --target aarch64-unknown-linux-gnu --release |
| 95 | + cp target/aarch64-unknown-linux-gnu/release/tamanoir-c2 tamanoir-c2-aarch64 |
45 | 96 |
|
46 | | - - name: Build tamanoir for arm64 musl |
| 97 | + - name: Build tamanoir-tui for arm64 |
47 | 98 | run: | |
48 | | - CROSS_CONTAINER_ENGINE=podman cross build --target aarch64-unknown-linux-musl --release |
49 | | - cp target/aarch64-unknown-linux-musl/release/tamanoir tamanoir-aarch64-unknown-linux-musl |
| 99 | + cargo build -p tamanoir-tui --target aarch64-unknown-linux-gnu --release |
| 100 | + cp target/aarch64-unknown-linux-gnu/release/tamanoir-tui tamanoir-tui-aarch64 |
50 | 101 |
|
51 | | - - name: Build tamanoir for x86_64 musl |
| 102 | + - name: Build hello-world shellcodes for arm64 |
52 | 103 | run: | |
53 | | - CROSS_CONTAINER_ENGINE=podman cross build --target x86_64-unknown-linux-musl --release |
54 | | - cp target/x86_64-unknown-linux-musl/release/tamanoir tamanoir-x86_64-unknown-linux-musl |
| 104 | + ./tamanoir-c2-aarch64 rce build -c ./assets/payloads/hello -t aarch64 |
| 105 | + ./tamanoir-c2-aarch64 rce build -c ./assets/payloads/xeyes -t aarch64 |
| 106 | + cp $HOME/.tamanoir/bins/tamanoir-rce-hello_aarch64.bin tamanoir-rce-hello_aarch64.bin |
| 107 | + cp $HOME/.tamanoir/bins/tamanoir-rce-xeyes_aarch64.bin tamanoir-rce-xeyes_aarch64.bin |
| 108 | +
|
| 109 | + - name: Persist artifacts |
| 110 | + uses: actions/upload-artifact@v4 |
| 111 | + with: |
| 112 | + name: arch-artifacts |
| 113 | + path: | |
| 114 | + tamanoir-aarch64 |
| 115 | + tamanoir-c2-aarch64 |
| 116 | + tamanoir-tui-aarch64 |
| 117 | + tamanoir-rce-hello_aarch64.bin |
| 118 | + tamanoir-rce-xeyes_aarch64.bin |
55 | 119 |
|
56 | | - - name: Upload Binary |
| 120 | + release: |
| 121 | + permissions: |
| 122 | + contents: write |
| 123 | + continue-on-error: false |
| 124 | + needs: [build_x86,build_arm] |
| 125 | + runs-on: ubuntu-latest |
| 126 | + steps: |
| 127 | + - name: Checkout |
| 128 | + uses: actions/checkout@v4 |
| 129 | + - name: Download artifacts |
| 130 | + uses: actions/download-artifact@v4 |
| 131 | + with: |
| 132 | + path: release-assets |
| 133 | + - name: Upload Binaries |
57 | 134 | uses: softprops/action-gh-release@v2 |
58 | 135 | with: |
59 | | - files: "tamanoir*" |
| 136 | + fail_on_unmatched_files: true |
| 137 | + files: | |
| 138 | + release-assets/**/tamanoir-* |
60 | 139 | body: | |
61 | 140 | [Release.md](${{ github.server_url }}/${{ github.repository }}/blob/main/Release.md) |
| 141 | +
|
| 142 | +
|
0 commit comments