forked from infobyte/faraday
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·125 lines (114 loc) · 4 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
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
#!/bin/bash
###
## Faraday Penetration Test IDE
## Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
## See the file 'doc/LICENSE' for the license information
###
#Check if is it root
if [ $EUID -ne 0 ]; then
echo "You must be root."
exit 1
fi
update=0
#protection
sha_kali2_i686=d08b0562acc3da5a392509a1801d5569e1ace750d26d020b83ecc4c8eea4f191
sha_kali2_x86_64=f8ee223706bd306dbdba1bd9232f196878c598cb449d006e24edbcbe85f19f2a
sha_kali_i686=f071539d8d64ad9b30c7214daf5b890a94b0e6d68f13bdcc34c2453c99afe9c4
sha_kali_x86_64=02a050372fb30ede1454e1dd99d97e0fe0963ce2bd36c45efe90eec78df11d04
sha_ubuntu13_10_i686=8199904fb5fca8bc244c31b596c3ae0d441483bfbb2dc47f66186ceffbf3586e
sha_ubuntu13_10_x86_64=2b1af6f8d7463324f6df103455748e53cdb1edf6ee796056cdf2f701ccaef031
sha_ubuntu13_04_i686=d3632a393aa0bf869653afe252248de62e528c4e42ab49a0d16850ab89fda13e
sha_ubuntu13_04_x86_64=ea3010b8c3f81229a6b79c8d679005c1d482548223ebc448963d2d29aabe5692
#os detection
arch=$(uname -m)
kernel=$(uname -r)
if [ -f /etc/lsb-release ]; then
if [ ! -f /usr/bin/lsb_release ] ; then
apt-get update
update=1
apt-get -y install lsb-release
fi
os=$(lsb_release -s -d)
elif [ -f /etc/debian_version ]; then
os="Debian $(cat /etc/debian_version)"
elif [ -f /etc/redhat-release ]; then
os=`cat /etc/redhat-release`
else
os="$(uname -s) $(uname -r)"
fi
echo "[+] Install $os $arch"
down=0
if [ "$os" = "Ubuntu 10.04.2 LTS" ]; then
version="ubuntu10-04.02$arch"
elif [[ "$os" =~ "Kali GNU/Linux 2."* ]]; then
version="kali2-$arch"
down=1
elif [[ "$os" =~ .*Kali.* ]]; then
version="kali-$arch"
down=1
elif [[ "$os" =~ "Ubuntu 12.04".* ]]; then
version="ubuntu12-$arch"
elif [ "$os" = "Ubuntu 13.10" ]; then
version="ubuntu13-10-$arch"
down=1
elif [ "$os" = "Ubuntu 13.04" ]; then
version="ubuntu13-04-$arch"
down=1
elif [[ "$os" =~ "Ubuntu 14.04".*|"Ubuntu 14.10".*|"Ubuntu Vivid Vervet (development branch)"|"Ubuntu 15".* ]]; then
version="ubuntu13-10-$arch"
down=1
# Install pip from github.
# Bug: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1306991
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
python get-pip.py
elif [[ "$os" =~ "Debian 7".*|"Debian 8".* ]]; then
version="ubuntu13-10-$arch"
down=1
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
python get-pip.py
echo "deb http://ftp.debian.org/debian experimental main" >> /etc/apt/sources.list
echo "deb http://ftp.debian.org/debian sid main" >> /etc/apt/sources.list
apt-get update
if [[ "$os" =~ "Debian 7".* ]]; then
apt-get -t experimental -y install libc6-dev
sed -i 's/deb http:\/\/ftp.debian.org\/debian experimental main//' /etc/apt/sources.list
sed -i 's/deb http:\/\/ftp.debian.org\/debian sid main//' /etc/apt/sources.list
apt-get update
fi
else
echo "[-] Could not find a install for $os ($arch $kernel)"
exit
fi
if [ "$down" -eq 1 ]; then
if [ -e lib-$version.tgz ]; then
echo "[+] QT Libs already downloaded"
else
echo "[+] Download QT Libs"
wget "https://www.faradaysec.com/down/faraday/lib-$version.tgz" -O lib-$version.tgz
fi
shav="sha_${version//-/_}"
echo `sha256sum lib-$version.tgz`
if [ -e lib-$version.tgz ]; then
if [ "`echo ${!shav}`" = "`sha256sum lib-$version.tgz | awk -F\" \" \{'print $1'\}`" ]; then
echo "[+] SHA256 ok"
tar -xvzf lib-$version.tgz
mv lib-$version/ external_libs
else
rm lib-$version.tgz
echo "[-] SHA256 file corrupt, deleted run again ./$0"
exit
fi
else
echo "[-] Download error"
exit
fi
else
apt-get -y install python-qt3
fi
if [ "$update" -eq 0 ]; then
apt-get update
update=1
fi
apt-get --ignore-missing -y install ipython python-pip python-dev libpq-dev couchdb
pip install -r requirements.txt
echo "You can now run Faraday, enjoy!"