CCob / okta-terrify

Okta Verify and Okta FastPass Abuse Tool
282 stars 30 forks source link

System.TypeInitializationException in OktaTerrify #3

Closed r3motecontrol closed 4 months ago

r3motecontrol commented 4 months ago

OktaTerrify is throwing a System.TypeInitializationException in the --info mode.

OktaTerrify.exe -s S-1-5-21-*****-1001 --info --db C:\Users\testaccount\AppData\Local\Okta\OktaVerify\DataStore.db --dbkey <redacted> --info

Unhandled Exception: System.TypeInitializationException: The type initializer for 'SQLite.SQLiteConnection' threw an exception. ---> System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.InternalGetDirectoryName(String path)
   at SQLitePCL.NativeLibrary.MakePossibilitiesFor(String basename, Assembly assy, Int32 flags, LibSuffix suffix)
   at SQLitePCL.NativeLibrary.MyLoad(String basename, Assembly assy, Int32 flags, Action`1 log)
   at SQLitePCL.NativeLibrary.Load(String libraryName, Assembly assy, Int32 flags)
   at SQLitePCL.Batteries_V2.MakeDynamic(String name, Int32 flags)
   at SQLitePCL.Batteries_V2.DoDynamic_cdecl(String name, Int32 flags)
   at SQLite.SQLiteConnection..cctor()
   --- End of inner exception stack trace ---
   at SQLite.SQLiteConnection..ctor(SQLiteConnectionString connectionString)
   at OktaVerify.OktaTerrify.GetDatabaseInfo(String sid, String databasePath, Byte[] dbKey)
   at OktaVerify.OktaTerrify.<Main>d__25.MoveNext()
--- 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 OktaVerify.OktaTerrify.<Main>(String[] args)
CCob commented 4 months ago

You are missing some of the SQLite dependencies from the OktaTerrify.exe folder. I've also updated the project to copy the native DLL's needed to, which should end up in the runtimes sub folder. Most managed DLLs get merged with dnMerge but the SQLite runtimes dont work when they have been merged so the folder structure should look like this.

image

r3motecontrol commented 4 months ago

Thanks for the clear explanation, it works now.