一、背景介绍

nmap是一个网络连接端扫描软件,用来扫描网上电脑开放的网络连接端。确定哪些服务运行在哪些连接端,并且推断计算机运行哪个操作系统(这是亦称 fingerprinting)。它是网络管理员必用的软件之一,以及用以评估网络系统安全。
正如大多数被用于网络安全的工具,nmap也是不少黑客及骇客(又称脚本小子)爱用的工具。系统管理员可以利用nmap来探测工作环境中未经批准使用的服务器,但是黑客会利用nmap来搜集目标电脑的网络设定,从而计划攻击的方法。
Nmap常被跟评估系统漏洞软件Nessus混为一谈。Nmap以隐秘的手法,避开闯入检测系统的监视,并尽可能不影响目标系统的日常操作。

Nmap is a network connection scanning software, used to scan the open network connection of computers on the network. Determine which services are running on which connections, and infer which operating system the computer is running on (this is also called fingerprinting). It is a network administrator must use one of the software, and to evaluate the network system security.
Like most of the tools used for network security, nmap is a favorite tool of many hackers and crackers (aka scripting kids). System administrators can use NMap to detect unapproved servers in their work environments, but hackers can use NMap to gather information about the network Settings of target computers to plan attacks.
NMAP is often confused with Nessus, the software that evaluates system vulnerabilities. NMAP uses stealth methods to avoid intrusion detection system monitoring and does not affect the daily operation of the target system as much as possible.

二、资源装备

1.安装好Kali Linux的虚拟机一台;
2.整装待发的小白一个。

  1. Install a virtual machine of Kali Linux;
  2. You're ready to go.

三、战略安排

3.1 nmap基本语法使用查看

命令:nmap --help

Nmap脚本引擎使用实战教程?(The Nmap scripting engine uses real-world tutorials)
Nmap脚本引擎使用实战教程?(The Nmap scripting engine uses real-world tutorials)

3.2 查看nmap脚本(scripts)路径。

命令:cd /usr/share/nmap/scripts
ls查看脚本列表

Nmap脚本引擎使用实战教程?(The Nmap scripting engine uses real-world tutorials)

3.3 利用命令查看脚本数量。

Ps:注意必须在脚本所在路径下使用该命令。
命令:ls | wc -l

Nmap脚本引擎使用实战教程?(The Nmap scripting engine uses real-world tutorials)

3.4 查看脚本模块中所包含的脚本列表。

命令:ls | grep 脚本模块名称
Eg :ls | grep auth

Nmap脚本引擎使用实战教程?(The Nmap scripting engine uses real-world tutorials)

auth:负责处理鉴权证书(绕开鉴权)的脚本
broadcast:在局域网内探查更多服务开启状况,如dhcp/dns/sqlserver等服务
brute:提供暴力破解方式,针对常见的应用如http/snmp等
default:使用-sC或-A选项扫描时候默认的脚本,提供基本脚本扫描能力
discovery:对网络进行更多的信息,如SMB枚举、SNMP查询等
dos:用于进行拒绝服务攻击
exploit:利用已知的漏洞入侵系统
external:利用第三方的数据库或资源,例如进行whois解析
fuzzer:模糊测试的脚本,发送异常的包到目标机,探测出潜在漏洞
intrusive:入侵性的脚本,此类脚本可能引发对方的IDS/IPs的记录或屏蔽
malware:探测目标机是否感染了病毒、开启了后门等信息
safe:此类与intrusive相反,属于安全性脚本
version:负责增强服务与版本扫描(version Detection)功能的脚本
vuln:负责检查目标机是否有常见的漏洞(vulnerability),如是否有MSo8_067

3.6 负责处理鉴权证书(绕开鉴权)的脚本,也可以作为检测部分应用弱口令

命令:nmap --script=auth 192.168.1.30
Nmap脚本引擎使用实战教程?(The Nmap scripting engine uses real-world tutorials)

3.7 默认的脚本扫描,主要是搜集各种应用服务的信息,收集到后,可再针对具体服务进行攻击

命令:nmap --script=default 192.168.1.30或者 nmap -sC 192.168.1.30

Nmap脚本引擎使用实战教程?(The Nmap scripting engine uses real-world tutorials)
Nmap脚本引擎使用实战教程?(The Nmap scripting engine uses real-world tutorials)

3.8 利用第三方的数据库或资源,例如进行whois解析

命令:nmap --script external 192.168.1.30

3.9 检查vnc bypass

命令:nmap --script=realvnc-auth-bypass 192.168.1.30

3.10 Mysql扫描,扫描root空口令

命令:nmap -p3306 --script=mysql-empty-password.nse 192.168.1.30

3.11 Mysql扫描,列出所有mysql用户

命令:nmap -p3306 --script=mysql-users.nse
--script-args=mysqluser=root 192.168.1.30

3.12 发现网关

命令:nmap --script=broadcast-netbios-master-browser 192.168.1.30

Nmap脚本引擎使用实战教程?(The Nmap scripting engine uses real-world tutorials)