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
Secure NTP with NTS
Viewed 9995 times since Sun, Dec 6, 2020
RHEL: Building a custom kernel on RHEL 6
Viewed 5471 times since Sat, Jun 2, 2018
debian How to Upgrade Debian 8 Jessie to Debian 9 Stretch
Viewed 3596 times since Sun, Sep 23, 2018
high swap space utilization in LINUX
Viewed 7535 times since Fri, Jul 13, 2018
Check a Website Availability from the Linux Command Line
Viewed 8054 times since Mon, Feb 18, 2019
“Too many authentication failures” with SSH
Viewed 7398 times since Mon, May 21, 2018
RHEL7: Create and configure LUKS-encrypted partitions and logical volumes to prompt for password and mount a decrypted file system at boot.
Viewed 14683 times since Mon, Aug 6, 2018
ZPOOL: Create a new zpool for zfs filesystems
Viewed 3336 times since Sun, Jun 3, 2018
Red Hat ADDING SWAP SPACE
Viewed 3051 times since Fri, Jun 8, 2018
How To Set Up an SSL Tunnel Using Stunnel on Ubuntu
Viewed 4462 times since Fri, Sep 28, 2018