KapeFiles icon indicating copy to clipboard operation
KapeFiles copied to clipboard

Additional KAPE variable for unique output filenames

Open Qazeer opened this issue 3 years ago • 2 comments

KAPE version

1.2.0.0

Is your feature request related to a problem? Please describe.

Some tools only allow for the specification of an output filename, overriding previous data if multiple executions are triggered.

For example, Nirsoft usbdeview.exe utility may retrieve data from the SYSTEM and RegBack\SYSTEM registry hives, but the second execution overrides the data from the previous one:

image

Describe the solution you'd like

A way to add uniqueness to output filename for tools that do not natively support this would be nice. A %timestamp% variable, replaced at runtime by the execution timestamp, would allow third-party tools to match the behavior of Eric Zimmerman's tools.

Describe alternatives you've considered

Instead of a %timestamp% variable, a variable that would convert the %sourceFile% path to a (Windows) valid filename would also allow for unique outputs. For example by converting X:\Windows\System32\config\SYSTEM to X_Windows_System32_config_SYSTEM.

Qazeer avatar Apr 24 '22 13:04 Qazeer

what if the path is crazy long? that would break things. would something like %guid% work to add a random guid to the output filename, guaranteeing uniqueness? heck, even a new random #s between 0 and 10000 work.

EricZimmerman avatar Jul 16 '22 13:07 EricZimmerman

Indeed anything that would make the filename unique would work (prefered solution mentioned timestamps, but a GUID or a random number would be fine as well)

Qazeer avatar Jul 22 '22 18:07 Qazeer

+1 on this. Running into the same issue.

Beercow avatar Dec 14 '22 20:12 Beercow

the real solution here is for other tools to not blindly overwrite things, but alas, we cant control those.

im thinking something like this since %d already exists, for timestamp. Note that the KAPE CLI option is %d, the NEW option is %d% (% on both sides)

        CommandLine: -f %sourceFile% --csv %destinationDirectory%\%sourceDirectoryBase% --csvf foo_%d%.csv

ends up working like this:

image

i also added %guid%, so this works:

image

EricZimmerman avatar Dec 20 '22 18:12 EricZimmerman

this will be in 1.3

EricZimmerman avatar Dec 20 '22 18:12 EricZimmerman