|
4 | 4 | # Cortex4py |
5 | 5 | Cortex4py is a Python API client for [Cortex](https://thehive-project.org/), a powerful observable analysis engine where observables such as IP and email addresses, URLs, domain names, files or hashes can be analyzed one by one using a Web interface. |
6 | 6 |
|
7 | | -Cortex4py allows analysts to automate these operations and submit observables in bulk mode through the Cortex REST API from alternative SIRP platforms and custom scripts. |
| 7 | +Cortex4py allows analysts to automate these operations and submit observables in bulk mode through the Cortex REST API from alternative SIRP platforms, custom scripts or MISP. |
| 8 | + |
| 9 | + |
| 10 | +# Features |
| 11 | +Cortex4py 2 is compatible with Cortex 2 and does not work with Cortex 1. It can: |
| 12 | +- Manage organizations |
| 13 | +- Manage users |
| 14 | +- Configure analyzers within an organization |
| 15 | +- List and launch analyzers |
| 16 | + |
| 17 | +For more details, please refer to the [full documentation](Usage.md). |
| 18 | + |
| 19 | +**Note**: Cortex4py 2 requires Python 3. It does not support Python 2. |
8 | 20 |
|
9 | 21 | # Use It |
10 | 22 | On macOS and Linux, type: |
11 | 23 | ``` |
12 | 24 | sudo pip install cortex4py |
13 | 25 | ``` |
14 | 26 |
|
15 | | -Following is an example of a Python script that runs an analysis using MaxMind analyzer: |
16 | | - |
17 | | -```python |
18 | | -import sys |
19 | | -import json |
20 | | -from cortex4py.api import CortexApi |
21 | | -from cortex4py.api import CortexException |
22 | | - |
23 | | -api = CortexApi('http://127.0.0.1:9000') |
24 | | - |
25 | | -# Run analysis |
26 | | -job_id = None |
27 | | -try: |
28 | | - response = api.run_analyzer("MaxMind_GeoIP_3_0", "ip", 1, "8.8.8.8") |
29 | | - job_id = response["id"] |
30 | | -except CortexException as ex: |
31 | | - print('[ERROR]: Failed to run analyzer: {}'.format(ex.message)) |
32 | | - sys.exit(0) |
33 | | - |
34 | | -# Get the job report |
35 | | -try: |
36 | | - response = api.get_job_report(job_id, '30s') |
37 | | - print(json.dumps(response, indent=4, sort_keys=True)) |
38 | | -except CortexException as ex: |
39 | | - print('[ERROR]: Failed to get job report'.format(ex.message)) |
40 | | - sys.exit(0) |
| 27 | +or, if you already have it, update it: |
| 28 | + |
| 29 | +``` |
| 30 | +sudo pip install -U cortex4py |
41 | 31 | ``` |
42 | 32 |
|
43 | 33 | If you are using Python on a Windows operating system, please forgo the `sudo` command. |
|
0 commit comments