Windows NT DGPENSV2LPKMN 10.0 build 14393 (Windows Server 2016) AMD64
Apache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/7.3.25
: 172.16.0.66 | : 172.16.0.254
Cant Read [ /etc/named.conf ]
7.3.25
SYSTEM
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
[ A ]
[ C ]
[ D ]
C: /
Windows /
diagnostics /
system /
Printer /
[ HOME SHELL ]
Name
Size
Permission
Action
en-US
[ DIR ]
drwxrwxrwx
CL_Utility.ps1
19.68
KB
-rw-rw-rw-
DiagPackage.diagpkg
27.5
KB
-rw-rw-rw-
DiagPackage.dll
63
KB
-rw-rw-rw-
MF_PrinterDiagnostic.ps1
4.11
KB
-rw-rw-rw-
RS_CancelAllJobs.ps1
547
B
-rw-rw-rw-
RS_DeletePrintJobs.ps1
4
KB
-rw-rw-rw-
RS_HomeGroup.ps1
2.71
KB
-rw-rw-rw-
RS_NoPrinterInstalled.ps1
1
KB
-rw-rw-rw-
RS_PrinterDriver.ps1
555
B
-rw-rw-rw-
RS_PrinterTurnedOff.ps1
377
B
-rw-rw-rw-
RS_ProcessPrinterjobs.ps1
1.19
KB
-rw-rw-rw-
RS_RestartSpoolerService.ps1
663
B
-rw-rw-rw-
RS_SetSpoolerStartMode.ps1
490
B
-rw-rw-rw-
RS_SpoolerCrashing.ps1
1.96
KB
-rw-rw-rw-
RS_StartSpoolerService.ps1
1.05
KB
-rw-rw-rw-
RS_WrongDefaultPrinter.ps1
1.37
KB
-rw-rw-rw-
TS_CannotConnect.ps1
3.99
KB
-rw-rw-rw-
TS_DefaultPrinter.ps1
1.42
KB
-rw-rw-rw-
TS_HomeGroup.ps1
2.71
KB
-rw-rw-rw-
TS_NoPrinterInstalled.ps1
1.07
KB
-rw-rw-rw-
TS_OutOfPaper.ps1
663
B
-rw-rw-rw-
TS_OutOfToner.ps1
757
B
-rw-rw-rw-
TS_PaperJam.ps1
654
B
-rw-rw-rw-
TS_PrintJobsStuck.ps1
1.99
KB
-rw-rw-rw-
TS_PrinterDriver.ps1
746
B
-rw-rw-rw-
TS_PrinterDriverError.ps1
1.03
KB
-rw-rw-rw-
TS_PrinterTurnedOff.ps1
760
B
-rw-rw-rw-
TS_SetSpoolerMode.ps1
636
B
-rw-rw-rw-
TS_SpoolerCrashing.ps1
1.36
KB
-rw-rw-rw-
TS_SpoolerService.ps1
640
B
-rw-rw-rw-
UpdatePrinterDriver.dll
10.5
KB
-rw-rw-rw-
VF_PrinterTurnedOff.ps1
1.23
KB
-rw-rw-rw-
Delete
Unzip
Zip
${this.title}
Close
Code Editor : CL_Utility.ps1
# Copyright © 2008, Microsoft Corporation. All rights reserved. Import-LocalizedData -BindingVariable localizationString -FileName CL_LocalizationData function GetAbsolutionPath([string]$fileName) { if([string]::IsNullorEmpty($fileName)) { WriteFunctionExceptionReport "GetAbsolutionPath" $localizationString.throw_invalidFileName return } return Join-Path (Get-Location).Path $fileName } # # Get system path of a file by adding the system path of current directory in the head of the specified file # function GetSystemPath([string]$fileName) { if([string]::IsNullorEmpty($fileName)) { WriteFunctionExceptionReport "GetSystemPath" $localizationString.throw_invalidFileName return } [string]$systemPath = [System.Environment]::SystemDirectory return Join-Path $systemPath $fileName } # # Check if the printer is a virtual printer by the printer name. # function IsVirtualPrinter([string]$printerDeviceID) { if([string]::IsNullorEmpty($printerDeviceID)) { WriteFunctionExceptionReport "IsVirtualPrinter" $localizationString.throw_noPrinterDeviceIDSpecified return } [bool]$result = $false $virtualPrinterDeviceIDs = ("Microsoft Print to PDF", "Adobe PDF", "Print as a PDF", "Microsoft XPS Document Writer", "Send To OneNote" , "Microsoft Office Live Meeting", "Fax", "Journal Note Writer") foreach($deviceID in $virtualPrinterDeviceIDs) { if($printerDeviceID.Contains($deviceID)) { $result = $true break } } return $result } # # Run power shell script and return the bool value # function RunDiagnosticScript([string]$scriptPath) { if([string]::IsNullorEmpty($scriptPath) -or -not (Test-Path $scriptPath)) { WriteFunctionExceptionReport "RunDiagnosticScript" $localizationString.throw_invalidFileName return } $result = &($scriptPath) if($result -is [bool]) { return [bool]$result } else { return $false } } # # Get the printer API # function GetPrinterType() { $winSpoolDefinition = @" [DllImport("winspool.drv", CharSet = CharSet.Unicode, SetLastError = true)] public static extern int OpenPrinter([MarshalAs(UnmanagedType.LPWStr)] string pPrinterName, ref IntPtr phPrinter, IntPtr pDefault); [DllImport("winspool.drv", CharSet = CharSet.Unicode, SetLastError=true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool GetPrinter(IntPtr hPrinter, int dwLevel, IntPtr pPrinter, int dwBuf, ref int dwNeeded); [DllImport("winspool.Drv", CharSet = CharSet.Unicode, SetLastError=true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool SetPrinter(IntPtr hPrinter, int Level, IntPtr pPrinter, uint Command); [DllImport("Winspool.drv", CharSet = CharSet.Unicode, SetLastError = true)] public static extern int EnumJobs(IntPtr hPrinter, int FirstJob, int NoJobs, int Level, IntPtr pJob, int cbBuf, ref int pcbNeeded, ref int pcReturned); [DllImport("winspool.drv", CharSet = CharSet.Unicode, SetLastError = true)] public static extern int SetJob(IntPtr hPrinter, UInt32 JobId, int Level, ref JOB_INFO_2 pJob, int Command_Renamed); [DllImport("winspool.drv", SetLastError=false)] public static extern int ClosePrinter(IntPtr hPrinter); [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct PRINTER_INFO_2 { [MarshalAs(UnmanagedType.LPWStr)] public string pServerName; [MarshalAs(UnmanagedType.LPWStr)] public string pPrinterName; [MarshalAs(UnmanagedType.LPWStr)] public string pShareName; [MarshalAs(UnmanagedType.LPWStr)] public string pPortName; [MarshalAs(UnmanagedType.LPWStr)] public string pDriverName; [MarshalAs(UnmanagedType.LPWStr)] public string pComment; [MarshalAs(UnmanagedType.LPWStr)] public string pLocation; public IntPtr pDevMode; [MarshalAs(UnmanagedType.LPWStr)] public string pSepFile; [MarshalAs(UnmanagedType.LPWStr)] public string pPrintProcessor; [MarshalAs(UnmanagedType.LPWStr)] public string pDatatype; [MarshalAs(UnmanagedType.LPWStr)] public string pParameters; public IntPtr pSecurityDescriptor; public uint Attributes; public uint Priority; public uint DefaultPriority; public uint StartTime; public uint UntilTime; public uint Status; public uint cJobs; public uint AveragePPM; } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct JOB_INFO_2 { public UInt32 JobId; [MarshalAs(UnmanagedType.LPWStr)] public string pPrinterName; [MarshalAs(UnmanagedType.LPWStr)] public string pMachineName; [MarshalAs(UnmanagedType.LPWStr)] public string pUserName; [MarshalAs(UnmanagedType.LPWStr)] public string pDocument; [MarshalAs(UnmanagedType.LPWStr)] public string pNotifyName; [MarshalAs(UnmanagedType.LPWStr)] public string pDatatype; [MarshalAs(UnmanagedType.LPWStr)] public string pPrintProcessor; [MarshalAs(UnmanagedType.LPWStr)] public string pParameters; [MarshalAs(UnmanagedType.LPWStr)] public string pDriverName; public IntPtr pDevMode; [MarshalAs(UnmanagedType.LPWStr)] public string pStatus; public IntPtr pSecurityDescriptor; public UInt32 Status; public UInt32 Priority; public UInt32 Position; public uint StartTime; public uint UntilTime; public UInt32 TotalPages; public UInt32 size; public SYSTEMTIME Submitted; public UInt32 time; public UInt32 PagesPrinted; } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct SYSTEMTIME { [MarshalAs(UnmanagedType.U2)] public short Year; [MarshalAs(UnmanagedType.U2)] public short Month; [MarshalAs(UnmanagedType.U2)] public short DayOfWeek; [MarshalAs(UnmanagedType.U2)] public short Day; [MarshalAs(UnmanagedType.U2)] public short Hour; [MarshalAs(UnmanagedType.U2)] public short Minute; [MarshalAs(UnmanagedType.U2)] public short Second; [MarshalAs(UnmanagedType.U2)] public short Milliseconds; } [StructLayout(LayoutKind.Sequential)] public struct PRINTER_DEFAULTS { public IntPtr pDatatype; public IntPtr pDevMode; public int DesiredAccess; } "@ $winSpoolType = Add-Type -MemberDefinition $winSpoolDefinition -Name "winSpoolCL" -UsingNamespace "System.Reflection","System.Diagnostics" -PassThru return $winSpoolType } # # Get the printer status # function GetPrinterStatus([string]$printerName) { # # the function return value # [int]$printStatus = 0 # # Gets related report string. # [string]$functionName = "GetPrinterStatus" [string]$errorFunctionName = [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.error_function_name, $functionName) [string]$errorFunctionDescription = [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.error_function_description, $functionName) if([string]::IsNullorEmpty($printerName)) { WriteFunctionExceptionReport $functionName $localizationString.throw_invalidPrinterName return $printStatus } # # Get the printer API # $winSpoolType = GetPrinterType [IntPtr]$hPrinter = [IntPtr]::Zero [int]$result = $winSpoolType[0]::OpenPrinter($printerName, [ref]$hPrinter, [IntPtr]::Zero) [int]$errorCode = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() if($result -eq 0) { WriteFunctionAPIExceptionReport $functionName "OpenPrinter" $errorCode return $printStatus } try { [int]$cbNeeded = 0 [bool]$bRet = $winSpoolType[0]::GetPrinter($hPrinter, 2, [IntPtr]::Zero, 0, [ref]$cbNeeded) if($cbNeeded -gt 0) { $pAddr = [System.Runtime.InteropServices.Marshal]::AllocHGlobal($cbNeeded) try { $bRet = $winSpoolType[0]::GetPrinter($hPrinter, 2, $pAddr, $cbNeeded, [ref]$cbNeeded) $errorCode = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() if ($bRet) { $PRINTER_INFO_2 = New-Object $winSpoolType[1] $info2 = [System.Runtime.InteropServices.Marshal]::PtrToStructure($pAddr, [System.Type]$PRINTER_INFO_2.GetType()) $printStatus = $info2.Status } else { WriteFunctionAPIExceptionReport $functionName "GetPrinter" $errorCode return $printStatus } } catch {} finally { [System.Runtime.InteropServices.Marshal]::FreeHGlobal($pAddr) } } } finally { $winSpoolType[0]::ClosePrinter($hPrinter) > $null } return $printStatus } # # Get the printer status # function GetPrinterAttributes([string]$printerName) { # # the function return value # [int]$printerAttributes = 0 # # Gets related report string. # [string]$functionName = "GetPrinterAttributes" [string]$errorFunctionName = [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.error_function_name, $functionName) [string]$errorFunctionDescription = [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.error_function_description, $functionName) if([string]::IsNullorEmpty($printerName)) { throw $localizationString.throw_invalidPrinterName return $printerAttributes } # # Get the printer API # $winSpoolType = GetPrinterType [IntPtr]$hPrinter = [IntPtr]::Zero [int]$result = $winSpoolType[0]::OpenPrinter($printerName, [ref]$hPrinter, [IntPtr]::Zero) [int]$errorCode = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() if($result -eq 0) { WriteFunctionAPIExceptionReport $functionName "OpenPrinter" $errorCode return $printerAttributes } try { [int]$cbNeeded = 0 [bool]$bRet = $winSpoolType[0]::GetPrinter($hPrinter, 2, [IntPtr]::Zero, 0, [ref]$cbNeeded) if($cbNeeded -gt 0) { $pAddr = [System.Runtime.InteropServices.Marshal]::AllocHGlobal($cbNeeded) try { $bRet = $winSpoolType[0]::GetPrinter($hPrinter, 2, $pAddr, $cbNeeded, [ref]$cbNeeded) $errorCode = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() if ($bRet) { $PRINTER_INFO_2 = New-Object $winSpoolType[1] $info2 = [System.Runtime.InteropServices.Marshal]::PtrToStructure($pAddr, [System.Type]$PRINTER_INFO_2.GetType()) $printerAttributes = $info2.Attributes } else { WriteFunctionAPIExceptionReport $functionName "GetPrinter" $errorCode return $printerAttributes } } finally { [System.Runtime.InteropServices.Marshal]::FreeHGlobal($pAddr) } } } finally { $winSpoolType[0]::ClosePrinter($hPrinter) > $null } return $printerAttributes } # # Get the printer status # function SetPrinterAttributes([string]$printerName, [int]$printerAttributes) { # # Gets related report string. # [string]$functionName = "SetPrinterAttributes" [string]$errorFunctionName = [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.error_function_name, $functionName) [string]$errorFunctionDescription = [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.error_function_description, $functionName) if([string]::IsNullorEmpty($printerName)) { throw $localizationString.throw_invalidPrinterName } # # Get the printer API # $winSpoolType = GetPrinterType [int]$PRINTER_ACCESS_ADMINISTER = 0x00000004 [int]$PRINTER_ACCESS_USE = 0x00000008 $defaults =New-Object $winSpoolType[4] $defaults.pDatatype = [IntPtr]::Zero $defaults.pDevMode = [IntPtr]::Zero $defaults.DesiredAccess = $PRINTER_ACCESS_ADMINISTER -bor $PRINTER_ACCESS_USE $pDefaults = [System.Runtime.InteropServices.Marshal]::AllocHGlobal([System.Runtime.InteropServices.Marshal]::SizeOf($defaults)) try { [System.Runtime.InteropServices.Marshal]::StructureToPtr($defaults, $pDefaults, $true) [IntPtr]$hPrinter = [IntPtr]::Zero [int]$result = $winSpoolType[0]::OpenPrinter($printerName, [ref]$hPrinter, $pDefaults) [int]$errorCode = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() if($result -eq 0) { throw [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.throw_win32APIFailed, "OpenPrinter", $errorCode) } try { [int]$cbNeeded = 0 [bool]$bRet = $winSpoolType[0]::GetPrinter($hPrinter, 2, [IntPtr]::Zero, 0, [ref]$cbNeeded) if($cbNeeded -gt 0) { # # In order to avoid that printer share name is null, add the max size of printer share name to allocated memory. # [int]$addLength = 164 $pAddr = [System.Runtime.InteropServices.Marshal]::AllocHGlobal($cbNeeded + $addLength) try { $bRet = $winSpoolType[0]::GetPrinter($hPrinter, 2, $pAddr, $cbNeeded, [ref]$cbNeeded) $errorCode = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() if ($bRet) { $PRINTER_INFO_2 = New-Object $winSpoolType[1] $info2 = [System.Runtime.InteropServices.Marshal]::PtrToStructure($pAddr, [System.Type]$PRINTER_INFO_2.GetType()) $info2.Attributes = $info2.Attributes -bor $printerAttributes if([string]::IsNullorEmpty($info2.pShareName)) { $info2.pShareName = $info2.pPrinterName } [System.Runtime.InteropServices.Marshal]::StructureToPtr($info2, $pAddr, $false) $bRet = $winSpoolType[0]::SetPrinter($hPrinter, 2, $pAddr, 0) $errorCode = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() if(-not $bRet) { throw [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.throw_win32APIFailed, "SetPrinter", $errorCode) } } else { throw [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.throw_win32APIFailed, "GetPrinter", $errorCode) } } finally { [System.Runtime.InteropServices.Marshal]::FreeHGlobal($pAddr) } } } finally { $winSpoolType[0]::ClosePrinter($hPrinter) | out-null } } finally { [System.Runtime.InteropServices.Marshal]::FreeHGlobal($pDefaults) } } # # Get the printer according printer name # function GetPrinterFromPrinterName([string]$printerName) { $printerSpecified = $null $printers = Get-WmiObject Win32_Printer if($printers -ne $null) { foreach($printer in $printers) { if($printerName -eq $printer.Name) { $printerSpecified = $printer break } } } return $printerSpecified } # # Check if the printer is a virtual printer by the printer name. # function PrinterIsShared([string]$printerName) { if([string]::IsNullorEmpty($printerName)) { WriteFunctionExceptionReport "PrinterIsShared" $localizationString.throw_noPrinterNameSpecified return } [bool]$result = $false [int]$PRINTER_ATTRIBUTE_SHARED = 0x00000008 $printerAttributes = GetPrinterAttributes $printerName if($printerAttributes -band $PRINTER_ATTRIBUTE_SHARED) { $result = $true } return $result } # # Write function exception to debug report # function WriteFunctionExceptionReport([string]$functionName, [string]$exceptionInfo) { [string]$errorFunctionName = [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.error_function_name, $functionName) [string]$errorFunctionDescription = [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.error_function_description, $functionName) $exceptionInfo | select-object -Property @{Name=$localizationString.error_information; Expression={$_}} | convertto-xml | Update-DiagReport -id $functionName -name $errorFunctionName -description $errorFunctionDescription -verbosity Debug } # # Write API exception in function to debug report # function WriteFunctionAPIExceptionReport([string]$functionName, [string]$APIName, [int]$errorCode) { [string]$exceptionInfo = [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.throw_win32APIFailed, $APIName, $errorCode) WriteFunctionExceptionReport $functionName $exceptionInfo } # # Write function exception to debug report # function WriteFileExceptionReport([string]$fileName, [string]$exceptionInfo) { [string]$errorFileName = [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.error_file_name, $fileName) [string]$errorFileDescription = [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.error_file_description, $fileName) # $exceptionInfo | select-object -Property @{Name=$localizationString.error_information; Expression={$_}} | convertto-xml | Update-DiagReport -id $fileName -name $errorFileName -description $errorFileDescription -verbosity Debug } # # Write API exception in file to debug report # function WriteFileAPIExceptionReport([string]$fileName, [string]$APIName, [int]$errorCode) { [string]$exceptionInfo = [System.String]::Format([System.Globalization.CultureInfo]::InvariantCulture, $localizationString.throw_win32APIFailed, $APIName, $errorCode) WriteFileExceptionReport $fileName $exceptionInfo } # Function to wait for expected service status function WaitFor-ServiceStatus([string]$serviceName=$(throw "No service name is specified"), [ServiceProcess.ServiceControllerStatus]$serviceStatus=$(throw "No service status is specified")) { [ServiceProcess.ServiceController]$sc = New-Object "ServiceProcess.ServiceController" $serviceName [TimeSpan]$timeOut = New-Object TimeSpan(0,0,0,5,0) $sc.WaitForStatus($serviceStatus, $timeOut) }
Close