[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AEN1A0G8NGHMMWZ768Q0EP":3,"skill-same:01M6AEN1A0G8NGHMMWZ768Q0EP":107},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":47,"linkOnly":48,"markdownContent":49,"markdownBody":50,"frontMatter":51,"refName":66,"commitSha":67,"skillDirectory":68,"forksCount":69,"repositoryHtmlUrl":70,"repositoryHomepageUrl":71,"ownerHtmlUrl":72,"ownerBlogUrl":73,"ownerDescription":74,"updatedAt":75,"install":76,"resources":89},"01M6AEN1A0G8NGHMMWZ768Q0EP","exploiting-bgp-hijacking-vulnerabilities","BGP 劫持漏洞分析与模拟","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.","在授权的实验室环境中分析和模拟 BGP 劫持场景，以评估路由源验证、RPKI 部署情况，以及针对互联网路由基础设施上前綴劫持和路由泄露攻击的 BGP 监控防御能力。","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",36146,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-bgp-hijacking-vulnerabilities\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C7NMKVVN7CCC4BCVAW8B18","渗透测试与红队行动","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"vulnerabilities","exploiting bgp hijacking vulnerabilities","security","cybersecurity","pr","infrastructure","deployment","routing","validation","monitoring","network","network-security","bgp","routing-security","rpki","route-hijacking","2026-11-10 10:12:30",false,"---\nname: exploiting-bgp-hijacking-vulnerabilities\ndescription: 'Analyzes and simulates BGP hijacking scenarios in authorized lab environments\n  to assess route origin validation, RPKI deployment, and BGP monitoring defenses\n  against prefix hijacking and route leak attacks on internet routing infrastructure.\n\n  '\ndomain: cybersecurity\nsubdomain: network-security\ntags:\n- network-security\n- bgp\n- routing-security\n- rpki\n- route-hijacking\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.IR-01\n- DE.CM-01\n- ID.AM-03\n- PR.DS-02\nmitre_attack:\n- T1046\n- T1040\n- T1557\n- T1071\n---\n# Exploiting BGP Hijacking Vulnerabilities\n\n## When to Use\n\n- Assessing an organization's exposure to BGP prefix hijacking and route leak attacks\n- Testing RPKI (Resource Public Key Infrastructure) deployment and route origin validation effectiveness\n- Validating BGP monitoring and alerting systems detect unauthorized route announcements\n- Simulating BGP hijacking in isolated lab environments to train network operations teams\n- Evaluating ISP prefix filtering and route origin authorization (ROA) configurations\n\n**Do not use** to perform actual BGP hijacking on the live internet, against BGP peers without authorization, or to disrupt real internet routing infrastructure. BGP attacks on production systems are illegal and can cause widespread internet outages.\n\n## Prerequisites\n\n- Isolated BGP lab environment using GNS3, EVE-NG, or Containerlab with virtual routers (FRRouting, BIRD, or Cisco IOS)\n- Understanding of BGP path attributes, AS path, prefix announcements, and route selection\n- Access to BGP looking glass servers and RPKI validators for monitoring real-world route status\n- bgpstream, RIPEstat, and BGPalerter tools for route monitoring\n- Written authorization for any testing that involves real AS numbers or prefix announcements\n\n## Workflow\n\n### Step 1: Build an Isolated BGP Lab Environment\n\n```bash\n# Install Containerlab for BGP simulation\nsudo bash -c \"$(curl -sL https:\u002F\u002Fget.containerlab.dev)\"\n\n# Create a BGP lab topology file\ncat > bgp-lab.clab.yml \u003C\u003C 'EOF'\nname: bgp-hijack-lab\ntopology:\n  nodes:\n    # Legitimate AS (AS65001) announcing 10.0.0.0\u002F24\n    legitimate-router:\n      kind: linux\n      image: frrouting\u002Ffrr:v8.5.0\n      binds:\n        - legitimate-frr.conf:\u002Fetc\u002Ffrr\u002Ffrr.conf\n    # Attacker AS (AS65002) that will hijack the prefix\n    attacker-router:\n      kind: linux\n      image: frrouting\u002Ffrr:v8.5.0\n      binds:\n        - attacker-frr.conf:\u002Fetc\u002Ffrr\u002Ffrr.conf\n    # Transit provider (AS65000) connecting both\n    transit-router:\n      kind: linux\n      image: frrouting\u002Ffrr:v8.5.0\n      binds:\n        - transit-frr.conf:\u002Fetc\u002Ffrr\u002Ffrr.conf\n    # Victim network receiving routes\n    victim-router:\n      kind: linux\n      image: frrouting\u002Ffrr:v8.5.0\n      binds:\n        - victim-frr.conf:\u002Fetc\u002Ffrr\u002Ffrr.conf\n  links:\n    - endpoints: [\"legitimate-router:eth1\", \"transit-router:eth1\"]\n    - endpoints: [\"attacker-router:eth1\", \"transit-router:eth2\"]\n    - endpoints: [\"transit-router:eth3\", \"victim-router:eth1\"]\nEOF\n\n# Configure legitimate router (AS65001)\ncat > legitimate-frr.conf \u003C\u003C 'EOF'\nfrr defaults traditional\nhostname legitimate-router\nrouter bgp 65001\n bgp router-id 1.1.1.1\n neighbor 10.0.1.2 remote-as 65000\n address-family ipv4 unicast\n  network 10.0.0.0\u002F24\n  neighbor 10.0.1.2 activate\n exit-address-family\n!\ninterface eth1\n ip address 10.0.1.1\u002F30\n!\ninterface lo\n ip address 10.0.0.1\u002F24\nEOF\n\n# Configure attacker router (AS65002) -- initially not announcing the prefix\ncat > attacker-frr.conf \u003C\u003C 'EOF'\nfrr defaults traditional\nhostname attacker-router\nrouter bgp 65002\n bgp router-id 2.2.2.2\n neighbor 10.0.2.2 remote-as 65000\n address-family ipv4 unicast\n  neighbor 10.0.2.2 activate\n exit-address-family\n!\ninterface eth1\n ip address 10.0.2.1\u002F30\nEOF\n\n# Deploy the lab\nsudo containerlab deploy -t bgp-lab.clab.yml\n```\n\n### Step 2: Verify Legitimate BGP Routing\n\n```bash\n# Connect to victim router and verify route to 10.0.0.0\u002F24\ndocker exec -it clab-bgp-hijack-lab-victim-router vtysh -c \"show ip bgp\"\ndocker exec -it clab-bgp-hijack-lab-victim-router vtysh -c \"show ip route 10.0.0.0\u002F24\"\n\n# Expected: Route via AS65000 AS65001 (legitimate path)\n# Verify traceroute follows the legitimate path\ndocker exec -it clab-bgp-hijack-lab-victim-router traceroute 10.0.0.1\n\n# Check BGP table on transit router\ndocker exec -it clab-bgp-hijack-lab-transit-router vtysh -c \"show ip bgp 10.0.0.0\u002F24\"\n```\n\n### Step 3: Simulate Prefix Hijack (More-Specific Route)\n\n```bash\n# On the attacker router, announce more-specific prefixes\ndocker exec -it clab-bgp-hijack-lab-attacker-router vtysh \u003C\u003C 'VTYSH'\nconfigure terminal\nrouter bgp 65002\n address-family ipv4 unicast\n  network 10.0.0.0\u002F25\n  network 10.0.0.128\u002F25\n exit-address-family\n!\ninterface lo\n ip address 10.0.0.1\u002F25\n ip address 10.0.0.129\u002F25\nexit\nend\nwrite memory\nVTYSH\n\n# Verify the hijack on the victim router\ndocker exec -it clab-bgp-hijack-lab-victim-router vtysh -c \"show ip bgp 10.0.0.0\u002F24 longer-prefixes\"\n\n# The victim should now prefer the \u002F25 routes via the attacker\n# because more-specific routes always win in IP routing\ndocker exec -it clab-bgp-hijack-lab-victim-router vtysh -c \"show ip route 10.0.0.1\"\n# Expected: Route now via AS65000 AS65002 (attacker)\n```\n\n### Step 4: Simulate AS Path Prepend and Origin Hijack\n\n```bash\n# Origin hijack: Attacker announces the exact \u002F24 prefix\ndocker exec -it clab-bgp-hijack-lab-attacker-router vtysh \u003C\u003C 'VTYSH'\nconfigure terminal\nrouter bgp 65002\n address-family ipv4 unicast\n  network 10.0.0.0\u002F24\n  no network 10.0.0.0\u002F25\n  no network 10.0.0.128\u002F25\n exit-address-family\nend\nwrite memory\nVTYSH\n\n# Check which route the victim prefers\n# With equal prefix length, shortest AS path wins\ndocker exec -it clab-bgp-hijack-lab-victim-router vtysh -c \"show ip bgp 10.0.0.0\u002F24\"\n# Both routes visible, attacker may win based on AS path length\n\n# Analyze how BGP path selection determines the winner\ndocker exec -it clab-bgp-hijack-lab-transit-router vtysh -c \"show ip bgp 10.0.0.0\u002F24 bestpath-compare\"\n```\n\n### Step 5: Test RPKI Route Origin Validation\n\n```bash\n# Set up RPKI validator (Routinator)\ndocker run -d --name routinator \\\n  -p 3323:3323 -p 8323:8323 \\\n  nlnetlabs\u002Froutinator:latest\n\n# Configure transit router to use RPKI validation\ndocker exec -it clab-bgp-hijack-lab-transit-router vtysh \u003C\u003C 'VTYSH'\nconfigure terminal\nrpki\n rpki cache 172.17.0.1 3323 preference 1\nexit\n!\nroute-map RPKI-FILTER permit 10\n match rpki valid\n!\nroute-map RPKI-FILTER deny 20\n match rpki invalid\n!\nroute-map RPKI-FILTER permit 30\n match rpki notfound\n!\nrouter bgp 65000\n address-family ipv4 unicast\n  neighbor 10.0.2.1 route-map RPKI-FILTER in\n exit-address-family\nend\nwrite memory\nVTYSH\n\n# Verify RPKI status\ndocker exec -it clab-bgp-hijack-lab-transit-router vtysh -c \"show rpki prefix-table\"\ndocker exec -it clab-bgp-hijack-lab-transit-router vtysh -c \"show ip bgp 10.0.0.0\u002F24\"\n# Attacker's announcement should be marked as RPKI Invalid if ROA exists\n```\n\n### Step 6: Monitor and Detect BGP Anomalies\n\n```bash\n# Install BGPalerter for real-time monitoring\nnpm install -g bgpalerter\nbgpalerter generate -o \u002Fetc\u002Fbgpalerter\n\n# Configure BGPalerter to monitor your prefixes\ncat > \u002Fetc\u002Fbgpalerter\u002Fprefixes.yml \u003C\u003C 'EOF'\n10.0.0.0\u002F24:\n  description: Production Network\n  asn: 65001\n  ignoreMorespecifics: false\n  group: production\nEOF\n\n# Start monitoring\nbgpalerter\n\n# Use bgpstream to query historical routing data\npip3 install pybgpstream\n\npython3 \u003C\u003C 'PYEOF'\nimport pybgpstream\n\n# Query for historical prefix announcements\nstream = pybgpstream.BGPStream(\n    from_time=\"2024-03-14 00:00:00\",\n    until_time=\"2024-03-15 00:00:00\",\n    collectors=[\"route-views2\", \"rrc00\"],\n    record_type=\"updates\",\n    filter=\"prefix more 10.0.0.0\u002F24\"\n)\n\nfor rec in stream.records():\n    for elem in rec:\n        if elem.type == \"A\":  # Announcement\n            print(f\"Time: {elem.time}\")\n            print(f\"Prefix: {elem.fields['prefix']}\")\n            print(f\"AS Path: {elem.fields['as-path']}\")\n            print(f\"Peer: {elem.peer_asn}\")\n            print(\"---\")\nPYEOF\n\n# Check RPKI status via RIPEstat\ncurl -s \"https:\u002F\u002Fstat.ripe.net\u002Fdata\u002Frpki-validation\u002Fdata.json?resource=AS65001&prefix=10.0.0.0\u002F24\" | python3 -m json.tool\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **BGP Hijacking** | Unauthorized announcement of IP prefixes by an AS that does not own them, diverting traffic through the attacker's network |\n| **More-Specific Hijack** | Announcing longer (more-specific) prefixes than the victim's, which always win in IP routing due to longest-prefix-match rule |\n| **RPKI (Resource PKI)** | Cryptographic framework that allows IP prefix holders to authorize specific ASNs to originate their routes via Route Origin Authorizations (ROAs) |\n| **Route Origin Authorization (ROA)** | Digitally signed object that authorizes an AS to originate a specific IP prefix, enabling RPKI-based route validation |\n| **AS Path Prepending** | BGP technique of adding duplicate AS numbers to the AS path to make a route less preferred, also used defensively against hijacking |\n| **Route Leak** | Propagation of BGP routing announcements beyond their intended scope, such as a customer re-advertising transit provider routes to other providers |\n\n## Tools & Systems\n\n- **Containerlab**: Network lab orchestration tool for deploying virtual router topologies using Docker containers\n- **FRRouting (FRR)**: Open-source routing suite supporting BGP, OSPF, IS-IS with RPKI validation capabilities\n- **BGPalerter**: Real-time BGP monitoring tool that detects prefix hijacking, route leaks, and RPKI status changes\n- **Routinator**: RPKI Relying Party software that validates ROAs and provides validated prefix-origin data to routers\n- **pybgpstream**: Python library for analyzing historical and real-time BGP data from RouteViews and RIPE RIS collectors\n\n## Common Scenarios\n\n### Scenario: Assessing an Organization's BGP Hijacking Resilience\n\n**Context**: A cloud hosting company (AS12345) announces 203.0.113.0\u002F24 for their customer-facing services. They need to assess their resilience to BGP hijacking attacks and verify their RPKI deployment is effective. The assessment includes lab simulation and real-world monitoring validation.\n\n**Approach**:\n1. Build a Containerlab topology replicating the organization's BGP peering with two upstream ISPs\n2. Verify that ROA records are correctly published for all the organization's prefixes using RIPEstat\n3. Simulate a more-specific prefix hijack (\u002F25) from a rogue AS and verify that upstream ISPs with RPKI validation drop the invalid routes\n4. Simulate an exact-match origin hijack and verify that RPKI ROV marks the route as invalid\n5. Test route leak scenarios where a customer AS re-announces the provider's prefix\n6. Deploy BGPalerter in production to continuously monitor for unauthorized announcements\n7. Verify that the organization's ISPs have proper prefix filtering (IRR-based and RPKI) configured\n\n**Pitfalls**:\n- Testing BGP hijacking on real internet infrastructure instead of isolated lab environments\n- Assuming RPKI alone prevents all hijacking -- many networks still do not validate RPKI\n- Not testing more-specific prefix announcements, which bypass origin validation if no max-length is set in ROAs\n- Overlooking route leak scenarios where authorized peers inadvertently redistribute routes\n\n## Output Format\n\n```\n## BGP Security Assessment Report\n\n**Organization**: Cloud Hosting Co. (AS12345)\n**Prefixes Assessed**: 203.0.113.0\u002F24, 198.51.100.0\u002F24\n**Assessment Date**: 2024-03-15\n\n### RPKI Status\n\n| Prefix | ROA Exists | Max Length | Origin AS | Status |\n|--------|-----------|------------|-----------|--------|\n| 203.0.113.0\u002F24 | Yes | \u002F24 | AS12345 | Valid |\n| 198.51.100.0\u002F24 | No | N\u002FA | AS12345 | Not Found |\n\n### Lab Simulation Results\n\n| Attack Type | RPKI Validation | Result |\n|-------------|-----------------|--------|\n| More-specific \u002F25 hijack | Enabled | BLOCKED (Invalid origin) |\n| More-specific \u002F25 hijack | Disabled | SUCCESSFUL (traffic diverted) |\n| Exact-match origin hijack | Enabled | BLOCKED (Invalid origin) |\n| Route leak via customer | Enabled | NOT BLOCKED (valid origin, wrong path) |\n\n### Recommendations\n1. Create ROA for 198.51.100.0\u002F24 (currently unprotected)\n2. Set max-length to \u002F24 in ROAs to prevent more-specific hijacks\n3. Request upstream ISPs enable RPKI Route Origin Validation\n4. Deploy BGPalerter for continuous prefix monitoring\n5. Register with IRR databases and request prefix filtering from peers\n```\n","# Exploiting BGP Hijacking Vulnerabilities\n\n## When to Use\n\n- Assessing an organization's exposure to BGP prefix hijacking and route leak attacks\n- Testing RPKI (Resource Public Key Infrastructure) deployment and route origin validation effectiveness\n- Validating BGP monitoring and alerting systems detect unauthorized route announcements\n- Simulating BGP hijacking in isolated lab environments to train network operations teams\n- Evaluating ISP prefix filtering and route origin authorization (ROA) configurations\n\n**Do not use** to perform actual BGP hijacking on the live internet, against BGP peers without authorization, or to disrupt real internet routing infrastructure. BGP attacks on production systems are illegal and can cause widespread internet outages.\n\n## Prerequisites\n\n- Isolated BGP lab environment using GNS3, EVE-NG, or Containerlab with virtual routers (FRRouting, BIRD, or Cisco IOS)\n- Understanding of BGP path attributes, AS path, prefix announcements, and route selection\n- Access to BGP looking glass servers and RPKI validators for monitoring real-world route status\n- bgpstream, RIPEstat, and BGPalerter tools for route monitoring\n- Written authorization for any testing that involves real AS numbers or prefix announcements\n\n## Workflow\n\n### Step 1: Build an Isolated BGP Lab Environment\n\n```bash\n# Install Containerlab for BGP simulation\nsudo bash -c \"$(curl -sL https:\u002F\u002Fget.containerlab.dev)\"\n\n# Create a BGP lab topology file\ncat > bgp-lab.clab.yml \u003C\u003C 'EOF'\nname: bgp-hijack-lab\ntopology:\n  nodes:\n    # Legitimate AS (AS65001) announcing 10.0.0.0\u002F24\n    legitimate-router:\n      kind: linux\n      image: frrouting\u002Ffrr:v8.5.0\n      binds:\n        - legitimate-frr.conf:\u002Fetc\u002Ffrr\u002Ffrr.conf\n    # Attacker AS (AS65002) that will hijack the prefix\n    attacker-router:\n      kind: linux\n      image: frrouting\u002Ffrr:v8.5.0\n      binds:\n        - attacker-frr.conf:\u002Fetc\u002Ffrr\u002Ffrr.conf\n    # Transit provider (AS65000) connecting both\n    transit-router:\n      kind: linux\n      image: frrouting\u002Ffrr:v8.5.0\n      binds:\n        - transit-frr.conf:\u002Fetc\u002Ffrr\u002Ffrr.conf\n    # Victim network receiving routes\n    victim-router:\n      kind: linux\n      image: frrouting\u002Ffrr:v8.5.0\n      binds:\n        - victim-frr.conf:\u002Fetc\u002Ffrr\u002Ffrr.conf\n  links:\n    - endpoints: [\"legitimate-router:eth1\", \"transit-router:eth1\"]\n    - endpoints: [\"attacker-router:eth1\", \"transit-router:eth2\"]\n    - endpoints: [\"transit-router:eth3\", \"victim-router:eth1\"]\nEOF\n\n# Configure legitimate router (AS65001)\ncat > legitimate-frr.conf \u003C\u003C 'EOF'\nfrr defaults traditional\nhostname legitimate-router\nrouter bgp 65001\n bgp router-id 1.1.1.1\n neighbor 10.0.1.2 remote-as 65000\n address-family ipv4 unicast\n  network 10.0.0.0\u002F24\n  neighbor 10.0.1.2 activate\n exit-address-family\n!\ninterface eth1\n ip address 10.0.1.1\u002F30\n!\ninterface lo\n ip address 10.0.0.1\u002F24\nEOF\n\n# Configure attacker router (AS65002) -- initially not announcing the prefix\ncat > attacker-frr.conf \u003C\u003C 'EOF'\nfrr defaults traditional\nhostname attacker-router\nrouter bgp 65002\n bgp router-id 2.2.2.2\n neighbor 10.0.2.2 remote-as 65000\n address-family ipv4 unicast\n  neighbor 10.0.2.2 activate\n exit-address-family\n!\ninterface eth1\n ip address 10.0.2.1\u002F30\nEOF\n\n# Deploy the lab\nsudo containerlab deploy -t bgp-lab.clab.yml\n```\n\n### Step 2: Verify Legitimate BGP Routing\n\n```bash\n# Connect to victim router and verify route to 10.0.0.0\u002F24\ndocker exec -it clab-bgp-hijack-lab-victim-router vtysh -c \"show ip bgp\"\ndocker exec -it clab-bgp-hijack-lab-victim-router vtysh -c \"show ip route 10.0.0.0\u002F24\"\n\n# Expected: Route via AS65000 AS65001 (legitimate path)\n# Verify traceroute follows the legitimate path\ndocker exec -it clab-bgp-hijack-lab-victim-router traceroute 10.0.0.1\n\n# Check BGP table on transit router\ndocker exec -it clab-bgp-hijack-lab-transit-router vtysh -c \"show ip bgp 10.0.0.0\u002F24\"\n```\n\n### Step 3: Simulate Prefix Hijack (More-Specific Route)\n\n```bash\n# On the attacker router, announce more-specific prefixes\ndocker exec -it clab-bgp-hijack-lab-attacker-router vtysh \u003C\u003C 'VTYSH'\nconfigure terminal\nrouter bgp 65002\n address-family ipv4 unicast\n  network 10.0.0.0\u002F25\n  network 10.0.0.128\u002F25\n exit-address-family\n!\ninterface lo\n ip address 10.0.0.1\u002F25\n ip address 10.0.0.129\u002F25\nexit\nend\nwrite memory\nVTYSH\n\n# Verify the hijack on the victim router\ndocker exec -it clab-bgp-hijack-lab-victim-router vtysh -c \"show ip bgp 10.0.0.0\u002F24 longer-prefixes\"\n\n# The victim should now prefer the \u002F25 routes via the attacker\n# because more-specific routes always win in IP routing\ndocker exec -it clab-bgp-hijack-lab-victim-router vtysh -c \"show ip route 10.0.0.1\"\n# Expected: Route now via AS65000 AS65002 (attacker)\n```\n\n### Step 4: Simulate AS Path Prepend and Origin Hijack\n\n```bash\n# Origin hijack: Attacker announces the exact \u002F24 prefix\ndocker exec -it clab-bgp-hijack-lab-attacker-router vtysh \u003C\u003C 'VTYSH'\nconfigure terminal\nrouter bgp 65002\n address-family ipv4 unicast\n  network 10.0.0.0\u002F24\n  no network 10.0.0.0\u002F25\n  no network 10.0.0.128\u002F25\n exit-address-family\nend\nwrite memory\nVTYSH\n\n# Check which route the victim prefers\n# With equal prefix length, shortest AS path wins\ndocker exec -it clab-bgp-hijack-lab-victim-router vtysh -c \"show ip bgp 10.0.0.0\u002F24\"\n# Both routes visible, attacker may win based on AS path length\n\n# Analyze how BGP path selection determines the winner\ndocker exec -it clab-bgp-hijack-lab-transit-router vtysh -c \"show ip bgp 10.0.0.0\u002F24 bestpath-compare\"\n```\n\n### Step 5: Test RPKI Route Origin Validation\n\n```bash\n# Set up RPKI validator (Routinator)\ndocker run -d --name routinator \\\n  -p 3323:3323 -p 8323:8323 \\\n  nlnetlabs\u002Froutinator:latest\n\n# Configure transit router to use RPKI validation\ndocker exec -it clab-bgp-hijack-lab-transit-router vtysh \u003C\u003C 'VTYSH'\nconfigure terminal\nrpki\n rpki cache 172.17.0.1 3323 preference 1\nexit\n!\nroute-map RPKI-FILTER permit 10\n match rpki valid\n!\nroute-map RPKI-FILTER deny 20\n match rpki invalid\n!\nroute-map RPKI-FILTER permit 30\n match rpki notfound\n!\nrouter bgp 65000\n address-family ipv4 unicast\n  neighbor 10.0.2.1 route-map RPKI-FILTER in\n exit-address-family\nend\nwrite memory\nVTYSH\n\n# Verify RPKI status\ndocker exec -it clab-bgp-hijack-lab-transit-router vtysh -c \"show rpki prefix-table\"\ndocker exec -it clab-bgp-hijack-lab-transit-router vtysh -c \"show ip bgp 10.0.0.0\u002F24\"\n# Attacker's announcement should be marked as RPKI Invalid if ROA exists\n```\n\n### Step 6: Monitor and Detect BGP Anomalies\n\n```bash\n# Install BGPalerter for real-time monitoring\nnpm install -g bgpalerter\nbgpalerter generate -o \u002Fetc\u002Fbgpalerter\n\n# Configure BGPalerter to monitor your prefixes\ncat > \u002Fetc\u002Fbgpalerter\u002Fprefixes.yml \u003C\u003C 'EOF'\n10.0.0.0\u002F24:\n  description: Production Network\n  asn: 65001\n  ignoreMorespecifics: false\n  group: production\nEOF\n\n# Start monitoring\nbgpalerter\n\n# Use bgpstream to query historical routing data\npip3 install pybgpstream\n\npython3 \u003C\u003C 'PYEOF'\nimport pybgpstream\n\n# Query for historical prefix announcements\nstream = pybgpstream.BGPStream(\n    from_time=\"2024-03-14 00:00:00\",\n    until_time=\"2024-03-15 00:00:00\",\n    collectors=[\"route-views2\", \"rrc00\"],\n    record_type=\"updates\",\n    filter=\"prefix more 10.0.0.0\u002F24\"\n)\n\nfor rec in stream.records():\n    for elem in rec:\n        if elem.type == \"A\":  # Announcement\n            print(f\"Time: {elem.time}\")\n            print(f\"Prefix: {elem.fields['prefix']}\")\n            print(f\"AS Path: {elem.fields['as-path']}\")\n            print(f\"Peer: {elem.peer_asn}\")\n            print(\"---\")\nPYEOF\n\n# Check RPKI status via RIPEstat\ncurl -s \"https:\u002F\u002Fstat.ripe.net\u002Fdata\u002Frpki-validation\u002Fdata.json?resource=AS65001&prefix=10.0.0.0\u002F24\" | python3 -m json.tool\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **BGP Hijacking** | Unauthorized announcement of IP prefixes by an AS that does not own them, diverting traffic through the attacker's network |\n| **More-Specific Hijack** | Announcing longer (more-specific) prefixes than the victim's, which always win in IP routing due to longest-prefix-match rule |\n| **RPKI (Resource PKI)** | Cryptographic framework that allows IP prefix holders to authorize specific ASNs to originate their routes via Route Origin Authorizations (ROAs) |\n| **Route Origin Authorization (ROA)** | Digitally signed object that authorizes an AS to originate a specific IP prefix, enabling RPKI-based route validation |\n| **AS Path Prepending** | BGP technique of adding duplicate AS numbers to the AS path to make a route less preferred, also used defensively against hijacking |\n| **Route Leak** | Propagation of BGP routing announcements beyond their intended scope, such as a customer re-advertising transit provider routes to other providers |\n\n## Tools & Systems\n\n- **Containerlab**: Network lab orchestration tool for deploying virtual router topologies using Docker containers\n- **FRRouting (FRR)**: Open-source routing suite supporting BGP, OSPF, IS-IS with RPKI validation capabilities\n- **BGPalerter**: Real-time BGP monitoring tool that detects prefix hijacking, route leaks, and RPKI status changes\n- **Routinator**: RPKI Relying Party software that validates ROAs and provides validated prefix-origin data to routers\n- **pybgpstream**: Python library for analyzing historical and real-time BGP data from RouteViews and RIPE RIS collectors\n\n## Common Scenarios\n\n### Scenario: Assessing an Organization's BGP Hijacking Resilience\n\n**Context**: A cloud hosting company (AS12345) announces 203.0.113.0\u002F24 for their customer-facing services. They need to assess their resilience to BGP hijacking attacks and verify their RPKI deployment is effective. The assessment includes lab simulation and real-world monitoring validation.\n\n**Approach**:\n1. Build a Containerlab topology replicating the organization's BGP peering with two upstream ISPs\n2. Verify that ROA records are correctly published for all the organization's prefixes using RIPEstat\n3. Simulate a more-specific prefix hijack (\u002F25) from a rogue AS and verify that upstream ISPs with RPKI validation drop the invalid routes\n4. Simulate an exact-match origin hijack and verify that RPKI ROV marks the route as invalid\n5. Test route leak scenarios where a customer AS re-announces the provider's prefix\n6. Deploy BGPalerter in production to continuously monitor for unauthorized announcements\n7. Verify that the organization's ISPs have proper prefix filtering (IRR-based and RPKI) configured\n\n**Pitfalls**:\n- Testing BGP hijacking on real internet infrastructure instead of isolated lab environments\n- Assuming RPKI alone prevents all hijacking -- many networks still do not validate RPKI\n- Not testing more-specific prefix announcements, which bypass origin validation if no max-length is set in ROAs\n- Overlooking route leak scenarios where authorized peers inadvertently redistribute routes\n\n## Output Format\n\n```\n## BGP Security Assessment Report\n\n**Organization**: Cloud Hosting Co. (AS12345)\n**Prefixes Assessed**: 203.0.113.0\u002F24, 198.51.100.0\u002F24\n**Assessment Date**: 2024-03-15\n\n### RPKI Status\n\n| Prefix | ROA Exists | Max Length | Origin AS | Status |\n|--------|-----------|------------|-----------|--------|\n| 203.0.113.0\u002F24 | Yes | \u002F24 | AS12345 | Valid |\n| 198.51.100.0\u002F24 | No | N\u002FA | AS12345 | Not Found |\n\n### Lab Simulation Results\n\n| Attack Type | RPKI Validation | Result |\n|-------------|-----------------|--------|\n| More-specific \u002F25 hijack | Enabled | BLOCKED (Invalid origin) |\n| More-specific \u002F25 hijack | Disabled | SUCCESSFUL (traffic diverted) |\n| Exact-match origin hijack | Enabled | BLOCKED (Invalid origin) |\n| Route leak via customer | Enabled | NOT BLOCKED (valid origin, wrong path) |\n\n### Recommendations\n1. Create ROA for 198.51.100.0\u002F24 (currently unprotected)\n2. Set max-length to \u002F24 in ROAs to prevent more-specific hijacks\n3. Request upstream ISPs enable RPKI Route Origin Validation\n4. Deploy BGPalerter for continuous prefix monitoring\n5. Register with IRR databases and request prefix filtering from peers\n```\n",{"name":5,"tags":52,"author":53,"domain":34,"license":16,"version":54,"nist_csf":55,"subdomain":42,"description":60,"mitre_attack":61},[42,43,44,45,46],"mahipal","1.0",[56,57,58,59],"PR.IR-01","DE.CM-01","ID.AM-03","PR.DS-02","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.\n",[62,63,64,65],"T1046","T1040","T1557","T1071","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Fexploiting-bgp-hijacking-vulnerabilities",4425,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":9,"skillName":5,"commands":77,"prompt":87,"zipAvailable":88},[78,81,84],{"tool":79,"command":80},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill exploiting-bgp-hijacking-vulnerabilities",{"tool":82,"command":83},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill exploiting-bgp-hijacking-vulnerabilities",{"tool":85,"command":86},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill exploiting-bgp-hijacking-vulnerabilities","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-bgp-hijacking-vulnerabilities\u002FSKILL.md",true,[90,95,101],{"path":91,"resourceType":91,"resourceTypeDesc":92,"sizeBytes":93,"sourceHtmlUrl":94},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-bgp-hijacking-vulnerabilities\u002FLICENSE",{"path":96,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Fapi-reference.md","REFERENCE","参考文档",1675,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-bgp-hijacking-vulnerabilities\u002Freferences\u002Fapi-reference.md",{"path":102,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":105,"sourceHtmlUrl":106},"scripts\u002Fagent.py","SCRIPT","脚本",5444,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-bgp-hijacking-vulnerabilities\u002Fscripts\u002Fagent.py",[108,138,167,197,228,259],{"skillNo":109,"name":110,"nameZh":111,"description":112,"descriptionZh":113,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":114,"categories":115,"keywords":120,"publishedAt":47},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","SLSA 构建来源验证","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","使用 Sigstore 的 cosign（verify、verify-attestation、verify-blob-attestation）和 slsa-verifier（verify-artifact）验证工件签名和 SLSA 来源（provenance），强制校验 keyless OIDC 构建者身份和源仓库是否符合 SLSA Build 级别。适用于 CI\u002FCD 中部署工件前、消费第三方证明时、建立 SLSA Build L3 管道，或在事件响应或准入控制期间确认来源的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[116,117],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":118,"categoryName":119,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C32Q37WAMK06SGMFC02VFP","软件供应链安全",[121,122,123,124,33,34,125,126,35,127,128,129,130,131,132,133,134,135,136,137],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","incident response","identity","code","artifacts","ci","supply-chain","pipeline","supply-chain-security","t1195","attestation","code-signing","cosign","keyless",{"skillNo":139,"name":140,"nameZh":141,"description":142,"descriptionZh":143,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":144,"categories":145,"keywords":150,"publishedAt":47},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","TPM 测量启动验证","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","使用 tpm2-tools 验证 TPM 2.0 测量启动（measured boot）的完整性和远程证明：读取 PCR（tpm2_pcrread）、重放启动事件日志、生成并检查签名报价（tpm2_quote\u002Ftpm2_checkquote），以及将机密封印（seal）到 PCR 策略。适用于确认系统已启动可信固件\u002F内核以实现零信任（Zero Trust）设备状态、通过 PCR 漂移检测启动链篡改，或构建黄金值基线用于机群（fleet）证明。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[146,147],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":148,"categoryName":149,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C89JJEXGGRGHS6XVXDA46K","终端安全加固",[151,134,152,153,33,154,34,35,155,156,157,158,159,160,161,162,163,164,165,166],"boot","TPM","validating tpm measured boot attestation","policy","verification","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":168,"name":169,"nameZh":170,"description":171,"descriptionZh":172,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":173,"categories":174,"keywords":181,"publishedAt":47},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","备份完整性验证","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","通过加密哈希验证、自动化恢复测试、损坏检测和可恢复性检查来验证备份完整性，确认备份对于灾难恢复和勒索软件响应是可靠的。适用于在依赖备份进行恢复之前、构建备份后验证管道、审计备份基础设施以满足合规要求，或检查不可变\u002Fair-gapped（气隙）备份是否存在静默损坏或篡改的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[175,178],{"categoryNo":176,"categoryName":177,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD4WETX0HM3SM9QKQ15B","SRE 工程师",{"categoryNo":179,"categoryName":180,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSSTY86MWS6W5GDQWB1ADQ","备份与灾难恢复",[161,182,183,184,185,34,36,39,155,186,187,188,189,190,191,192,193,194,195,196],"backup","recovery","validating backup integrity for recovery","testing","compliance","hash-verification","incident-response","ransomware","cryptocurrency","detection","t1078","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":198,"name":199,"nameZh":200,"description":201,"descriptionZh":202,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":203,"categories":204,"keywords":209,"publishedAt":47},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","KAPE Windows 取证收集","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","运行 KAPE（Kroll Artifact Parser and Extractor），通过 Targets 收集目标取证工件（注册表配置单元、$MFT、事件日志、prefetch、浏览器数据），并使用封装 Eric Zimmerman 的 EZ Tools（PECmd、MFTECmd、RECmd）的 Modules 进行解析。适用于事件遏制\u002F分诊早期阶段——此时完整磁盘镜像不切实际，但需要快速获得可采信、可解析的 Windows 工件集，包括大规模远程收集。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[205,206],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":207,"categoryName":208,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C9JZH3GWXPJ6CQG5P7J48Y","数字取证与电子证据分析",[210,211,212,34,213,214,215,216,217,218,219,220,221,222,223,224,158,225,226,227],"windows","kape","triaging windows with kape","registry","browser","logs","windows-forensics","dfir","mft","mftecmd","data","prefetch","eric-zimmerman","digital-forensics","SET","collection","pecmd","artifact-collection",{"skillNo":229,"name":230,"nameZh":231,"description":232,"descriptionZh":233,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":234,"categories":235,"keywords":240,"publishedAt":47},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","SSVC 漏洞优先级分诊","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","使用 CISA 的 Stakeholder-Specific Vulnerability Categorization（SSVC，利益相关方特定漏洞分类）决策树对漏洞进行分诊和优先级排序，权衡利用状态（通过 CISA KEV 目录和 FIRST EPSS API）、技术影响、自动化程度和任务普遍性，输出 Track\u002FTrack*\u002FAttend\u002FAct 决策。适用于对漏洞扫描结果（OpenVAS、Nessus、Qualys）进行优先级排序以制定修复计划，而不局限于原始 CVSS 分数的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[236,239],{"categoryNo":237,"categoryName":238,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQV98CYQ7TEW2D1MRQ00TE","安全公告与漏洞管理",{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[31,241,242,34,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258],"framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","vulnerability","api","prioritization","ssvc","decision-tree",{"skillNo":260,"name":261,"nameZh":262,"description":263,"descriptionZh":264,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":265,"categories":266,"keywords":271,"publishedAt":47},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","安全事件初步分诊","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","使用 NIST SP 800-61r3 和 SANS PICERL 框架对安全事件进行初步分诊，分类事件类型、按业务影响分配优先级，并路由到相应的响应团队。适用于 SIEM\u002FEDR 告警需要人工分类、并发告警必须确定优先级，或用户报告或威胁情报 IOC 匹配需要初步事件分类的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[267,268],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":269,"categoryName":270,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTHYSJPJ500X64JJ5CH06D","安全事件响应与威胁狩猎",[33,272,34,273,274,275,276,277,278,279,280,192,281,193,282,283,284,285,286,287],"triaging security incident","siem","file","ioc","soc","NIST-800-61","NIST","severity","edr","execution","analysis","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]