Fix WEBRUNNER: attack_box format, self-contained CIDR, tools submenu, Tor, teardown
- deploy_webrunner.py: full rewrite following attack_box pattern exactly — auto-generate engagement name when blank, select_provider+gather_provider_config per provider (handles region selection), separate teardown_after_scan (default=yes) from enhanced_opsec, use_tor prompt, bundled YAML defaults, setup_logging+confirm_action+show_naming_relationship - utils/cidr_resolver.py: self-contained RIR delegation file downloader/parser — downloads APNIC/ARIN/RIPE/LACNIC/AFRINIC, caches 24h in ~/.cache/c2itall/cidr/, no geo-scout dep - utils/chunk_utils.py: remove geo-scout _try_load_geo_scout() dependency, use cidr_resolver - modules/webrunner/inputs/countries.yaml: bundled default country list (no external dep) - modules/webrunner/inputs/targets.yaml: bundled default scan targets and ports - deploy.py: move WEBRUNNER from main menu (item 14) to tools submenu (item 10) - configure_node.yml: install tor+proxychains4, start tor service, configure proxychains, wait for circuit establishment when use_tor=true - run_scan.yml: prefix command with proxychains4 when use_tor=true - providers/webrunner.yml: add Play 4 teardown — Linode DELETE + AWS terminate-instances using hostvars instance IDs stored during provisioning, conditional on teardown_after_scan
This commit is contained in:
+4
-36
@@ -1,20 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import ipaddress
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def _try_load_geo_scout() -> bool:
|
||||
candidates = [
|
||||
Path(__file__).parents[2] / 'geo-scout',
|
||||
Path.home() / 'tools' / 'geo-scout',
|
||||
]
|
||||
for p in candidates:
|
||||
if (p / 'lib' / 'cidr.py').exists():
|
||||
if str(p) not in sys.path:
|
||||
sys.path.insert(0, str(p))
|
||||
return True
|
||||
return False
|
||||
from utils.cidr_resolver import get_country_cidrs
|
||||
|
||||
|
||||
def ip_count(cidr: str) -> int:
|
||||
@@ -24,27 +10,6 @@ def ip_count(cidr: str) -> int:
|
||||
return 0
|
||||
|
||||
|
||||
def get_country_cidrs(country_codes: list[str], exclude_map: dict[str, list] | None = None) -> dict[str, list[str]]:
|
||||
if exclude_map is None:
|
||||
exclude_map = {}
|
||||
|
||||
_try_load_geo_scout()
|
||||
try:
|
||||
from lib.cidr import fetch_rir_data, load_index, get_cidrs, merge_cidrs
|
||||
except ImportError:
|
||||
return {cc.upper(): [] for cc in country_codes}
|
||||
|
||||
fetch_rir_data()
|
||||
index = load_index()
|
||||
result = {}
|
||||
for cc in country_codes:
|
||||
cc = cc.upper()
|
||||
cidrs = get_cidrs(cc, index)
|
||||
cidrs = merge_cidrs(cidrs, exclude_map.get(cc, []))
|
||||
result[cc] = cidrs
|
||||
return result
|
||||
|
||||
|
||||
def chunk_cidrs(all_cidrs: list[str], chunk_size: int) -> list[dict]:
|
||||
chunks = []
|
||||
current_cidrs: list[str] = []
|
||||
@@ -69,3 +34,6 @@ def chunk_cidrs(all_cidrs: list[str], chunk_size: int) -> list[dict]:
|
||||
chunks.append({'cidrs': current_cidrs, 'ip_count': current_count})
|
||||
|
||||
return chunks
|
||||
|
||||
|
||||
__all__ = ['get_country_cidrs', 'chunk_cidrs', 'ip_count']
|
||||
|
||||
Reference in New Issue
Block a user