Skip to content

Commit

Permalink
Removed nse_auxiliar. Updated Script Argument parsing. Fixed typos in
Browse files Browse the repository at this point in the history
documentation. Improved MySQLinfo.nse. Nsock/dnet metatabels are now
protected.
  • Loading branch information
batrick committed May 31, 2008
1 parent 21a2e7a commit 742ff67
Show file tree
Hide file tree
Showing 12 changed files with 124 additions and 335 deletions.
6 changes: 3 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ INSTALLZENMAP=@INSTALLZENMAP@
UNINSTALLZENMAP=@UNINSTALLZENMAP@

ifneq (@LIBLUA_LIBS@,)
NSE_SRC=nse_main.cc nse_auxiliar.cc nse_nsock.cc nse_init.cc nse_nmaplib.cc nse_debug.cc nse_pcrelib.cc nse_string.cc
NSE_HDRS=nse_main.h nse_auxiliar.h nse_nsock.h nse_init.h nse_nmaplib.h nse_debug.h nse_macros.h nse_pcrelib.h nse_string.h
NSE_OBJS=nse_main.o nse_auxiliar.o nse_nsock.o nse_init.o nse_nmaplib.o nse_debug.o nse_pcrelib.o nse_string.o
NSE_SRC=nse_main.cc nse_nsock.cc nse_init.cc nse_nmaplib.cc nse_debug.cc nse_pcrelib.cc nse_string.cc
NSE_HDRS=nse_main.h nse_nsock.h nse_init.h nse_nmaplib.h nse_debug.h nse_macros.h nse_pcrelib.h nse_string.h
NSE_OBJS=nse_main.o nse_nsock.o nse_init.o nse_nmaplib.o nse_debug.o nse_pcrelib.o nse_string.o
NSESTDLIB=nsestdlib
endif

Expand Down
2 changes: 1 addition & 1 deletion docs/scripting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ $ nmap -sC --script-args user=foo,pass=bar,anonFTP={pass=ftp@foobar.com}
which would result in the Lua table:
</para>
<programlisting>
{user="foo",pass="bar",anonFTP={pass=nobody@foobar.com}}
{user="foo",pass="bar",anonFTP={pass="nobody@foobar.com"}}
</programlisting>

<para>You could therefore access the username (<literal>"foo"</literal>)
Expand Down
4 changes: 0 additions & 4 deletions mswin32/nmap.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,6 @@
RelativePath="..\NmapOutputTable.cc"
>
</File>
<File
RelativePath="..\nse_auxiliar.cc"
>
</File>
<File
RelativePath="..\nse_debug.cc"
>
Expand Down
132 changes: 0 additions & 132 deletions nse_auxiliar.cc

This file was deleted.

53 changes: 0 additions & 53 deletions nse_auxiliar.h

This file was deleted.

29 changes: 17 additions & 12 deletions nse_debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,27 @@ void l_dumpStack(lua_State* l) {
}

void l_dumpValue(lua_State* l, int i) {
if(lua_istable(l, i))
switch (lua_type(l, i))
{
case LUA_TTABLE:
l_dumpTable(l, i);
else if(lua_isfunction(l, i))
break;
case LUA_TFUNCTION:
l_dumpFunction(l, i);
else if(lua_isstring(l, i)) {
lua_pushvalue(l, i);
log_write(LOG_PLAIN, "string '%s'\n", lua_tostring(l, -1));
lua_pop(l, 1);
}
else if(lua_isboolean(l, i))
log_write(LOG_PLAIN, "boolean: %s", lua_toboolean(l, i) ? "true\n" : "false\n");
else if(lua_isnumber(l, i))
break;
case LUA_TSTRING:
log_write(LOG_PLAIN, "string '%s'\n", lua_tostring(l, i));
break;
case LUA_TBOOLEAN:
log_write(LOG_PLAIN, "boolean: %s\n",
lua_toboolean(l, i) ? "true" : "false");
break;
case LUA_TNUMBER:
log_write(LOG_PLAIN, "number: %g\n", lua_tonumber(l, i));
else
break;
default:
log_write(LOG_PLAIN, "%s\n", lua_typename(l, lua_type(l, i)));
}
}

void l_dumpTable(lua_State *l, int index) {
Expand All @@ -56,4 +62,3 @@ void l_dumpFunction(lua_State* l, int index) {
// log_write(LOG_PLAIN, "\tname: %s %s\n", ar.namewhat, ar.name);
fflush(stdout);
}

Loading

0 comments on commit 742ff67

Please sign in to comment.