forked from OpenToAllCTF/pwnvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vagrant_setup.sh
executable file
·155 lines (130 loc) · 3.92 KB
/
vagrant_setup.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
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
#!/bin/bash
# Updates
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install python3-pip
sudo apt-get -y install screen
sudo apt-get -y install gdb gdb-multiarch
sudo apt-get -y install unzip
sudo apt-get -y install build-essential
sudo apt-get -y install unrar
sudo apt-get -y install foremost
sudo apt-get -y install htop
# QEMU with MIPS/ARM - http://reverseengineering.stackexchange.com/questions/8829/cross-debugging-for-mips-elf-with-qemu-toolchain
sudo apt-get -y install qemu qemu-user qemu-user-static
sudo apt-get -y install 'binfmt*'
sudo apt-get -y install libc6-armhf-armel-cross
sudo apt-get -y install debian-keyring
sudo apt-get -y install debian-archive-keyring
sudo apt-get -y install emdebian-archive-keyring
tee /etc/apt/sources.list.d/emdebian.list << EOF
deb http://mirrors.mit.edu/debian squeeze main
deb http://www.emdebian.org/debian squeeze main
EOF
sudo apt-get -y install libc6-mipsel-cross
sudo apt-get -y install libc6-arm-cross
mkdir /etc/qemu-binfmt
ln -s /usr/mipsel-linux-gnu /etc/qemu-binfmt/mipsel
ln -s /usr/arm-linux-gnueabihf /etc/qemu-binfmt/arm
rm /etc/apt/sources.list.d/emdebian.list
# These are so the 64 bit vm can build 32 bit
sudo apt-get -y install libx32gcc-4.8-dev
sudo apt-get -y install libc6-dev-i386
# Install ARM binutils
sudo apt-get install binutils-arm-linux-gnueabi
# Install Pwntools
sudo apt-get -y install python2.7 python-pip python-dev git libssl-dev libffi-dev build-essential
sudo pip install --upgrade pip
sudo pip install --upgrade pwntools
cd
mkdir tools
cd tools
# Capstone for pwndbg
git clone https://github.com/aquynh/capstone
pushd capstone
git checkout -t origin/next
sudo ./make.sh install
cd bindings/python
sudo python3 setup.py install # Ubuntu 14.04+, GDB uses Python3
popd
# pycparser for pwndbg
sudo pip3 install pycparser # Use pip3 for Python3
# Install radare2
git clone https://github.com/radare/radare2
pushd radare2
./sys/install.sh
popd
# Install binwalk
git clone https://github.com/devttys0/binwalk
pushd binwalk
sudo python setup.py install
popd
# Uninstall capstone
sudo pip2 uninstall capstone -y
# Install correct capstone
pushd capstone/bindings/python
sudo python setup.py install
popd
# Install Angr
sudo apt-get -y install python-dev libffi-dev build-essential virtualenvwrapper
sudo pip install virtualenv
virtualenv angr
source angr/bin/activate
pip install angr --upgrade
deactivate
#
# oh-my-zsh
sudo apt-get -y install zsh
echo vagrant | sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
# tmux
wget https://github.com/tmux/tmux/releases/download/2.6/tmux-2.6.tar.gz
tar -zxvf tmux-2.6.tar.gz
pushd tmux-2.6
sudo apt-get -y install libevent-dev
sudo apt-get -y install libncurses-dev
./configure && make && sudo make install
popd
rm -rf tmux-2.6.tar.gz
rm -rf tmux-2.6
# fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
## GDB Tools
# Install peda
git clone https://github.com/longld/peda.git ~/peda
# Install pwndbg
git clone https://github.com/zachriggle/pwndbg
# Install gef
git clone https://github.com/hugsy/gef.git
# Install voltron
git clone https://github.com/snare/voltron.git
# Add Peda
echo "source ~/peda/peda.py" >> ~/.gdbinit
# pushd voltron
# ./install.sh
# popd
# fixenv
wget https://raw.githubusercontent.com/hellman/fixenv/master/r.sh
mv r.sh fixenv
chmod +x fixenv
# AFL Fuzzer
wget http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz
tar -zxvf afl-latest.tgz
pushd afl-*
make && sudo make install
popd
rm afl-latest.tgz
# Enable 32bit binaries on 64bit host
sudo dpkg --add-architecture i386
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install libc6:i386 libc6-dbg:i386 libncurses5:i386 libstdc++6:i386
# Install z3 theorem prover
git clone https://github.com/Z3Prover/z3.git && cd z3
python scripts/mk_make.py --python
cd build; make && sudo make install
# Install Zeratool
cd ~
git clone https://github.com/ChrisTheCoolHut/Zeratool
cd Zeratool
./install.sh