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
LVM: Managing snapshots
Viewed 7599 times since Sat, Jun 2, 2018
Open SSL Encrypt & Decrypt Files With Password Using OpenSSL
Viewed 7735 times since Mon, Feb 18, 2019
How to remove CTRL-M (^M) characters from a file in Linux
Viewed 2439 times since Thu, Feb 7, 2019
Using etckeeper with git
Viewed 6703 times since Sun, Jun 3, 2018
RHCS6: ’fencing’ basics
Viewed 2136 times since Sun, Jun 3, 2018
7 Tips – Tuning Command Line History in Bash
Viewed 5119 times since Fri, Jul 5, 2019
UUIDs and Linux: Everything you ever need to know [Update]
Viewed 4834 times since Tue, Jul 17, 2018
OpenSSL: Find Out SSL Key Length – Linux Command Line
Viewed 6610 times since Mon, Feb 18, 2019
ubuntu How to reset lost root password on Ubuntu 16.04 Xenial Xerus Linux
Viewed 8123 times since Tue, Dec 8, 2020
RHCS6: Luci - the cluster management console
Viewed 3065 times since Sun, Jun 3, 2018