Nmap Development mailing list archives

Re: [NSE] Sample plugin


From: Martin Holst Swende <martin () swende se>
Date: Sat, 30 Oct 2010 19:56:12 +0200

On 10/29/2010 03:03 PM, Ron wrote:
On Fri, 29 Oct 2010 00:21:20 -0700 Fyodor <fyodor () insecure org> wrote:
On Thu, Oct 28, 2010 at 11:03:13PM -0500, Ron wrote:

We talked about this at Defcon, and I went ahead and wrote
it. Basically, it's a sample plugin (basically, a template). It
defines all the fields we need, as well as some of the more common
functions, with plenty of comments to explain what's going on.

Hi Ron, great idea!  It will make a good template for people to copy
and modify when creating new scripts.

For now, I put this in the 'docs' folder.

It does not seem to be checked in yet, but /nmap/docs does sound like
a good place for it.

This should probably be documented in docs/scripting.xml so people can
learn about it by reading http://nmap.org/book/nse.html.  If you're
able to find a good place for it in scripting.xml and add the
information, that will be great.  Otherwise I'll make a note to add it
next time I have time to do updates.

Cheers,
Fyodor
All righty, it's checked in now. If anybody has any suggestions for
changes (either better descriptions, fields I'm not showing off, or
functions/best practices I'm skipping), let me know!
One suggestion, since you do mention it, is that it may be good to
include some example of how to perform socket operations - and how NOT
to. I have the feeling that a common beginner mistake is to perform
socket reading in a way which breaks if incoming data is split up in
several tcp packets - i.e. they don't use buffering reads.

This may be a problem that will be solved under the hood, I remember
some discussions about changing the socket read behaviour. If so, great,
otherwise, I think an example of how to solve that could be added. There
are examples of sockets which buffers both input and output in Patrik's
libraries (db2?) and I made several layers of buffering in my rmi
library (bufferedreader, bufferedwriter).

Otherwise, I think it is great that you make a template, and also my hat
off to you for documenting the libraries!

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


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


Current thread: