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
Oracle Linux 7 – How to audit changes to a trusted file such as /etc/passwd or /etc/shadow
Viewed 3041 times since Wed, Jul 25, 2018
RHEL: GPT/MBR partition tables (using disks larger than 2 TiB)
Viewed 12396 times since Sun, May 27, 2018
Installing and Configuring an OCFS2 Clustered File System
Viewed 5980 times since Sat, Jun 2, 2018
YUM CRON RHEL7: Configure automatic updates.
Viewed 2027 times since Fri, Oct 26, 2018
LVM: Managing snapshots
Viewed 7816 times since Sat, Jun 2, 2018
How To Use the Linux Auditing System on CentOS 7
Viewed 4024 times since Fri, Apr 5, 2019
Linux 20 Netstat Commands for Linux Network Management
Viewed 9715 times since Mon, Sep 21, 2020
Find All Large Files On A Linux System
Viewed 2278 times since Mon, Oct 29, 2018
Exclude multiple files and directories with rsync
Viewed 2613 times since Wed, Oct 31, 2018
Extending Linux LVM partitions script
Viewed 6467 times since Wed, Feb 6, 2019