SharpHound icon indicating copy to clipboard operation
SharpHound copied to clipboard

Illegal Characters in Path

Open ChrisTruncer opened this issue 2 years ago • 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;
    }`

ChrisTruncer avatar Sep 29 '23 18:09 ChrisTruncer