forked from bata24/gef
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
59 lines (49 loc) · 1.85 KB
/
install.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh -eux
if [ ! $(id -u) = 0 ]; then
echo "[-] Detected non-root user."
echo "[-] INSTALLATION FAILED"
exit 1
fi
echo "[+] apt"
apt-get update
apt-get install -y gdb-multiarch binutils python3-pip ruby-dev git
echo "[+] pip3"
pip3 install crccheck unicorn capstone ropper keystone-engine tqdm magika
echo "[+] install seccomp-tools, one_gadget"
if [ "x$(which seccomp-tools)" = "x" ]; then
gem install seccomp-tools
fi
if [ "x$(which one_gadget)" = "x" ]; then
gem install one_gadget
fi
echo "[+] install rp++"
if [ "x$(uname -m)" = "xx86_64" ]; then
if [ "x$(which rp-lin)" = "x" ] && [ ! -e /usr/local/bin/rp-lin ]; then
# v2.1.3 will cause an error on Ubuntu 22.10 or earlier.
# The only difference between 2.1.2 and 2.1.3 is for OpenBSD compatibility and can be ignored.
wget -q https://github.com/0vercl0k/rp/releases/download/v2.1.2/rp-lin-clang.zip -P /tmp
unzip /tmp/rp-lin-clang.zip -d /usr/local/bin/
chmod +x /usr/local/bin/rp-lin
rm /tmp/rp-lin-clang.zip
fi
fi
echo "[+] install vmlinux-to-elf"
if [ "x$(which vmlinux-to-elf)" = "x" ] && [ ! -e /usr/local/bin/vmlinux-to-elf ]; then
pip3 install --upgrade lz4 zstandard git+https://github.com/clubby789/python-lzo@b4e39df
pip3 install --upgrade git+https://github.com/marin-m/vmlinux-to-elf
fi
echo "[+] download gef"
if [ -e /root/.gdbinit-gef.py ]; then
echo "[-] /root/.gdbinit-gef.py already exists. Please delete or rename."
echo "[-] INSTALLATION FAILED"
exit 1
else
wget -q https://raw.githubusercontent.com/bata24/gef/dev/gef.py -O /root/.gdbinit-gef.py
fi
echo "[+] setup gef"
STARTUP_COMMAND="source /root/.gdbinit-gef.py"
if [ ! -e /root/.gdbinit ] || [ "x$(grep "$STARTUP_COMMAND" /root/.gdbinit)" = "x" ]; then
echo "$STARTUP_COMMAND" >> /root/.gdbinit
fi
echo "[+] INSTALLATION SUCCESSFUL"
exit 0