Closed tadghh closed 11 months ago
What parameters did you use to start HardeningKitty? Is it possible to run it without any file parameter? If so, HardeningKitty will create a file in the same directory where it is started from
What parameters did you use to start HardeningKitty? Is it possible to run it without any file parameter? If so, HardeningKitty will create a file in the same directory where it is started from
Iirc I gave it the logging one but the path to the log file didnt exist (no "tmp" folder on the root of the c drive)
If you only use -Log without -LogFile, HardeningKitty will generate the file name for you and save the file it in the current folder. I'm uncertain what the default behaviour should be: report that the path does not exist, create a temporary file, create all non-existent folders, or... ;-)
Considering context of Kitty and accidentally passing an incorrect path and not getting a backup / log could leave a system in an undesirable state. Maybe stop the execution if the passed path doesnt exist or create the path.
I added checks for log, report, and backup file path, HardeningKitty stops if the path does not exist: https://github.com/0x6d69636b/windows_hardening/commit/f6079cfc6a691eb9de0c3889ea3d7d71ff51a34d
When are we running this check, I pulled the recent version and havent triggered your fix yet, should'nt we make sure the log file can be created at the path before proceeding?
I don't like tools or scripts that create folders on my systems, so I prefer to stop HardeningKitty rather than create directories. On the one hand, I understand your use case, but on the other hand, if the log file path has a typo in it or is otherwise wrong, it would be uncool to create the full path
I don't like tools or scripts that create folders on my systems, so I prefer to stop HardeningKitty rather than create directories. On the one hand, I understand your use case, but on the other hand, if the log file path has a typo in it or is otherwise wrong, it would be uncool to create the full path
Yeah sort of like idempotence. Sorry just wanted to clarify I downloaded the change you made and I still ran into the issue, below is the command im using to test. Shouldnt we make sure that if Kitty is to write something to the disk as requested by the user, we should make sure the path is valid before checking the system with kitty itself.
We would be wasting resources checking the whole system just to tell the user at the end that we cant write to the non existant directory.
And here is the test command im using
Invoke-HardeningKitty -Mode Config -Report -ReportFile C:\tmp\my_hardeningkitty_report.csv
Agreed. The check takes place during the initialisation phase, and if the path does not exist, execution will be aborted. In your case, you should only receive the message "The path to your report file does not exist.". Can you make sure you're using the latest version from the dev repo?
Agreed. The check takes place during the initialisation phase, and if the path does not exist, execution will be aborted. In your case, you should only receive the message "The path to your report file does not exist.". Can you make sure you're using the latest version from the dev repo?
Dev repo?
This is the prod repo, the dev repo is https://github.com/0x6d69636b/windows_hardening
Yup looking good! My bad haha.
Thank you for the update 👍
A non existant folder isnt created :( perhaps this could be done automatically incase people automate this script. Ex Sys admin wasnt paying attention when running this across a network, uh oh the folder I gave Kitty was the wrong path and now I lost the default settings