Nmap Development mailing list archives

Re: warning message when overwriting output files


From: Daniel Miller <bonsaiviking () gmail com>
Date: Wed, 12 Nov 2014 15:26:39 -0600

I recall having a conversation once about a potential output file
rotation feature. It seems like this could be a related problem, in
that it involves rewriting file names. If we can decide on a good
notation, then this could be used in both cases. Maybe adding another
percent-escaped value for "incrementing ID" such that -oN
example-%n.nmap would create example-0.nmap on the first run,
otherwise it would write example-1.nmap or whatever is one higher than
the highest currently-named file in the output directory. This would
be an easy way to guarantee you never clobber output.

Nmap does not have an rcfile capability right now, though Jacek did a
little work in that direction, IIRC.

Dan

On Wed, Nov 12, 2014 at 2:08 PM, Robin Wood <robin@digi.ninja> wrote:
I think appending something if the file already exists would be best but it
may mess up people who expect the overwrite in scripted jobs.

Renaming could work as well.

I should know this but is there any way to have a resource file for nmap?
That would be a good way to handle this, the default is overwrite but a
config setting would say rename or change output name as appropriate. A lot
of work for this feature but I can think of a lot of other use cases for the
feature.

Robin

On 12 Nov 2014 19:42, "Daniel Miller" <bonsaiviking () gmail com> wrote:

On Mon, Nov 10, 2014 at 11:37 AM, Robin Wood <robin@digi.ninja> wrote:
It would be good to have a warning when a scan which does outputs
(-o?) is going to overwrite existing files. I've just managed to lose
a load of work when I switched from TCP to UDP and forgot to change
the filename.


Robin,

That sounds like a good idea. How would you expect it to act? We don't
have any other interactive features, so asking for confirmation would
be a departure from our usual way of doing things. We could also just
append to the filename if it exists, or copy the old one to X.orig, or
something.

For future reference, I usually avoid this problem by including %T in
my output filename to include the timestamp, so unless I do two scans
within a second of each other, there's no clobbering.

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


Current thread: