-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathprepareClientScan.sh
executable file
·51 lines (40 loc) · 1.49 KB
/
prepareClientScan.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
#!/bin/bash
##
# prepareClientScan.sh handles dependencies for KrackPlus Scan
##
# Installs dependencies
echo "Setting up dependencies..."
# Checks whether dependencies are already installed; if not, installs them.
while read packages; do
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $packages | grep "install ok installed")
if [ "" == "$PKG_OK" ]; then
echo "$packages not found. Setting up $packages."
apt-get -y update > /dev/null
sudo apt-get --force-yes --yes install $packages > /dev/null
fi
# Gets the list of dependencies from a file
done <dependenciesClientScan
# Make modified hostapd instance. Only needs to be done once.
if [[ ! -x "./findVulnerable/hostapd/hostapd" ]]
then
echo "Compiling hostapd"
cd ./findVulnerable/hostapd/
cp defconfig .config
make -j 2 &>/dev/null
cd ../../
fi
# Disables network
nmcli radio wifi off
# Make sure that the hwEncryptionDisabled file exits
if [[ ! -e "./hwEncryptionDisabled" ]]
then
touch hwEncryptionDisabled
fi
# Disables hardware encryption, as bugs on some Wi-Fi network interface cards could interfere with the script used to check whether a client is vulnerable
if ! cat hwEncryptionDisabled| grep -q '1';
then
./findVulnerable/krackattack/disable-hwcrypto.sh
fi
# Replace default password if user requests it
sed -i "88s/.*/ssid=$(sed '1q;d' ./networkCredentials.txt)/" ./findVulnerable/hostapd/hostapd.conf
sed -i "1146s/.*/wpa_passphrase=$(sed '2q;d' ./networkCredentials.txt)/" ./findVulnerable/hostapd/hostapd.conf