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: Getting/Setting hardware clock’s time
Viewed 2750 times since Sat, Jun 2, 2018
IPTABLES linux
Viewed 16703 times since Sat, Jun 2, 2018
systemd Auto-restart a crashed service in systemd
Viewed 2742 times since Fri, Jan 17, 2020
Expand or grow a file system on a Linux VMWare VM without downtime
Viewed 11397 times since Fri, Jul 27, 2018
Red Hat 8 How to Set Up Automatic Updates for CentOS 8
Viewed 3379 times since Fri, Sep 25, 2020
Do you Know These 5 Use of V$session View ?
Viewed 99492 times since Thu, Jun 21, 2018
A Quick and Practical Reference for tcpdump
Viewed 12173 times since Fri, Jul 27, 2018
Using Official Redhat DVD as repository
Viewed 10893 times since Mon, Oct 29, 2018
Cron YUM How to use yum-cron to automatically update RHEL/CentOS Linux
Viewed 2227 times since Fri, Oct 26, 2018
Inxi: Find System And Hardware Information On Linux
Viewed 2017 times since Sat, Jun 2, 2018