Nmap Development mailing list archives
Re: NMAP NSE script for iSCSI enumeration
From: Ron <ron () skullsecurity net>
Date: Sat, 10 Oct 2009 20:15:18 -0500
Hi Michel,Like Fyodor, I don't have access to any iSCSI devices. That being said, I think your code looks great overall! Just two comments:
1. Like Fyodor, I think the packets should be spelled out more cleanly. I highly recommend using bin.pack() and bin.unpack() (look at any of my scripts to see examples). They aren't the most straight forward functions, but it makes it way easier to see what's going on (it looks to me like yours is a bunch of null-terminated strings, which is 'z' when using bin.pack()).
2. When reading the output, you're going to have a nil-pointer exception if TargetName wasn't in your string. Also, you don't need to define an 'e' variable, if you leave it off it'll work as expected (not a big deal). I'd suggest checking that 's' is valid.
I'd also suggest only returning an error code if nmap.debugging() > 0. In all my scripts, I only return errors when debugging is enabled. Not everybody does that, but I think it's cleaner that way. That one's up to you, obviously.
Hope that helps! And if you have any questions about NSE scripts, feel free to ask me. I'm always happy to help!
Ron On 10/10/2009 12:54 PM, Michel Chamberland wrote:
Hello list, I wrote a nmap nse script to enumerate iSCSI targets. I would be interested to get feedback on it. The script can be found here: http://blog.securitywire.com/2009/10/10/nmap-nse-script-to-enumerate-iscsi-targets/ I have very limited access to iSCSI targets so I'd be really interested to hear how it works out across a variety of targets. I have about 2 hours of experience with lua too so I'm sure it shows :) Thanks - Michel Chamberland CEH, Security+, MCP, CIW Associate http://www.securitywire.com _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org
-- Ron Bowes http://www.skullsecurity.org/ _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org
Current thread:
- NMAP NSE script for iSCSI enumeration Michel Chamberland (Oct 10)
- Re: NMAP NSE script for iSCSI enumeration Fyodor (Oct 10)
- Re: NMAP NSE script for iSCSI enumeration Michel Chamberland (Oct 10)
- Re: NMAP NSE script for iSCSI enumeration Patrick Donnelly (Oct 10)
- Re: NMAP NSE script for iSCSI enumeration Michel Chamberland (Oct 10)
- Re: NMAP NSE script for iSCSI enumeration David Fifield (Oct 11)
- Re: NMAP NSE script for iSCSI enumeration Michel Chamberland (Oct 11)
- Re: NMAP NSE script for iSCSI enumeration Fyodor (Oct 10)