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
How setting the TZ environment variable avoids thousands of system calls
Viewed 11036 times since Mon, May 21, 2018
How to Clear RAM Memory Cache, Buffer and Swap Space on Linux
Viewed 4038 times since Mon, Nov 23, 2020
Epoch & Unix Timestamp Conversion Tools
Viewed 81154 times since Fri, Jun 22, 2018
RHEL: Retrieve and generate a unique SCSI identifier
Viewed 4252 times since Sat, Jun 2, 2018
stunnel basics and pki standards
Viewed 10317 times since Fri, Sep 28, 2018
HowTo: Retrieve Email from a POP3 Server using the Command Line
Viewed 13580 times since Mon, Feb 18, 2019
Linux ssh Hide OpenSSH Version Banner
Viewed 56925 times since Wed, Apr 22, 2020
Tip: SSD and Linux. Enable TRIM and check if it works
Viewed 18434 times since Fri, May 15, 2020
Linux - How to unlock and reset user’s account
Viewed 5997 times since Fri, Jun 8, 2018
How to Configure ‘FirewallD’ in RHEL/CentOS 7 and Fedora 21
Viewed 11659 times since Wed, Oct 9, 2019