Nmap Development mailing list archives

Stupid patch... autostat every x seconds


From: "Aleksandar Petrinic" <petrinic () gmail com>
Date: Tue, 6 Jan 2009 22:28:33 +0100

Hi.
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.

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.

Thank you, and sorry for my really bad english.

Attachment: nmap_autostats.patch
Description:


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

Current thread: