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
10 Linux nslookup Command Examples for DNS Lookup
Viewed 10056 times since Sun, Sep 30, 2018
Linux Add a Swap File – HowTo
Viewed 9979 times since Fri, Jun 8, 2018
Enabling automatic updates in Centos 7 and RHEL 7
Viewed 2335 times since Wed, Oct 17, 2018
RHEL: Crash kernel dumps configuration and analysis on RHEL 7
Viewed 6882 times since Sat, Jun 2, 2018
How to disable SSH cipher/ MAC algorithms for Linux and Unix
Viewed 45206 times since Fri, Aug 21, 2020
Linux - How to get Memory information
Viewed 1754 times since Fri, Jun 8, 2018
Kernel sysctl configuration file for Linux
Viewed 5003 times since Fri, Aug 3, 2018
linux-training.be gives you books for free to study Linux
Viewed 4737 times since Sat, Jun 2, 2018
RHCS6: Quorum disk and heuristics
Viewed 4019 times since Sun, Jun 3, 2018
Improve security with polyinstantiation
Viewed 13013 times since Fri, May 15, 2020