forked from outflanknl/C2-Tool-Collection
-
Notifications
You must be signed in to change notification settings - Fork 5
/
make_bof.sh
35 lines (30 loc) · 974 Bytes
/
make_bof.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
HOME=$(pwd)
BOF=$1
echo "[+] Changing directory: ./BOF/$BOF/SOURCE"
cd ./BOF/$BOF/SOURCE
echo "[+] Compiling:"
make
cd .. # ./BOF/$BOF/
echo "[+] Creating artifact:"
mkdir artifacts
mv *.o ./artifacts/
VERSION=$(git describe --tags --abbrev=0)
cat extension.json | jq ".version |= \"$VERSION\"" > ./artifacts/extension.json
cd artifacts # ./BOF/$BOF/artifacts/
echo
pwd
ls -l
echo
echo "[+] Creating package:"
MANIFEST=$(cat extension.json | base64 -w 0)
COMMAND_NAME=$(cat extension.json | jq -r .command_name)
echo "[+] executing: tar -czvf $HOME/packages/$COMMAND_NAME.tar.gz ."
tar -czvf $HOME/packages/$COMMAND_NAME.tar.gz .
cd $HOME/packages
echo
pwd
ls -l
echo "[+] Signing package:"
#bash -c "echo \"\" | ~/minisign -s ~/minisign.key -S -m ./$COMMAND_NAME.tar.gz -t \"$MANIFEST\" -x $COMMAND_NAME.minisig"
bash -c "echo \"\" | /home/runner/minisign -s /home/runner/minisign.key -S -m ./$COMMAND_NAME.tar.gz -t \"$MANIFEST\" -x $COMMAND_NAME.minisig"