nmap NSE脚本研究之一:脚本扫描参数及基本用法

前记:这篇博客首次写的时间比较久远,内容参考自nmap官网,可能还有其他作者的内容。如有重叠,望海涵。只是做技术分享而已。

-sC

等于 --script=default。-sC option enables the NSE and runs any script in the default category.

--script=<Lua scripts>

Lua一种嵌入式语言。使用a comma逗号 separated分隔 list of directories, script-files or script-categories。其实不止这三种引用方式,后面会专门进行介绍。

--script-args=<n1=v1,[n2=v2,...]>

provide提供 arguments to scripts

--script-args-file=filename

provide NSE(Nmap Scripting Engine) script args in a file

--script-trace

Show all data sent and received

--script-help=<Lua scripts>

Show help about scripts. <Lua scripts> is a comma-separated list of script-files orscript-categories.

 

--script-updatedb

Update the script database.

 

NSE Introduction

It was introduced during       Google’s Summer of Code in 2007。开发NSE脚本的初衷是增强“服务探测和OS探测”。今天,有14个类别涉及广泛的任务,从network discovery到detection

and exploitation of security vulnerabilities。比如:暴力破解弱口令。

 

NSE Script分类(category

Script category

Description

认证

auth

与用户身份认证相关的NSE脚本

广播

broadcast

一个非常有趣的脚本类型,需要使用广播的方式去收集网络信息

爆破

brute

进行暴力破解的脚本类型,用于暴力破解用户密码

默认

default

sC参数指定时,默认执行的脚本类型

发现

discovery

与主机和服务发现相关的脚本

拒绝服务

dos

与拒绝服务攻击相关的脚本

利用

exploit

用于利用安全漏洞的脚本

扩展

external

这类脚本依赖于第三方的服务

模糊

fuzzer

专注于模糊测试的NSE脚本

入侵

intrusive

该类别,可能会导致一些东西崩溃或产生大量的网络噪音。系统管理员可能认为具有侵入性的脚本

恶意软件

malware

与恶意软件检测相关的脚本类别。

安全

safe

在所有情况下都被认为是安全的脚本

版本

version

用于高级版本检测

漏洞

vuln

与检测和利用安全漏洞相关的脚本

 

脚本选择引用

#通过脚本名称、脚本列表引用

nmap --script http-title,http-methods <target>

nmap --script discovery,intrusive <target>

#通过脚本路径、包含脚本的目录,后者会将目录中的所有脚本执行一遍。

nmap --script /path/to/script.nse,/another/path/script2.nse <target>

nmap --script /path/to/folder/ <target>

注释:--script       option接受“相对路径”、“绝对路径”的脚本和文件夹。相对路径:除了当前目录外,还会在以下目录下查找:

--datadir

$NMAPDIR

~/.nmap

%HOMEPATH%\AppData\Roaming\nmap

包含nmap的目录

包含nmap的目录后跟此相对路径:../share/nmap

NMAPDATADIR

 

#高级脚本选择,使用表达式。表达式用于描述一组脚本。

##匹配任何脚本,exploit类型除外

#nmap -sV --script "not exploit" <target>

##匹配任何脚本,intrusive、dos、exploit类型除外

#nmap --script "not(intrusive or dos or exploit)" -sV <target>

##匹配broadcast和discovery类型脚本

#nmap --script "broadcast and discovery" <<target>

##使用通配符匹配snmp-开头的所有脚本

#nmap --script "snmp-*" <target>

##匹配http-开头的所有脚本,除了“http-slowloris、http-brute、http-enum、http-form-fuzzer”4个脚本之外

#nmap --script "http-* and not(http-slowloris or http-brute or http-enum or http-form-fuzzer)" <target>

##匹配http-开头的所有脚本,除了里面exploit类型以外

#nmap --script "http-* and not(exploit)" <target>

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值