Netcat shell zabezpieczony hasłem

Prosty skrypt autorstwa Vittorio Milazzo ukazujący sposób przyznania powłoki za pomocą netcat dopiero po podaniu hasła:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
ncpassword () {
NC="/bin/netcat"
PORT="999"
PASSWORD="123456"
SHELL="/bin/bash"
 
echo -n "Enter password: "
 
stty -echo
read  mypass
stty echo
 
if [ ${mypass} = $PASSWORD ]
  then
    echo "Access granted...start netcat shell on port $PORT"
    while true; do $NC -l -p $PORT -e $SHELL; done
  else
    echo "Incorrect Password"
fi
}
 
ncpassword
sh $0
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Linux - How to get CPU information
Viewed 2388 times since Fri, Jun 8, 2018
Inxi – A Powerful Feature-Rich Commandline System Information Tool for Linux
Viewed 19079 times since Sat, Jun 2, 2018
Secure NTP with NTS
Viewed 8642 times since Sun, Dec 6, 2020
What UUIDs can do for you
Viewed 1938 times since Tue, Jul 17, 2018
OpenSSL – sprawdzanie czy klucz pasuje do certyfikatu
Viewed 2855 times since Thu, May 24, 2018
IPTABLES linux
Viewed 17263 times since Sat, Jun 2, 2018
Linux Audit The Linux security blog about Auditing, Hardening, and Compliance lynis
Viewed 2284 times since Thu, Jan 16, 2020
PROCESSOR AND MEMORY INFORMATION
Viewed 5768 times since Sat, Jun 2, 2018
LVM: Rename root VG/LV
Viewed 7860 times since Sat, Jun 2, 2018
linux unix aix banner /etc/issue
Viewed 2159 times since Fri, Aug 3, 2018