Accenture/Codecepticon

Access to the path "C:\whatever\path" is denied.

nerotix opened this issue · 1 comments

Tried to do an obfuscation on Rubeus and got the following error:

.\Codecepticon.exe --action obfuscate --module csharp --verbose --path "C:\Users\username\source\repos\Rubeus\Rubeus.sln" --map-file "C:\Users\username\Desktop" --profile rubeus --rename fp --rename-method random --rename-charset abcdefg --rename-length 7 --string-rewrite --string-rewrite-method xor
[18:47:05] Codecepticon v1.2.2 is starting...
[18:47:05] Getting Visual Studio Instance
[18:47:05] Creating MSBuild Workspace
[18:47:06] Loading solution: C:\Users\username\source\repos\Rubeus\Rubeus.sln
[18:47:09] Finished loading solution
[18:47:09]
[18:47:09] Processing project C:\Users\username\source\repos\Rubeus\Rubeus\Rubeus.csproj
[18:47:12]
[18:47:12] Elements Found:
[18:47:12] Namespaces: 22
[18:47:12] Classes: 156
[18:47:12] Enums: 625
[18:47:12] Functions: 562
[18:47:12] Properties: 186
[18:47:12] Parameters: 624
[18:47:12] Variables: 1512
[18:47:12] Structs: 89
[18:47:12] Generating mappings...
[18:47:12] Creating mappings for functions
[18:47:12] Creating mappings for properties
[18:47:12] Rewriting code...
[18:47:12] Selected profile is: Rubeus
[18:47:12] Running profile-specific pre-process actions...
[18:47:12] Rewriting assemblies..................
[18:47:12] Removing comments..................
[18:47:12] Rewriting switch statements..................
[18:47:12] Rewriting strings..................
[18:47:13] Renaming 562 functions..................
[18:48:50] Renaming 186 properties..................
[18:49:50] Running profile-specific post-process actions...
[18:49:51] Applying changes to solution...
[18:49:51] Running profile-specific final actions...
[18:49:51] Applying changes (again) to solution...
[18:49:51] Generating mapping file to: C:\Users\username\Desktop

Unhandled Exception: System.UnauthorizedAccessException: Access to the path 'C:\Users\username\Desktop' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
at Codecepticon.Modules.DataUnmapping.WriteTemplateFile(String saveAs, Dictionary`2 data) in C:\Users\username\Source\Repos\Codecepticon\Codecepticon\Modules\DataUnmapping.cs:line 183
at Codecepticon.Modules.CSharp.CSharpManager.d__1.MoveNext() in C:\Users\username\Source\Repos\Codecepticon\Codecepticon\Modules\CSharp\CSharpManager.cs:line 165
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Codecepticon.Modules.CSharp.CSharpManager.d__0.MoveNext() in C:\Users\username\Source\Repos\Codecepticon\Codecepticon\Modules\CSharp\CSharpManager.cs:line 43
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Codecepticon.Program.

d__0.MoveNext() in C:\Users\username\Source\Repos\Codecepticon\Codecepticon\Program.cs:line 70
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Codecepticon.Program.(String[] args)

Even thought there's no special access required to the path.. I set the HTML mapping file to my desktop.

--map-file "C:\Users\username\Desktop" has to be a file not a directory, change it to --map-file "C:\Users\username\Desktop\something.html"