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
sed Delete / Remove ^M Carriage Return (Line Feed / CRLF) on Linux or Unix
Viewed 9099 times since Thu, Feb 7, 2019
Enabling automatic updates in Centos 7 and RHEL 7
Viewed 1936 times since Wed, Oct 17, 2018
RHCS6: Clustered LVM
Viewed 1606 times since Sun, Jun 3, 2018
LVM: Remove a Filesystem / Logical Volume
Viewed 2024 times since Sat, Jun 2, 2018
How to disable SSH cipher/ MAC algorithms for Linux and Unix
Viewed 33692 times since Fri, Aug 21, 2020
Linux - How to unlock and reset user’s account
Viewed 2372 times since Fri, Jun 8, 2018
RHEL: Extending a vmdk (Virtual Machine disk)
Viewed 3460 times since Sun, May 27, 2018
RHEL: Rename a network interface on RHEL 7
Viewed 8381 times since Sat, Jun 2, 2018
YUM CRON RHEL7: Configure automatic updates.
Viewed 1432 times since Fri, Oct 26, 2018
Linux Audit The Linux security blog about Auditing, Hardening, and Compliance lynis
Viewed 1388 times since Thu, Jan 16, 2020