55# # See the file 'doc/LICENSE' for the license information
66# ##
77
8-
98# Check if is it root
109if [ $EUID -ne 0 ]; then
1110 echo " You must be root."
4140 os=" $( uname -s) $( uname -r) "
4241fi
4342
43+ # Check if python2 is already installed
44+ if ! which python2 > /dev/null; then
45+ echo " [-] Please install Python2 or make sure it is in your path"
46+ exit 1
47+ fi
48+
4449echo " [+] Install $os $arch "
4550down=0
4651if [ " $os " = " Ubuntu 10.04.2 LTS" ]; then
4752 version=" ubuntu10-04.02$arch "
48- elif [[ " $os " =~ " Kali GNU/Linux 2." * ]]; then
53+ elif [[ " $os " =~ " Kali GNU/Linux 2." * | " Kali GNU/Linux Rolling " . * ]]; then
4954 version=" kali2-$arch "
50- down=1
55+ down=1
5156elif [[ " $os " =~ .* Kali.* ]]; then
5257 version=" kali-$arch "
5358 down=1
@@ -60,6 +65,13 @@ elif [ "$os" = "Ubuntu 13.04" ]; then
6065 version=" ubuntu13-04-$arch "
6166 down=1
6267elif [[ " $os " =~ " Ubuntu 14.04" .* | " Ubuntu 14.10" .* | " Ubuntu Vivid Vervet (development branch)" | " Ubuntu 15" .* ]]; then
68+ version=" ubuntu13-10-$arch "
69+ down=1
70+ # Install pip from github.
71+ # Bug: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1306991
72+ wget https://bootstrap.pypa.io/get-pip.py
73+ python get-pip.py
74+ elif [[ " $os " =~ " Mint 17" .* ]]; then
6375 version=" ubuntu13-10-$arch "
6476 down=1
6577 # Install pip from github.
@@ -69,38 +81,49 @@ elif [[ "$os" =~ "Ubuntu 14.04".*|"Ubuntu 14.10".*|"Ubuntu Vivid Vervet (develop
6981elif [[ " $os " =~ " Debian 7" .* | " Debian 8" .* | " stretch/sid" .* ]]; then
7082 version=" ubuntu13-10-$arch "
7183 down=1
72- wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
73- python get-pip.py
84+ # Install pip from github.
85+ # Bug: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1306991
86+ wget https://bootstrap.pypa.io/get-pip.py
87+ python get-pip.py
88+
89+ # Check if user agree with change to experimental
90+ read -r -p " We need change your debian to experimental - sid branch (If you are not). You agree?[Y/n] " input
91+
92+ case $input in
93+
94+ [nN][oO]|[nN])
95+ echo " [!]Faraday install: Aborted"
96+ echo " [!]You need agree the update to experimental - sid"
97+ exit 1;;
98+ esac
99+
74100 echo " deb http://ftp.debian.org/debian experimental main" >> /etc/apt/sources.list
75101 echo " deb http://ftp.debian.org/debian sid main" >> /etc/apt/sources.list
76102 apt-get update
77103
78104 if [[ " $os " =~ " Debian 7" .* ]]; then
79105 apt-get -t experimental -y install libc6-dev
80- sed -i ' s/deb http:\/\/ftp.debian.org\/debian experimental main//' /etc/apt/sources.list
81- sed -i ' s/deb http:\/\/ftp.debian.org\/debian sid main//' /etc/apt/sources.list
82- apt-get update
83106 fi
84107else
85108 echo " [-] Could not find a install for $os ($arch $kernel )"
86109 exit
87110fi
88111
89112if [ " $down " -eq 1 ]; then
90-
113+
91114 if [ -e lib-$version .tgz ]; then
92115 echo " [+] QT Libs already downloaded"
93116 else
94117 echo " [+] Download QT Libs"
95118 wget " https://www.faradaysec.com/down/faraday/lib-$version .tgz" -O lib-$version .tgz
96119 fi
97-
120+
98121 shav=" sha_${version// -/ _} "
99122 echo ` sha256sum lib-$version .tgz`
100123 if [ -e lib-$version .tgz ]; then
101124 if [ " ` echo ${! shav} ` " = " ` sha256sum lib-$version .tgz | awk -F\" \" \{ ' print $1' \} ` " ]; then
102125 echo " [+] SHA256 ok"
103- tar -xvzf lib-$version .tgz
126+ tar -xvzf lib-$version .tgz
104127 mv lib-$version / external_libs
105128 else
106129 rm lib-$version .tgz
@@ -119,7 +142,23 @@ if [ "$update" -eq 0 ]; then
119142 apt-get update
120143 update=1
121144fi
145+
122146apt-get --ignore-missing -y install ipython python-pip python-dev libpq-dev couchdb
147+
148+ # Check if python-setuptools not exists.
149+ python -c " import setuptools" > /dev/null 2>&1
150+
151+ if [ " $? " -eq 1 ]; then
152+ apt-get install python-setuptools
153+ fi
154+
155+ # Delete debian experimental from sources.
156+ if [[ " $os " =~ " Debian 7" .* | " Debian 8" .* | " stretch/sid" .* ]]; then
157+ sed -i ' s/deb http:\/\/ftp.debian.org\/debian experimental main//' /etc/apt/sources.list
158+ sed -i ' s/deb http:\/\/ftp.debian.org\/debian sid main//' /etc/apt/sources.list
159+ apt-get update
160+ fi
161+
123162pip install -r requirements.txt
124163
125164echo " You can now run Faraday, enjoy!"
0 commit comments