Nmap Development mailing list archives

Re: Stupid patch... autostat every x seconds


From: David Fifield <david () bamsoftware com>
Date: Sun, 25 Jan 2009 22:39:37 -0700

On Tue, Jan 06, 2009 at 10:28:33PM +0100, Aleksandar Petrinic wrote:
Just for fun I started to develop a graphical front end to nmap in qt4. All
goes well, but I haved issue with nmap's stats (when you press i or space
while it is running).
My need is very simple, I had to bind a progress bar with nmap's stats.
Unfortunately nmap can't receive stdin with a commonly used write() method
(QProcess').
At the beginning I believe that the problem was in "nmap_tty.cc" with this
checks: if (tty_fd && tcgetpgrp(tty_fd) == getpid()) {.
So I tried to remove this checks, but still can't write to nmap's stdin to
print out the stats.
Now I have write a very little patch for nmap that enables another option...
--auto-stats <seconds> that print a stats every <seconds> seconds.
I don't know if it could be usefull for someone, but I have tried. The diff
is in the attachment.

Something like this could be good for Zenmap too. If you run a long scan
and forget to turn on -v it can look like the scan isn't running at all.
It would be better if we can communicate the scan status through some
side channel, so it doesn't show up in the output window. I don't know
what's a good way to do that though.

Well, maybe it's not the cleaner, but works(it isn't much accurate too). One
thing that confuse me it's where I have to put a temporary global variable,
for now I put it in the NmapOps, even if I immagine that it's not properly
the right place. With this patch I can syncronize a progress bar with nmap's
stats fine.

Some global state is kept in NmapOps. In this case I would probably make
seconds a static variable in nmap_tty.cc.

David Fifield

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


Current thread: