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.
Add_passwordneverexpires_user_byLDAP.cs
C# · 3,146 bytesusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.DirectoryServices;
namespace Add_passwordneverexpires_user_byLDAP
{
class Program
{
static void ShowUsage()
{
string Usage = @"
Add_passwordneverexpires_user_byLDAP
Use to set the selected user with password_never_expires by LDAP.
Complie:
C:\Windows\Microsoft.NET\Framework64\v3.5\csc.exe Add_passwordneverexpires_user_byLDAP.cs /r:System.DirectoryServices.dll
or
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe Add_passwordneverexpires_user_byLDAP.cs /r:System.DirectoryServices.dll
Usage:
Add_passwordneverexpires_user_byLDAP <LDAP ServerIP> <user> <password> <target user>
Eg:
Add_passwordneverexpires_user_byLDAP.exe 192.168.1.1 administrator password1 test1
";
Console.WriteLine(Usage);
}
static void Main(string[] args)
{
if (args.Length != 4)
{
ShowUsage();
System.Environment.Exit(0);
}
try
{
DirectoryEntry entry = new DirectoryEntry("LDAP://" + args[0], args[1], args[2]);
//When you are in the domain
//DirectoryEntry de = new DirectoryEntry("LDAP://" + args[0]);
DirectorySearcher deSearch = new DirectorySearcher(entry);
deSearch.Filter = "(&(&(objectCategory=person)(objectClass=user))(sAMAccountName=" + args[3] + "))";
deSearch.SearchScope = SearchScope.Subtree;
SearchResult result = deSearch.FindOne();
entry = new DirectoryEntry(result.Path, args[1], args[2]);
//When you are in the domain
//DirectoryEntry de = new DirectoryEntry("LDAP://" + args[0]);
Console.WriteLine("[*] Querying: {0}", deSearch.Filter);
Console.WriteLine("[+] samaccountname: {0}", entry.Properties["samaccountname"][0]);
int NON_EXPIRE_FLAG = 0x10000;
int x = (int)entry.Properties["userAccountControl"].Value;
Console.WriteLine(" userAccountControl: {0}", x);
Console.WriteLine("[*] Trying to set userAccountControl");
entry.Properties["userAccountControl"].Value = x | NON_EXPIRE_FLAG;
entry.CommitChanges();
result = deSearch.FindOne();
entry = new DirectoryEntry(result.Path, args[1], args[2]);
//When you are in the domain
//DirectoryEntry de = new DirectoryEntry("LDAP://" + args[0]);
int y = (int)entry.Properties["userAccountControl"].Value;
Console.WriteLine("[+] samaccountname: {0}", entry.Properties["samaccountname"][0]);
Console.WriteLine(" userAccountControl(new): {0}", y);
}
catch (Exception e)
{
Console.WriteLine("[!] ERROR: {0}", e.Message);
}
}
}
}