Skip to content

Latest commit

 

History

History
2798 lines (1748 loc) · 75.9 KB

ProcessAndExecutionApi.md

File metadata and controls

2798 lines (1748 loc) · 75.9 KB

cs_sdk_python.api_client.ProcessAndExecutionApi

All URIs are relative to https://localhost:50443

Method HTTP request Description
elevate_command POST /api/v1/beacons/{bid}/elevate/command Run a Command elevated (runasadmin)
execute_beacon_interpreter_lint POST /api/v1/beacons/{bid}/execute/interpreter/lint Lint Beacon Interpreter Script
execute_beacon_interpreter_pack POST /api/v1/beacons/{bid}/execute/interpreter/pack Run Beacon Interpreter Script With Packed Arguments
execute_beacon_interpreter_packed POST /api/v1/beacons/{bid}/execute/interpreter/packed Run Beacon Interpreter Script (Packed Arguments)
execute_beacon_interpreter_string POST /api/v1/beacons/{bid}/execute/interpreter/string Run Beacon Interpreter Script With Optional String Argument
execute_bof_packed_arg POST /api/v1/beacons/{bid}/execute/bof/packed Run BOF with Packed Arguments
execute_bof_string_arg POST /api/v1/beacons/{bid}/execute/bof/string Run BOF
execute_bofpe_packed_arg POST /api/v1/beacons/{bid}/execute/bof-pe/packed Run BOF-PE with Packed Arguments
execute_bofpe_string_arg POST /api/v1/beacons/{bid}/execute/bof-pe/string Run BOF-PE
execute_bofpeto_pack_args POST /api/v1/beacons/{bid}/execute/bof-pe/pack Pack Arguments and Run BOF-PE
execute_bofto_pack_args POST /api/v1/beacons/{bid}/execute/bof/pack Pack Arguments and Run BOF
execute_exit POST /api/v1/beacons/{bid}/execute/exit Exit
execute_get_privs POST /api/v1/beacons/{bid}/execute/getPrivs Enable all available privileges
execute_get_system POST /api/v1/beacons/{bid}/execute/getSystem Attempt to obtain System Privileges
execute_get_uid POST /api/v1/beacons/{bid}/execute/getUid Get current User ID
execute_kill_process POST /api/v1/beacons/{bid}/execute/killProcess Kill Process
execute_power_shell_import POST /api/v1/beacons/{bid}/execute/powershell/import Import Powershell Script
execute_ps POST /api/v1/beacons/{bid}/execute/ps List Process information
execute_set_env POST /api/v1/beacons/{bid}/execute/setenv Set Environment variable
inject_beacon POST /api/v1/beacons/{bid}/inject/beacon Execute Beacon Shellcode (Inject)
inject_dll POST /api/v1/beacons/{bid}/inject/dll Load DLL via reflective DLL loading (Inject)
inject_load_dll POST /api/v1/beacons/{bid}/inject/loadDll Load Library from disk (Inject)
inject_pth POST /api/v1/beacons/{bid}/inject/pth Pass-the-Hash (Inject)
inject_shellcode POST /api/v1/beacons/{bid}/inject/shellcode Execute Shellcode (Inject)
inject_unmanaged_power_shell POST /api/v1/beacons/{bid}/inject/powershell/unmanaged Execute unmanaged Powershell / psinject (Inject)
list_elevate_command_methods GET /api/v1/beacons/{bid}/elevate/command List Command Privilege Elevators
list_remote_execute_beacon_methods GET /api/v1/beacons/{bid}/remoteExec/beacon List Remote Beacon Execution methods
list_remote_execution_command_methods GET /api/v1/beacons/{bid}/remoteExec/command List Remote Command Execution methods
remote_execute_beacon POST /api/v1/beacons/{bid}/remoteExec/beacon Remote Beacon Execution (jump)
remote_execute_command POST /api/v1/beacons/{bid}/remoteExec/command Remote Command Execution (remote-exec)
spawn_beacon POST /api/v1/beacons/{bid}/spawn/beacon Execute Beacon Shellcode (Spawn)
spawn_beacon_as_user POST /api/v1/beacons/{bid}/spawn/beacon/asUser Execute Beacon Shellcode as User (Spawn)
spawn_beacon_under POST /api/v1/beacons/{bid}/spawn/beacon/under Execute Beacon Shellcode under parentPID (Spawn)
spawn_dot_net_assembly POST /api/v1/beacons/{bid}/spawn/dotnetAssembly Execute .NET assembly (Spawn)
spawn_power_shell POST /api/v1/beacons/{bid}/spawn/powershell Execute Managed Powershell (Spawn)
spawn_pth POST /api/v1/beacons/{bid}/spawn/pth Pass-the-Hash (Spawn)
spawn_run_command POST /api/v1/beacons/{bid}/spawn/command/run Run (Spawn)
spawn_run_command_as POST /api/v1/beacons/{bid}/spawn/command/runAs Run As (Spawn)
spawn_run_command_under POST /api/v1/beacons/{bid}/spawn/command/runUnder Run under parentPID (Spawn)
spawn_shell_command POST /api/v1/beacons/{bid}/spawn/command/shell Run Shell Command (Spawn)
spawn_shellcode POST /api/v1/beacons/{bid}/spawn/shellcode Execute Shellcode (Spawn)
spawn_unmanaged_power_shell POST /api/v1/beacons/{bid}/spawn/powershell/unmanaged Execute unmanaged Powershell / powerpick (Spawn)

elevate_command

AsyncCommandResponse elevate_command(bid, request_model)

Run a Command elevated (runasadmin)

Attempt to execute the command in an elevated context using the specified privilege elevation technique. Depending on technique, proceses could be spawned or injected.

Related CS Console Command: runasadmin

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.elevate_command(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.RunAsAdminDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model RunAsAdminDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_beacon_interpreter_lint

AsyncCommandResponse execute_beacon_interpreter_lint(bid, request_model)

Lint Beacon Interpreter Script

Compile (lint) a C script in Beacon Interpreter without execution.

Related CS Console Command: beacon-interpreter-lint

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_beacon_interpreter_lint(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.BeaconInterpreterLintDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model BeaconInterpreterLintDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_beacon_interpreter_pack

AsyncCommandResponse execute_beacon_interpreter_pack(bid, request_model)

Run Beacon Interpreter Script With Packed Arguments

Pack typed arguments and execute a C script in Beacon Interpreter.

Related CS Aggressor functions: bbeacon_interpreter

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_beacon_interpreter_pack(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.BeaconInterpreterPackDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model BeaconInterpreterPackDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_beacon_interpreter_packed

AsyncCommandResponse execute_beacon_interpreter_packed(bid, request_model)

Run Beacon Interpreter Script (Packed Arguments)

Execute a C script in Beacon Interpreter using pre-packed Base64 arguments.

Related CS Aggressor function: bbeacon_interpreter

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_beacon_interpreter_packed(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.BeaconInterpreterPackedDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model BeaconInterpreterPackedDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_beacon_interpreter_string

AsyncCommandResponse execute_beacon_interpreter_string(bid, request_model)

Run Beacon Interpreter Script With Optional String Argument

Compile and execute a C script in Beacon Interpreter using a string argument.

Related CS Console Command: beacon-interpreter

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_beacon_interpreter_string(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.BeaconInterpreterStringDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model BeaconInterpreterStringDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_bof_packed_arg

AsyncCommandResponse execute_bof_packed_arg(bid, request_model)

Run BOF with Packed Arguments

Execute a Beacon Object File (BOF) with the packed argument.

Related CS Aggressor function: binline_execute()

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_bof_packed_arg(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.InlineExecutePackedDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model InlineExecutePackedDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_bof_string_arg

AsyncCommandResponse execute_bof_string_arg(bid, request_model)

Run BOF

Execute a Beacon Object File (BOF) with a String argument.

Related CS Console Command: inline-execute

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_bof_string_arg(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.InlineExecuteStringDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model InlineExecuteStringDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_bofpe_packed_arg

AsyncCommandResponse execute_bofpe_packed_arg(bid, request_model)

Run BOF-PE with Packed Arguments

Execute a BOF-PE with packed arguments.

Related CS Console Command: inline-execute-pe

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_bofpe_packed_arg(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.InlineExecutePePackedDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model InlineExecutePePackedDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_bofpe_string_arg

AsyncCommandResponse execute_bofpe_string_arg(bid, request_model)

Run BOF-PE

Execute a BOF-PE with a String argument.

Related CS Console Command: inline-execute-pe

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_bofpe_string_arg(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.InlineExecutePeStringDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model InlineExecutePeStringDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_bofpeto_pack_args

AsyncCommandResponse execute_bofpeto_pack_args(bid, request_model)

Pack Arguments and Run BOF-PE

Pack the provided arguments and execute a BOF-PE with the resulting packed argument.

Related CS Aggressor function: bof_pack() then beacon_inline_execute_pe()

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_bofpeto_pack_args(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.InlineExecutePePackDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model InlineExecutePePackDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_bofto_pack_args

AsyncCommandResponse execute_bofto_pack_args(bid, request_model)

Pack Arguments and Run BOF

Pack the provided arguments and execute a Beacon Object File (BOF) with the resulting packed argument.

Related CS Aggressor function: bof_pack() then binline_execute()

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_bofto_pack_args(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.InlineExecutePackDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model InlineExecutePackDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_exit

AsyncCommandResponse execute_exit(bid)

Exit

Terminate the Beacon session.

Related CS Console Command: exit

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_exit(
            bid='bid_example',
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_get_privs

AsyncCommandResponse execute_get_privs(bid)

Enable all available privileges

Enable as many system privileges as possible on current token.

Related CS Console Command: getprivs

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_get_privs(
            bid='bid_example',
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_get_system

AsyncCommandResponse execute_get_system(bid)

Attempt to obtain System Privileges

Elevate the session permissions from a local administrator to SYSTEM.

Related CS Console Command: getsystem

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_get_system(
            bid='bid_example',
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_get_uid

AsyncCommandResponse execute_get_uid(bid)

Get current User ID

Get the User ID associated with the current token.

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_get_uid(
            bid='bid_example',
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_kill_process

AsyncCommandResponse execute_kill_process(bid, request_model)

Kill Process

Kills the specified process.

Related CS Console Command: kill

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_kill_process(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.KillDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model KillDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_power_shell_import

AsyncCommandResponse execute_power_shell_import(bid, request_model)

Import Powershell Script

Import a powershell script which is combined with future calls to the powershell command.

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_power_shell_import(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.PowerShellImportDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model PowerShellImportDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_ps

AsyncCommandResponse execute_ps(bid)

List Process information

List information about processes running on the system.\n\nRelated CS Console Command: ps

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_ps(
            bid='bid_example',
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

execute_set_env

AsyncCommandResponse execute_set_env(bid, request_model)

Set Environment variable

Set an environment variable.

Related CS Console Command: setenv

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.execute_set_env(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.SetEnvDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model SetEnvDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

inject_beacon

AsyncCommandResponse inject_beacon(bid, request_model)

Execute Beacon Shellcode (Inject)

Open the process and inject shellcode to start a Beacon.

Related CS Console Command: inject

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.inject_beacon(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.InjectDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model InjectDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

inject_dll

AsyncCommandResponse inject_dll(bid, request_model)

Load DLL via reflective DLL loading (Inject)

Open the process and injects a Reflective DLL.

Related CS Console Command: dllinject

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.inject_dll(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.DllInjectDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model DllInjectDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

inject_load_dll

AsyncCommandResponse inject_load_dll(bid, request_model)

Load Library from disk (Inject)

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

Related CS Console Command: dllload

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.inject_load_dll(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.DllLoadDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model DllLoadDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

inject_pth

AsyncCommandResponse inject_pth(bid, request_model)

Pass-the-Hash (Inject)

Inject into the specified 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.

Related CS Console Command: pth

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.inject_pth(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.PthInjectDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model PthInjectDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

inject_shellcode

AsyncCommandResponse inject_shellcode(bid, request_model)

Execute Shellcode (Inject)

Open the process and inject shellcode into it.

Related CS Console Command: shinject

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.inject_shellcode(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.ShInjectDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model ShInjectDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

inject_unmanaged_power_shell

AsyncCommandResponse inject_unmanaged_power_shell(bid, request_model)

Execute unmanaged Powershell / psinject (Inject)

Inject Unmanaged Powershell into a specific process and execute the specified command.

Related CS Console Command: psinject

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.inject_unmanaged_power_shell(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.PowerShellInject(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model PowerShellInject

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

list_elevate_command_methods

List[ElevatorInfoDto] list_elevate_command_methods(bid)

List Command Privilege Elevators

List available local privilege elevation techniques specific for running a command.

Related CS Console Command: runasadmin

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.list_elevate_command_methods(
            bid='bid_example',
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str

Return type

List[ElevatorInfoDto]

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

list_remote_execute_beacon_methods

List[RemoteExploitInfoDto] list_remote_execute_beacon_methods(bid)

List Remote Beacon Execution methods

List available remote command execution methods for running Beacon remotely.

Related CS Console Command: jump

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.list_remote_execute_beacon_methods(
            bid='bid_example',
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str

Return type

List[RemoteExploitInfoDto]

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

list_remote_execution_command_methods

List[RemoteExecInfoDto] list_remote_execution_command_methods(bid)

List Remote Command Execution methods

List available remote command execution methods for running a remote command.

Related CS Console Command: remote-exec

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.list_remote_execution_command_methods(
            bid='bid_example',
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str

Return type

List[RemoteExecInfoDto]

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

remote_execute_beacon

AsyncCommandResponse remote_execute_beacon(bid, request_model)

Remote Beacon Execution (jump)

Execute a Beacon session on a remote target with the specified remote execution method. Could use spawn or inject depending on chosen method.

Related CS Console Command: jump

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.remote_execute_beacon(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.JumpDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model JumpDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

remote_execute_command

AsyncCommandResponse remote_execute_command(bid, request_model)

Remote Command Execution (remote-exec)

Execute a command on a target via specific remote execution method. Could use spawn or inject depending on chosen method.

Related CS Console Command: remote-exec

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.remote_execute_command(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.RemoteExecDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model RemoteExecDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

spawn_beacon

AsyncCommandResponse spawn_beacon(bid, request_model)

Execute Beacon Shellcode (Spawn)

Spawn an x86 or x64 process and inject shellcode for the payload source.

Related CS Console Command: spawn

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.spawn_beacon(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.SpawnDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model SpawnDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

spawn_beacon_as_user

AsyncCommandResponse spawn_beacon_as_user(bid, request_model)

Execute Beacon Shellcode as User (Spawn)

Spawn a process as another user and Beacon inject shellcode for the payload source.

Related CS Console Command: spawnas

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.spawn_beacon_as_user(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.SpawnBeaconAsDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model SpawnBeaconAsDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

spawn_beacon_under

AsyncCommandResponse spawn_beacon_under(bid, request_model)

Execute Beacon Shellcode under parentPID (Spawn)

Attempt to spawn a session with the specified PID as its parent.

Related CS Console Command: spawnu

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.spawn_beacon_under(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.SpawnuDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model SpawnuDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

spawn_dot_net_assembly

AsyncCommandResponse spawn_dot_net_assembly(bid, request_model)

Execute .NET assembly (Spawn)

Spawns a local .NET executable assembly as a Beacon post-exploitation job.

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.spawn_dot_net_assembly(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.ExecuteAssemblyDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model ExecuteAssemblyDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

spawn_power_shell

AsyncCommandResponse spawn_power_shell(bid, request_model)

Execute Managed Powershell (Spawn)

Execute the command using powershell.

Related CS Console Command: powershell

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.spawn_power_shell(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.PowerShellDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model PowerShellDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

spawn_pth

AsyncCommandResponse spawn_pth(bid, request_model)

Pass-the-Hash (Spawn)

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.

Related CS Console Command: pth

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.spawn_pth(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.PthSpawnDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model PthSpawnDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

spawn_run_command

AsyncCommandResponse spawn_run_command(bid, request_model)

Run (Spawn)

Execute the program. Returns output.

Related CS Console Command: run

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.spawn_run_command(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.RunDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model RunDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

spawn_run_command_as

AsyncCommandResponse spawn_run_command_as(bid, request_model)

Run As (Spawn)

Attempt to execute a program as another user.

Related CS Console Command: runas

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.spawn_run_command_as(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.RunAsDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model RunAsDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

spawn_run_command_under

AsyncCommandResponse spawn_run_command_under(bid, request_model)

Run under parentPID (Spawn)

Attempt to execute a program with the specified PID as its parent.

Related CS Console Command: runu

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.spawn_run_command_under(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.RunUDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model RunUDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

spawn_shell_command

AsyncCommandResponse spawn_shell_command(bid, request_model)

Run Shell Command (Spawn)

Execute the command using cmd.exe.

Related CS Console Command: shell

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.spawn_shell_command(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.ShellDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model ShellDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

spawn_shellcode

AsyncCommandResponse spawn_shellcode(bid, request_model)

Execute Shellcode (Spawn)

Spawn a process and inject shellcode into it.

Related CS Console Command: shspawn

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.spawn_shellcode(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.ShSpawnDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str Beacon id
request_model ShSpawnDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]

spawn_unmanaged_power_shell

AsyncCommandResponse spawn_unmanaged_power_shell(bid, request_model)

Execute unmanaged Powershell / powerpick (Spawn)

Execute the Powershell command using Unmanaged PowerShell. Unmanaged PowerShell is a way to run PowerShell scripts without powershell.exe. the code loads the .NET CLR, reflectively loads a .NET class through that CLR, and uses that .NET class to call APIs in the System.management.automation namespace to evaluate arbitrary PowerShell expressions.

Related CS Console Command: powerpick

Example

import asyncio
import os

import cs_sdk_python.api_client
from cs_sdk_python.api_client import ApiClient, Configuration
from cs_sdk_python.api_client.api import ProcessAndExecutionApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = ProcessAndExecutionApi(client)
        response = await api.spawn_unmanaged_power_shell(
            bid='bid_example',
            request_model=cs_sdk_python.api_client.PowerPickDto(),
        )


asyncio.run(main())

Replace example values and populate the required model fields before running.

Parameters

Name Type Description Notes
bid str
request_model PowerPickDto

Return type

AsyncCommandResponse

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: application/json
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to API reference]