NetExec icon indicating copy to clipboard operation
NetExec copied to clipboard

Request: Add (optional) timestamping to output

Open FallenHero66 opened this issue 3 months ago • 7 comments

Please Describe The Problem To Be Solved Timestamps would make multiple things easier when using this tool in a pentest. For example, a customer might want you to include the time of when you performed an action in the final report. Another example is with password spraying: You don't want to lock any accounts, so you need to wait the amount of time specified in the password policy for the fail counter to reset. Instead of having to rely on remembering to check the clock or using external tools like date or ts, it would be cool to have an option to just switch "timekeeping" on when using nxc and thus always having the information at hand.

(Optional): Suggest A Solution I imagine this could be fixed in varying degrees of complexity, e.g.:

  • simply add a "Command finished at %timestamp%" print after the command is done, which could maybe be switched on or off in the nxc.conf?
  • add a "command log" in the nxcdb. As a bonus this might also make it possible to link found creds to the respective source scan?

FallenHero66 avatar Nov 06 '25 10:11 FallenHero66

There is a "log_mode" in the nxc.conf which, when enabled, logs every line that is logged including the command iirc into the nxc logs located in the ~/.nxc folder. That is what I usually use for exactly this purpose. If that is not enough we could also add an optional timestamp to every command.

NeffIsBack avatar Nov 06 '25 11:11 NeffIsBack

I do && date to get the time printed after the scan finished, I just thought it would be neat to have this built-in. The log_mode is pretty useful itself, too, though!

FallenHero66 avatar Nov 06 '25 14:11 FallenHero66

You can use --log $filename on one-off commands if you don't want to log everything to the nxc folder.

Marshall-Hallenbeck avatar Nov 06 '25 15:11 Marshall-Hallenbeck

You can use --log $filename on one-off commands if you don't want to log everything to the nxc folder.

Tried to fix that command formatting, but looks like this is simply broken lol atm. Perhaps due to that citing below

NeffIsBack avatar Nov 06 '25 17:11 NeffIsBack

You can use --log $filename on one-off commands if you don't want to log everything to the nxc folder.

Tried to fix that command formatting, but looks like this is simply broken lol atm. Perhaps due to that citing below

I replied via email because I was on my phone and just wanted to suggest that, but now I can't even edit it to properly show the code block, even after deleting the quoting lmao

Marshall-Hallenbeck avatar Nov 06 '25 22:11 Marshall-Hallenbeck

I understood though, thanks for the suggestion! Full blown logging was what I wanted to avoid when writing the feature request, but it does do the job.

I just had the idea that throwing out a timestamp after a spray would be neat, but I understand why you disagree, since you already implemented proper logging.

FallenHero66 avatar Nov 07 '25 07:11 FallenHero66

I don't necessarily disagree, but it isn't really high on my priority list because of the logging that already exists. Maybe some day in the future we might look into that if there is a good way to integrate it and a good reason to add it.

NeffIsBack avatar Nov 07 '25 11:11 NeffIsBack