Skip to content

Agent API_p23

grisun0 edited this page Oct 16, 2026 · 1 revision

API (page 23 of 23)

Previous: API_p22.md

static/js/vis-network.min.js

Depends on: cli/show.py, core/process.py, lazyown-docker/init.sh

static/js/xterm-addon-web-links-0.5.0.js

static/js/xterm.js

Depends on: lazyown-docker/init.sh, modules/colors.py, skills/claude_md_orchestrator/parser.py

telegram_c2.py

Depends on: core/parsers.py, lazyown.py, modules/llm_adapter.py

telegram_hermes.py

Depends on: core/parsers.py

tests/run_mutation_api_authz.py

tests/run_mutation_c2_route_auth.py

tools/contract_check.py

tools/extract_cluster.py

  • fragment_name (function) tools/extract_cluster.py:29 def fragment_name(fragment) -- Return the function name defined by an extracted source fragment.
  • collect_methods (function) tools/extract_cluster.py:41 def collect_methods(source_text, wanted) -- Collect verbatim source of wanted methods in class-definition order.
  • build_module (function) tools/extract_cluster.py:66 def build_module(target_class, phase, category, title, methods, extra_imports) -- Render the new pending CommandSet module source.
  • main (function) tools/extract_cluster.py:141 def main() -- Extract the requested cluster and write the target module.

tools/gen_demo_gifs.py

Imported by: tools/gen_demo_gifs_extra.py

tools/gen_demo_gifs_extra.py

Depends on: tools/gen_demo_gifs.py

utils.py

Depends on: cli/banner_config.py, core/config.py, core/console.py, core/crypto.py, core/dependencies.py, core/parsers.py, core/process.py, core/safe_subprocess.py, core/validators.py, modules/backdoor/server.c, modules/lazyencoder_decoder.py, skills/claude_md_orchestrator/parser.py Imported by: banner.py, cli/commands/_base.py, cli/commands/ai.py, cli/commands/anti_forensics.py, cli/commands/applocker_bypass.py, cli/commands/bitm.py, cli/commands/bof_registry.py, cli/commands/c2_profile.py, cli/commands/c2_session.py, cli/commands/caldera.py, cli/commands/campaign.py, cli/commands/catalog.py, cli/commands/cicd.py, cli/commands/cli_auth.py, cli/commands/cloud.py, cli/commands/collaboration.py, cli/commands/command_and_control.py, cli/commands/command_and_control_migrated.py, cli/commands/containers.py, cli/commands/cred.py, cli/commands/cred_migrated.py, cli/commands/crystal_ball.py, cli/commands/daemon_ctl.py, cli/commands/database.py, cli/commands/defaults.py, cli/commands/demo.py, cli/commands/dns_exfil.py, cli/commands/dpapi.py, cli/commands/edr_detect.py, cli/commands/encoding.py, cli/commands/enum.py, cli/commands/estorides.py, cli/commands/evasive_payload.py, cli/commands/exfiltration.py, cli/commands/exploit.py, cli/commands/exploit_migrated.py, cli/commands/exploitgym.py, cli/commands/help_ui.py, cli/commands/infra.py, cli/commands/lab.py, cli/commands/lateral.py, cli/commands/lateral_migrated.py, cli/commands/lazyloop.py, cli/commands/lazyops.py, cli/commands/marketplace.py, cli/commands/mcp_bridge.py, cli/commands/misc_migrated.py, cli/commands/mobile_macos.py, cli/commands/module_manager.py, cli/commands/nethelpers.py, cli/commands/payload_generation.py, cli/commands/persist.py, cli/commands/persist_migrated.py, cli/commands/phishing_wizard.py, cli/commands/pivoting.py, cli/commands/postexp.py, cli/commands/postexp_migrated.py, cli/commands/privilege_escalation.py, cli/commands/pwn.py, cli/commands/recon.py, cli/commands/recon_migrated.py, cli/commands/redteam_gym.py, cli/commands/resource_scripting.py, cli/commands/scan.py, cli/commands/scan_migrated.py, cli/commands/session_ops.py, cli/commands/shellsys.py, cli/commands/sleep_obfuscation.py, cli/commands/socks_proxy.py, cli/commands/supply_chain.py, cli/commands/surface.py, cli/commands/ux.py, contrib/legacy/lazysmbrelay.py, lazyc2.py, lazyc2/blueprints/phishing.py, lazyown.py, modules/atomic_cli.py, modules/c2_builder.py, modules/lazy_intel.py, modules/lazy_loop.py, modules/lazy_runner.py, modules/listener_manager.py, slack_c2_bot.py, tests/test_api_key_resolution.py, tests/test_boyscout_contracts.py, tests/test_fuzzy_picker.py, tests/test_lazy_worker_safety.py, tests/test_scope_guard.py, tests/test_security_hardening_v5.py, tests/test_single_implementation.py

  • needs_sudo (function) utils.py:323 def needs_sudo(command) -- Return True when any shell segment of the command runs sudo/doas.
  • sudo_available (function) utils.py:347 def sudo_available() -- Return whether passwordless sudo works here, cached per process.
  • redact_secrets (function) utils.py:376 def redact_secrets(text) -- Mask API keys and credentials embedded in a command line.
  • parse_ip_mac (function) utils.py:396 def parse_ip_mac(input_string) -- Extracts IP and MAC addresses from a formatted input string using a regular expression.
  • create_arp_packet (function) utils.py:418 def create_arp_packet(src_mac, src_ip, dst_ip, dst_mac) -- Constructs an ARP packet with the given source and destination IP and MAC addresses.
  • send_packet (function) utils.py:453 def send_packet(packet, iface) -- Sends a raw ARP packet over the specified network interface.
  • load_version (function) utils.py:471 def load_version() -- Load the version number from the 'version.json' file.
  • parse_bool (function) utils.py:497 def parse_bool(value) -- Interpret a configuration value as a boolean.
  • signal_handler (function) utils.py:515 def signal_handler(sig, frame) -- Handles signals such as Control + C and shows a message on how to exit.
  • activate_virtualenv (function) utils.py:540 def activate_virtualenv(venv_path) -- Activates a virtual environment and starts an interactive shell.
  • parse_proc_net_file (function) utils.py:565 def parse_proc_net_file(file_path) -- Internal function to parse a /proc/net file and extract network ports.
  • get_open_ports (function) utils.py:609 def get_open_ports() -- Internal function to get open TCP and UDP ports on the operating system.
  • rotate_char (function) utils.py:628 def rotate_char(c, shift) -- Internal function to rotate characters for ROT cipher.
  • get_network_info (function) utils.py:650 def get_network_info() -- Retrieves network interface information with their associated IP addresses.
  • get_git_info (function) utils.py:685 def get_git_info()
  • get_venv_info (function) utils.py:704 def get_venv_info()
  • getprompt (function) utils.py:725 def getprompt() -- Render the configurable Neon Box prompt for the cmd2 shell.
  • copy2clip (function) utils.py:743 def copy2clip(text) -- Copia el texto proporcionado al portapapeles usando xclip.
  • clean_output (function) utils.py:763 def clean_output(output) -- Removes color escape sequences and other non-printable characters.
  • teclado_usuario (function) utils.py:776 def teclado_usuario(filename) -- Processes a file to extract and display characters from specific write sequences.
  • salida_strace (function) utils.py:812 def salida_strace(filename) -- Lee un archivo, extrae texto desde secuencias de escritura y muestra el contenido reconstruido.
  • exploitalert (function) utils.py:848 def exploitalert(content) -- Process and display results from ExploitAlert.
  • packetstormsecurity (function) utils.py:887 def packetstormsecurity(content) -- Process and display results from PacketStorm Security.
  • nvddb (function) utils.py:925 def nvddb(content) -- Process and display results from the National Vulnerability Database.
  • find_ss (function) utils.py:971 def find_ss(keyword) -- Find CVEs in the National Vulnerability Database based on a keyword.
  • find_ea (function) utils.py:1033 def find_ea(keyword) -- Find exploits in ExploitAlert based on a keyword.
  • find_ps (function) utils.py:1083 def find_ps(keyword) -- Find exploits in PacketStorm Security based on a keyword.
  • run (function) utils.py:1115 def run(command) -- Executes a shell command using the subprocess module, capturing its output.
  • is_exist (function) utils.py:1174 def is_exist(file) -- Check if a file exists.
  • get_domain (function) utils.py:1203 def get_domain(url) -- Extracts the domain from a given URL.
  • generate_random_cve_id (function) utils.py:1220 def generate_random_cve_id() -- Generate a random CVE identifier in the form CVE-{year}-{code}.
  • generate_certificates (function) utils.py:1232 def generate_certificates() -- Generates a certificate authority (CA), client certificate, and client key.
  • generate_emails (function) utils.py:1315 def generate_emails(full_name, domain) -- Generate email permutations based on the provided full name and domain.
  • clean_url (function) utils.py:1375 def clean_url(host) -- Checks if the last character is a slash and removes it if so.
  • random_string (function) utils.py:1382 def random_string(length) -- Generates a random alphanumeric string.
  • generate_http_req (function) utils.py:1388 def generate_http_req(host, port, uri, custom_header, cmd) -- Generates an HTTP request with the Shellshock payload.
  • format_openssh_key (function) utils.py:1412 def format_openssh_key(raw_key) -- Formats a raw OpenSSH private key string to the correct OpenSSH format.
  • format_rsa_key (function) utils.py:1444 def format_rsa_key(raw_key) -- Formats a raw RSA private key string to the correct PEM format.
  • is_package_installed (function) utils.py:1475 def is_package_installed(package_name) -- Check if a Python package is installed.
  • extract (function) utils.py:1486 def extract(string, extract_flag) -- Extracts and processes specific hexadecimal sequences from a string based on a flag.
  • clean_html (function) utils.py:1510 def clean_html(html_string) -- Remove HTML tags from a string.
  • get_credentials (function) utils.py:1537 def get_credentials(file, ncred) -- Searches for credential files with the pattern 'credentials*.txt' and allows the user to select one.
  • obfuscate_payload (function) utils.py:1593 def obfuscate_payload(payload) -- Obfuscates a payload string by converting its characters into hexadecimal format, with additional comments for every...
  • read_payloads (function) utils.py:1618 def read_payloads(file_path) -- Reads a file containing payloads and returns a list of properly formatted strings.
  • inject_payloads (function) utils.py:1640 def inject_payloads(urls, payload_url, request_timeout) -- Sends HTTP requests to a list of URLs with injected payloads for testing XSS vulnerabilities.
  • send_request (function) utils.py:1665 def send_request(raw_url)
  • handle_forms (function) utils.py:1702 def handle_forms(content, url)
  • prompt (function) utils.py:1740 def prompt(label, default) -- Return the prompt in the function do_xss
  • add (function) utils.py:1748 def add(str_part, delimiter, i) -- Adds a delimiter between string parts if it's not the first part.
  • detect_delimiter (function) utils.py:1765 def detect_delimiter(foo_bar) -- Detects the delimiter used in the input string (e.g., "-", "_", ".").
  • transform (function) utils.py:1784 def transform(parts, delimiter, casing) -- Transforms a list of string parts based on the chosen casing style.
  • handle (function) utils.py:1814 def handle(input_str) -- Splits the input string into parts based on delimiters or mixed casing.
  • get_users_dic (function) utils.py:1844 def get_users_dic(txt) -- List all .txt files in the 'sessions/' directory and prompt the user to select one by number.
  • get_hash (function) utils.py:1879 def get_hash(dir) -- Searches for hash files with the pattern 'hash*.txt' and allows the user to select one.
  • is_digit (function) utils.py:1920 def is_digit(the_digit) -- Check if the given character is a digit.
  • crack_password (function) utils.py:1932 def crack_password(crypttext) -- Crack a Cisco Type 7 password.
  • get_terminal_size (function) utils.py:1972 def get_terminal_size()
  • halp (function) utils.py:1981 def halp() -- Display the help panel for the LazyOwn RedTeam Framework.
  • ensure_tmux_session (function) utils.py:2036 def ensure_tmux_session(session_name) -- Ensure that a tmux session is active.
  • get_xml (function) utils.py:2072 def get_xml(directory) -- Retrieves a list of XML files from the specified directory.
  • get_domain_from_xml (function) utils.py:2085 def get_domain_from_xml(xml_file) -- Extracts the first domain or IP address from an Nmap scan XML file.
  • shellcode_to_sylk (function) utils.py:2115 def shellcode_to_sylk(shellcode_path)
  • get_banner (function) utils.py:2140 def get_banner(ip, port)
  • list_binaries (function) utils.py:2157 def list_binaries(directory) -- List all executable binaries in the specified directory.
  • select_binary (function) utils.py:2177 def select_binary(binaries) -- Prompt the user to select a binary from a list.
  • decode (function) utils.py:2202 def decode(data) -- Decodes base64 data received from the server output.
  • get_command (function) utils.py:2220 def get_command(url, lhost) -- Reads a command from standard input and initiates a thread to send the command to the target server.
  • send_command (function) utils.py:2231 def send_command(cmd, url, lhost) -- Constructs and sends an SQL payload with xp_cmdshell and certutil for command execution and exfiltration.
  • activate_server (function) utils.py:2259 def activate_server(httpd, url, lhost) -- Activates the HTTP server and fetches the first command from the user.
  • Spray (function) utils.py:2270 def Spray(domain, users, password, target_url, wait, verbose, more_verbose)
  • ProcessResults (function) utils.py:2317 def ProcessResults(results, outfile)
  • generate_index (function) utils.py:2332 def generate_index(repo_dir) -- Generates an APT repository structure and index files for proper compatibility.
  • replace_variables (function) utils.py:2382 def replace_variables(command, variables) -- Replace variables in a command string with their corresponding values.
  • create_caldera_config (function) utils.py:2403 def create_caldera_config(file_path) -- Creates a Caldera configuration file with the specified content at the given file path.
  • extract_banners (function) utils.py:2499 def extract_banners(xml_file) -- Extract banner information from an XML file.
  • scrape_news (function) utils.py:2548 def scrape_news() -- Makes a request to the Hacker News page and extracts titles, links, and scores.
  • display_news (function) utils.py:2583 def display_news(titles, links, scores) -- Creates a pandas DataFrame and prints it, showing titles, links, and scores.
  • htmlify (function) utils.py:2597 def htmlify(data) -- Wrap C2 comms in html and html2 code to make requests look more legitimate
  • de_htmlify (function) utils.py:2608 def de_htmlify(data) -- Cleant wrap C2 comms of html and html2 code to get the command from request
  • is_port_in_use (function) utils.py:2620 def is_port_in_use(port, host)
  • return_creds (function) utils.py:2629 def return_creds()
  • query_arin_ip (function) utils.py:2643 def query_arin_ip(ip) -- Queries ARIN whois API for organization information of an IP address.
  • get_org (function) utils.py:2662 def get_org(data) -- Extracts organization name from ARIN whois response data.
  • load_adversary (function) utils.py:2679 def load_adversary()
  • replace_placeholders (function) utils.py:2685 def replace_placeholders(template, replacements) -- Replace placeholders in a template string with values from a dictionary.
  • replace_command_placeholders (function) utils.py:2703 def replace_command_placeholders(command, params) -- Replace placeholders in a command string with values from a params dictionary.
  • replace_match (function) utils.py:2721 def replace_match(match)
  • parse_nmap_csv (function) utils.py:2729 def parse_nmap_csv(csv_path)
  • query_ollama (function) utils.py:2743 def query_ollama(prompt, model) -- Sends query to Ollama and returns model response.
  • preprocess_llm_response (function) utils.py:2758 def preprocess_llm_response(response) -- Pre-process LLM response to handle common issues before YAML parsing
  • manual_yaml_extraction (function) utils.py:2793 def manual_yaml_extraction(content) -- Fallback method to manually extract YAML data from malformed content
  • create_synthetic_yaml (function) utils.py:2859 def create_synthetic_yaml(nmap_services) -- Create a basic synthetic YAML playbook when all else fails
  • parse_yaml_response (function) utils.py:2932 def parse_yaml_response(content) -- Improved function to extract and parse YAML content from LLM response with better error handling and recovery attempts
  • fix_common_yaml_issues (function) utils.py:2967 def fix_common_yaml_issues(yaml_content) -- Fixes common YAML formatting issues
  • aggressive_yaml_fix (function) utils.py:3007 def aggressive_yaml_fix(yaml_content) -- More aggressive YAML fixing for recovery attempts
  • save_playbook (function) utils.py:3038 def save_playbook(playbook_data, playbook_name) -- Guarda el playbook generado en disco
  • load_knowledge_base (function) utils.py:3050 def load_knowledge_base(knowledge_file) -- Carga la base de conocimientos personalizada.
  • anti_debug (function) utils.py:3058 def anti_debug()
  • create_msfshellcoder_parser (function) utils.py:3067 def create_msfshellcoder_parser()
  • load_user_aliases (function) utils.py:3087 def load_user_aliases() -- Carga los aliases del archivo JSON si existe.
  • SimpleHTTPRequestHandler.log_request (method) utils.py:3112 def log_request(self)
  • SimpleHTTPRequestHandler.log_message (method) utils.py:3115 def log_message(self)
  • SimpleHTTPRequestHandler.do_GET (method) utils.py:3118 def do_GET(self) -- Serve certutil callback using centralized payload config.
  • IP2ASN.__init__ (method) utils.py:3138 def __init__(self)
  • IP2ASN.open_file (method) utils.py:3143 def open_file(self, filename) -- Open and parse the IP-to-ASN file.
  • IP2ASN.open_reader (method) utils.py:3148 def open_reader(self, reader) -- Parse the reader stream, handling both regular and gzipped files.
  • IP2ASN.as_of_ip (method) utils.py:3188 def as_of_ip(self, ip) -- Return the ASN associated with the given IP address.
  • IP2ASN.as_name (method) utils.py:3203 def as_name(self, asn) -- Get the AS name by ASN.
  • IP2ASN.as_country (method) utils.py:3207 def as_country(self, asn) -- Get the country by ASN.
  • VulnerabilityScanner.__init__ (method) utils.py:3244 def __init__(self, user_agent, max_workers, sessions_dir, description_language) -- Initialize the scanner with configurable network and storage knobs.
  • VulnerabilityScanner.search_cves (method) utils.py:3270 def search_cves(self, service) -- Return CVE records matching the supplied service banner.
  • VulnerabilityScanner.persist (method) utils.py:3340 def persist(self, service, target, cves) -- Persist cves to sessions/vulns_<target>.json.
  • VulnerabilityScanner.pretty_print (method) utils.py:3377 def pretty_print(self, cves_details) -- Render cves_details as semicolon-separated rows in the shell.

Start

Wiki

Agent Docs

Recipes

Clone this wiki locally