Skip to content

Commit 791fa75

Browse files
Create connect.sh
1 parent 0486aea commit 791fa75

File tree

1 file changed

+142
-0
lines changed

1 file changed

+142
-0
lines changed

connect.sh

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
## LxaNce Hacker
2+
__version__=1.0
3+
clear
4+
5+
## ANSI colors (FG & BG)
6+
RED="$(printf '\033[31m')" GREEN="$(printf '\033[32m')" ORANGE="$(printf '\033[33m')" BLUE="$(printf '\033[34m')"
7+
MAGENTA="$(printf '\033[35m')" CYAN="$(printf '\033[36m')" WHITE="$(printf '\033[37m')" BLACK="$(printf '\033[30m')"
8+
REDBG="$(printf '\033[41m')" GREENBG="$(printf '\033[42m')" ORANGEBG="$(printf '\033[43m')" BLUEBG="$(printf '\033[44m')"
9+
MAGENTABG="$(printf '\033[45m')" CYANBG="$(printf '\033[46m')" WHITEBG="$(printf '\033[47m')" BLACKBG="$(printf '\033[40m')"
10+
RESETBG="$(printf '\e[0m\n')"
11+
12+
13+
14+
## Script termination
15+
exit_on_signal_SIGINT() {
16+
{ printf "\n\n%s\n\n" "${RED}[${WHITE}!${RED}]${RED} Program Interrupted." 2>&1; reset_color; }
17+
exit 0
18+
}
19+
20+
exit_on_signal_SIGTERM() {
21+
{ printf "\n\n%s\n\n" "${RED}[${WHITE}!${RED}]${RED} Program Terminated." 2>&1; reset_color; }
22+
exit 0
23+
}
24+
25+
trap exit_on_signal_SIGINT SIGINT
26+
trap exit_on_signal_SIGTERM SIGTERM
27+
28+
## Reset terminal colors
29+
reset_color() {
30+
tput sgr0 # reset attributes
31+
tput op # reset color
32+
return
33+
}
34+
35+
36+
# Check for a newer release
37+
check_update(){
38+
echo -ne "${GREEN}[${WHITE}+${GREEN}]${CYAN} Checking for update : "
39+
relase_url='https://api.github.com/repos/LxaNce-Hacker/samba/releases/latest'
40+
new_version=$(curl -s "${relase_url}" | grep '"tag_name":' | awk -F\" '{print $4}')
41+
tarball_url="https://github.com/LxaNce-Hacker/samba/archive/refs/tags/${new_version}.tar.gz"
42+
43+
if [[ $new_version != $__version__ ]]; then
44+
echo -ne "${ORANGE}update found\n"${WHITE}
45+
sleep 2
46+
echo -ne "\n${GREEN}[${WHITE}+${GREEN}]${ORANGE} Downloading Update..."
47+
pushd "$HOME" > /dev/null 2>&1
48+
wget "${tarball_url}" -O ".samba.tar.gz"
49+
50+
if [[ -e ".samba.tar.gz" ]]; then
51+
tar -xf .samba.tar.gz -C "$BASE_DIR" --strip-components 1 > /dev/null 2>&1
52+
[ $? -ne 0 ] && { echo -e "\n\n${RED}[${WHITE}!${RED}]${RED} Error occured while extracting."; reset_color; exit 1; }
53+
rm -f .samba.tar.gz
54+
popd > /dev/null 2>&1
55+
{ sleep 3; clear; banner_small; }
56+
echo -ne "\n${GREEN}[${WHITE}+${GREEN}] Successfully updated! Run samba again\n\n"${WHITE}
57+
{ reset_color ; exit 1; }
58+
else
59+
echo -e "\n${RED}[${WHITE}!${RED}]${RED} Error occured while downloading."
60+
{ reset_color; exit 1; }
61+
fi
62+
else
63+
echo -ne "${GREEN}up to date\n${WHITE}" ; sleep .5
64+
fi
65+
}
66+
67+
68+
## Check Internet Status
69+
check_status() {
70+
echo -ne "\n${GREEN}[${WHITE}+${GREEN}]${CYAN} Internet Status : "
71+
timeout 3s curl -fIs "https://api.github.com" > /dev/null
72+
[ $? -eq 0 ] && echo -e "${GREEN}Online${WHITE}" && check_update || echo -e "${RED}Offline${WHITE}"
73+
}
74+
75+
## Banner
76+
banner() {
77+
cat <<- EOF
78+
${RED}
79+
${RED}⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⠴⠖⠒⠛⠛⠒⠦⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
80+
${RED}⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠚⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
81+
${RED}⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢳⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
82+
${RED}⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
83+
${RED}⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
84+
${RED}⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢺⠃⠀⠀⠀⣀⡀⠀⣀⡀⠀⠀⠀⠀⠀⠀⠀⢀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
85+
${RED}⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣧⣴⣶⣿⣿⣷⠟⠉⠉⢳⡄⠀⠀⠀⠀⠀⠀⣯⠉⠙⠒⠦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
86+
${RED}⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣿⣿⣿⣿⣆⣀⣀⣴⠇⠀⠀⠀⠀⡤⠀⣼⣇⠀⠀⠀⠀⠈⠙⠶⢤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
87+
${RED}⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣟⣿⠾⠷⣿⣿⣦⡀⠀⠀⠀⠀⣴⠃⢠⠇⢹⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
88+
${RED}⠀⠀⢀⣄⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣟⠀⣠⡟⠁⠙⠿⣦⠀⢀⣾⠏⢠⠏⠀⢸⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀
89+
${RED}⠀⠀⠸⡏⠉⠉⠙⠛⠛⠛⠛⠛⠿⠶⠶⠶⢶⣶⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⢹⠟⣟⠀⠀⣀⣴⣟⣴⣟⣡⣴⣯⣤⣀⣼⠀⠀⠀⢰⡄⠀⠀⠀⠀⠀⠀⠀⠹⣆⠀⠀⠀⠀⠀⠀⠀
90+
${RED}⠀⠀⠀⢻⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⡄⠀⠀⠀⠀⠀⠀⠀⢸⠀⠸⣿⣿⣟⣋⣉⣉⣯⣀⣸⠃⠀⠈⠃⠀⠀⠀⢘⣇⠀⠀⠀⠀⠀⣠⡦⠀⠙⣆⠀⠀⠀⠀⠀⠀
91+
${RED}⠀⠀⠀⠀⢳⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⡄⠀⠀⠀⠀⠀⠀⢸⡆⢰⣟⣚⣛⣛⣿⣛⣛⣛⣿⣆⣀⣀⣀⣤⡀⠀⠀⢿⡄⡄⠀⢀⣾⣿⠇⠀⠀⠹⡄⠀⠀⠀⠀⠀
92+
${RED}⢤⢤⣤⣀⣀⣱⡀SAMBA SERVER⠀⠈⢿⣄⠀⢀⣀⣀⣠⣾⣧⣸⡇⠀⠀⠀⠀⣠⡾⣛⣋⣭⡥⠴⠂⠘⣿⡄⠀⠘⣿⣧⡴⠟⠋⣁⠀⠀⠀⠀⢷⠀⠀⠀⠀⠀
93+
${RED}⢸⠀⠀⠀⠀⠉⠻⡄⠀Don't Misuse⠈⢿⡟⠉⠙⠻⣍⠉⠃⠙⠷⠤⢤⠤⠤⠼⠿⣿⣯⠤⠤⠐⠀⠀⢻⣿⣦⣤⣾⠿⣷⣶⣯⣥⣴⣶⣶⣦⣼⡆⠀⠀⠀⠀
94+
${RED}⢸⠀⠀⠀⠀⠀⠀⠹⣆⠀⠀⠀⠀It⠀⠀⠀⠀⠀⠀⠀⠈⢿⡶⠶⠒⣿⣄⣀⣀⡀⠀⢸⡆⠀⠀⢠⠏⢳⡖⠒⠒⠀⠀⢸⣿⣇⠈⠙⡆⠀⠙⠣⠀⠀⠀⠀⠀⠙⣧⠀⠀⠀⠀
95+
${RED}⢸⠀⠀⠀⠀⠀⠀⠀⠘⢧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⣿⣿⣥⣿⣯⣿⣿⣿⠿⢿⣶⣶⣾⠤⢬⣽⣷⣶⣦⣴⣿⣿⠏⠀⠀⡷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡀⠀⠀⠀
96+
${RED}⢸⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣿⣷⣶⣤⣤⣈⣉⣽⣿⣶⠖⠀⠉⠉⠙⠳⠤⣤⣴⣃⣀⣀⠀⠀⠀⠀⠀⠀⠀⢠⡇⠀⠀⠀
97+
${RED}⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠙⠒⠲⠤⢄⣀⣀⠀⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⠟⠛⠛⠛⠛⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠉⠉⠓⠛⠓⠢⠤⣄
98+
${RED}⠸⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠬⠭⠭⠿⠶⢶⣶⣾⣯⡤⡥⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⢼
99+
${RED} Version : ${__version__}
100+
101+
${GREEN}[${WHITE}-${GREEN}]${CYAN} Tool Created by LxaNce-Hacker (Prince Katiyar)${WHITE}
102+
EOF
103+
check_status
104+
}
105+
106+
banner
107+
108+
echo -e
109+
read -p "${RED}[${ORANGE}*${RED}]${GREEN} Enter Target IP : ${RED}" IP
110+
111+
read -n1 -p "${RED}[${WHITE}?${RED}]${ORANGE} Do You Want To Change The WorkGround ? ${GREEN}[${CYAN}Y${GREEN}/${CYAN}N${GREEN}] :${ORANGE} " op
112+
113+
if [[ ${op,,} == "y" ]]; then
114+
echo -e "\n"
115+
read -p "${RED}[${ORANGE}*${RED}]${GREEN} Enter Target WorkGround : ${RED}" workground
116+
else
117+
echo -e "${RED}\n\n ...Ok Dear"
118+
fi
119+
120+
read -p "${RED}[${ORANGE}*${RED}]${GREEN} Enter Target Server Username : ${RED}" username
121+
122+
if [[ ${workground} ]]; then
123+
smbclient -L $IP -W $workground -U $username
124+
else
125+
smbclient -L $IP -U $username
126+
fi
127+
read -n1 -p "${RED}[${WHITE}?${RED}]${ORANGE} Do You Want To Connect That Server? ${GREEN}[${CYAN}Y${GREEN}/${CYAN}N${GREEN}] :${ORANGE} " ops
128+
129+
if [[ ${ops,,} == "y" ]]; then
130+
echo -e "\n"
131+
read -p "${RED}[${ORANGE}*${RED}]${GREEN} Enter Target ShareName : ${RED}" sharename
132+
if [[ ${workground} ]]; then
133+
smbclient \\\\$IP\\C$ -W $workground -U $username
134+
else
135+
smbclient \\\\$IP\\C$ -U $username
136+
fi
137+
else
138+
echo -e "${GREEN}\n\n ...Bye "
139+
{ reset_color; exit 1; }
140+
fi
141+
142+

0 commit comments

Comments
 (0)