Skip to content

SSZcreate/Pentab_server / .agents/skills/cybersecurity/skills/exploiting-bgp-hijacking-vulnerabilities

exploiting-bgp-hijacking-vulnerabilities

Flagged

Analyzes and simulates BGP hijacking scenarios in authorized lab environments to assess route origin validation, RPKI deployment, and BGP monitoring defenses against prefix hijacking and route leak attacks on internet routing infrastructure.

FileKindSize
LICENSEother11.0 KB
SKILL.mdskill md12.3 KB
references/api-reference.mdmarkdown1.6 KB
scripts/agent.pyscript5.3 KB

references/api-reference.md

View on GitHub
# API Reference: BGP Hijacking Assessment Agent

## Dependencies

| Library | Version | Purpose |
|---------|---------|---------|
| requests | >=2.28 | HTTP client for RIPEstat API queries |

## CLI Usage

```bash
# Full ASN assessment
python scripts/agent.py --asn 12345 --output bgp_report.json

# Check a specific prefix
python scripts/agent.py --asn 12345 --prefix 203.0.113.0/24
```

## Functions

### `check_rpki_status(prefix, asn) -> dict`
Queries RIPEstat RPKI validation endpoint. Returns `{status, validating_roas}`.

### `get_announced_prefixes(asn) -> list`
Lists all prefixes currently announced by the given ASN.

### `get_routing_status(prefix) -> dict`
Returns first/last seen timestamps, visibility across RIS peers, and origin ASN list.

### `check_roas(prefix) -> list`
Retrieves Route Origin Authorization records for the prefix.

### `get_bgp_looking_glass(prefix) -> dict`
Queries RIPEstat looking glass for current route advertisements across RRCs.

### `assess_hijack_resilience(asn) -> dict`
Runs full assessment: enumerates prefixes, checks RPKI, detects multi-origin conflicts.

## RIPEstat API Endpoints

| Endpoint | Purpose |
|----------|---------|
| `/rpki-validation/data.json` | RPKI validity for prefix-origin pair |
| `/announced-prefixes/data.json` | Prefixes announced by an ASN |
| `/routing-status/data.json` | Current routing state of a prefix |
| `/looking-glass/data.json` | BGP routes from RIS collectors |

## Output Schema

```json
{
  "asn": 12345,
  "total_prefixes": 5,
  "rpki_valid": 3,
  "rpki_unprotected": 2,
  "multi_origin_conflicts": 0,
  "prefix_details": [{"prefix": "203.0.113.0/24", "rpki_status": "valid"}]
}
```
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 467kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 467kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 467kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 193kUpdated Claude CodeCodexVerifiedInstall