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
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传输完成。
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-11-08 21:06:48