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
RHCS: Configure an active/backup pacemaker cluster
Viewed 898 times since Sun, Jun 3, 2018
LVM: Rename root VG/LV
Viewed 986 times since Sat, Jun 2, 2018
18 Quick ‘lsof’ command examples for Linux Geeks
Viewed 690 times since Sun, Jun 30, 2019
Nagrywanie sesji SSH do pliku
Viewed 944 times since Thu, May 24, 2018
Get UUID of Hard Disks [Update]
Viewed 511 times since Tue, Jul 17, 2018
RHEL7: Create and configure LUKS-encrypted partitions and logical volumes to prompt for password and mount a decrypted file system at boot.
Viewed 1062 times since Mon, Aug 6, 2018
RHEL: ACLs basics
Viewed 1385 times since Sun, May 27, 2018
Use Fail2ban to Secure Your Server
Viewed 1482 times since Fri, Jul 5, 2019
Using stunnel to Encrypt Database Connections
Viewed 996 times since Fri, Sep 28, 2018
Jak ustawić LVM, jak robić snapshoty oraz automatycznie powiększać LV, czyli małe howto
Viewed 1331 times since Sun, May 20, 2018