forked from P0cL4bs/WiFi-Pumpkin-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.sh
155 lines (144 loc) · 4.64 KB
/
installer.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
#---------------------------------------
txtund=$(tput sgr 0 1)
txtbld=$(tput bold)
green=$(tput setaf 2)
bldred=${txtbld}$(tput setaf 1)
red_color=$(tput setaf 1)
color_y=$(tput setaf 3)
bldblu=${txtbld}$(tput setaf 4)
bldwht=${txtbld}$(tput setaf 7)
txtrst=$(tput sgr0)
#---------------------------------------
requeries=true
func_Banner(){
clear
echo ' ============================='
echo " |$bldblu wifi-pumpkin Installer$txtrst|"
echo ' ============================='
echo " Version: $(tput setaf 5)0.8.8 $txtrst"
echo "usage: ./installer.sh --install | --uninstall"
}
usage(){
echo "usage: ./installer.sh --install | --uninstall"
}
func_check_install(){
if which $1 >/dev/null; then
echo "----[$green✔$txtrst]----[$green+$txtrst] $1 Installed"
else
echo "----[$red_color✘$txtrst]----[$red_color-$txtrst] $1 not Installed "
nome="$1"
requeries=$nome
fi
}
function program_is_installed {
local return_=1
type $1 >/dev/null 2>&1 || { local return_=0; }
echo "$return_"
}
func_install(){
func_Banner
if [ "$(id -u)" != "0" ]; then
echo -e "$(tput setaf 6)[-] This script must be run as root$(tput sgr0)" 1>&2
exit 1
fi
apt-get update
apt-get install -y python-pip libffi-dev libssl-dev libxml2-dev libxslt1-dev zlib1g-dev
apt-get install -y libarchive-dev
apt-get install -y build-essential libnetfilter-queue-dev
apt-get install -y python-qt4 python-scapy hostapd rfkill
apt-get install -y python-dev git
apt-get install -y libpcap-dev
dist=$(tr -s ' \011' '\012' < /etc/issue | head -n 1)
if [ "$dist" = "Kali" ]; then
apt-get install libssl1.0
fi
pip install -r requirements.txt
echo "----------------------------------------"
echo "[=]$bldblu checking dependencies $txtrst "
func_check_install "hostapd"
echo "----------------------------------------"
dist=$(tr -s ' \011' '\012' < /etc/issue | head -n 1)
check_arch=$(uname -m)
echo "[$green+$txtrst] Distribution Name: $dist"
echo "----------------------------------------"
if [ "$dist" = "Ubuntu" ]; then
apt-get install libjpeg8-dev -y
fi
if [ "$dist" = "Debian" ]; then
apt-get install -y gdebi
wget http://ftp.de.debian.org/debian/pool/main/m/mitmproxy/mitmproxy_0.18.2-6_all.deb \
-O /tmp/mitmproxy_0.18.2-6_all.deb
gdebi --non-interactive /tmp/mitmproxy_0.18.2-6_all.deb
else
pip install mitmproxy==0.18.2
fi
echo "[=] $bldblu Install WiFi-Pumpkin $txtrst"
if [ -d "$DIRECTORY" ]; then
rm -r $DIRECTORY
fi
mkdir $DIRECTORY
cp -r $path_install /usr/share/WiFi-Pumpkin/
bin_install
echo "[$green✔$txtrst] wifi-pumpkin installed with success"
echo "[$green✔$txtrst] execute $bldred sudo wifi-pumpkin$txtrst in terminal"
echo "[$green+$txtrst]$color_y P0cL4bs Team CopyRight 2015-2017$txtrst"
echo "[$green+$txtrst] Enjoy"
echo "[+] $green WiFiMode $txtrst: is a module to include binary hostapd-mana/hostapd-Karma options \n
the WiFiMode will go download and compile the plugin hostapd/Mana and Karma."
echo -n "[!] Do you wanna install wifimode ? (y/n)? "
read answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
sudo ./installer_wifimode.sh
fi
exit 0
}
bin_install(){
echo "[$green✔$txtrst] binary::/usr/bin/"
if which update-alternatives >/dev/null; then
update-alternatives --install /usr/bin/wifi-pumpkin wifi-pumpkin /usr/share/WiFi-Pumpkin/wifi-pumpkin 1 > /dev/null
else
ln -sfT /usr/share/WiFi-Pumpkin/wifi-pumpkin /usr/bin/wifi-pumpkin
fi
cp wifi-pumpkin.desktop /usr/share/applications/wifi-pumpkin.desktop
chmod +x /usr/share/WiFi-Pumpkin/wifi-pumpkin
}
uninstall(){
if [ "$(id -u)" != "0" ]; then
echo -e "$(tput setaf 6)[-] This script must be run as root$(tput sgr0)" 1>&2
exit 1
fi
if [ -d "$DIRECTORY" ]; then
if which update-alternatives >/dev/null; then
update-alternatives --remove wifi-pumpkin /usr/share/WiFi-Pumpkin/wifi-pumpkin > /dev/null
else
rm /usr/bin/wifi-pumpkin
fi
rm /usr/share/applications/wifi-pumpkin.desktop
echo "[$red_color-$txtrst] Deleted Binary:$bldwht/usr/bin/wifi-pumpkin $txtrst"
echo "[$red_color-$txtrst] Delete Path:$bldwht $DIRECTORY $txtrst"
rm -r $path_uninstall
else
echo "[$red_color✘$txtrst] wifi-pumpkin is not Installed"
fi
}
func_Banner
DIRECTORY="/usr/share/WiFi-Pumpkin"
Dir_isntall=$(pwd)
path_install=$Dir_isntall"/*"
path_uninstall=$DIRECTORY"/"
while [ "$1" != "" ]; do
case $1 in
--install ) shift
func_install
;;
--uninstall ) uninstall
;;
-h | --help ) usage
exit
;;
* ) usage
exit 1
esac
shift
done