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
Odpalenie polecenia tylko na jedną godzinę
Viewed 2851 times since Thu, May 24, 2018
Fix rpmdb: Thread died in Berkeley DB library
Viewed 21098 times since Fri, Feb 14, 2020
RHCS: Install a two-node basic cluster
Viewed 9997 times since Sun, Jun 3, 2018
Logrotate Example for Custom Logs
Viewed 2621 times since Sun, Jan 12, 2020
linux ssh Remotely Initiated Reverse SSH Tunnel
Viewed 3149 times since Wed, Apr 22, 2020
stunnel basics and pki standards
Viewed 9485 times since Fri, Sep 28, 2018
RHEL: What is "SysRq key" and how to use it
Viewed 5342 times since Sat, Jun 2, 2018
RHEL: Allowing users to ’su’ to "root" / Allowing ’root’ to login directly to the system using ’ssh’
Viewed 2890 times since Sat, Jun 2, 2018
Sample logrotate configuration and troubleshooting part 2
Viewed 9509 times since Fri, Nov 30, 2018
Manage Linux Password Expiration and Aging Using chage
Viewed 4640 times since Tue, Sep 11, 2018