Nmap Development mailing list archives

Jacek's status report - #3 of 16


From: Jacek Wielemborek <wielemborekj1 () gmail com>
Date: Tue, 25 Jun 2013 00:19:31 +0200

Hi guys!

Below is my report for the week 3/16 of „Bringing Lua to Ncat” GSoC
project. I can proudly say I completed most of the priorities (and the
ones I didn't complete were simply replaced with other ones, as in
Telnet demo being replaced with a ROT13 one for example). It was a
really exciting week - though the amount of work I had to do was
really large, I also learned a real lot. I have to admit that David is
a fantastic mentor - he taught me things that I never really thought
of before.

Accomplishments:

* The --lua-exec implementation seems almost complete now. In addition
to running the Lua scripts with redirected standard input and output,
it is now able to detect syntax errors early and has a “scripts”
directory with a few simple yet illustrative demos. I also wrote a bit
of documentation for the manpages and added a testcase to the
ncat-test.pl script. As for the documentation, I have no access for
the Lua user's guide XML file and David said he'll take care of
writing the docs himself.

* Started a new branch, ncat-lua-inlines. As I stated in the commit in
which I created it, the branch is meant not for merging, but for
experiments with adding Lua callbacks to the send/receive events.
Currently it is capable of running any Lua decode/encode functions in
order to replace the buffers – for example, you can use ROT13 or
Base64 to transparently encode the buffer. Unfortunately, at the
moment the code still has some segfaults and memory leaks all over it
that need to be found and fixed.

* Set up a Windows development environment. That took quite some time
to feel relatively comfortable, but eventually I ended up with a fully
updated environment (did you know it takes several reboots to just
install all the critical updates?) running on a Qemu-KVM virtual
machine. After that, I experimented with remote access options
(surprisingly, RDP feels a tad more responsive even though it's
virtualized, as opposed to the VNC interface built into the virtual
machine) and installed MSVC IDE, configuring it to be capable of
building Ncat with Lua linked in. Here's what it looks like:
http://imgur.com/14acIw9 (the remote desktop window is transparent, in
the background you can see my terminal with Irssi connected; the
code's running here's from before r31053)

* Ported --lua-exec to Windows. I have to admit that was a real pain
because Windows lacks POSIX fork() system call, which led to some
tricks that feel a bit dirty (the current implementation adds the
--internal-lua-exec command-line switch that makes Ncat run in the Lua
interpreter mode, which enabled me to code this up with just a little
bit of code added). Prior to David coming up with the --internal
command-line switch, I did some digging on how Cygwin implements
fork() and I must admit it is a hack really worth attention
(http://www.cygwin.com/faq.html#faq.api.fork,
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/fork.cc?rev=1.243&content-type=text/x-cvsweb-markup&cvsroot=src).

Priorities:

* Improve the Windows --lua-exec implementation. We're most likely
going to stick to the --internal-lua-exec solution, but it has some
problems that have to be addressed before the release - for example,
handling script filenames with spaces in it.

* David pointed me out today a major design flaw in ncat-lua-inlines
that pretty much leads me to the conclusion that I should come up with
a new way to implement the inlines. I'm going to explore the new
approach he suggested.

* Graduate. If there is no paperwork problems, I will most likely take
the exam this Thursday. It will cost me quite some time, but I'll make
it up this weekend; I'd really like to get the CS degree as soon as
possible.

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


Current thread: