您的位置:首页 > 其它

NC(netcat)应用全记录<持续更新>

2015-08-19 19:27 417 查看
1. 连接tianya.cn(MIME欺骗)

$ nc -nvv 221.11.172.178 80

Connection to 221.11.172.178 80 port [tcp/*] succeeded!

get / http/1.1

HTTP/1.0 400 Bad request

Cache-Control: no-cache

Connection: close

Content-Type: text/html

<html><body><h1>400 Bad request</h1>

Your browser sent an invalid request.

</body></html>

2. 聊天:

服务器端:

$ nc -l 1234

ddd

sss

xxxxx

客户端:

$ nc 127.0.0.1 1234

ddd

sss

xxxxx
$ nc  192.168.1.255 1234  ---- 局域网广播消息

3. 端口扫描:

$ nc -nvv -w2 192.168.1.1 80-90

Connection to 192.168.1.1 80 port [tcp/*] succeeded!

nc: connect to 192.168.1.1 port 81 (tcp) failed: Connection refused

nc: connect to 192.168.1.1 port 82 (tcp) failed: Connection timed out

4. 传输文件:

服务器端:

$ nc -lvv 1234 > test.txt

客户端:

$ nc 127.0.0.1 1234 < test.txt
test.txt传输完成。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: