Repository navigation
Agent KB_security
grisun0 edited this page Oct 16, 2026
·
19 revisions
- Layer: utility
- Language: py
- Imported by:
tests/test_security_lazyc2.py
- Doc: Command allowlist policy for the LazyOwn C2
/api/runendpoint. - Layer: utility
- Language: py
- Symbols:
-
CommandRejectionReason(class, line 36)class CommandRejectionReason(StrEnum) -
CommandDecision(class, line 48)class CommandDecision -
CommandAllowlist(class, line 70)class CommandAllowlist -
to_dict(method, line 61)def to_dict(self) -
__init__(method, line 82)def __init__(self, allowed, audit_log_path) -
allowed(method, line 94)def allowed(self) -
check(method, line 98)def check(self, command) -
_audit(method, line 126)def _audit(self, decision, command)
-
- Depends on:
cli/commands/enum.py - Imported by:
lazyc2.py,tests/test_command_allowlist.py,tests/test_command_allowlist_behavior.py
- Doc: Security constants and validation patterns for the LazyOwn C2 web layer.
- Layer: utility
- Language: py
- Imported by:
lazyc2.py,lazyc2/security/html_sanitizer.py,lazyc2/security/services.py,lazyc2/security/validators.py
- Doc: CORS origin allowlist policy for the LazyOwn C2 web layer.
- Layer: utility
- Language: py
- Symbols:
-
CorsConfigError(class, line 46)class CorsConfigError(ValueError) -
CorsPolicy(class, line 50)class CorsPolicy -
_origin_matches(function, line 197)def _origin_matches(allowed, candidate) -
_scheme_of(function, line 221)def _scheme_of(origin) -
_host_of(function, line 228)def _host_of(origin) -
__init__(method, line 70)def __init__(self, env, lhost, allowed_origins, c2_port, extra_socketio_ports) -
env(method, line 85)def env(self) -
resolve_origins(method, line 89)def resolve_origins(self) -
origins_for_socketio(method, line 110)def origins_for_socketio(self) -
is_allowed(method, line 136)def is_allowed(self, origin) -
_socketio_ports(method, line 157)def _socketio_ports(self) -
_collect_candidates(method, line 166)def _collect_candidates(self) -
_clean(method, line 175)def _clean(candidates) -
_dev_fallback_origins(method, line 185)def _dev_fallback_origins(self) -
_dev_fallback(method, line 193)def _dev_fallback(self)
-
- Imported by:
lazyc2.py,tests/test_cors_behavior.py,tests/test_cors_policy.py,tests/test_cors_socketio_regression.py
- Doc: CSRF protection policy for the LazyOwn C2 web layer.
- Layer: utility
- Language: py
- Symbols:
-
CSRFPolicy(class, line 48)class CSRFPolicy -
__init__(method, line 69)def __init__(self, header, form_field, cookie_name, exempt_paths, secret) -
header(method, line 85)def header(self) -
cookie_name(method, line 90)def cookie_name(self) -
issue(method, line 94)def issue(self, session_id) -
rotate(method, line 111)def rotate(self, session_id) -
forget(method, line 126)def forget(self, session_id) -
validate(method, line 130)def validate(self, session_id, candidate) -
is_exempt(method, line 147)def is_exempt(self, path) -
extract_token(method, line 163)def extract_token(self, request) -
check_request(method, line 182)def check_request(self, session_id, request)
-
- Imported by:
lazyc2.py,lazyc2/blueprints/addons.py,tests/test_csrf_behavior.py,tests/test_csrf_policy.py
- Doc: HTML sanitizer backed by
bleachfor the LazyOwn C2 web layer. - Layer: utility
- Language: py
- Symbols:
-
_strip_dangerous_blocks(function, line 62)def _strip_dangerous_blocks(raw_html) -
sanitize_html(function, line 78)def sanitize_html(raw_html, allowed_tags, allowed_attributes)
-
- Depends on:
lazyc2/security/constants.py - Imported by:
lazyc2.py,tests/test_html_sanitizer.py
- Doc: HTTPS redirect policy for the LazyOwn C2 web layer.
- Layer: presentation
- Language: py
- Symbols:
-
RedirectResponse(class, line 29)class RedirectResponse -
HTTPSRedirect(class, line 41)class HTTPSRedirect -
__init__(method, line 51)def __init__(self, env, enabled) -
enabled(method, line 56)def enabled(self) -
evaluate(method, line 60)def evaluate(self, request)
-
- Imported by:
lazyc2.py,tests/test_https_redirect.py
- Doc: Security services for the LazyOwn C2 web layer.
- Layer: business_logic
- Language: py
- Symbols:
-
SecretKeyManager(class, line 19)class SecretKeyManager -
SafeFileService(class, line 56)class SafeFileService -
AESKeyManager(class, line 152)class AESKeyManager -
UploadSizeValidator(class, line 183)class UploadSizeValidator -
__init__(method, line 30)def __init__(self, sessions_dir) -
get_or_create(method, line 33)def get_or_create(self) -
__init__(method, line 63)def __init__(self, base_dir) -
_resolve_safe(method, line 68)def _resolve_safe(self, relative_path) -
read_bytes(method, line 86)def read_bytes(self, relative_path) -
read_text(method, line 102)def read_text(self, relative_path, encoding) -
write_bytes(method, line 119)def write_bytes(self, relative_path, data) -
exists(method, line 136)def exists(self, relative_path) -
__init__(method, line 158)def __init__(self, key_file) -
get_or_generate(method, line 161)def get_or_generate(self) -
__init__(method, line 189)def __init__(self, max_size_bytes) -
validate(method, line 192)def validate(self, content_length)
-
- Depends on:
lazyc2/security/constants.py,lazyc2/security/validators.py - Imported by:
lazyc2.py,lazyc2/app_factory.py,modules/c2_agent.py,tests/test_security_lazyc2.py
- Doc: Trusted proxy resolver for the LazyOwn C2 web layer.
- Layer: utility
- Language: py
- Symbols:
-
TrustedProxyResolver(class, line 30)class TrustedProxyResolver -
__init__(method, line 42)def __init__(self, trusted_count, operator_allowlist) -
trusted_count(method, line 53)def trusted_count(self) -
client_ip(method, line 57)def client_ip(self, remote_addr, x_forwarded_for) -
is_operator(method, line 80)def is_operator(self, ip)
-
- Imported by:
lazyc2.py,tests/test_trusted_proxy.py
- Doc: Input validators for the LazyOwn C2 web layer.
- Layer: utility
- Language: py
- Symbols:
-
validate_route_path(function, line 24)def validate_route_path(route_path) -
validate_template_name(function, line 46)def validate_template_name(template_name) -
validate_yaml_filename(function, line 68)def validate_yaml_filename(filename) -
validate_request_data(function, line 86)def validate_request_data(data) -
validate_aes_key(function, line 102)def validate_aes_key(key) -
validate_password_length(function, line 118)def validate_password_length(password) -
validate_upload_size(function, line 134)def validate_upload_size(content_length) -
validate_file_path_within_base(function, line 150)def validate_file_path_within_base(file_path, base_dir) -
resolve_contained_file_path(function, line 174)def resolve_contained_file_path(raw_url, base_dir)
-
- Depends on:
lazyc2/security/constants.py - Imported by:
lazyc2.py,lazyc2/blueprints/phishing.py,lazyc2/security/services.py,tests/test_security_lazyc2.py,tests/test_short_url_file_containment.py
Generated offline by readmenator from commit bb49626e7e46. Edits here are overwritten by readmenator . --rebuild.
Start
Wiki
- community_0_cli_commands
- community_10_modules_opsec_scorer
- community_11_modules_finding_lifecycle
- community_12_modules_kerberos_core
- community_13_modules_saas_attacks
- community_14_modules_polymorphic_engine
- community_15_contrib_legacy
- community_16_scripts_journal
- community_17_modules_backdoor
- community_18_poc_tui
- community_19_scripts_check_contract_manifest
- community_1_modules_lazyc2
- community_20_scripts_migrate_lazyown
- community_21_tools
- community_22_orphans
- community_2_cli
- community_3_modules_autonomous_daemon
- community_4_modules_lazy_loop
- community_5_lazygui_panels
- community_6_skills_claude_md_orchestrator
- community_7_static_js
- community_8_modules_llm_budget
- community_9_modules_atomic_exploit_bridge
- concepts
- queries
- REPORT
Agent Docs
- API
- API_p10
- API_p11
- API_p12
- API_p13
- API_p14
- API_p15
- API_p16
- API_p17
- API_p18
- API_p19
- API_p2
- API_p20
- API_p21
- API_p22
- API_p23
- API_p3
- API_p4
- API_p5
- API_p6
- API_p7
- API_p8
- API_p9
- ARCHITECTURE
- ARCHITECTURE_p2
- ARCHITECTURE_p3
- ARCHITECTURE_p4
- ARCHITECTURE_p5
- ARCHITECTURE_p6
- ARCHITECTURE_p7
- CONCEPTS
- GOTCHAS
- INDEX
- INDEX_p2
- INDEX_p3
- KB_backdoor
- KB_blueprints
- KB_cgi-bin
- KB_claude_md_orchestrator
- KB_cli
- KB_cli_p2
- KB_cli_p3
- KB_cli_p4
- KB_cli_p5
- KB_commands
- KB_commands_p2
- KB_commands_p3
- KB_commands_p4
- KB_config
- KB_contract
- KB_core
- KB_core_p2
- KB_devtools
- KB_extensions
- KB_hermes-lazyown
- KB_integrations
- KB_js
- KB_js_p2
- KB_js_p3
- KB_js_p4
- KB_lazyc2
- KB_lazygui
- KB_lazyown-docker
- KB_legacy
- KB_legacy_p2
- KB_misc
- KB_modules
- KB_modules_p10
- KB_modules_p11
- KB_modules_p12
- KB_modules_p13
- KB_modules_p14
- KB_modules_p2
- KB_modules_p3
- KB_modules_p4
- KB_modules_p5
- KB_modules_p6
- KB_modules_p7
- KB_modules_p8
- KB_modules_p9
- KB_modules_tools
- KB_palettes
- KB_panels
- KB_plugins
- KB_poc_tui
- KB_root
- KB_root_p2
- KB_rootkit
- KB_scripts
- KB_security
- KB_services
- KB_skills
- KB_skills_claude_md_orchestrator_tests
- KB_skills_p2
- KB_skills_p3
- KB_skills_p4
- KB_skills_p5
- KB_skills_tests
- KB_tests
- KB_tests_p10
- KB_tests_p11
- KB_tests_p12
- KB_tests_p13
- KB_tests_p14
- KB_tests_p15
- KB_tests_p16
- KB_tests_p17
- KB_tests_p2
- KB_tests_p3
- KB_tests_p4
- KB_tests_p5
- KB_tests_p6
- KB_tests_p7
- KB_tests_p8
- KB_tests_p9
- KB_theme
- KB_tools
- KB_widgets
- KB_win_rootkit
- KB_windows
- MEMORY
- SECURITY
- SYMBOLS
- SYMBOLS_p10
- SYMBOLS_p11
- SYMBOLS_p12
- SYMBOLS_p13
- SYMBOLS_p14
- SYMBOLS_p15
- SYMBOLS_p16
- SYMBOLS_p17
- SYMBOLS_p18
- SYMBOLS_p19
- SYMBOLS_p2
- SYMBOLS_p20
- SYMBOLS_p21
- SYMBOLS_p22
- SYMBOLS_p23
- SYMBOLS_p24
- SYMBOLS_p25
- SYMBOLS_p26
- SYMBOLS_p27
- SYMBOLS_p28
- SYMBOLS_p29
- SYMBOLS_p3
- SYMBOLS_p30
- SYMBOLS_p31
- SYMBOLS_p32
- SYMBOLS_p33
- SYMBOLS_p34
- SYMBOLS_p35
- SYMBOLS_p36
- SYMBOLS_p37
- SYMBOLS_p38
- SYMBOLS_p39
- SYMBOLS_p4
- SYMBOLS_p40
- SYMBOLS_p41
- SYMBOLS_p5
- SYMBOLS_p6
- SYMBOLS_p7
- SYMBOLS_p8
- SYMBOLS_p9
Recipes