mirror of
https://github.com/SHOGGOTH-SECTOR/sica-fondt.git
synced 2026-08-01 08:30:20 +00:00
Place useful parts of the surrounding repos into sica-fondt by layer, per the
body model (Ada = membrane; brain/endocrine/capabilities/knowledge non-Ada):
- brain/ LLM reasoning + providers (dapr, hermes, MoMoA)
- capabilities/ REPRAG sidecars: hermes tools/skills, dapr tools, parallel
dispatch, A51 channels, and the OSINT cluster
- knowledge/ LORAG corpus: 754 cyber-skills, agency personas, secure-coding,
MITRE ATT&CK data
- reference/ defensive threat-reference (C3, shhbruh doc) + AdaYaml parser
License handling: AGPL sources (worldosint, advanced_evolution, mercury,
Reticulum) and GPL DeTTECT are SPEC-only clean-room/port descriptions — no
copyleft code copied. MIT/Apache/data parts copied as working trees.
Safety: shhbruh escape/persistence material and C3 covert-C2 kept as reference
only, not wired into the running organism. See CONSOLIDATION.md.
https://claude.ai/code/session_01UehUqEXXJJCsHoA4voCU5c
69 lines
1.6 KiB
Markdown
69 lines
1.6 KiB
Markdown
# API Reference: Detecting DNP3 Protocol Anomalies
|
|
|
|
## DNP3 Function Codes
|
|
|
|
| Code | Name | Risk Level |
|
|
|------|------|------------|
|
|
| 0x01 | READ | Normal |
|
|
| 0x02 | WRITE | Caution |
|
|
| 0x03 | SELECT | Caution |
|
|
| 0x04 | OPERATE | Critical |
|
|
| 0x05 | DIRECT_OPERATE | Critical |
|
|
| 0x0D | COLD_RESTART | Critical |
|
|
| 0x0E | WARM_RESTART | Critical |
|
|
| 0x10 | INITIALIZE_APPLICATION | Critical |
|
|
| 0x12 | STOP_APPLICATION | Critical |
|
|
|
|
## Zeek DNP3 Log Fields
|
|
|
|
```
|
|
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p fc_request fc_reply
|
|
```
|
|
|
|
## Zeek DNP3 Protocol Analyzer
|
|
|
|
```bash
|
|
# Enable DNP3 analyzer in Zeek
|
|
zeek -C -r capture.pcap protocols/dnp3
|
|
|
|
# Output: dnp3.log with function codes, objects, IIN bits
|
|
```
|
|
|
|
## Suricata DNP3 Rules
|
|
|
|
```
|
|
alert dnp3 any any -> any 20000 (msg:"DNP3 Cold Restart"; \
|
|
dnp3_func:cold_restart; sid:1000001; rev:1;)
|
|
|
|
alert dnp3 any any -> any 20000 (msg:"DNP3 Direct Operate"; \
|
|
dnp3_func:direct_operate; sid:1000002; rev:1;)
|
|
```
|
|
|
|
## Scapy DNP3 Parsing
|
|
|
|
```python
|
|
from scapy.all import rdpcap
|
|
from scapy.contrib.dnp3 import DNP3
|
|
|
|
packets = rdpcap("dnp3_capture.pcap")
|
|
for pkt in packets:
|
|
if pkt.haslayer(DNP3):
|
|
print(pkt[DNP3].func_code)
|
|
```
|
|
|
|
## ICS-CERT Detection Indicators
|
|
|
|
| Anomaly | Detection Method |
|
|
|---------|-----------------|
|
|
| Unauthorized master | Source IP not in allowed list |
|
|
| Burst traffic | >10 events/sec from single source |
|
|
| Off-hours commands | Control operations outside maintenance windows |
|
|
| Unknown function codes | Function codes not in normal baseline |
|
|
|
|
## CLI Usage
|
|
|
|
```bash
|
|
python agent.py --zeek-log dnp3.log
|
|
python agent.py --zeek-log dnp3.log --authorized-masters masters.txt
|
|
```
|