#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import Any, Dict, List
from kittysploit import *
class Module(Prestage):
PRESTAGE_ID = "scope_guard"
__info__ = {
"name": "Scope Guard (Python)",
"description": "Exit when the callback host is outside the embedded lab scope",
"author": "KittySploit Team",
"version": "1.0.0",
"platform": Platform.MULTI,
"languages": ["python"],
"prestage_dependencies": ["telemetry_buffer"],
"tags": ["prestage", "offline", "guard", "python"],
}
allowed_scope = OptString(
"",
"Extra allowed hosts/CIDRs (comma-separated, merged with private ranges)",
False,
)
def generate_python(self, context: Dict[str, Any] = None) -> str:
from lib.c2.prestage_guards import build_scope_guard_bootstrap
ctx = dict(context or {})
c2_host = str(ctx.get("c2_host") or "").strip()
raw_scope = str(ctx.get("prestage_scope") or getattr(getattr(self, "allowed_scope", None), "value", "") or "").strip()
allowed_hosts: List[str] = []
allowed_cidrs: List[str] = []
for token in [part.strip() for part in raw_scope.split(",") if part.strip()]:
if "/" in token:
allowed_cidrs.append(token)
else:
allowed_hosts.append(token)
if c2_host and c2_host not in allowed_hosts:
allowed_hosts.append(c2_host)
return build_scope_guard_bootstrap(
c2_host=c2_host,
allowed_hosts=allowed_hosts,
allowed_cidrs=allowed_cidrs or None,
)
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
29 Sep 2026 10:07Current
5.9Medium risk
Vulners AI Score5.9