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
Linux Customizing Bash
Viewed 560 times since Sun, Dec 6, 2020
How To Ping Specific Port Number
Viewed 1792 times since Mon, Jun 1, 2020
Linux - How to perform I/O performance test with dd command
Viewed 4802 times since Fri, Jun 8, 2018
RHEL: Reinstalling Boot Loader on the Master Boot Record (MBR)
Viewed 1958 times since Sun, May 27, 2018
How to Synchronize Directories Using Lsyncd in Linux
Viewed 10351 times since Wed, Oct 31, 2018
OEL 7 – How to disable IPv6 on Oracle Linux 7 – Follow Up
Viewed 8024 times since Wed, Jul 25, 2018
An easier way to manage disk decryption at boot with Red Hat Enterprise Linux 7.5 using NBDE
Viewed 4635 times since Mon, Aug 6, 2018
Używanie rsync poprzez Secure Shell
Viewed 38500 times since Thu, May 24, 2018
Linux: Disks diagnostic using smartctl
Viewed 12262 times since Wed, Jul 25, 2018
Using renice and taskset to manage process priority and CPU affinity with Linux OEL 6.4
Viewed 1959 times since Mon, Feb 17, 2020