-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpwnaclear.sh
69 lines (64 loc) · 1.87 KB
/
pwnaclear.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
#!/bin/bash
# Written by sokdr 20/10/2020
# https://twitter.com/sokdr1
echo ' ____ ____ _ _____ ____'
echo '| _ \__ ___ __ __ _ / ___| |___ / __ _| ___|'
echo '| |_) \ \ /\ / / _ \ / _` | | | | |_ \ / _` |___ \'
echo '| __/ \ V V /| | | | (_| | |___| |___) | (_| |___) |'
echo '|_| \_/\_/ |_| |_|\__,_|\____|_|____/ \__,_|____/'
echo
echo
#
trap ctrl_c INT
function ctrl_c() {
echo 'You pressed Ctrl+C...Exiting'
exit 0;
}
#
echo "Welcome $HOSTNAME to Pwnaclear: a bash script to find the clear and right handshakes from your friend Pwnagotchi:"
echo
echo "Remember always to backup your original Pwnagotchi handshakes"
echo
read -p 'Please enter the Handshake Path: ' userpath
echo
echo You entered $userpath #read user input
echo
if [ -d $userpath ]; then # check if user input exists.
echo 'Directory exists ;) '
else
echo 'Directory does not exist....exiting (; '
exit 0;
fi
count=$(find $userpath -type f -name "*.pcap" | wc -l) # count pcap files
echo
echo 'Found' $count 'PCAP files'
echo
echo 'Checking if aircrack-ng is installed on your system'
echo
if [ -f /usr/bin/aircrack-ng ]; then #check if aircrack-ng is installed on the system
echo 'OK found moving ok '
else
echo 'Not found please install it and run again the script'
exit 0;
fi
echo
mkdir $userpath/CleanHandshakes
touch $userpath/log.txt # error logs txt
echo 'Check for the right pcap files::'
echo '##########'
echo
{
for file in $userpath/*.pcap; do
check_pcap=$(echo 1 | aircrack-ng $file)
if [[ "$check_pcap" =~ "No networks found, exiting." ]]; then
echo > /dev/null 2>&1
else mv $file $userpath/CleanHandshakes
fi
done } > /$userpath/log.txt 2>&1 # log output errors
clean_pcap=$(ls -l $userpath/CleanHandshakes | wc -l)
echo '##########'
echo
echo 'it seems you have' $clean_pcap 'pcap files to crack ;)'
echo '##########'
echo 'Happy hunting ;)'
exit 0;