Nmap Development mailing list archives

Re: Bugfixes for smb-psexec


From: Ron <ron () skullsecurity net>
Date: Mon, 5 Jul 2010 13:41:22 -0500

On Mon, 21 Jun 2010 16:12:48 -0600 David Fifield
<david () bamsoftware com> wrote:
It's not particularly clean to grep the first line for the word
"module". Could you redefine the module function to a do-nothing
function, or a function that prints the error message?
I was looking at how to do that, but I don't know how. Batrick, here's the code I'm using, can you tell me what's going 
wrong? I'm out of my Lua element here. 

    -- Load the config file
    stdnse.print_debug(1, "smb-psexec: Attempting to load config file: %s", filename)
    local file = loadfile(filename)
    if(not(file)) then
        return false, "Couldn't load module file:\n" .. filename
    end

    -- Run the config file
    local real_module = module

    -- Re-define the module() function temporarily
    module = function()
        io.write("TESTING!\n\n")
    end

    -- Run the code
    file()

    -- Restore the original module() function
    module = real_module



I think the more important issue is to find out why nmap.fetchfile is
seemingly changing its behavior when run in a subprocess. I rather
suspect some kind of installation problem.
I'll try to reproduce and get you more information. 

-- 
Ron Bowes
http://www.skullsecurity.org
http://www.twitter.com/iagox86

Attachment: _bin
Description:

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/

Current thread: