mirror of
https://github.com/nmap/nmap.git
synced 2025-12-17 13:09:02 +00:00
moving debugger to nmap-exp/diman until further notice
This commit is contained in:
@@ -274,7 +274,6 @@ void NmapOps::Initialize() {
|
|||||||
script = 0;
|
script = 0;
|
||||||
scriptversion = 0;
|
scriptversion = 0;
|
||||||
scripttrace = 0;
|
scripttrace = 0;
|
||||||
scriptdebug = 0;
|
|
||||||
scriptupdatedb = 0;
|
scriptupdatedb = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -328,7 +328,6 @@ class NmapOps {
|
|||||||
char *scriptargs;
|
char *scriptargs;
|
||||||
int scriptversion;
|
int scriptversion;
|
||||||
int scripttrace;
|
int scripttrace;
|
||||||
int scriptdebug;
|
|
||||||
int scriptupdatedb;
|
int scriptupdatedb;
|
||||||
void chooseScripts(char* argument);
|
void chooseScripts(char* argument);
|
||||||
std::vector<std::string> chosenScripts;
|
std::vector<std::string> chosenScripts;
|
||||||
|
|||||||
5
nmap.cc
5
nmap.cc
@@ -627,8 +627,6 @@ int nmap_main(int argc, char *argv[]) {
|
|||||||
{"script", required_argument, 0, 0},
|
{"script", required_argument, 0, 0},
|
||||||
{"script-trace", no_argument, 0, 0},
|
{"script-trace", no_argument, 0, 0},
|
||||||
{"script_trace", no_argument, 0, 0},
|
{"script_trace", no_argument, 0, 0},
|
||||||
{"script-debug", no_argument, 0, 0},
|
|
||||||
{"script_debug", no_argument, 0, 0},
|
|
||||||
{"script-updatedb", no_argument, 0, 0},
|
{"script-updatedb", no_argument, 0, 0},
|
||||||
{"script_updatedb", no_argument, 0, 0},
|
{"script_updatedb", no_argument, 0, 0},
|
||||||
{"script-args",required_argument,0,0},
|
{"script-args",required_argument,0,0},
|
||||||
@@ -670,9 +668,6 @@ int nmap_main(int argc, char *argv[]) {
|
|||||||
fatal("Error parsing --script-args\n");
|
fatal("Error parsing --script-args\n");
|
||||||
}else if (optcmp(long_options[option_index].name, "script-trace") == 0) {
|
}else if (optcmp(long_options[option_index].name, "script-trace") == 0) {
|
||||||
o.scripttrace = 1;
|
o.scripttrace = 1;
|
||||||
} else if (optcmp(long_options[option_index].name, "script-debug") == 0) {
|
|
||||||
o.scriptdebug = 1;
|
|
||||||
o.noninteractive = true;
|
|
||||||
} else if (optcmp(long_options[option_index].name, "script-updatedb") == 0){
|
} else if (optcmp(long_options[option_index].name, "script-updatedb") == 0){
|
||||||
o.scriptupdatedb = 1;
|
o.scriptupdatedb = 1;
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -207,9 +207,6 @@ void tty_init()
|
|||||||
{
|
{
|
||||||
struct termios ti;
|
struct termios ti;
|
||||||
|
|
||||||
if(o.noninteractive)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (tty_fd)
|
if (tty_fd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
22
nse_init.cc
22
nse_init.cc
@@ -30,7 +30,6 @@ int init_fetchfile(char *result, size_t result_max_len, char* file);
|
|||||||
int init_fetchfile_absolute(char *path, size_t path_len, char *file);
|
int init_fetchfile_absolute(char *path, size_t path_len, char *file);
|
||||||
int init_updatedb(lua_State* l);
|
int init_updatedb(lua_State* l);
|
||||||
int init_pick_default_categories(std::vector<std::string>& chosenScripts);
|
int init_pick_default_categories(std::vector<std::string>& chosenScripts);
|
||||||
int init_debugger(lua_State* l);
|
|
||||||
|
|
||||||
int check_extension(const char* ext, const char* path);
|
int check_extension(const char* ext, const char* path);
|
||||||
|
|
||||||
@@ -59,31 +58,12 @@ int init_lua(lua_State* l) {
|
|||||||
SCRIPT_ENGINE_LUA_TRY(lua_pcall(l, 1, 0, 0));
|
SCRIPT_ENGINE_LUA_TRY(lua_pcall(l, 1, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* publish the nmap bindings to the script */
|
/* publish the nmap bindings to the script */
|
||||||
lua_newtable(l);
|
lua_newtable(l);
|
||||||
SCRIPT_ENGINE_TRY(set_nmaplib(l));
|
SCRIPT_ENGINE_TRY(set_nmaplib(l));
|
||||||
lua_setglobal(l, "nmap");
|
lua_setglobal(l, "nmap");
|
||||||
SCRIPT_ENGINE_TRY(init_setlualibpath(l));
|
SCRIPT_ENGINE_TRY(init_setlualibpath(l));
|
||||||
|
|
||||||
SCRIPT_ENGINE_TRY(init_debugger(l));
|
|
||||||
|
|
||||||
return SCRIPT_ENGINE_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
int init_debugger(lua_State* l) {
|
|
||||||
|
|
||||||
if(o.scriptdebug > 0) {
|
|
||||||
luaL_loadstring(l, "require 'debugger'");
|
|
||||||
SCRIPT_ENGINE_TRY(lua_pcall(l, 0, 0, 0));
|
|
||||||
} else {
|
|
||||||
char* debugger_dummy = "\
|
|
||||||
package.loaded['debugger'] = true\n\
|
|
||||||
pause = function() end\n";
|
|
||||||
|
|
||||||
luaL_loadstring(l, debugger_dummy);
|
|
||||||
SCRIPT_ENGINE_TRY(lua_pcall(l, 0, 0, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
return SCRIPT_ENGINE_SUCCESS;
|
return SCRIPT_ENGINE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1342
nselib/debugger.lua
1342
nselib/debugger.lua
File diff suppressed because it is too large
Load Diff
@@ -28,8 +28,6 @@ end
|
|||||||
action = function(host, port)
|
action = function(host, port)
|
||||||
local data, result, title, protocol
|
local data, result, title, protocol
|
||||||
|
|
||||||
pause("test")
|
|
||||||
|
|
||||||
data = http.get( host, port, '/' )
|
data = http.get( host, port, '/' )
|
||||||
result = data.body
|
result = data.body
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user