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 Linux Network Statistics Tools / Commands
Viewed 10308 times since Mon, Sep 21, 2020
Top 20 OpenSSH Server Best Security Practices - good article
Viewed 12042 times since Mon, Oct 1, 2018
HP-UX - Stunnel Configuration
Viewed 3426 times since Fri, Sep 28, 2018
LVM: Reduce SWAP size by shrinking existing Logical Volume
Viewed 7222 times since Sat, Jun 2, 2018
Fix rpmdb: Thread died in Berkeley DB library
Viewed 22088 times since Fri, Feb 14, 2020
Using grep to find string in files
Viewed 3249 times since Fri, May 15, 2020
ZPOOL: Remove an existing zpool
Viewed 2985 times since Sun, Jun 3, 2018
RHCS6: Mirror/unmirror a GFS2 volume
Viewed 5988 times since Sun, Jun 3, 2018
Understanding System auditing with auditd
Viewed 12084 times since Fri, Apr 5, 2019
Method 2 – Use shell scripts How to install yum cron on a CentOS/RHEL 6.x/7.x
Viewed 5061 times since Tue, Dec 4, 2018