BloodHoundAD/SharpHound

Illegal Characters in Path

ChrisTruncer opened this issue · 0 comments

I ran into an issue where I specified an output directory (it exists), but for some reason when sharphound ran, it gave an "Illegal Characters in Path" error and died. Rohan said to file a bug and thinks it relates to the following code:

`public string ResolveFileName(string filename, string extension, bool addTimestamp)
{
var finalFilename = filename;
if (!filename.EndsWith(extension))
finalFilename = $"{filename}.{extension}";

        if (extension is "json" or "zip" && Flags.RandomizeFilenames)
            finalFilename = $"{Path.GetRandomFileName()}";

        if (addTimestamp) finalFilename = $"{CurrentLoopTime}_{finalFilename}";

        if (OutputPrefix != null) finalFilename = $"{OutputPrefix}_{finalFilename}";

        var finalPath = Path.Combine(OutputDirectory, finalFilename);

        return finalPath;
    }`