Exploit databaseDownload repository ZIP
GH-3c88fcf80633ba9e8dbc777e479d7774
3gstudent/homework-of-c-sharp
Sources for CVE-2020-0688
37 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files37
3gstudent/homework-of-c-sharpRevision 6ab29ba191b8
- AddMachineAccountofDomain.cs
- Add_passwordneverexpires_user_byLDAP.cs
- BrailleToASCII.cs
- DcsyncofMimikatz.cs
- DumpLsass.cs
- GzipandBase64.cs
- ListUserMailbyLDAP.cs
- List_passwordneverexpires_user_byLDAP.cs
- Office14-Microsoft.Office.Interop.OutlookMicrosoft.Office.Interop.Outlook.dll
- Office15-Microsoft.Office.Interop.Outlook.dll
- PELoaderofMimikatz.cs
- README.md
- ReadShellcode.cs
- SSLCertScan.cs
- SafetyKatz.cs
- SerializeXamlToViewState.cs
- SharpADFindDemo.cs
- SharpDCSync.cs
- SharpDCSync_krbtgt.cs
- SharpExchangeBackdoor.cs
- SharpExchangeDeserializeShell-NoAuth-ActivitySurrogateSelectorFromFile.cs
- SharpExchangeDeserializeShell-NoAuth-Fromzcgonvh.cs
- SharpExchangeDeserializeShell-NoAuth-ghostfile.cs
- SharpExchangeDumpHash.cs
- SharpGetUserLoginIPRPC.cs
- SharpGetUserLoginIPWMI.cs
- SharpMimikatz_x64.cs
- SharpMimikatz_x86.cs
- SharpPELoaderGenerater.cs
- SharpSSHCheck_SSH.NET.cs
- SharpSSHRunCmd_SSH.NET.cs
- SharpTGTImporter.cs
- Shellcode.cs
- ShellcodeBase64.txt
- SqlClient.cs
- XamlToViewState.cs
- mapi_tool.cs
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
SharpADFindDemo.cs
C# · 3,262 bytesusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.DirectoryServices;
namespace SharpADFindDemo
{
class Program
{
static void ShowUsage()
{
string Usage = @"
SharpADFindDemo
Use to export the AD data by LDAP.
Complie:
C:\Windows\Microsoft.NET\Framework64\v3.5\csc.exe SharpADFindDemo.cs /r:System.DirectoryServices.dll
or
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe SharpADFindDemo.cs /r:System.DirectoryServices.dll
Usage:
SharpADFindDemo <LDAP ServerIP> <user> <password> <command>
command:
- user
- machine
- group
- ou
- username
- machinename
- groupname
- ouname
Note:The maxsize is 1000.
Eg:
SharpADFindDemo.exe 192.168.1.1 test1 password1 user
";
Console.WriteLine(Usage);
}
static void Main(string[] args)
{
if (args.Length != 4)
{
ShowUsage();
System.Environment.Exit(0);
}
try
{
string q = null;
if (args[3] == "user" || args[3] == "username")
q = "(&(objectCategory=person))";
else if(args[3] == "machine" || args[3] == "machinename")
q = "(&(objectCategory=computer))";
else if(args[3] == "group" || args[3] == "groupname")
q = "(&(objectCategory=group))";
else if(args[3] == "ou" || args[3] == "ouname")
q = "(&(objectCategory=organizationalUnit))";
else
{
Console.WriteLine("[!] Wrong parameter");
System.Environment.Exit(0);
}
Console.WriteLine("[*] Querying LDAP://{0}", args[0]);
Console.WriteLine("[*] Querying: {0}", q);
DirectoryEntry de = new DirectoryEntry("LDAP://" + args[0],args[1],args[2]);
DirectorySearcher ds = new DirectorySearcher(de);
ds.Filter = q;
SearchResultCollection rs = ds.FindAll();
foreach (SearchResult r in rs)
{
if(args[3].Contains("name"))
Console.WriteLine(r.GetDirectoryEntry().Name.ToString());
else
{
ResultPropertyCollection rprops = r.Properties;
string prop = null;
foreach (string name in rprops.PropertyNames)
{
foreach (object vl in rprops[name])
{
prop = name + ":" + vl.ToString();
Console.WriteLine(prop);
}
}
Console.WriteLine("-----");
}
}
Console.WriteLine("Total:"+rs.Count);
}
catch (Exception e)
{
Console.WriteLine("[!] ERROR: {0}", e.Message);
}
}
}
}