-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompile.sh
45 lines (41 loc) · 1.32 KB
/
compile.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
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# cd /tmp && wget http://10.0.2.2:8080/compile.sh && chmod +x compile.sh && ./compile.sh
echo "deb http://archive.debian.org/debian squeeze main" > /etc/apt/sources.list
echo "Acquire::Check-Valid-Until false;" > /etc/apt/apt.conf
apt-get update && apt-get install debian-keyring && apt-get install -y build-essential
# netcat
cd /tmp
wget http://10.0.2.2:8080/nc110.tgz
mkdir nc && cd nc
tar -zxvf ../nc110.tgz
sed -i 's/res_init/ \/\/res_init/' netcat.c
sed -i 's/FD_SETSIZE 16/FD_SETSIZE 1024/' netcat.c
gcc netcat.c -o /tmp/nc-dynamic -DGAPING_SECURITY_HOLE
gcc netcat.c -o /tmp/nc-static -DGAPING_SECURITY_HOLE --static
# busybox
cd /tmp
apt-get install linux-headers-$(uname -r)
wget http://10.0.2.2:8080/busybox-1.2.2.tar.bz2
tar -xvjf busybox-1.2.2.tar.bz2
cd busybox-1.2.2
# fix busybox compilation on squeeze
wget http://10.0.2.2:8080/.config
cd include
wget http://10.0.2.2:8080/bb_config.h
cd ..
sed -i 's/#include <asm\/page.h>/\/\/ #include <asm\/page.h>/' util-linux/mkswap.c
make
mv busybox /tmp/busybox-dynamic
make clean && make LDFLAGS='-static'
mv busybox /tmp/busybox-static
# socat
cd /tmp
wget http://10.0.2.2:8080/socat-1.7.3.2.tar.gz
tar -zxvf socat-1.7.3.2.tar.gz
cd socat-1.7.3.2
./configure
make
cp socat /tmp/socat-dynamic
make clean && ./configure LDFLAGS="-static"
make
cp socat /tmp/socat-static