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
RHEL: Checking HBAs
Viewed 11017 times since Sun, May 27, 2018
10 Linux cryptsetup Examples for LUKS Key Management (How to Add, Remove, Change, Reset LUKS encryption Key)
Viewed 2549 times since Tue, Jul 31, 2018
sed Delete / Remove ^M Carriage Return (Line Feed / CRLF) on Linux or Unix
Viewed 6856 times since Thu, Feb 7, 2019
How to create a Systemd service in Linux
Viewed 897 times since Mon, Dec 7, 2020
10 Linux rsync Examples to Exclude Files/Directories
Viewed 9524 times since Wed, Oct 31, 2018
CentOS / RHEL : How to move a Volume Group from one system to another
Viewed 1516 times since Mon, Jan 28, 2019
Tunnel SSH Connections Over SSL Using ‘Stunnel’ On Debian 7 / Ubuntu 13.10
Viewed 1348 times since Fri, Sep 28, 2018
RHEL: Enabling standard ftp/telnet
Viewed 1601 times since Sun, May 27, 2018
HowTo: Create CSR using OpenSSL Without Prompt (Non-Interactive)
Viewed 11547 times since Mon, Feb 18, 2019
Setup SSL Tunnel Using Stunnel on Ubuntu
Viewed 844 times since Fri, Sep 28, 2018