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
A Quick and Practical Reference for tcpdump
Viewed 2404 times since Fri, Jul 27, 2018
How to accurately determine when the system was booted
Viewed 789 times since Wed, Oct 3, 2018
RHEL: Forgotten ’root’ password / using single-user to gain access
Viewed 1557 times since Sat, Jun 2, 2018
LVM basic
Viewed 1022 times since Sat, Jun 2, 2018
HowTo: Find Out Hard Disk Specs / Details on Linux
Viewed 1013 times since Mon, Jan 28, 2019
How to maximise SSD performance with Linux
Viewed 3517 times since Fri, May 15, 2020
HowTo: Send Email from an SMTP Server using the Command Line
Viewed 707 times since Mon, Feb 18, 2019
How to enable Proxy Settings for Yum Command on RHEL / CentOS Servers
Viewed 1845 times since Thu, Jul 19, 2018
RHEL: Crash kernel dumps configuration and analysis on RHEL 5
Viewed 1627 times since Sat, Jun 2, 2018
15 Linux Yum Command Examples – Install, Uninstall, Update Packages
Viewed 1445 times since Thu, Oct 25, 2018