-
Notifications
You must be signed in to change notification settings - Fork 131
245 lines (229 loc) · 8.45 KB
/
stealth-push.yaml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
name: Static Stealth Build & www push
on: [workflow_dispatch]
permissions:
contents: write
env:
OPENSSL_VER: 1.1.1w
BINDIR: ${{ github.ref == 'refs/heads/master' && 'bin' || 'beta/bin' }}
# OPENSSL_OPTS: no-tests no-dso no-threads no-shared
OPENSSL_OPTS: no-tests no-dso no-threads no-shared no-zlib no-bf no-cast no-dh no-md2 no-mdc2 no-rc2 no-rc4 no-rc5 no-idea no-md4 no-rmd160 no-dsa no-ssl no-ssl2 -no-tls1_3 no-camellia no-seed no-afalgeng no-autoerrinit no-autoload-config no-capieng no-cms no-comp no-ct no-dgram no-engine no-err no-filenames no-gost no-ocsp no-hw-padlock no-pic no-srtp no-ssl-trace no-ui-console no-ssl3-method no-tls1-method no-tls1_1-method no-dtls1-method no-dtls1_2-method no-deprecated
jobs:
MacOS:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Compile
run: |
brew install automake
./bootstrap
./configure --prefix=/opt --enable-static --enable-stealth
make all
strip tools/gs-netcat
mv tools/gs-netcat tools/gs-netcat_mini-macOS-x86_64
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: gsnc
path: tools/gs-netcat_mini-macOS-x86_64
MacOS-arm64:
runs-on: macos-14
steps:
- uses: actions/checkout@v3
- name: Compile
run: |
brew install automake
./bootstrap
./configure --prefix=/opt --enable-static --enable-stealth
make all
strip tools/gs-netcat
mv tools/gs-netcat tools/gs-netcat_mini-macOS-arm64
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: gsnc
path: tools/gs-netcat_mini-macOS-arm64
# https://github.com/vmactions/openbsd-vm
OpenBSD:
env:
OS: "openbsd"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Starting the VM
uses: vmactions/openbsd-vm@v1
with:
usesh: true
prepare: |
pkg_add curl
pkg_add autoconf-2.71
pkg_add automake-1.16.5
pkg_add openssl-3.0.8
pkg_info -Q tar
pkg_add gcc-11.2.0p3
pkg_add gmake
pkg_add tar
run: |
curl -SsfL https://www.openssl.org/source/openssl-${OPENSSL_VER:-1.1.1w}.tar.gz | tar -xzf - -C /tmp/
( cd /tmp/openssl-${OPENSSL_VER:-1.1.1w} && \
./Configure --prefix=/opt ${OPENSSL_OPTS} BSD-generic64 && \
make install_sw )
rm -rf rm -rf /tmp/openssl-${OPENSSL_VER:-1.1.1w} /opt/bin/openssl /opt/bin/c_rehash
export AUTOCONF_VERSION=2.71
export AUTOMAKE_VERSION=1.16
./bootstrap
./configure --enable-static --prefix=/opt --enable-stealth
make all
strip tools/gs-netcat
mv tools/gs-netcat tools/gs-netcat_mini-${{ env.OS }}-x86_64
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: gsnc
path: tools/gs-netcat_mini-${{ env.OS }}-x86_64
FreeBSD:
env:
OS: "freebsd"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Starting the VM
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
pkg install -y curl automake autoconf gcc
run: |
curl -SsfL https://www.openssl.org/source/openssl-${OPENSSL_VER:-1.1.1w}.tar.gz | tar -xzf - -C /tmp/
( cd /tmp/openssl-${OPENSSL_VER:-1.1.1w} && \
./Configure --prefix=/opt ${OPENSSL_OPTS} BSD-generic64 && \
make install_sw )
rm -rf rm -rf /tmp/openssl-${OPENSSL_VER:-1.1.1w} /opt/bin/openssl /opt/bin/c_rehash
./bootstrap
./configure --enable-static --prefix=/opt --enable-stealth
make all
strip tools/gs-netcat
mv tools/gs-netcat tools/gs-netcat_mini-${{ env.OS }}-x86_64
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: gsnc
path: tools/gs-netcat_mini-${{ env.OS }}-x86_64
Linux-Cross-Compile:
strategy:
matrix:
# arch: [x86_64, aarch64, mips64, mips32, mipsel, i686, arm, armv6, armv7l, powerpc, powerpc64, powerpcle, powerpc64le]
include:
- arch: x86_64
cc: x86_64-linux-musl
ssl: linux-generic64
# UPX apps get SIGSTOP on grsec/SELinux 3.10/CentOS Linux 7 (Core)
# upx: 1
- arch: aarch64
cc: aarch64-linux-musl
ssl: linux-generic64
# upx: 1
- arch: mips64
cc: mips64-linux-musl
ssl: linux64-mips64
- arch: mips32
cc: mips-linux-muslsf
ssl: linux-mips32
- arch: mipsel
cc: mipsel-linux-muslsf
ssl: linux-mips32
- arch: i686
cc: i686-linux-musl
ssl: linux-generic32
- arch: arm
cc: arm-linux-musleabi
ssl: linux-generic32
- arch: armv6
cc: armv6-linux-musleabi
ssl: linux-generic32
- arch: armv7l
cc: armv7l-linux-musleabihf
ssl: linux-generic32
- arch: powerpc
cc: powerpc-linux-muslsf # Big Endian, 32bit
ssl: linux-generic32
- arch: powerpc64
cc: powerpc64-linux-musl # Big Endian, 64bit
ssl: linux-generic64
- arch: powerpcle
cc: powerpcle-linux-muslsf # Little Endian, 32bit
ssl: linux-generic32
- arch: powerpc64le
cc: powerpc64le-linux-musl # Little Endian, 64bit
ssl: linux-generic64
runs-on: ubuntu-latest
container:
image: muslcc/x86_64:${{ matrix.cc }}
options: --user root
steps:
- uses: actions/checkout@v3
- name: Add build dependencies
run: |
apk add --update --no-cache --no-progress bash perl make curl upx tar dpkg autoconf automake
- name: Cache SSL
id: cachessl
uses: actions/cache@v3
with:
path: /opt
key: ${{ matrix.arch }}-ssl
- name: Generate OpenSSL
if: steps.cachessl.outputs.cache-hit != 'true'
run: |
curl -SsfL https://www.openssl.org/source/openssl-${OPENSSL_VER:-1.1.1w}.tar.gz | tar -xzf - -C /tmp/
( cd /tmp/openssl-${OPENSSL_VER:-1.1.1w} && \
./Configure --prefix=/opt ${OPENSSL_OPTS} ${{ matrix.ssl }} && \
make install_sw )
rm -rf rm -rf /tmp/openssl-${OPENSSL_VER:-1.1.1w} /opt/bin/openssl /opt/bin/c_rehash
- name: SaveCache
if: steps.cachessl.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: /opt
key: ${{ matrix.arch }}-ssl
- name: Compile-${{ matrix.arch }}
run: |
[ ! -d /opt/dist ] && mkdir -p /opt/dist
./bootstrap
./configure --prefix=/opt --enable-realprefix=/usr --enable-static --host=${{ matrix.arch }} --enable-stealth
make all
echo "UPX='${{ matrix.upx }}'"
strip tools/gs-netcat
if [ "${{ matrix.upx }}" != '' ]; then
upx tools/gs-netcat
fi
mv tools/gs-netcat tools/gs-netcat_mini-linux-${{ matrix.arch }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: gsnc
path: tools/gs-netcat_mini-linux-${{ matrix.arch }}
deploy:
# needs: [Linux-Cross-Compile, MacOS, OpenBSD, FreeBSD]
needs: [Linux-Cross-Compile, MacOS, FreeBSD]
name: Deploy to gsocket.io
runs-on: ubuntu-latest
steps:
- name: Add build dependencies
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: /tmp
- name: Deploy to gsocket.io/bin
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
run: |
mkdir ~/.ssh && echo "$SSH_DEPLOY_KEY" >~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519
cd /tmp
git clone -b gh-pages --single-branch [email protected]:hackerschoice/gsocket.io.git
cd gsocket.io/${BINDIR:-/dev/null}
mv /tmp/gsnc/gs-netcat_* .
pwd
ls -alR
git config --local user.name "GitHub Action"
git config --local user.email "[email protected]"
git add gs-netcat_* && git commit -m "stealth binary" && git push