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传输完成。
$ 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传输完成。
相关文章推荐
- 使用keepalived实现nginx的高可用性
- Android之——ContentResolver查询的三种方式
- 题目:搜索二维矩阵
- 变量声明和定义的关系
- #开发中注意的问题
- 异常
- 模板特化
- 自动机理论学习
- poj1006
- 树链剖分
- mysql---行与列互转
- java中将由数字组成的字符串型(String)转换成整型(int)
- 题目:插入区间
- Java IO流 装饰 字节流--19
- Lua闭包的理解
- windows获取.exe文件版本号
- BZOJ1046
- 8.ios-Protocol
- Linux 命令 - 文件搜索命令 locate
- Unity3d基础组件 (Component) 和脚本 (Script) 关系