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 An introduction to swap space on Linux systems
Viewed 2325 times since Thu, Jan 23, 2020
Open SSL Creating Certificate Signing Request — CSR Generation
Viewed 1815 times since Mon, Feb 18, 2019
Linux File Systems (mkfs, mount, fstab) ext4
Viewed 3100 times since Sat, Jun 2, 2018
FIO (Flexible I/O) – a benchmark tool for any operating system
Viewed 19313 times since Wed, Jul 25, 2018
How to maximise SSD performance with Linux
Viewed 8549 times since Fri, May 15, 2020
Top 4 Reasons for Node Reboot or Node Eviction in Real Application Cluster (RAC) Environment
Viewed 90014 times since Thu, Jun 21, 2018
Modifying the inode count for an ext2/ext3/ext4 file system
Viewed 14918 times since Fri, Sep 18, 2020
red hat 7 tmpfiles service
Viewed 1742 times since Thu, Oct 11, 2018
“Too many authentication failures” with SSH
Viewed 5701 times since Mon, May 21, 2018
ZPOOL: Add a mirror to a concat zpool
Viewed 3689 times since Sun, Jun 3, 2018