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
BIND for the Small LAN
Viewed 4021 times since Sun, May 20, 2018
SSH Essentials: Working with SSH Servers, Clients, and Keys
Viewed 5421 times since Wed, Jun 27, 2018
ZFS: Verify/change properties of a zfs filesystem
Viewed 3262 times since Sun, Jun 3, 2018
RHEL: GPT/MBR partition tables (using disks larger than 2 TiB)
Viewed 13122 times since Sun, May 27, 2018
Linux PAM configuration that allows or deny login via the sshd server
Viewed 2509 times since Wed, Oct 3, 2018
ZPOOL: Create a new zpool for zfs filesystems
Viewed 2883 times since Sun, Jun 3, 2018
Use Fail2ban to Secure Your Server
Viewed 15957 times since Fri, Jul 5, 2019
Linux Network (TCP) Performance Tuning with Sysctl
Viewed 12886 times since Fri, Aug 3, 2018
20 Linux Command Tips and Tricks That Will Save You A Lot of Time linux
Viewed 5556 times since Thu, Apr 18, 2019
haproxy linux
Viewed 3103 times since Sun, Dec 6, 2020