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
Find All Large Files On A Linux System
Viewed 2072 times since Mon, Oct 29, 2018
How to Configure ‘FirewallD’ in RHEL/CentOS 7 and Fedora 21
Viewed 10321 times since Wed, Oct 9, 2019
How to mount software RAID1 member using mdadm
Viewed 2956 times since Wed, Oct 3, 2018
How to retrieve and change partition’s UUID Universally Unique Identifier on linux
Viewed 2953 times since Tue, Jul 17, 2018
Inxi – A Powerful Feature-Rich Commandline System Information Tool for Linux
Viewed 18838 times since Sat, Jun 2, 2018
How to accurately determine when the system was booted
Viewed 2237 times since Wed, Oct 3, 2018
HowTo: Retrieve Email from a POP3 Server using the Command Line
Viewed 10550 times since Mon, Feb 18, 2019
debian Install a newer kernel in Debian 9 (stretch) stable
Viewed 1716 times since Sun, Sep 23, 2018
How to disable SSH cipher/ MAC algorithms for Linux and Unix
Viewed 45871 times since Fri, Aug 21, 2020
Red Hat Cluster Tutorial
Viewed 1974 times since Sun, Jun 3, 2018