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
Logrotate Example for Custom Logs
Viewed 2734 times since Sun, Jan 12, 2020
How to enable Proxy Settings for Yum Command on RHEL / CentOS Servers
Viewed 12794 times since Thu, Jul 19, 2018
Understanding logrotate utility part 1
Viewed 1887 times since Fri, Nov 30, 2018
stunnel bacula
Viewed 2193 times since Fri, Sep 28, 2018
Linux LVM recovery
Viewed 17943 times since Wed, Jan 23, 2019
ZPOOL: Verify/change properties of a zpool
Viewed 2217 times since Sun, Jun 3, 2018
RHEL: Scan and configure new SAN (fibre channel) LUNs
Viewed 8277 times since Sun, May 27, 2018
YUM How to use yum command on CentOS/RHEL
Viewed 7362 times since Thu, Oct 25, 2018
SSH Essentials: Working with SSH Servers, Clients, and Keys
Viewed 4642 times since Wed, Jun 27, 2018
How to find your System details using inxi
Viewed 3512 times since Sat, Jun 2, 2018