nmap:网络探测工具和安全/端口扫描器
简介nmap命令是一款开放源代码的网络探测和安全审核工具,是Network Mapper的缩写。其设计目的是快速的扫描大型网络。nmap可以发现网络上有哪些主机,主机提供了什么服务器,并探测操作系统的类型及版本信息。 如果系统没有nmap命令,则可以使用下面的命令来安装: yum -y install nmap
说明
nmap命令是一款开放源代码的网络探测和安全审核工具,是Network Mapper的缩写。其设计目的是快速的扫描大型网络。nmap可以发现网络上有哪些主机,主机提供了什么服务器,并探测操作系统的类型及版本信息。
如果系统没有nmap命令,则可以使用下面的命令来安装:
yum -y install nmap
格式
nmap [扫描类型] [选项] [扫描目标]
常用参数
- -sS:TCP同步扫描
- -sT:TCP连接扫描
- -sn:不进行端口扫描,只检查主机正在运行
- -sV:探测服务器版本信息
- -O:获取主机的标志,也就是操作系统类型
- -p<端口>:指定要扫描的端口,可以是一个单独的端口,也可以用逗号分给开多个端口,还可以使用”-“表示一个端口范围
- -n:不进行DNS解析,加快扫描速度
- -v:显示扫描过程中的详细信息
示例
1、查看主机当前开放的端口
[root@localhost ~]# nmap 192.168.71.108
Starting Nmap 6.40 ( http://nmap.org ) at 2018-06-21 17:04 CST
Nmap scan report for 192.168.71.108
Host is up (0.00018s latency).#目标主机正在运行
Not shown: 997 closed ports #997个关闭的端口
PORT STATE SERVICE
22/tcp open ssh #22端口提供SSH服务
80/tcp open http #80端口提供http服务
3306/tcp open mysql #3306端口提供mysql服务
MAC Address: 00:0C:29:1E:D8:26 (VMware) #目标主机的mac地址
Nmap done: 1 IP address (1 host up) scanned in 32.95 seconds
2、扫描主机的指定端口
[root@localhost ~]# nmap -p 80 192.168.71.108
Starting Nmap 6.40 ( http://nmap.org ) at 2018-06-21 17:06 CST
Nmap scan report for 192.168.71.108
Host is up (0.00033s latency).
PORT STATE SERVICE
80/tcp open http
MAC Address: 00:0C:29:1E:D8:26 (VMware)
Nmap done: 1 IP address (1 host up) scanned in 13.44 seconds
[root@localhost ~]#
[root@localhost ~]# nmap -p 80,3306 192.168.71.108
Starting Nmap 6.40 ( http://nmap.org ) at 2018-06-21 17:06 CST
Nmap scan report for 192.168.71.108
Host is up (0.00030s latency).
PORT STATE SERVICE
80/tcp open http
3306/tcp open mysql
MAC Address: 00:0C:29:1E:D8:26 (VMware)
Nmap done: 1 IP address (1 host up) scanned in 14.45 seconds
[root@localhost ~]#
[root@localhost ~]# nmap -p 1-10000 192.168.71.108
Starting Nmap 6.40 ( http://nmap.org ) at 2018-06-21 17:07 CST
Nmap scan report for 192.168.71.108
Host is up (0.0016s latency).
Not shown: 9997 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
3306/tcp open mysql
MAC Address: 00:0C:29:1E:D8:26 (VMware)
Nmap done: 1 IP address (1 host up) scanned in 15.40 seconds
3、扫描局域网内所有的IP
[root@localhost ~]# nmap 192.168.71.0/24
Starting Nmap 6.40 ( http://nmap.org ) at 2018-06-21 17:11 CST
Nmap scan report for 192.168.71.1
Host is up (0.00075s latency).
Not shown: 996 filtered ports
PORT STATE SERVICE
443/tcp open https
902/tcp open iss-realsecure
912/tcp open apex-mesh
5357/tcp open wsdapi
MAC Address: 00:50:56:C0:00:08 (VMware)
Nmap scan report for 192.168.71.2
Host is up (0.00024s latency).
Not shown: 999 closed ports
PORT STATE SERVICE
53/tcp filtered domain
MAC Address: 00:50:56:F5:F6:48 (VMware)
Nmap scan report for 192.168.71.108
Host is up (0.00051s latency).
Not shown: 997 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
3306/tcp open mysql
MAC Address: 00:0C:29:1E:D8:26 (VMware)
Nmap scan report for 192.168.71.254
Host is up (-0.10s latency).
All 1000 scanned ports on 192.168.71.254 are filtered
MAC Address: 00:50:56:F4:6C:04 (VMware)
4、扫描局域网内在运行的主机
[root@localhost ~]# nmap -sn 192.168.71.0/24
Starting Nmap 6.40 ( http://nmap.org ) at 2018-06-20 06:01 EDT
Nmap scan report for 192.168.71.1
Host is up (0.00010s latency).
MAC Address: 00:50:56:C0:00:08 (VMware)
Nmap scan report for 192.168.71.2
Host is up (0.000091s latency).
MAC Address: 00:50:56:F5:F6:48 (VMware)
Nmap scan report for 192.168.71.107
Host is up (0.00031s latency).
MAC Address: 00:0C:29:0B:D8:26 (VMware)
Nmap scan report for 192.168.71.254
Host is up (0.00043s latency).
MAC Address: 00:50:56:F4:6C:04 (VMware)
Nmap scan report for 192.168.71.108
Host is up.
Nmap done: 256 IP addresses (5 hosts up) scanned in 27.87 seconds
5、扫描指定范围内进行扫描
[root@localhost ~]# nmap -sn 192.168.71.100-108
Starting Nmap 6.40 ( http://nmap.org ) at 2018-06-20 06:03 EDT
Nmap scan report for 192.168.71.107
Host is up (0.00013s latency).
MAC Address: 00:0C:29:0B:D8:26 (VMware)
Nmap scan report for 192.168.71.108
Host is up.
Nmap done: 9 IP addresses (2 hosts up) scanned in 26.34 seconds
6、探测目标主机的服务和操作系统版本
[root@localhost ~]# nmap -O -sV 192.168.71.108
Starting Nmap 6.40 ( http://nmap.org ) at 2018-06-21 17:20 CST
Nmap scan report for 192.168.71.108
Host is up (0.00066s latency).
Not shown: 997 closed ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 6.4 (protocol 2.0)
80/tcp open http nginx
3306/tcp open mysql MySQL (unauthorized)
MAC Address: 00:0C:29:1E:D8:26 (VMware)
No exact OS matches for host (If you know what OS is running on it, see http://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=6.40%E=4%D=6/21%OT=22%CT=1%CU=35805%PV=Y%DS=1%DC=D%G=Y%M=000C29%T
OS:M=5B2B6E11%P=x86_64-redhat-linux-gnu)SEQ(SP=108%GCD=1%ISR=103%TI=Z%CI=I%
OS:TS=A)SEQ(SP=108%GCD=1%ISR=103%TI=Z%CI=I%II=I%TS=A)OPS(O1=M5B4ST11NW7%O2=
OS:M5B4ST11NW7%O3=M5B4NNT11NW7%O4=M5B4ST11NW7%O5=M5B4ST11NW7%O6=M5B4ST11)WI
OS:N(W1=3890%W2=3890%W3=3890%W4=3890%W5=3890%W6=3890)ECN(R=Y%DF=Y%T=40%W=39
OS:08%O=M5B4NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3
OS:(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=
OS:Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=
OS:Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%T=40%IPL=164%UN=0%R
OS:IPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD=S)
Network Distance: 1 hop
OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 34.48 seconds
上面输出的信息中不仅包含了端口号,而且还包含了服务的版本号。在网络安全要求较高的主机上,最好能够屏蔽服务版本号,以防止黑客利用特定版本存在的漏洞进行攻击。
有时候我们并不想让自己的应用能多次进行启动,所以本文主要讲解下如何限制Electron的应用多次被启动。
线性表是最基本、最简单、也是最常用的一种数据结构,一个线性表是n个具有相同特性的数据元素的有限序列。
grep命令是常用个一个命令。能够从文本文件或管道数据流中筛选匹配的行及数据,如果使用正则表达式进行一起使用,功能会更加强大。
对加密相关概念整理
Nginx作为使用量非常大的Web服务器,但是如果遇到一个访问量比较大的网站,其访问日志会快速的进行增长,如果一直将所有的访问日志存放在一个文件中肯定是不对的,所以我们就需要对访问量大的访问日志进行分割,然后按照一定的时间删除不需要的日志文件。
快速生成表格
在使用Git的过程中,不想每次都输入用户名和密码去拉取代码,所以就需要保存这些信息,那么既然有保存了,就必须有清除功能。
Docker编译镜像出现:fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.12/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory问题
在Mac电脑中,如何对Git的用户名和密码进行修改呢?起初不懂Mac,所以整了很久,本文将记录如何对这个进行操作,以便后期使用。