From 156952fbf82500abd50dc8803b0ad5a64e84334b Mon Sep 17 00:00:00 2001 From: david Date: Sun, 18 Jul 2010 20:31:32 +0000 Subject: [PATCH] Do index canonicalization in scripting.xml. Remove ".nse" where not needed. --- docs/scripting.xml | 43 +++++++++++++++++++++++++------------------ scripts/asn-query.nse | 2 +- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/docs/scripting.xml b/docs/scripting.xml index 42a6bb350..b8b48d3c4 100644 --- a/docs/scripting.xml +++ b/docs/scripting.xml @@ -205,7 +205,7 @@ Nmap done: 1 IP address (1 host up) scanned in 0.33 seconds or . Every host will be assumed up and still only host scripts will be run. This technique is useful for scripts like - whois.nsewhois.nse + whoiswhois script that only use the remote system's address and don't require it to be up. @@ -647,7 +647,7 @@ Nmap script database, but should be used cautiously since Nmap may contain explo nmap --script smb-os-discovery - Loads only the smb-os-discovery.nse + Loads only the smb-os-discovery script. Note that the .nse extension is optional. @@ -656,7 +656,7 @@ Nmap script database, but should be used cautiously since Nmap may contain explo nmap --script default,banner,/home/user/customscripts Loads the script in the default - category, the banner.nse script, and all + category, the banner script, and all .nse files in the directory /home/user/customscripts. @@ -676,8 +676,8 @@ Nmap script database, but should be used cautiously since Nmap may contain explo Loads all scripts whose name starts with http-, such as - http-auth.nse and - http-open-proxy.nse. The argument to + http-auth and + http-open-proxy. The argument to had to be in quotes to protect the wildcard from the shell. @@ -952,7 +952,7 @@ that. names of scripts that should run before this script, if they are also selected. This is used when one script can make use of the results of another. For example, most of the smb-* scripts depend on - smb-brute,smb-brute.nse + smb-brute,smb-brute script because the accounts found by smb-brute may allow the other scripts to get more information. Listing a script in dependencies doesn't cause that script to be run; it @@ -960,7 +960,7 @@ that. or otherwise. dependencies merely forces an ordering among the scripts that are selected. This is an example of a dependencies table, from - smb-os-discovery:smb-os-discovery.nse + smb-os-discovery:smb-os-discovery script dependencies = {"smb-brute"} @@ -1058,7 +1058,7 @@ action refer to . extended with libraries for interfacing with Nmap. The Nmap API is in the Lua namespace nmap. This means that all calls to resources provided by Nmap have an - nmap prefix.nmap NSE module + nmap prefix.nmap NSE library nmap.new_socket(), for example, returns a new socket wrapper object. The Nmap library layer also takes care of initializing the Lua context, scheduling parallel @@ -1197,9 +1197,9 @@ action refer to . The smallest compiled module that comes with NSE is - bit,bit NSE module + bit,bit NSE library and one of the most straightforward is - openssl.openssl NSE module + openssl.openssl NSE library These modules serve as good examples for a beginning module writer. The source code for bit is found in @@ -1267,7 +1267,7 @@ LUALIB_API int luaopen_openssl(lua_State *L) { Nmap API - nmap NSE module + nmap NSE library Nmap Scripting Engine (NSE)API NSE scripts have access to several Nmap facilities for writing @@ -1700,9 +1700,12 @@ socket:close() handle, call ethernet_close. Sometimes the easiest ways to understand complex APIs is by - example. The ipidseq.nse script included with + example. The + ipidseqipidseq script + script included with Nmap uses raw IP packets to test hosts for suitability for Nmap's - Idle Scan (). The sniffer-detect.nse + Idle Scan (). The + sniffer-detectsniffer-detect script script also included with Nmap uses raw Ethernet frames in an attempt to detect promiscuous-mode machines on the network (those running sniffers). @@ -2191,7 +2194,7 @@ server (your default DNS server, or whichever one you specified with the --- -- @usage --- nmap --script asn-query.nse [--script-args dns=<DNS server>] <target> +-- nmap --script asn-query [--script-args dns=<DNS server>] <target> -- @args dns The address of a recursive nameserver to use (optional). -- @output -- Host script results: @@ -2633,8 +2636,11 @@ mutexfn = nmap.mutex(object) A simple example of using the API is provided in . For - real-life examples, read the asn-query.nse and - whois.nse scripts in the Nmap + real-life examples, read the + asn-queryasn-query script + and + whoiswhois script + scripts in the Nmap distribution. @@ -2928,6 +2934,7 @@ end A typical version detection script (Skype version 2 detection) +skypev2-version script description = [[ Detects the Skype version 2 service. @@ -3002,10 +3009,10 @@ end - Example Script: <filename>finger.nse</filename> + Example Script: <filename>finger</filename> finger script - The finger script (finger.nse) is a perfect + The finger script is a perfect example of a short and simple NSE script. diff --git a/scripts/asn-query.nse b/scripts/asn-query.nse index f4e81c036..4b1fa1fad 100644 --- a/scripts/asn-query.nse +++ b/scripts/asn-query.nse @@ -19,7 +19,7 @@ server (your default DNS server, or whichever one you specified with the --- -- @usage --- nmap --script asn-query.nse [--script-args dns=] +-- nmap --script asn-query [--script-args dns=] -- @args dns The address of a recursive nameserver to use (optional). -- @output -- Host script results: