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 - How to monitor memory usage
Viewed 531 times since Fri, Jun 8, 2018
O’Reilly’s CD bookshelf
Viewed 5394 times since Wed, Jun 27, 2018
red hat 7 tmpfiles service
Viewed 524 times since Thu, Oct 11, 2018
www.unixarena.com
Viewed 594 times since Fri, Jul 27, 2018
RHEL: Route network packets to go out via the same interface they came in
Viewed 1259 times since Sat, Jun 2, 2018
How To Create a Linux Swap File
Viewed 723 times since Fri, Jun 8, 2018
RHEL: Multipathing basics
Viewed 1422 times since Sat, Jun 2, 2018
RHEL: Display swap/RAM size
Viewed 1016 times since Sat, Jun 2, 2018
Use inotify-tools on CentOS 7 or RHEL 7 to watch files and directories for events
Viewed 1030 times since Fri, Jul 27, 2018
How log rotation works with logrotate
Viewed 1508 times since Fri, Nov 30, 2018