-
Notifications
You must be signed in to change notification settings - Fork 18
/
smb-menu
executable file
·47 lines (32 loc) · 1.26 KB
/
smb-menu
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
#!/bin/bash
# Website: https://t3chnocat.com
# Text coloring
yellow='\033[1;33m'
red='\033[1;91m'
nc='\033[0m'
# User variables start
smbserver=/usr/local/bin/impacket/examples/smbserver.py
# User variables end
echo
echo -e "${yellow}This starts a simple SMB server${nc}"
echo
echo -e "${yellow}Enter the desired share name: ${nc}"
read share
echo
echo -e "${yellow}Enter the directory to share (www, winbin, <dir> or . for current directory): ${nc}"
read dir
ip=$(/sbin/ifconfig tun0 | grep inet | cut -d" " -f10 | head -1)
echo
#echo -e "Your share is \\\\$ip\\$share"
echo -e "${yellow}Your share is \\\\\\$ip\\\\$share${nc}"
echo
if [ "$dir" = "www" ];
then echo -e "${yellow}Contents of directory:${nc}" && echo && ls /var/www/html && echo && python $smbserver $share /var/www/html -smb2support
elif [ "$dir" = "winbin" ];
then echo -e "${yellow}Contents of directory:${nc}" && echo && ls /usr/share/windows-binaries && echo && python $smbserver $share /usr/share/windows-binaries -smb2support
elif [ "$dir" = "." ];
then echo -e "${yellow}Contents of directory:${nc}" && echo && ls && echo && python $smbserver $share . -smb2support
else
echo -e "${yellow}Contents of directory:${nc}" && echo && ls $dir && echo && python $smbserver $share $dir -smb2support
fi
exit 1