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
Load a beacon and access some properties and settings:
>>> from dissect.cobaltstrike.beacon import BeaconConfig
>>> bconfig = BeaconConfig.from_path("beacon.bin")
>>> bconfig.version
<BeaconVersion 'Cobalt Strike 4.2 (Nov 06, 2020)', tuple=(4, 2), date=2020-11-06>
>>> hex(bconfig.watermark)
'0x5109bf6d'
>>> bconfig.protocol
'https'
>>> 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')]
Loading Malleable C2 Profiles and access 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.1.0.tar.gz
(49.7 kB
view hashes)
Built Distribution
Close
Hashes for dissect.cobaltstrike-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a1d0ee038950306e645207eb92ba22d3cbd22ec0fcb7820f3ee8ce242e915ad |
|
MD5 | 8bd145fc7ac3148c1284ab626ac6df0a |
|
BLAKE2b-256 | 6e30992888257e4654f6ce81ee3a449d56e0a27eda3a500d32e447776870487b |
Close
Hashes for dissect.cobaltstrike-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3626ee4982f1b291fa2b96c1751cad41fd994e4ce2721d1c6cd436f7de8bae48 |
|
MD5 | 46e754a19af1de9f44f9a7a9ef2b69d6 |
|
BLAKE2b-256 | 9f13b328af21ec1f9eafa72afc7d4b6bf2e1324c29cc8a0669a215b1bc217963 |