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
Easily Monitor CPU Utilization in Linux Terminal With Stress Terminal UI
Viewed 3657 times since Thu, Apr 18, 2019
RHEL: XFS basic operations
Viewed 15438 times since Sat, Jun 2, 2018
www.unixarena.com
Viewed 2175 times since Fri, Jul 27, 2018
How to manage Linux password expiry with the chage command
Viewed 10910 times since Tue, Sep 11, 2018
20 IPtables Examples For New SysAdmins
Viewed 1879 times since Fri, May 15, 2020
Understanding logrotate utility part 1
Viewed 1481 times since Fri, Nov 30, 2018
logrotate How log rotation works with logrotate
Viewed 8573 times since Sun, Jan 12, 2020
LVM: Create a new Logical Volume / Filesystem
Viewed 1857 times since Sat, Jun 2, 2018
ZPOOL: Verify/change properties of a zpool
Viewed 1856 times since Sun, Jun 3, 2018
Improve security with polyinstantiation
Viewed 12707 times since Fri, May 15, 2020