Nmap Development mailing list archives

Bugfixes for smb-psexec


From: Ron <ron () skullsecurity net>
Date: Mon, 14 Jun 2010 11:03:21 -0500

Somebody in #nmap on Freenode was having an issue with smb-psexec that we resolved. It actually came down to two 
separate issues. 

When running Nmap through another program (like bash, perl, etc), the following two things would happen:
o The require() function would no longer take absolute paths
o nmap.fetchfile() would no longer take absolute paths

Both of these broke smb-psexec, which determines the absolute path of the configuration profile and loads it. Although 
I didn't troubleshoot *why* those were failing, I patched the two issues by:
o No longer using require(), which Patrick tells me I was abusing anyways -- I use loadfile() now like I'm supposed to. 
o Checking if the file exists using io.open() before using nmap.fetchfile(). 

Unfortunately, the first of those requires a minor compatibility break in the configure files for smb-psexec (removing 
a single line), which I automatically detect and print an error for. 

Patrick tells me this still isn't the cleanest way, because I'm loading the 'modules' table into the global space, but 
fixing that seems to break other things. So, for now, I'd like to apply this patch to fix the bug, then maybe we can 
focus on some code cleanup afterwards. 

Any opinions?

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

Attachment: psexec-updates.diff
Description:

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: