Nmap Development mailing list archives

Jacek's status report - #5 of 16


From: Jacek Wielemborek <wielemborekj1 () gmail com>
Date: Mon, 8 Jul 2013 23:43:32 +0200

Jacek's status report - #5 of 16

Hi guys,

This is the report 5/16 for the Google Summer of Code project
“Bringing Lua to Ncat”.

This week I was mostly playing with the io.ncatin functionality that I
introduced in ncat-lua-script branch. I modified io.select to make it
work with file descriptor arrays and started the implementation of
broadcasting Ncat's standard input across ncatins. This turned out to
be really tricky because I needed to find a way to handle cases when
--keep-open is turned on (or not) for both TCP and UDP, which makes it
difficult to insert standard input hooks in the current Ncat
architecture due to different execution paths. This is why there
wasn't much code added by me - I mostly did reading and experimenting,
many times producing code that wasn't appropriate for committing.
Anyway, well, here are my achievements and priorities for this week:

Achievements:

* Finally merged in the ncat-lua branch into the trunk. This means
that the code finally looks good enough and hopefully has most bugs
caught and fixed. I can't wait to see this feature in a new Nmap
package! :D Also, I removed the ncat-lua-inlines branch.

* Implemented io.select() that takes an array of file descriptors.
That allows to cut the CPU usage of some scripts and allows for full
duplex support. All the ncatin demos are ported to the new
implementation.

* Did a lot of research and experimenting on the bug with ncatin
reading from stdin. The original (r31182) code led to a race condition
in netexec() when the ncatin extensions were turned on in a
--keep-open server. The problem turned out to be pretty hard to solve,
because I needed to find a way to keep track of all the pipes that
needed to be fed with stdin data in a single master process, that also
took care of actually capturing the data. I was also confused by the
UDP behavior of ncatins. The first implementation spawning a listener
thread, but David rejected it because of pthread dependency. Then I
implemented a testing system for this feature and came up with another
solution.

* Wrote a lengthy report on the current status of the project, its
capabilities and limitations and the discussion about it with links to
particular threads. You can read it here:
http://seclists.org/nmap-dev/2013/q3/33

Priorities:

* Once it turns out that --lua-extensions seems done, I'm going to
come up with a new command-line syntax for this feature. The current
“ncat --lua-extensions --lua-exec scripts/ws.lua echo.webserver.org
80” is ugly beyond any recognition. It's up to David, though, to
decide whether I should be stabilizing lua-extensions or working on
the “plugin” syntax.

* Spark up more discussion about the Ncat-Lua use cases. I definitely
need more feedback to decide on which features are actually useful and
which are redundant.

So, well, I guess that's it for now.

Yours,
Jacek Wielemborek
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: