-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathctfvm_install.sh
executable file
·80 lines (62 loc) · 2.64 KB
/
ctfvm_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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# based on https://gist.github.com/K-atc/750b1da15dc42aa1f3f41a31e74a0208
cd $HOME
pwd
# ■common
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y vim mux gdb gdbserver socat binutils nasm python git autoconf libtool make || \
(echo "[!] sudo apt-get stall failed"; exit)
sudo apt-get install -y vim-gtk
sudo apt-get install -y virtualbox-guest-dkms
# ■pwnlib
sudo apt-get install -y python2.7-dev python-pip
pip install pwntools
# ■peda
cd $HOME
git clone https://github.com/longld/peda.git $HOME/peda
echo source $HOME/peda/peda.py >> $HOME/.gdbinit
# ■rp++
cd $HOME
wget -q https://github.com/downloads/0vercl0k/rp/rp-lin-x64
chmod +x rp-lin-x64 && mv rp-lin-x64 /usr/local/bin
# ■disas-seccomp-filter
cd $HOME
git clone git://github.com/seccomp/libseccomp && cd libseccomp
./autogen.sh && ./configure && make
cp tools/scmp_bpf_disasm tools/scmp_sys_resolver /usr/local/bin
wget -q https://raw.githubusercontent.com/akiym/akitools/master/disas-seccomp-filter
chmod +x disas-seccomp-filter && mv disas-seccomp-filter /usr/local/bin
# 以下,使うかどうかわからないけど取り敢えず
# ■libheap
cd $HOME
sudo apt-get install -y libc6-dbg || \
(echo "[!] sudo apt-get install failed"; exit)
wget -q http://pastebin.com/raw/8Mx8A1zG -O libheap.py
echo 'from .libheap import *' > __init__.py
mkdir -p /usr/local/lib/python3.4/dist-packages/libheap/
mv libheap.py __init__.py /usr/local/lib/python3.4/dist-packages/libheap/
echo -e 'define heap\n python from libheap import *\nend' >> $HOME/.gdbinit
# ■katana
cd $HOME
sudo apt-get -y install libelf-dev libdwarf-dev libunwind8-dev libreadline-dev bison flex g++
git clone git://git.savannah.nongnu.org/katana.git && cd katana
ls /usr/bin/aclocal-1.15 || ln -s /usr/bin/aclocal-1.14 /usr/bin/aclocal-1.15
ls /usr/bin/automake-1.15 || ln -s /usr/bin/automake-1.14 /usr/bin/automake-1.15
sed -i '784,787d' src/patchwrite/patchwrite.c
sed -i '783a\int res=dwarf_producer_init(flags,dwarfWriteSectionCallback,dwarfErrorHandler,NULL,&err);' src/patchwrite/patchwrite.c
./configure && make
sed -i 's/\($(AM_V_CCLD).*\)/\1 $(lebtest_LDFLAGS)/' tests/code/Makefile
make && make install
# ■my
DOTDIR="$HOME/dotfiles"
cd "${DOTDIR}"
curl -O https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
curl -O https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
sudo apt-get install -y cmigemo fonts-ricty-diminished
mkdir ~/.vim
ln -si "${DOTDIR}/.bashrc" ~/.bashrc
ln -si "${DOTDIR}/.vimrc" ~/.vimrc
ln -si "${DOTDIR}/.gvimrc" ~/.gvimrc
ln -si "${DOTDIR}/dein.toml" ~/.vim/dein.toml
echo "[+] bootstrap.sh done!"