# montysecurity/c2-tracker architecture

> Architecture diagram of the GitHub repository montysecurity/c2-tracker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/montysecurity/c2-tracker
- Repository: https://github.com/montysecurity/c2-tracker

## Overview

C2 Tracker collects infrastructure indicators by querying Shodan, writes per-tool and aggregate IP feeds, and offers an OpenCTI connector that imports, reconciles, and optionally relates indicators to tool or malware entities. The README also describes historical analysis through repository history and SIEM/TIP ingestion of raw feed files. Censys support exists in tracker.py but is disabled. The repository is archived, and the README says its former data files are no longer maintained; the excerpts do not show the full connector startup or every OpenCTI operation.

Main entry points: [`tracker.py`](https://github.com/montysecurity/c2-tracker/blob/main/tracker.py) (Tracker runner), [`opencti-connector/src/connector.py`](https://github.com/montysecurity/c2-tracker/blob/main/opencti-connector/src/connector.py) (Indicator reconciliation), [`opencti-connector/src/purge.py`](https://github.com/montysecurity/c2-tracker/blob/main/opencti-connector/src/purge.py) (Indicator purger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["IOC collection"]
  node_tracker["Tracker runner<br/>[tracker.py]"]
  node_shodan["Shodan search<br/>[tracker.py]"]
  node_censys["Censys search<br/>[tracker.py]"]
end

subgraph group_feeds["Feed output"]
  node_feedfiles["IP feed files<br/>[tracker.py]"]
end

subgraph group_opencti["OpenCTI integration"]
  node_feedreader["Feed fetcher<br/>[connector.py]"]
  node_reconcile["Indicator reconciliation<br/>[connector.py]"]
  node_openctiapi[("OpenCTI platform")]
  node_entitylinking["Entity relationships<br/>[connector.py]"]
  node_purger["Indicator purger<br/>[purge.py]"]
end

subgraph group_consumption["Feed consumption"]
  node_siem["SIEM / TIP"]
  node_historian(("History investigator"))
end

node_operator(("Local operator"))

node_operator -->|"runs"| node_tracker
node_tracker -->|"queries"| node_shodan
node_tracker -.->|"can query"| node_censys
node_tracker -->|"writes IPs"| node_feedfiles
node_feedfiles -->|"ingested as feed"| node_siem
node_historian -->|"searches history"| node_feedfiles
node_feedreader -->|"fetches IPs"| node_feedfiles
node_feedreader -->|"passes IPs"| node_reconcile
node_reconcile -->|"creates and deletes"| node_openctiapi
node_reconcile -->|"checks MITRE"| node_entitylinking
node_entitylinking -->|"creates relationships"| node_openctiapi
node_operator -.->|"runs cleanup"| node_purger
node_purger -->|"deletes tagged indicators"| node_openctiapi

click node_tracker "https://github.com/montysecurity/c2-tracker/blob/main/tracker.py"
click node_shodan "https://github.com/montysecurity/c2-tracker/blob/main/tracker.py"
click node_censys "https://github.com/montysecurity/c2-tracker/blob/main/tracker.py"
click node_feedfiles "https://github.com/montysecurity/c2-tracker/blob/main/tracker.py"
click node_feedreader "https://github.com/montysecurity/c2-tracker/blob/main/opencti-connector/src/connector.py"
click node_reconcile "https://github.com/montysecurity/c2-tracker/blob/main/opencti-connector/src/connector.py"
click node_entitylinking "https://github.com/montysecurity/c2-tracker/blob/main/opencti-connector/src/connector.py"
click node_purger "https://github.com/montysecurity/c2-tracker/blob/main/opencti-connector/src/purge.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_tracker,node_shodan,node_censys toneBlue
class node_feedfiles toneAmber
class node_feedreader,node_reconcile,node_openctiapi,node_entitylinking,node_purger toneMint
class node_siem,node_historian toneRose
class node_operator toneIndigo
```

## Components

### IOC collection

- [Tracker runner](https://github.com/montysecurity/c2-tracker/blob/main/tracker.py): `tracker.py`
- [Shodan search](https://github.com/montysecurity/c2-tracker/blob/main/tracker.py): `tracker.py`
- [Censys search](https://github.com/montysecurity/c2-tracker/blob/main/tracker.py): `tracker.py`

### Feed output

- [IP feed files](https://github.com/montysecurity/c2-tracker/blob/main/tracker.py): `tracker.py`

### OpenCTI integration

- [Feed fetcher](https://github.com/montysecurity/c2-tracker/blob/main/opencti-connector/src/connector.py): `opencti-connector/src/connector.py`
- [Indicator reconciliation](https://github.com/montysecurity/c2-tracker/blob/main/opencti-connector/src/connector.py): `opencti-connector/src/connector.py`
- **OpenCTI platform**
- [Entity relationships](https://github.com/montysecurity/c2-tracker/blob/main/opencti-connector/src/connector.py): `opencti-connector/src/connector.py`
- [Indicator purger](https://github.com/montysecurity/c2-tracker/blob/main/opencti-connector/src/purge.py): `opencti-connector/src/purge.py`

### Feed consumption

- **SIEM / TIP**
- **History investigator**

### Other components

- **Local operator**

## Connections

- Local operator → Tracker runner: runs (evidence: `README.md`)
- Tracker runner → Shodan search: queries (evidence: `tracker.py`)
- Tracker runner → Censys search: can query (evidence: `README.md`)
- Tracker runner → IP feed files: writes IPs (evidence: `tracker.py`)
- IP feed files → SIEM / TIP: ingested as feed (evidence: `README.md`)
- History investigator → IP feed files: searches history (evidence: `README.md`)
- Feed fetcher → IP feed files: fetches IPs (evidence: `opencti-connector/src/connector.py`)
- Feed fetcher → Indicator reconciliation: passes IPs (evidence: `opencti-connector/src/connector.py`)
- Indicator reconciliation → OpenCTI platform: creates and deletes (evidence: `opencti-connector/src/connector.py`)
- Indicator reconciliation → Entity relationships: checks MITRE (evidence: `opencti-connector/src/connector.py`)
- Entity relationships → OpenCTI platform: creates relationships (evidence: `opencti-connector/src/connector.py`)
- Local operator → Indicator purger: runs cleanup
- Indicator purger → OpenCTI platform: deletes tagged indicators (evidence: `opencti-connector/src/purge.py`)
