a Python library for dissecting Cobalt Strike related data
Project description
dissect.cobaltstrike is a Python library for dissecting and parsing Cobalt Strike related data such as beacon payloads and Malleable C2 Profiles.
Installation
The library is available on PyPI. Use pip to install it:
$ pip install dissect.cobaltstrike
dissect.cobaltstrike requires Python 3.6 or later.
Documentation
The project documentation can be found here: https://dissect-cobaltstrike.readthedocs.io
Basic Usage
Parse a Cobalt Strike beacon and extract some config settings:
>>> from dissect.cobaltstrike.beacon import BeaconConfig
>>> bconfig = BeaconConfig.from_path("beacon.bin")
>>> hex(bconfig.watermark)
'0x5109bf6d'
>>> bconfig.protocol
'https'
>>> bconfig.version
<BeaconVersion 'Cobalt Strike 4.2 (Nov 06, 2020)', tuple=(4, 2), date=2020-11-06>
>>> bconfig.settings
mappingproxy({'SETTING_PROTOCOL': 8,
'SETTING_PORT': 443,
'SETTING_SLEEPTIME': 5000,
'SETTING_MAXGET': 1048576,
'SETTING_JITTER': 0, ...
>>> bconfig.settings["SETTING_C2_REQUEST"]
[('_HEADER', b'Connection: close'),
('_HEADER', b'Accept-Language: en-US'),
('BUILD', 'metadata'),
('MASK', True),
('BASE64', True),
('PREPEND', b'wordpress_ed1f617bbd6c004cc09e046f3c1b7148='),
('HEADER', b'Cookie')]
Parse a Malleable C2 Profile and read some configuration settings:
>>> from dissect.cobaltstrike.c2profile import C2Profile
>>> profile = C2Profile.from_path("amazon.profile")
>>> profile.as_dict()
{'sleeptime': ['5000'],
'jitter': ['0'],
'maxdns': ['255'],
'useragent': ['Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko'],
'http-get.uri': ['/s/ref=nb_sb_noss_1/167-3294888-0262949/field-keywords=books'],
'http-get.client.header': [('Accept', '*/*'), ('Host', 'www.amazon.com')],
...
}
>>> profile.properties["useragent"]
['Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko']
>>> profile.properties["http-get.uri"]
['/s/ref=nb_sb_noss_1/167-3294888-0262949/field-keywords=books']
License
dissect.cobaltstrike is developed and distributed under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dissect.cobaltstrike-0.2.2.tar.gz
(52.3 kB
view hashes)
Built Distribution
Close
Hashes for dissect.cobaltstrike-0.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d3fe293dc4da049634db8a42e9c3c37e237878d8839195c9d8b10ee14615b2a |
|
MD5 | 495d75be52c16af5538f7fd719e80a45 |
|
BLAKE2b-256 | 6e454d64dc5f5e469d028e16aa473f7192c4681d50116bb358085c521b12f764 |
Close
Hashes for dissect.cobaltstrike-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c881adde6ab7aaca5634dd6134ea56b92ead3324ba73603ac5cb26f5e393d3d |
|
MD5 | 3bfc82d577122cf7845ead7955a4fb4a |
|
BLAKE2b-256 | f939a54707ff6fd7f5e681a47d9340564a6e22f024f5963fdb9d63afc0eb27fe |