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
ubuntu How to reset lost root password on Ubuntu 16.04 Xenial Xerus Linux
Viewed 7987 times since Tue, Dec 8, 2020
RHEL: Extending a vmdk (Virtual Machine disk)
Viewed 3804 times since Sun, May 27, 2018
Moving SSL Certificate from IIS to Apache
Viewed 1690 times since Mon, Feb 18, 2019
How To Use the Linux Auditing System on CentOS 7
Viewed 3635 times since Fri, Apr 5, 2019
python learning
Viewed 1616 times since Wed, Dec 18, 2019
RHEL: Reinstalling Boot Loader on the Master Boot Record (MBR)
Viewed 3013 times since Sun, May 27, 2018
LVM: Extend SWAP size by growing existing Logical Volume
Viewed 2235 times since Sat, Jun 2, 2018
Using grep to find string in files
Viewed 1732 times since Fri, May 15, 2020
HOWTO: Use SSL/port 465 in smarthost stunnel
Viewed 3445 times since Fri, Sep 28, 2018
Secure Remote Logging to Central Log Server Using RSYSLOG on CentOS 6 / CentOS 7 and stunnel
Viewed 3312 times since Sun, Dec 6, 2020