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
RHCS6: Extend an existing Logical Volume / GFS2 filesystem
Viewed 4210 times since Sun, Jun 3, 2018
RHEL: Getting/Setting hardware clock’s time
Viewed 4592 times since Sat, Jun 2, 2018
Use inotify-tools on CentOS 7 or RHEL 7 to watch files and directories for events
Viewed 15457 times since Fri, Jul 27, 2018
How to Install and use Lsyncd on CentOS 7 / RHEL 7 rsync
Viewed 5767 times since Wed, Oct 31, 2018
12 Tcpdump Commands – A Network Sniffer Tool
Viewed 9645 times since Fri, Jul 27, 2018
What Is /dev/shm And Its Practical Usage
Viewed 9405 times since Tue, Mar 12, 2019
Build a simple RPM that packages a single file
Viewed 9925 times since Sat, Jun 2, 2018
Odpalenie polecenia tylko na jedną godzinę
Viewed 3594 times since Thu, May 24, 2018
20 Linux Command Tips and Tricks That Will Save You A Lot of Time linux
Viewed 5999 times since Thu, Apr 18, 2019
Script to Offline and Remove A Disk In Linux
Viewed 2706 times since Mon, Jan 28, 2019