This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun.sh
executable file
·212 lines (195 loc) · 6.48 KB
/
run.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
#!/usr/bin/env bash
# Feel free to redistribute parts and/or concept/code in any form/fork leave credits or not :)
# by <jenge0x00@pm.me> < https://github.com/sammyjeng/shoba.git>
# ------------------------------------------------------------------------------------------------
#A badass banner
clear
export BLUE='\033[1;94m'
export GREEN='\033[1;92m'
export RED='\033[1;91m'
export RESETCOLOR='\033[1;00m'
echo -e "${RED}"
echo " "
echo " ██████ ██░ ██ ▒█████ ▄▄▄▄ ▄▄▄
▒██ ▒ ▓██░ ██▒▒██▒ ██▒▓█████▄ ▒████▄
░ ▓██▄ ▒██▀▀██░▒██░ ██▒▒██▒ ▄██▒██ ▀█▄
▒ ██▒░▓█ ░██ ▒██ ██░▒██░█▀ ░██▄▄▄▄██
▒██████▒▒░▓█▒░██▓░ ████▓▒░░▓█ ▀█▓ ▓█ ▓██▒
▒ ▒▓▒ ▒ ░ ▒ ░░▒░▒░ ▒░▒░▒░ ░▒▓███▀▒ ▒▒ ▓▒█░
░ ░▒ ░ ░ ▒ ░▒░ ░ ░ ▒ ▒░ ▒░▒ ░ ▒ ▒▒ ░
░ ░ ░ ░ ░░ ░░ ░ ░ ▒ ░ ░ ░ ▒
░ ░ ░ ░ ░ ░ ░ ░ ░
░ "
echo " "
echo " "
echo " -By sammyjeng "
echo " "
echo " a bash script to automate shodan-cli functions "
echo -e "${BLUE} [queries/suggestions: jenge0x00@pm.me]"
echo -e "${RESETCOLOR}"
#function to display warnings
warnings(){
echo -e "${RED}"
echo " "
echo " ⚠ IMPORTANT⚠ "
echo "➤ FOR YOUR OWN LEGAL BENEFIT, DO NOT ATTEMPT TO LOGIN (EVEN WITH DEFAULT PASSWORDS)."
echo " "
sleep 6
echo "➤ THE AUTHOUR OF THIS SCRIPT DOESN'T ENCOURAGE ILLEGAL/UNETHIACAL ACTIVITIES."
sleep 6
echo " "
echo "➤ ANY ACTIONS YOU TAKE UPON USING THE SCRIPT IS STRICTLY AT YOUR OWN RISK."
echo " "
sleep 6
echo "➤ DON'T OVERUSE THIS SCRIPT USING TOR, WHICH WILL AFFECT THE EXPERINCE OF THE FELLOW TOR USERS!!"
echo " "
sleep 6
echo "➤ ENABLE YOUR FAVORITE VPN SERVICE OR USE TOR BROWSER(YOU GOTTA!! IF YOU WANT TO REMAIN SLIGHTLY ANONYMOUS)."
echo " "
sleep 6
echo "➤ DON'T GET INTO TROUBLE, USE IT WISELY AND BE RESPONIBLE."
sleep 15
clear
main_menu
}
#function to search
function search(){
echo -e ${BLUE}
read -p "Enter the search term(query) : " b
if [[ -z "$b" ]]; then
select_task
else
read -p "Save as[file name] : " n
shodan download $n $b #this will download save a file with a given name and extension .json.gz
echo " $n is saved in : ↶"
pwd
read -p "Do you wanna search again?[Y/n] : " re
if [[ "$re" == "Y" || "$re" = "y" ]]; then
clear
search
else
echo -e "${NC}"
sleep 1
main_menu
fi
fi
}
#function to open 10[hey you!! if you want to increase the number, sure do)addresses in web-browser
function open_em(){
echo -e ${BLUE}
yes_no "open the results in a web-browser?" &&
if [[ "$1" == "y" || "Y" ]]; then
echo " "
echo "list of downloade files: "
echo -e ${RED}
ls | grep .json.gz
echo " "
echo "Type in the name of the downloaded file(don't include the file extension)↶"
echo -e ${BLUE}
read -p "file name :" q # reads the file name
read -p "Enter the full name of your favorite web browser:↶
$(echo "➤ firefox")
$(echo "➤ brave-browser --incognito" )
$(echo "➤ chrome-browser..etc") : " br
echo " "
echo "opening ten tabs at once, close those tabs to open the next ten."
echo "saving results in [filename].txt ;)"
shodan parse --fields ip_str,port,org --separator : $q.json.gz >> $q.txt
((shodan parse --fields ip_str,port --separator : $q.json.gz) | xargs -n 10 $br) > /dev/null 2>&1
clear
select_task
fi
}
#scan a host using host address[IPv4]
function scan() {
echo -e "${BLUE} ➥ Enter the IP of the host : "
read -p "[IPv4 format x . x . x . x] ➠ " ip_4
shodan host $ip_4 | tee $ip_4".txt"
select_task
}
#function to ask yes or no
function yes_no(){
while true; do
read -p "Do you really want to $* [y/n]: " yn
case $yn in
[Yy]*) return 0
;;
[Nn]*) main_menu ; return 1
;;
esac
done
}
#general exit function
function exit_script() {
yes_no "exit shoba" &&
echo -e ${RED} "➥ Thank you for using shoba ❤ "
sleep 1.5
clear
exit 0
}
#menu dialogues
function print_tasks(){
echo -e "${RED}➥ task menu"
echo -e "${GREEN} 1. Search and download results from Shodan using the same query syntax as the website. "
echo -e " 2. open obtained results in a web browser."
echo -e " 3. Gather host Information using host IP[IPv4]."
echo -e " 4. Go back to main menu."
echo -e " 5. Exit script. "
echo -e "${RED} ➘"
}
function print_menu() {
echo -e "${RED}"
echo "➥ main menu "
echo -e "${GREEN}"
echo " 1. Select a task. "
echo " 2. Display user disclaimer/warnings."
echo " 3. Exit script." "${NC}"
echo -e "${RED} ➘"
}
#task select menu
function select_task(){
print_tasks
read -rp "shoba↠ task menu➜ " select_task
clear
case ${select_task} in
1)
search
;;
2)
open_em
;;
3)
scan
;;
4)
main_menu
;;
5)
exit_script
;;
*)
select_task
;;
esac
}
#main menu
function main_menu() {
print_menu
read -rp "shoba↠ main menu➜ " main_option
clear
case ${main_option} in
1)
select_task
;;
2)
warnings
;;
3)
exit_script
;;
*)
main_menu
;;
esac
}
main_menu #main function invocation