diff --git a/CHANGELOG b/CHANGELOG index ad901e4af..c601f43b5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # Nmap Changelog ($Id$); -*-text-*- +o Added a new timing_level() function to NSE which reports the Nmap + timing level from 0 to 5, as set by the Nmap -T option. The default + is 3. [Thomas Buchanan] + o Integrated several service match lines from Tom Sellers. o An error was fixed where Zenmap would crash when trying to load from diff --git a/docs/scripting.xml b/docs/scripting.xml index dbcae4c80..bc043152d 100644 --- a/docs/scripting.xml +++ b/docs/scripting.xml @@ -1961,6 +1961,18 @@ nmap.fetchfile("nmap-rpc") + + + timing_levelnmap.timing_level + + + Returns the timing level as a non-negative integer. Possible return + values vary from 0 to 5, corresponding to the six built-in Nmap + timing templates. The timing level can be set with the + option (see ). + + + diff --git a/nse_nmaplib.cc b/nse_nmaplib.cc index 3f33c6f99..e2e45719b 100644 --- a/nse_nmaplib.cc +++ b/nse_nmaplib.cc @@ -42,6 +42,7 @@ static int l_get_verbosity(lua_State *); static int l_get_debugging(lua_State *); static int l_get_have_ssl(lua_State *L); static int l_fetchfile(lua_State *L); +static int l_get_timing_level(lua_State *L); int l_clock_ms(lua_State *L); @@ -63,6 +64,7 @@ int l_clock_ms(lua_State *L); {"debugging", l_get_debugging}, {"have_ssl", l_get_have_ssl}, {"fetchfile", l_fetchfile}, + {"timing_level", l_get_timing_level}, {NULL, NULL} }; @@ -584,3 +586,8 @@ err: return 0; } +static int l_get_timing_level(lua_State *L) +{ + lua_pushnumber(L, o.timing_level); + return 1; +}