Running Commands

Beacon’s shell command will task a Beacon to execute a command via cmd.exe on the compromised host. When the command completes, Beacon will present the output to you.

Use the run command to execute a command without cmd.exe. The run command will post output to you. The execute command runs a program in the background and does not capture output.

Use the powershell command to execute a command with PowerShell on the compromised host. Use the powerpick command to execute PowerShell cmdlets without powershell.exe. This command relies on the Unmanaged PowerShell technique developed by Lee Christensen. The powershell and powerpick commands will use your current token.

The psinject command will inject Unmanaged PowerShell into a specific process and run your cmdlet from that location.

The powershell-import command will import a PowerShell script into Beacon. Future uses of the powershell, powerpick, and psinject commands will have cmdlets from the imported script available to them. Beacon will only hold one PowerShell script at a time. Import an empty file to clear the imported script from Beacon.

The execute-assembly command will run a local .NET executable as a Beacon post-exploitation job. You may pass arguments to this assembly as if it were run from a Windows command-line interface. This command will also inherit your current token.

If you want Beacon to execute commands from a specific directory, use the cd command in the Beacon console to switch the working directory of the Beacon’s process. The pwd command will tell you which directory you’re currently working from.

The setenv command will set an environment variable.

Beacon can execute Beacon Object Files without creating a new process. Beacon Object Files are compiled C programs, written to a specific convention, that run within a Beacon session. Use inline-execute [args] to execute a Beacon Object File with the specified arguments. See Beacon Object Files for more information.

Beacon Console Commands

The following commands are built into Beacon and exist to configure Beacon or perform housekeeping actions. For more information on their equivalents on the Cobalt Strike REST API, see the REST API documentation.

Command Type Summary Description Equivalent REST API Endpoints
! Housekeeping commands Runs a command from the command history
Use:
!!
![number]
! [number]
![string]
! [string]
!?[string]
! ?[string]

Runs a command from the command history. You can view history via the history command.

!! runs the most recent command from the command history. Equivalent to running !-1 or ! -1.

![number] or ! [number] runs a specific command from the command history:

  • Including a positive number will run the command at that position in the command history (e.g., !1 runs the command at position 1 in history).

  • Including a negative number will run the command that many commands back in the command history (e.g., !-1 runs the previous command).

![string] or ! [string] finds the most recent command in the history that starts with the string and run it.

!?[string] or ! ?[string] finds the most recent command in the command history that contains the string and runs it.

Out of Scope: GUI specific command
argue Housekeeping commands Spoofs arguments for matching processes
Use:
argue [command] [fake arguments]
argue [command]
argue

Spoofs [fake arguments] for [command] processes launched by Beacon.

This option does not affect runu/spawnu, runas/spawnas, or post-ex jobs.

Use argue [command] to disable this feature for the specified command.

Use argue by itself to list programs with defined spoofed arguments.

/api/v1/beacons/{bid}/state/spoofedArguments
beacon_config Housekeeping commands Functions for managing beacon configuration
Use:
beacon_config [commands] [arguments]

Functions for managing beacon configuration.

Use beacon_config to view and update beacon status and configuration.

The beacon_config commands are:

Command Description
failover_notification View and update notification options for failover events
host View and update callback host details for a beacon

Use help beacon_config [command] for more information.

/api/v1/beacons/{bid}/state/c2/failoverNotification/disable
/api/v1/beacons/{bid}/state/c2/failoverNotification/enable
/api/v1/beacons/{bid}/state/c2/host
/api/v1/beacons/{bid}/state/c2/host/hold
/api/v1/beacons/{bid}/state/c2/host/profiles
/api/v1/beacons/{bid}/state/c2/host/release
/api/v1/beacons/{bid}/state/c2/host/reset
beacon_gate Housekeeping commands Functions for managing BeaconGate
Use:
beacon_gate [disable|enable]

Change the use of beacon_gate at runtime to disable/enable the functionality.

/api/v1/beacons/{bid}/state/beaconGate/disable
/api/v1/beacons/{bid}/state/beaconGate/enable
blockdlls Housekeeping commands Blocks non-Microsoft DLLs in child processes
Use:
blockdlls [start|stop]

Launches child processes with a binary signature policy that blocks non-Microsoft DLLs from loading into the child process.

Use blockdlls stop to disable this behavior.

This feature requires Windows 10 or later, or Windows Server 2012 or later.

/api/v1/beacons/{bid}/state/blockdlls/disable
/api/v1/beacons/{bid}/state/blockdlls/enable
cancel Housekeeping commands Cancels a download that's in-progress
Use:
cancel [*file*]

Cancels a download that is currently in progress. Wildcards are OK.

/api/v1/beacons/{bid}/execute/cancelFileDownload
checkin Housekeeping commands Calls home and post data
Use:
checkin

Forces DNS Beacon to connect to you. During a checkin, Beacon posts its host metadata and dumps logged keystrokes.

/api/v1/beacons/{bid}/execute/checkIn
clear Housekeeping commands Clears beacon queue
Use:
clear

Clears beacon queue.

/api/v1/beacons/{bid}/clearCommandQueue
data-store Housekeeping commands Stores post-ex items to Beacon
Use:
data-store load [bof|dotnet|file] [item path]
data-store load [bof|dotnet|file] [name] [item path]
data-store unload [index]
data-store list

Use data-store load to load post-ex items to Beacon. If the name is omitted, then the file name is used. The data store supports Beacon Object Files (bof) and .NET assemblies (dotnet). It is also possible to add arbitrary files to the data store (file). This provides a mechanism to upload data and then query it via BOFs using APIs such as BeaconStoreGetItem().

Use data-store unload to remove a specific post-ex item from the store.

Use data-store list to print the post-ex items currently available in the data store.

Out of Scope: Will be added in GA
downloads Housekeeping commands Lists file downloads in progress
Use:
downloads

Lists any file downloads that are currently in progress.

/api/v1/beacons/{bid}/activeDownloads
file_browser Housekeeping commands Opens the file browser tab for this beacon
Use:
file_browser

Opens the file browser tab for this beacon. Starts in the current directory.

Out of Scope: GUI specific command
help Housekeeping commands Displays the Help menu
Use:
help
help [command]
help [options]

Use help to display a list of commands with short descriptions. The default layout (#list or #groups) is set in preferences.

Use help [command] to display the long-form description of a specified command.

Additional options:

  • #list or #groups - Used to override the default layout from preferences.

  • @[group-id] - Used to display a selected group (#groups layout only).

  • -[contains-filter] - Used to filter the listed commands (#list or #groups layout).

group-id values:

  • Special values - @builtin, @userdefined

  • Predefined values - @housekeeping, @native, @postexdll, @bof

  • User defined values - @[id] (you can define as needed, see aggressor function: beacon_command_group)

Example:

Show help using the "groups" layout for "native" group filtering to list commands that contain the text "spawn":

help #groups -spawn @native

/api/v1/beacons/{bid}/help
/api/v1/beacons/{bid}/help/{command}
history Housekeeping commands Shows the command history
Use:
history
history all
history [number]

Shows the command history.

Use history with the [number] argument to only show that number of most recent commands.

Use history without the [number] argument to list all the commands in the history.

Use history without the all argument to list all the commands in the history.

Out of scope: Superseded by Task mechanism
jobs Housekeeping commands Lists long-running post-exploitation tasks
Use:
jobs

Lists long-running post-exploitation tasks.

/api/v1/beacons/{bid}/state/jobs
mode Housekeeping commands Sets the DNS Beacon mode [dns|dns6|dns-txt] (DNS beacon only)
Use:
mode [dns|dns6|dns-txt]

Sets Beacon's mode to exchange data with the end-user. This only has an effect on a DNS beacon.

  • mode dns - Gets tasks with DNS A record requests. Use this option to communicate with DNS when TXT records are not an option. Sends data as DNS requests with data encoded inside of the hostname.

  • mode dns6 - Gets tasks with DNS AAAA record requests. Use this option to communicate with DNS when TXT records are not an option. Sends data as DNS requests with data encoded inside of the hostname.

  • mode dns-txt - Gets tasks with DNS TXT record requests. This channel carries 189 bytes per request versus 4 bytes for a DNS A record request. Sends data with the same technique as the other DNS mode.

/api/v1/beacons/{bid}/state/dnsMode
note Housekeeping commands Assigns a note to this Beacon
Use:
note [text]

Assigns a note to this Beacon.

/api/v1/beacons/{bid}/note
powershell-import Housekeeping commands Imports a PowerShell script
Use:
powershell-import [/path/to/local/script.ps1]

Imports a PowerShell script which is combined with future calls to the PowerShell command. You can only use one imported script at a time.

/api/v1/beacons/{bid}/execute/powershell/import
ppid Housekeeping commands Sets parent PID for spawned post-ex jobs
Use:
ppid [pid]

Uses the specified PID as a parent for processes Beacon launches. The runas command is not affected, but most other commands are.

Type ppid by itself to reset to default behavior.

WARNING: Do not specify a parent PID in another desktop session. This can break several of Beacon's features and workflows. Use runu to run a command under a parent in another desktop session.
/api/v1/beacons/{bid}/state/ppid
process_browser Housekeeping commands Opens the process browser tab for this beacon
Use:
process_browser

Opens the process browser tab for this beacon.

Out of Scope: GUI specific command
sleep Housekeeping commands Sets Beacon sleep time
Use:
sleep [time in seconds] <jitter>
sleep <number of days>d <number of hours>h <number of minutes>m <number of seconds>s <jitter>j

Changes how often the beacon calls home. Use sleep 0 to force Beacon to call home many times each second.

Specify a jitter value (0-99) to force Beacon to randomly modify its sleep time.

When setting long sleep periods, use the sleep <number of days>d <number of hours>h <number of minutes>m <number of seconds>s <jitter>j format.

Example:

Sets a sleep period of 2 hours and 30 minutes with a jitter value of 15%. This can be achieved using:

sleep 9000 15 or sleep 2h 30m 15j

Both commands set the same sleep period of 9000 seconds with a jitter value of 15%.

The sleep 2h 30m 15j option allows you to set the sleep period without requiring mathematics to convert the period into seconds.

/api/v1/beacons/{bid}/state/sleepTime
spawnto Housekeeping commands Sets the executable to spawn processes into
Use:
spawnto [x86|x64] [c:\path\to\whatever.exe]

Sets the executable that Beacon spawns x86 and x64 shellcode into. You must specify a full-path. Environment variables are OK (e.g., %windir%\sysnative\rundll32.exe)

Do not reference %windir%\system32\ directly. This path is different depending on whether or not Beacon is x86 or x64. Use %windir%\sysnative\ and %windir%\syswow64\ instead.

Beacon will map %windir%\syswow64\ to system32 when WOW64 is not present.

/api/v1/beacons/{bid}/state/spawnto
syscall-method Housekeeping commands Changes or queries the syscall method
Use:
syscall-method <method>

Changes the syscall method at runtime. Valid method types are: None, Direct, and Indirect.

syscall-method without any arguments will query the current syscall method.

/api/v1/beacons/{bid}/state/syscallMethod
variables Housekeeping commands Displays the available command line variables
Use:
variables

Lists the available command line variables. Command line variables will be replaced with the appropriate values when commands run.

Out of Scope: GUI specific command
windows_error_code Housekeeping commands Shows the Windows error code for a Windows error code number
Use:
windows_error_code [number]

Show the Windows error code for a Windows error code number.

Out of Scope: GUI specific command
cd Native commands - WinAPI only Changes the directory on the host
Use:
cd [directory]

Changes the directory on the host.

/api/v1/beacons/{bid}/execute/cd
connect Native commands - WinAPI only Connects to a Beacon peer over TCP
Use:
connect [target] connect [target] [port]

Connects to a TCP Beacon and re-establishes control of it. All requests for the connected Beacon will go through this Beacon.

Use unlink to disconnect from a TCP Beacon.

/api/v1/beacons/{bid}/execute/link/tcp
cp Native commands - WinAPI only Copies a file
Use:
cp [source file] [dest file]

Copies a source file to the specified destination.

/api/v1/beacons/{bid}/execute/cp
dllinject Native commands - WinAPI only Injects a Reflective DLL into a process
Use:
dllinject [pid] [/path/to/my.dll]

Opens the process and injects a Reflective DLL.

/api/v1/beacons/{bid}/inject/dll
download Native commands - WinAPI only Downloads a file
Use:
download [file]

Downloads a file. To see the file, go to View -> Downloads.

/api/v1/beacons/{bid}/execute/download
drives Native commands - WinAPI only Lists drives on target
Use:
drives

Lists drives on the current system.

/api/v1/beacons/{bid}/execute/drives
execute Native commands - WinAPI only Executes a program on target (no output)
Use:
execute [program] [arguments]

Executes the program. Does not block or return output.

/api/v1/beacons/{bid}/spawn/command/runNoOutput
execute-assembly Native commands - WinAPI only Executes a local .NET program in-memory on target
Use:
execute-assembly [/path/to/file.exe] [arguments]
execute-assembly "[PATCHES: [patch-rule] [patch-rule] [patch-rule] [patch-rule]]" [/path/to/file.exe] [arguments]

Executes a local .NET process assembly on target. This command loads the CLR in a temporary process and loads the assembly into it. If the assembly is in the data store, this command will use the loaded item automatically. For more information (help data-store).

The optional PATCHES: argument can modify functions in memory for the process. Up to four patch-rule rules can be specified (space delimited).

"patch-rule" syntax (comma delimited): [library],[function],[offset],[hex-patch-value]

  • library - 1-260 characters

  • function - 1-256 characters

  • offset - 0-65535 (The offset from the start of the executable function)

  • hex-patch-value - 2-200 hex characters (0-9,A-F). Length must be even number (hex pairs).

Examples:
execute-assembly ""PATCHES: ntdll.dll,EtwEventWrite,0,C300"" [/path/to/file.exe] [arguments]
execute-assembly ""PATCHES: ntdll.dll,EtwEventWrite,0,C3 ntdll.dll,EtwEventWrite,1,00"" [/path/to/file.exe] [arguments]
/api/v1/beacons/{bid}/spawn/dotnetAssembly
exit Native commands - WinAPI only Terminates the beacon session
Use:
exit

Terminates the beacon session.

/api/v1/beacons/{bid}/execute/exit
getprivs Native commands - WinAPI only Enables system privileges on current token
Use:
getprivs

Enables as many system privileges as possible on current token.

/api/v1/beacons/{bid}/execute/getPrivs
getuid Native commands - WinAPI only Gets the User ID
Use:
getuid

Gets the User ID associated with the current token.

/api/v1/beacons/{bid}/execute/getUid
inject Native commands - WinAPI only Spawns a session in a specific process
Use:
inject [pid] <x86|x64> [listener]

Opens the process and injects shellcode for the listener.

/api/v1/beacons/{bid}/inject/beacon
inline-execute Native commands - WinAPI only Runs a Beacon Object File in this session
Use:
inline-execute [/path/to/file.o] [args]

Runs a Beacon Object File in this Beacon session. A Beacon Object File is a C program, compiled as an object file, written to use conventions specified in the Cobalt Strike documentation. If the Beacon Object File is in the data store, this command will use the loaded item automatically. For more information, use help data-store.

/api/v1/beacons/{bid}/execute/bof/pack
/api/v1/beacons/{bid}/execute/bof/packed
/api/v1/beacons/{bid}/execute/bof/string
jobkill Native commands - WinAPI only Kills a long-running post-exploitation task
Use:
jobkill [job ID]

Stops a long-running post-exploitation task.

/api/v1/beacons/{bid}/execute/jobStop
kill Native commands - WinAPI only Kills a process
Use:
kill [process id]

Kills the specified process.

/api/v1/beacons/{bid}/execute/killProcess
link Native commands - WinAPI only Connects to a Beacon peer over a named pipe
Use:
link [target] [pipe]
link [target]

Connects to an SMB Beacon and re-establishes control of it. All requests for the connected Beacon will go through this Beacon. Specify an explicit [pipe] to link to that pipename. The default pipe from the current profile is used otherwise.

/api/v1/beacons/{bid}/execute/link/smb
ls Native commands - WinAPI only Lists files
Use:
ls [folder]

Lists all files in a folder.

/api/v1/beacons/{bid}/execute/ls
make_token Native commands - WinAPI only Creates a token to pass credentials
Use:
make_token [DOMAIN\user] [password]
Use (UPN syntax):
make_token [user@domain] [password]

Clones the current access token and sets it up to pass the specified username and password when you interact with network resources. This command does not validate the credentials you provide and it has no effect on local actions.

/api/v1/beacons/{bid}/execute/makeToken/logonName
/api/v1/beacons/{bid}/execute/makeToken/upn
 
mkdir Native commands - WinAPI only Makes a directory
Use:
mkdir [folder]

Makes a directory.

/api/v1/beacons/{bid}/execute/mkdir
mv Native commands - WinAPI only Moves a file
Use:
mv [source file] [dest file]

Moves the source file to the specified destination.

/api/v1/beacons/{bid}/execute/mv
powershell Native commands - WinAPI only Executes a command via powershell.exe
Use:
powershell [commandlet] [arguments]

Executes the command using PowerShell. Any cmdlets from the last use of powershell-import are available here too.

/api/v1/beacons/{bid}/spawn/powershell
ps Native commands - WinAPI only Shows process list
Use:
ps

Shows a list of processes.

/api/v1/beacons/{bid}/execute/ps
pwd Native commands - WinAPI only Displays the current directory
Use:
pwd

Displays the current working directory of this Beacon.

/api/v1/beacons/{bid}/execute/pwd
rev2self Native commands - WinAPI only Reverts to the original token
Use:
rev2self

Reverts to your original access token

/api/v1/beacons/{bid}/execute/rev2self
rm Native commands - WinAPI only Removes a file or folder
Use:
rm [folder]

Removes a file or folder.

/api/v1/beacons/{bid}/execute/rm
rportfwd Native commands - WinAPI only Sets up a reverse port forward
Use:
rportfwd [bind port] [forward host] [forward port]
rportfwd stop [bind port]

Binds the specified port on the target host. When a connection comes in, Cobalt Strike will make a connection to the forwarded host/port and use Beacon to relay traffic between the two connections.

/api/v1/beacons/{bid}/execute/rportfwdStart/onTeamserver
/api/v1/beacons/{bid}/execute/rportfwdStop/onTeamserver
 
rportfwd_local Native commands - WinAPI only Sets up a reverse port forward via Cobalt Strike client
Use:
rportfwd_local [bind port] [forward host] [forward port]
rportfwd_local stop [bind port]

Binds the specified port on the target host. When a connection comes in, Cobalt Strike will make a connection to the forwarded host/port, via your Cobalt Strike client, and use Beacon to relay traffic between the two connections.

Out of scope: Equivalent to rportfwd
run Native commands - WinAPI only Executes a program on target (returns output)
Use:
run [program] [arguments]

Executes a program on the target (returns output).

/api/v1/beacons/{bid}/spawn/command/run
runas Native commands - WinAPI only Executes a program as another user
Use:
runas [DOMAIN\user] [password] [command] [arguments]

Attempts to execute a program as another user. If you do not specify DOMAIN, Beacon will try to authenticate as a local user.

This command will usually fail if you are in a SYSTEM context.

/api/v1/beacons/{bid}/spawn/command/runAs
runu Native commands - WinAPI only Executes a program under another PID
Use:
runu [pid] [command] [arguments]

Attempts to execute a program with the specified PID as its parent. This program will run with the identity of the specified PID.

/api/v1/beacons/{bid}/spawn/command/runUnder
setenv Native commands - WinAPI only Sets an environment variable
Use:
setenv [key] [value]

Sets an environment variable.

/api/v1/beacons/{bid}/execute/setenv
shell Native commands - WinAPI only Executes a command via cmd.exe
Use:
shell [command] [arguments]

Executes the command using cmd.exe.

/api/v1/beacons/{bid}/spawn/command/shell
shinject Native commands - WinAPI only Injects shellcode into a process
Use:
shinject [pid] <x86|x64> [/path/to/my.bin]

Opens the process and injects shellcode into it.

/api/v1/beacons/{bid}/inject/shellcode
shspawn Native commands - WinAPI only Spawns a process and injects shellcode into it
Use:
shspawn <x86|x64> [/path/to/my.bin]

Spawns a process and injects shellcode into it.

/api/v1/beacons/{bid}/spawn/shellcode
socks Native commands - WinAPI only Starts/stops a SOCKS4a/SOCKS5 server to relay traffic
Use:
socks [stop]
socks [port]
socks [port] [socks4]
socks [port] [socks5]
socks [port] [socks5] [enableNoAuth|disableNoAuth] [user] [password]
socks [port] [socks5] [enableNoAuth|disableNoAuth] [user] [password] [enableLogging|disableLogging]

Starts a SOCKS4a (default) or SOCKS5 server on the specified port. This server will relay connections through this Beacon.

SOCKS5 servers can be configured with NoAuth authentication (default), User/Password authentication, and some additional logging.

SOCKS5 Servers currently do not support GSSAPI authentication, UDP Association, and IPV6.

Use socks stop to stop the SOCKS servers and terminate existing connections.

Traffic will not relay while Beacon is asleep. Change the sleep time with the sleep command to reduce latency.

/api/v1/beacons/{bid}/execute/socks4Start
/api/v1/beacons/{bid}/execute/socks5Start
/api/v1/beacons/{bid}/execute/socksStop/{port}
/api/v1/beacons/{bid}/execute/socksStop/all
spawn Native commands - WinAPI only Spawns a session
Use:
spawn [x86|x64] [listener] spawn [listener]

Spawns an x86 or x64 process and inject shellcode for the listener.

/api/v1/beacons/{bid}/spawn/beacon
/api/v1/beacons/{bid}/spawn/postExDll
spawnas Native commands - WinAPI only Spawns a session as another user
Use:
spawnas [DOMAIN\user] [password] [listener]

Attempts to spawn a payload as another user. If you do not specify DOMAIN, Beacon will try to authenticate as a local user.

This command will usually fail if you are in a SYSTEM context. Use make_token to create a token to pass the desired credentials instead.

/api/v1/beacons/{bid}/spawn/beacon/asUser
spawnu Native commands - WinAPI only Spawns a session under another process
Use:
spawnu [pid] [listener]

Attempts to spawn a session with the specified PID as its parent. This session will run with the identity of the specified PID.

/api/v1/beacons/{bid}/spawn/beacon/under
spunnel Native commands - WinAPI only Spawns and tunnels an agent via rportfwd
Use:
spunnel [x86|x64] [host] [port] [/path/to/agent.bin]

This is the spawn-and-tunnel command, which spawns an agent and creates a reverse port-forward tunnel to its controller.

Out of scope: Discarded in the REST API because it is equivalent to rportfwd + spawn

spunnel_local Native commands - WinAPI only Spawns and tunnels an agent via Cobalt Strike client rportfwd
Use:
spunnel_local [x86|x64] [host] [port] [/path/to/agent.bin]

This is the spawn-and-tunnel command, which spawns an agent and creates a reverse port-forward tunnel through your Cobalt Strike client to its controller.

Out of scope: Discarded in the REST API because it is equivalent to rportfwd + spawn

steal_token Native commands - WinAPI only Steals an access token from a process
Use:
steal_token [pid]
steal_token [pid] <OpenProcessToken access mask>

Steals an access token from a process.

OpenProcessToken access mask suggested values:

  • blank = default (TOKEN_ALL_ACCESS)

  • 0 = TOKEN_ALL_ACCESS

  • 11 = TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_QUERY (1+2+8)

Access mask values:

  • STANDARD_RIGHTS_REQUIRED . . . . : 983040

  • TOKEN_ASSIGN_PRIMARY . . . . . . : 1

  • TOKEN_DUPLICATE . . . . . . . . : 2

  • TOKEN_IMPERSONATE . . . . . . . : 4

  • TOKEN_QUERY . . . . . . . . . . : 8

  • TOKEN_QUERY_SOURCE . . . . . . . : 16

  • TOKEN_ADJUST_PRIVILEGES . . . . : 32

  • TOKEN_ADJUST_GROUPS . . . . . . : 64

  • TOKEN_ADJUST_DEFAULT . . . . . . : 128

  • TOKEN_ADJUST_SESSIONID . . . . . : 256

For more information, see Trust Relationships.

/api/v1/beacons/{bid}/execute/stealToken
token-store Native commands - WinAPI only Hot-swappable access tokens
Use:
token-store steal [pid,...] <OpenProcessToken access mask>
token-store steal-and-use [pid] <OpenProcessToken access mask>
token-store use [id]
token-store show
token-store remove [id,...]
token-store remove-all

Use token-store steal to steal an access token and store it in the token store.

Use token-store steal-and-use to steal an access token, store it, and then immediately apply it to the current beacon.

Use token-store use to use an access token from the token store.

Use token-store show to print the access tokens currently available in the token store.

Use token-store remove to remove specific access tokens from the store.

Use token-store remove-all to remove all access tokens from the store.

OpenProcessToken access mask suggested values:

  • blank = default (TOKEN_ALL_ACCESS)

  • 0 = TOKEN_ALL_ACCESS

  • 11 = TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_QUERY (1+2+8)

Access mask values:

  • STANDARD_RIGHTS_REQUIRED . . . . : 983040

  • TOKEN_ASSIGN_PRIMARY . . . . . . : 1

  • TOKEN_DUPLICATE . . . . . . . . : 2

  • TOKEN_IMPERSONATE . . . . . . . : 4

  • TOKEN_QUERY . . . . . . . . . . : 8

  • TOKEN_QUERY_SOURCE . . . . . . . : 16

  • TOKEN_ADJUST_PRIVILEGES . . . . : 32

  • TOKEN_ADJUST_GROUPS . . . . . . : 64

  • TOKEN_ADJUST_DEFAULT . . . . . . : 128

  • TOKEN_ADJUST_SESSIONID . . . . . : 256

For more information, see Trust Relationships.

/api/v1/beacons/{bid}/execute/tokenStore/remove
/api/v1/beacons/{bid}/execute/tokenStore/removeAl
/api/v1/beacons/{bid}/execute/tokenStore/steal
/api/v1/beacons/{bid}/execute/tokenStore/stealAndUse
/api/v1/beacons/{bid}/execute/tokenStore/use
/api/v1/beacons/{bid}/state/tokenStore
unlink Native commands - WinAPI only Disconnects from parent Beacon
Use:
unlink [ip address]
unlink [ip address] [pid]

Disconnects from a named pipe or TCP Beacon.

Specify an IP address or an IP address and session PID to disconnect a specific Beacon.

/api/v1/beacons/{bid}/execute/unlink
upload Native commands - WinAPI only Uploads a file
Use:
upload [/path/to/file]

Uploads a file to host.

/api/v1/beacons/{bid}/execute/upload
browserpivot Postex DLL Sets up a browser pivot session
Use:
browserpivot [pid] [x86|x64]
browserpivot [stop]

Sets up a Browser Pivot into the specified process. To hijack authenticated web sessions, make sure the process is an Internet Explorer tab. These processes have iexplore.exe as their parent process.

Use browserpivot stop to tear down the browser pivoting sessions associated with this Beacon.

/api/v1/beacons/{bid}/execute/browserpivotStop
/api/v1/beacons/{bid}/inject/browserpivotStart
chromedump Postex DLL Recovers credentials from Google Chrome
Use:
chromedump [pid] [arch]
chromedump

Injects into the specified process to recover credential material from Google Chrome.

Use chromedump with no [pid] and [arch] arguments to spawn a temporary process to recover credential material from Google Chrome.

This command will use mimikatz to recover the credential material and should be run under a user context.

/api/v1/beacons/{bid}/inject/chromedump
/api/v1/beacons/{bid}/spawn/chromedump
covertvpn Postex DLL Deploys a Covert VPN client
Use:
covertvpn [interface] [ip address]

Deploys a Covert VPN to the target's system. You must have administrator privileges for the client to work.

Setup an [interface] through Cobalt Strike -> VPN Interfaces. The [ip address] is the IP address of the target interface you want to deploy the VPN client to.

Out of scope
dcsync Postex DLL Extracts a password hash from a DC
Use:
dcsync [pid] [arch] [DOMAIN.fqdn] <DOMAIN\user>
dcsync [DOMAIN.fqdn] <DOMAIN\user>

Injects into the specified process to extract the NTLM password hashes.

Use dcsync with no [pid] and [arch] arguments to spawn a temporary process to extract the NTLM password hashes.

This command uses mimikatz to extract the NTLM password hash for domain users from the domain controller. Specify a user to get their hash only.

This command requires a domain administrator trust relationship.

/api/v1/beacons/{bid}/inject/dcsync
/api/v1/beacons/{bid}/spawn/dcsync
desktop Postex DLL Views and interacts with target's desktop
Use:
desktop [pid] [x86|x64] [high|low]
desktop [high|low]

Injects a VNC server onto the target and connects to it. You may specify whether the session is high- or low-quality.

Out of Scope: GUI specific command
execute-assembly Postex DLL Executes a local .NET program in-memory on target
Use:
execute-assembly [/path/to/file.exe] [arguments]
execute-assembly "[PATCHES: [patch-rule] [patch-rule] [patch-rule] [patch-rule]]" [/path/to/file.exe] [arguments]

Executes a local .NET process assembly on target. This command loads the CLR in a temporary process and loads the assembly into it. If the assembly is in the data store, this command will use the loaded item automatically. For more information, run help data-store.

The optional PATCHES: argument can modify functions in memory for the process. Up to four patch-rule rules can be specified (space-delimited).

"patch-rule" syntax (comma delimited): [library],[function],[offset],[hex-patch-value]

  • library - 1-260 characters

  • function - 1-256 characters

  • offset - 0-65535 (The offset from the start of the executable function)

  • hex-patch-value - 2-200 hex characters (0-9,A-F). Length must be even number (hex pairs).

Examples:
execute-assembly "PATCHES: ntdll.dll,EtwEventWrite,0,C300" [/path/to/file.exe] [arguments]
execute-assembly "PATCHES: ntdll.dll,EtwEventWrite,0,C3 ntdll.dll,EtwEventWrite,1,00" [/path/to/file.exe] [arguments]
/api/v1/beacons/{bid}/spawn/dotnetAssembly
hashdump Postex DLL Dumps password hashes
Use:
hashdump [pid] [x86|x64]
hashdump

Injects the hashdump tool into the specified process.

Use hashdump with no arguments to spawn a temporary process and inject the hashdump tool into it.

The hashdump tool will dump password hashes (warning: Injects into LSASS).

This command requires administrator privileges. If injecting into a pid that process requires administrator privileges.

/api/v1/beacons/{bid}/inject/hashdump
/api/v1/beacons/{bid}/spawn/hashdump
keylogger Postex DLL Starts a keystroke logger
Use:
keylogger [pid] [x86|x64]
keylogger

Injects a keystroke logger into the specified process.

Use keylogger with no arguments to spawn a temporary process and inject the keystroke logger into it.

To terminate this task, use jobs to find the job ID and then use jobkill to kill the job.

/api/v1/beacons/{bid}/inject/keylogger

/api/v1/beacons/{bid}/spawn/keylogger

logonpasswords Postex DLL Dumps credentials and hashes with mimikatz
Use:
logonpasswords [pid] [arch]
logonpasswords

Injects into the specified process to dump plaintext credentials and NTLM hashes.

Use logonpasswords with no [pid] and [arch] arguments to spawn a temporary process to dump plaintext credentials and NTLM hashes.

This command uses mimikatz and requires administrator privileges.

/api/v1/beacons/{bid}/inject/logonPasswords
/api/v1/beacons/{bid}/spawn/logonPasswords
mimikatz Postex DLL Runs a mimikatz command
Use:
mimikatz [pid] [arch] [module::command] <args>
mimikatz [pid] [arch] [!module::command] <args>
mimikatz [pid] [arch] [@module::command] <args>
mimikatz [module::command] <args>
mimikatz [!module::command] <args>
mimikatz [@module::command] <args>

Injects into the specified process to run a mimikatz command.

Use mimikatz with no [pid] and [arch] arguments to spawn a temporary process to run a mimikatz command.

Use ! to make mimikatz elevate to SYSTEM before it runs your command. Some commands require this.

Use @ to make mimikatz impersonate Beacon's thread token before it runs your command. This is helpful for mimikatz commands that interact with remote systems (e.g., lsadump::dcsync)

Use ; to separate multiple mimikatz commands. The maximum length of the commands is 511 characters.

Example:
mimikatz crypto::capi ; crypto::certificates /systemstore:local_machine /store:my /export
/api/v1/beacons/{bid}/inject/mimikatz
/api/v1/beacons/{bid}/spawn/mimikatz
net Postex DLL Network and host enumeration tool
Use:
net [pid] [arch] [command] [arguments]
net [command] [arguments]

Injects the network and host enumeration tool into the specified process.

Use net with no [pid] and [arch] arguments to spawn a temporary process and inject the network and host enumeration tool into it.

Beacon's network and host enumeration tool. The built-in net commands are:

Command Description
computers lists hosts in a domain (groups)
dclist lists domain controllers
domain display domain for this host
domain_controllers lists DCs in a domain (groups)
domain_trusts lists domain trusts
group lists groups and users in groups
localgroup lists local groups and users in local groups
logons lists users logged onto a host
sessions lists sessions on a host
share lists shares on a host
user lists users and user information
time show time for a host
view lists hosts in a domain (browser service)

Use help net [command] for more information.

/api/v1/beacons/{bid}/execute/net/domain
/api/v1/beacons/{bid}/inject/net/computers
/api/v1/beacons/{bid}/inject/net/dclist
/api/v1/beacons/{bid}/inject/net/domainControllers
/api/v1/beacons/{bid}/inject/net/domainTrusts
/api/v1/beacons/{bid}/inject/net/group
/api/v1/beacons/{bid}/inject/net/localGroup
/api/v1/beacons/{bid}/inject/net/logons
/api/v1/beacons/{bid}/inject/net/sessions
/api/v1/beacons/{bid}/inject/net/share
/api/v1/beacons/{bid}/inject/net/time
/api/v1/beacons/{bid}/inject/net/user
/api/v1/beacons/{bid}/inject/net/user/detail
/api/v1/beacons/{bid}/inject/net/view
/api/v1/beacons/{bid}/spawn/net/computers
/api/v1/beacons/{bid}/spawn/net/dclist
/api/v1/beacons/{bid}/spawn/net/domainControllers
/api/v1/beacons/{bid}/spawn/net/domainTrusts
/api/v1/beacons/{bid}/spawn/net/group
/api/v1/beacons/{bid}/spawn/net/localGroup
/api/v1/beacons/{bid}/spawn/net/logons
/api/v1/beacons/{bid}/spawn/net/sessions
/api/v1/beacons/{bid}/spawn/net/share
/api/v1/beacons/{bid}/spawn/net/time
/api/v1/beacons/{bid}/spawn/net/user
/api/v1/beacons/{bid}/spawn/net/user/detail
/api/v1/beacons/{bid}/spawn/net/view

portscan Postex DLL Scans a network for open services
Use:
portscan [pid] [arch] [targets] [ports] [arp|icmp|none] [max connections]
portscan [targets] [ports] [arp|icmp|none] [max connections]

Injects into the specified process to run a port scan against the specified hosts.

Use portscan with no [pid] and [arch] arguments to spawn a temporary process to run a port scan against the specified hosts.

[targets] is a comma separated list of hosts to scan. You may also specify IPv4 address ranges (e.g., 192.168.1.128-192.168.2.240, 192.168.1.0/24).

[ports] is a comma separated list or ports to scan. You may specify port ranges as well (e.g., 1-65535).

The [arp|icmp|none] options dictate how the port scanning tool will determine if a host is alive. The ARP option uses ARP to see if a system responds to the specified address. The ICMP option sends an ICMP echo request. The none option tells the portscan tool to assume all hosts are alive.

The [max connections] option limits how many connections the port scan tool will attempt at any one time. The portscan tool uses asynchronous I/O and can handle a large number of connections at once. A higher value will make the portscan go much faster (default is 1024).

/api/v1/beacons/{bid}/inject/portscan
/api/v1/beacons/{bid}/spawn/portscan
powerpick Postex DLL Executes a command via Unmanaged PowerShell
Use:
powerpick [commandlet] [arguments]
powerpick "[PATCHES: [patch-rule] [patch-rule] [patch-rule] [patch-rule]]" [commandlet] [arguments]

Executes the command using Unmanaged PowerShell. Any cmdlets from the last use of powershell-import are available here, too.

The optional PATCHES: argument can modify functions in memory for the process. Up to four patch-rule rules can be specified (space-delimited).

"patch-rule" syntax (comma delimited): [library],[function],[offset],[hex-patch-value]

  • library - 1-260 characters

  • function - 1-256 characters

  • offset - 0-65535 (The offset from the start of the executable function)

  • hex-patch-value - 2-200 hex characters (0-9,A-F). Length must be even number (hex pairs).

Examples:
powerpick "PATCHES: ntdll.dll,EtwEventWrite,0,C300" [commandlet] [arguments]
powerpick "PATCHES: ntdll.dll,EtwEventWrite,0,C3 ntdll.dll,EtwEventWrite,1,00" [commandlet] [arguments]
/api/v1/beacons/{bid}/spawn/powershell/unmanaged
printscreen Postex DLL Takes a single screenshot via PrintScr method
Use:
printscreen [pid] [x86|x64]
printscreen

Injects a screenshot tool into the specified process.

Use printscreen with no arguments to spawn a temporary process and inject the screenshot tool into it.

printscreen forces a PrintScr keypress, grabs the screenshot from the clipboard, and then exits. This command will clear the clipboard contents after its done.

No long-running variant of this exists because destroying the clipboard periodically is not a good OPSEC practice.

/api/v1/beacons/{bid}/inject/printscreen
/api/v1/beacons/{bid}/spawn/printscreen
psinject Postex DLL Executes a PowerShell command in a specific process
Use:
psinject [pid] [arch] [commandlet] [arguments]

Injects Unmanaged PowerShell into a specific process and executes the specified command. Any cmdlets from the last use of powershell-import are available here too.

/api/v1/beacons/{bid}/inject/powershell/unmanaged
pth Postex DLL Pass-the-hash using mimikatz
Use:
pth [pid] [arch] [DOMAIN\user] [NTLM hash]
pth [DOMAIN\user] [NTLM hash]

Injects into the specified process to generate and impersonate a token.

Use pth with no [pid] and [arch] arguments to spawn a temporary process to generate and impersonate a token.

This command uses mimikatz to generate and impersonate a token that uses the specified DOMAIN, user, and NTLM hash as single sign-on credentials. Beacon will pass this hash when you interact with network resources.

/api/v1/beacons/{bid}/inject/pth
/api/v1/beacons/{bid}/spawn/pth
screenshot Postex DLL Takes a single screenshot
Use:
screenshot [pid] [x86|x64]
screenshot

Injects a screenshot tool into the specified process.

Use screenshot with no arguments to spawn a temporary process and injects the screenshot tool into it.

screenshot takes a picture of the visible desktop and exits.

/api/v1/beacons/{bid}/inject/screenshot
/api/v1/beacons/{bid}/spawn/screenshot
screenwatch Postex DLL Takes periodic screenshots of desktop
Use:
screenwatch [pid] <x86|x64>
screenwatch

Injects a screen watcher tool into the specified process.

Use screenwatch with no arguments to spawn a temporary process and inject the screen watch tool into it.

screenwatch sends a screenshot of the user's desktop (one per Beacon check-in) until terminated. If the user is idle, the screen watch tool will take a new screenshot every three minutes.

To terminate this task, use jobs to find the job ID and then use jobkill to kill the job.

/api/v1/beacons/{bid}/inject/screenwatch
/api/v1/beacons/{bid}/spawn/screenwatch
ssh Postex DLL Uses SSH to spawn an SSH session on a host
Use:
ssh [pid] [arch] [target:port] [user] [pass]
ssh [target:port] [user] [pass]

Injects into the specified process to run an SSH client and attempts to log in to the specified target.

Use ssh with no [pid] and [arch] arguments to spawn a temporary process to run an SSH client and attempt to log in to the specified target.

/api/v1/beacons/{bid}/inject/ssh
/api/v1/beacons/{bid}/spawn/ssh
ssh-key Postex DLL Uses SSH to spawn an SSH session on a host
Use:
ssh-key [pid] [arch] [target:port] [user] [/path/to/key.pem]
ssh-key [target:port] [user] [/path/to/key.pem]

Injects into the specified process to run an SSH client and attempts to log in to the specified target.

Use ssh-key with no [pid] and [arch] arguments to spawn a temporary process to run an SSH client and attempt to login to the specified target.

The key file needs to be in the PEM format. If the file is not in the PEM format, make a copy of the file and then convert the copy with the following command:

/usr/bin/ssh-keygen -f [/path/to/copy] -e -m pem -p

/api/v1/beacons/{bid}/inject/sshKey
/api/v1/beacons/{bid}/spawn/sshKey
beacon_info Beacon Object File (BOF) Prints beacon's in-memory location
Use:
beacon_info

Prints detailed information about the beacon's runtime state such as its base address, allocated memory regions, allocated section details, heap records, and sleep mask information.

Useful for inspecting the current memory layout of Beacon.

/api/v1/beacons/{bid}/execute/beaconInfo
clipboard Beacon Object File (BOF) Attempts to get the text clipboard contents
Use:
clipboard

Attempts to get the text clipboard contents.

/api/v1/beacons/{bid}/execute/clipboard
dllload Beacon Object File (BOF) Loads a DLL into a process with LoadLibrary()
Use:
dllload [pid] [c:\path\to\file.dll]

Loads a DLL into the specified remote process via LoadLibrary(). The DLL must exist on the target.

/api/v1/beacons/{bid}/inject/loadDll
elevate Beacon Object File (BOF) Spawns a session in an elevated context
Use:
elevate [exploit] [listener]

Attempts to spawn an elevated session with the specified exploit.

Type elevate by itself to see a list of available local exploits.

/api/v1/beacons/{bid}/elevate/beacon
getsystem Beacon Object File (BOF) Attempts to get SYSTEM
Use:
getsystem

Attempts to get SYSTEM.

/api/v1/beacons/{bid}/execute/getSystem
jump Beacon Object File (BOF) Spawns a session on a remote host
Use:
jump [exploit] [target] [listener]

Attempts to spawn a session on a remote target with the specified exploit.

Type jump by itself to see a list of available remote exploits.

/api/v1/beacons/{bid}/remoteExec/beacon
kerberos_ccache_use Beacon Object File (BOF) Applies a Kerberos ticket from cache to this session
Use:
kerberos_ccache_use [/path/to/file.ccache]

Applies a Kerberos ticket to this session from a ccache file.

Out of scope
kerberos_ticket_purge Beacon Object File (BOF) Purges Kerberos tickets from this session
Use:
kerberos_ticket_purge

Purges Kerberos tickets from this session.

/api/v1/beacons/{bid}/execute/kerberos/ticket/purge
kerberos_ticket_use Beacon Object File (BOF) Applies a Kerberos ticket to this session
Use:
kerberos_ticket_use [/path/to/file.ticket]

Applies a Kerberos ticket to this session.

/api/v1/beacons/{bid}/execute/kerberos/ticket/use
reg Beacon Object File (BOF) Queries the registry
Use:
reg query [x86|x64] [root\path]
reg queryv [x86|x64] [root\path] [subkey]

Use query to query a key within the registry. Lists all subkeys and values.

Use queryv to query a subkey within the registry. Lists only the subkey and its value.

Use HKLM, HKCR, HKCC, HKCU, or HKU for the root

Specify x86|x64 to force a specific view of the registry.

/api/v1/beacons/{bid}/execute/reg/query
/api/v1/beacons/{bid}/execute/reg/queryv
remote-exec Beacon Object File (BOF) Runs a command on a remote host
Use:
remote-exec [method] [target] [command]

Runs a [command] on [target] via [method].

Type remote-exec by itself to see a list of methods.

/api/v1/beacons/{bid}/remoteExec/command
runasadmin Beacon Object File (BOF) Executes a program in an elevated context
Use:
runasadmin [exploit] [command] [args]

Attempts to run the specified command in an elevated context.

Type runasadmin by itself to see a list of available local exploits.

/api/v1/beacons/{bid}/elevate/command
timestomp Beacon Object File (BOF) Applies timestamps from one file to another
Use:
timestomp [fileA] [fileB]

Updates the Modified, Access, and Created times of fileA to match those of fileB.

/api/v1/beacons/{bid}/execute/timestomp

 

Related Topics