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
Red Hat 8 How to Set Up Automatic Updates for CentOS 8
Viewed 3949 times since Fri, Sep 25, 2020
RHEL: Back-up/Replicate a partition table
Viewed 3650 times since Sun, May 27, 2018
Linux – Securing your important files with XFS extendend attributes
Viewed 7661 times since Wed, Jul 25, 2018
RHCS6: Reduce a Global Filesystem 2 (GFS2)
Viewed 3530 times since Sun, Jun 3, 2018
RHEL: Rename a network interface on RHEL 7
Viewed 10792 times since Sat, Jun 2, 2018
How to run command or code in parallel in bash shell under Linux or Unix
Viewed 3398 times since Tue, Aug 6, 2019
8 Vim Tips And Tricks That Will Make You A Pro User
Viewed 3075 times since Fri, Apr 19, 2019
RHCS6: ’fencing’ basics
Viewed 2396 times since Sun, Jun 3, 2018
RHCS6: Mirror/unmirror a GFS2 volume
Viewed 5389 times since Sun, Jun 3, 2018
Split and Reassemble files
Viewed 3626 times since Mon, May 28, 2018