标签:输入 聊天 input 数据 love state 网络连接 NPU tin
[root@cs6 ~]# /etc/init.d/iptables status 表格:filter Chain INPUT (policy ACCEPT) num target prot opt source destination 1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 5 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT) num target prot opt source destination 1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT) num target prot opt source destination [root@cs6 ~]# /etc/init.d/iptables stop iptables:将链设置为政策 ACCEPT:filter [确定] iptables:清除防火墙规则: [确定] iptables:正在卸载模块: [确定] [root@cs6 ~]# setenforce 0 [root@cs6 ~]# getenforce Permissive
[root@cs6 ~]# nc -l 12345 > lewen.nc #<=监听12345端口,将数据写入oldboy.nc #<=执行完上面的命令后,当前窗口挂起。 #<=新开一个窗口执行命令。 [root@cs6 ~]# cat lewen.nc #<=首先查看12345端口。 [root@cs6 ~]# netstat -lntup|grep 12345 tcp 0 0 0.0.0.0:12345 0.0.0.0:* LISTEN 2612/nc [root@cs6 ~]# cat lewen.log #<=待用的文件。 6.8.0 #<=文件中的内容 [root@cs6 ~]# nc 10.0.0.100 12345 < lewen.log #<=使用nc命令向10.0.0.100 主机12345 端口传输lewen.log文件 [root@cs6 ~]# netstat -lntup|grep 12345 #<==nc命令传输完数据后自动终止。 [root@cs6 ~]# cat lewen.nc #检查结果 6.8.0
[root@cs6 ~]# echo "I love linux www.wenyule.top" >test.txt [root@cs6 ~]# vim web.sh #!/bin/bash while true do nc -l 80 < test.txt # 一直监听80端口,test.txt是发送给用户的内容。 done [root@cs6 ~]# sh web.sh &>/dev/null & [1] 2685 [root@cs6 ~]# [root@cs6 ~]# netstat -lntup|grep 80 tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2686/nc [root@cs6 ~]# curl 127.0.0.1 I love linux www.wenyule.top
[root@cs6 ~]# nc blog.oldboyedu.com 80 GET /about-us/ HTTP/1.1 <=粘贴这两行语句,速度要快,如果慢了程序就会超时自动退出。 host:blog.oldboyedu.com <==HTTP/1.1的要求必须写明hosto #<==敲两次回车确认发送请求报文,下面就是响应报文的内容。 HTTP/1.1 301 Moved Permanently Server: nginx Date: Tue, 07 May 2019 13:40:50 GMT Content-Type: text/html Content-Length: 178 Connection: keep-alive Location: https://blog.oldboyedu.com/about-us/ <html> <head><title>301 Moved Permanently</title></head> <body bgcolor="white"> <center><h1>301 Moved Permanently</h1></center> <hr><center>nginx</center> </body> </html>
[root@cs6 ~]# nc -z 10.0.0.100 20-30 Connection to 10.0.0.100 22 port [tcp/ssh] succeeded! [root@cs6 ~]# nc -z 10.0.0.100 22 Connection to 10.0.0.100 22 port [tcp/ssh] succeeded! [root@cs6 ~]# nc -zv 10.0.0.100 20-30 #<=使用-v选项详细显示扫描过程 nc: connect to 10.0.0.100 port 20 (tcp) failed: Connection refused nc: connect to 10.0.0.100 port 21 (tcp) failed: Connection refused Connection to 10.0.0.100 22 port [tcp/ssh] succeeded! nc: connect to 10.0.0.100 port 23 (tcp) failed: Connection refused nc: connect to 10.0.0.100 port 24 (tcp) failed: Connection refused nc: connect to 10.0.0.100 port 25 (tcp) failed: Connection refused nc: connect to 10.0.0.100 port 26 (tcp) failed: Connection refused nc: connect to 10.0.0.100 port 27 (tcp) failed: Connection refused nc: connect to 10.0.0.100 port 28 (tcp) failed: Connection refused nc: connect to 10.0.0.100 port 29 (tcp) failed: Connection refused nc: connect to 10.0.0.100 port 30 (tcp) failed: Connection refused
标签:输入 聊天 input 数据 love state 网络连接 NPU tin
原文地址:https://www.cnblogs.com/fadewalk/p/10840523.html