Skip to content

Latest commit

 

History

History
397 lines (243 loc) · 9.52 KB

BeaconInfoApi.md

File metadata and controls

397 lines (243 loc) · 9.52 KB

cs_sdk_python.api_client.BeaconInfoApi

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

Method HTTP request Description
clear_command_queue POST /api/v1/beacons/{bid}/clearCommandQueue Clear Queue
delete_beacon DELETE /api/v1/beacons/{bid} Delete Beacon
execute_check_in POST /api/v1/beacons/{bid}/execute/checkIn DNS Beacon Checkin
get_beacon GET /api/v1/beacons/{bid} Get Beacons
list_beacons GET /api/v1/beacons List Beacons
set_note POST /api/v1/beacons/{bid}/note Set Note

clear_command_queue

AsyncCommandResponse clear_command_queue(bid)

Clear Queue

Clear the Beacon queue of pending commands not yet distributed to the Beacon.

Related CS Console Command: clear

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 BeaconInfoApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = BeaconInfoApi(client)
        response = await api.clear_command_queue(
            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]

delete_beacon

delete_beacon(bid)

Delete Beacon

Remove a Beacon session from the Beacon listing/GUI and Beacons data model.

Note: Prior to removing, active Beacons should be terminated with the ""exit"" command or {bid}/execute/exit route or they will re-appear once they check-in.

Related CS Aggressor function: beacon_remove()

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 BeaconInfoApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = BeaconInfoApi(client)
        await api.delete_beacon(
            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

void (empty response body)

Authorization

BearerAuthentication

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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_check_in

AsyncCommandResponse execute_check_in(bid)

DNS Beacon Checkin

Request DNS Beacon to send metadata to teamserver.

Related CS Console Command: checkin

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 BeaconInfoApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = BeaconInfoApi(client)
        response = await api.execute_check_in(
            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]

get_beacon

BeaconDto get_beacon(bid)

Get Beacons

Get metadata of the specified Beacon Id.

Related CS Aggressor function: beacon_info()

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 BeaconInfoApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = BeaconInfoApi(client)
        response = await api.get_beacon(
            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

BeaconDto

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_beacons

List[BeaconDto] list_beacons()

List Beacons

Return a list containing metadata about each Beacon such as ID, Process, computer, listener, etc.

Related CS Aggressor function: beacons()

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 BeaconInfoApi


async def main():
    config = Configuration(host="https://localhost:50443")
    config.access_token = os.environ["CS_ACCESS_TOKEN"]
    async with ApiClient(config) as client:
        api = BeaconInfoApi(client)
        response = await api.list_beacons()


asyncio.run(main())

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

Parameters

This endpoint does not need any parameter.

Return type

List[BeaconDto]

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]

set_note

AsyncCommandResponse set_note(bid, request_model)

Set Note

Assigns a note to the Beacon.

Related CS Console Command: note

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 BeaconInfoApi


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


asyncio.run(main())

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

Parameters

Name Type Description Notes
bid str
request_model NoteDto

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]