{
  "report_info": {
    "version": "9.0.1",
    "generated_at": "2026-06-08T16:22:06Z",
    "binary_name": "dns-leak"
  },
  "binary": {
    "name": "dns-leak",
    "path": "/opt/kodachi/dashboard/hooks/dns-leak",
    "timestamp": "2026-06-08T16:22:06Z",
    "file_info": {
      "size": 5641248,
      "sha256": "06a08b066cf88feff9e6966d0951d7495607fa8f641909c42fd5cfe21a92d2d0"
    },
    "flag_n": {
      "command": "info",
      "data": {
        "author": "Warith Al Maawali",
        "copyright": "© 2026 Linux Kodachi",
        "description": "DNS leak detection and analysis for Kodachi OS",
        "features": [
          "Network interface discovery and validation",
          "DNS leak detection via challenge-response testing",
          "Geolocation-based leak analysis",
          "Multi-interface simultaneous testing",
          "Detailed test reporting with JSON export",
          "System resolver configuration analysis"
        ],
        "license": "Proprietary",
        "name": "dns-leak",
        "securityFeatures": {
          "authentication": "Secure authentication for sensitive operations",
          "encryption": "HTTPS for all external API communications",
          "inputValidation": "All interface names and IDs are sanitized and validated",
          "rateLimiting": "Built-in retry limits and timeouts for DNS queries"
        },
        "systemRequirements": {
          "dependencies": [
            "Network interfaces",
            "DNS resolver access",
            "Internet connectivity for leak testing"
          ],
          "os": "Linux (Debian-based, specifically Kodachi OS)",
          "privileges": "root/sudo for network interface access"
        },
        "version": "9.0.1",
        "website": "https://digi77.com"
      },
      "errors": [],
      "metadata": {
        "executionTime": 1,
        "hostname": "REDACTED-BUILD-HOST",
        "user": "REDACTED-BUILD-USER"
      },
      "status": "success",
      "timestamp": "2026-06-08T16:22:06.100573322Z",
      "version": "9.0.1",
      "warnings": []
    },
    "flag_v": {
      "command": "version",
      "data": {
        "buildDate": "REDACTED-BUILD-TIME",
        "gitCommit": "108458e790ab73d65ccc5529f5d2c1497c733ecd",
        "name": "dns-leak",
        "rustVersion": "1.96.0",
        "version": "9.0.1"
      },
      "errors": [],
      "metadata": {
        "executionTime": 1,
        "hostname": "REDACTED-BUILD-HOST",
        "user": "REDACTED-BUILD-USER"
      },
      "status": "success",
      "timestamp": "2026-06-08T16:22:06.174173151Z",
      "version": "9.0.1",
      "warnings": []
    },
    "flag_h": {
      "command": "help",
      "data": {
        "commandCategories": [
          {
            "category": "Network Discovery",
            "commands": [
              {
                "description": "Discover network interfaces available for testing",
                "examples": [
                  "dns-leak discover",
                  "dns-leak discover --json",
                  "dns-leak discover --verbose"
                ],
                "name": "discover",
                "options": [
                  {
                    "description": "Enable verbose output",
                    "flag": "-V, --verbose",
                    "required": false
                  }
                ],
                "requires_sudo": false,
                "usage": "dns-leak discover [OPTIONS]"
              }
            ]
          },
          {
            "category": "DNS Leak Testing",
            "commands": [
              {
                "description": "Run DNS leak test on specified interface or all interfaces",
                "examples": [
                  "dns-leak test",
                  "dns-leak test --interface eth0",
                  "dns-leak test --json"
                ],
                "name": "test",
                "options": [
                  {
                    "default": "all interfaces",
                    "description": "Specify a network interface to test",
                    "flag": "-i, --interface <INTERFACE>",
                    "required": false
                  }
                ],
                "requires_sudo": false,
                "usage": "dns-leak test [OPTIONS]"
              }
            ]
          },
          {
            "category": "Reporting",
            "commands": [
              {
                "description": "Generate a detailed report of a previous test",
                "examples": [
                  "dns-leak report --id dns_leak_results_<TIMESTAMP>",
                  "dns-leak report --id dns_leak_results_<TIMESTAMP> --json"
                ],
                "name": "report",
                "options": [
                  {
                    "description": "Test ID to generate report for",
                    "flag": "-r, --id <ID>",
                    "required": true
                  }
                ],
                "requires_sudo": false,
                "usage": "dns-leak report -r <ID>"
              },
              {
                "description": "Display results from a previous DNS leak test",
                "examples": [
                  "dns-leak results --file test_results.json",
                  "dns-leak results --file test_results.json --json"
                ],
                "name": "results",
                "options": [
                  {
                    "description": "Path to the results JSON file",
                    "flag": "-f, --file <FILE>",
                    "required": true
                  }
                ],
                "requires_sudo": false,
                "usage": "dns-leak results --file <FILE>"
              }
            ]
          }
        ],
        "description": "DNS leak detection and analysis for Kodachi OS",
        "dnsLeakDetectionMethods": [
          "Real DNS resolution (system resolver, unique challenge subdomains per test run)",
          "External API verification (challenge-response correlation)",
          "Direct DNS server comparison and geolocation analysis",
          "Country-based DNS server leak detection",
          "System resolver configuration analysis"
        ],
        "environmentVariables": [
          {
            "default": "info",
            "description": "Set logging level",
            "name": "RUST_LOG",
            "values": "error|warn|info|debug|trace"
          },
          {
            "default": "unset",
            "description": "Disable all colored output when set",
            "name": "NO_COLOR",
            "values": "1|true|yes (any value disables color)"
          }
        ],
        "exitCodes": {
          "0": "Success",
          "1": "General error",
          "2": "Invalid arguments",
          "3": "Permission denied",
          "4": "Network error",
          "5": "File not found",
          "6": "Authentication required",
          "7": "DNS leak detected"
        },
        "globalOptions": [
          {
            "description": "Print help information",
            "flag": "-h, --help"
          },
          {
            "description": "Print version information",
            "flag": "-v, --version"
          },
          {
            "description": "Display detailed information",
            "flag": "-n, --info"
          },
          {
            "description": "Show usage examples",
            "flag": "-e, --examples"
          },
          {
            "description": "Output in JSON format",
            "flag": "--json"
          },
          {
            "description": "Force output format (text|json)",
            "flag": "-o, --output-format <FORMAT>"
          },
          {
            "description": "Pretty-print JSON output",
            "flag": "--json-pretty"
          },
          {
            "description": "Enable verbose output",
            "flag": "--verbose"
          },
          {
            "description": "Suppress non-essential output",
            "flag": "--quiet"
          },
          {
            "description": "Disable colored output",
            "flag": "--no-color"
          },
          {
            "description": "Set timeout (default: 30)",
            "flag": "--timeout <SECS>"
          },
          {
            "description": "Retry attempts (default: 3)",
            "flag": "--retry <COUNT>"
          },
          {
            "description": "DNS query timeout (default: 5)",
            "flag": "--dns-timeout <SECS>"
          },
          {
            "description": "Specify network interface to test",
            "flag": "-i, --interface <IF>"
          },
          {
            "description": "Show unmasked public IP in output and saved files (default: masked)",
            "flag": "--show-public-ip"
          },
          {
            "description": "Keep all result files (default: older files pruned for privacy)",
            "flag": "--keep-all"
          }
        ],
        "interfaceSpecifications": {
          "commonInterfaces": "eth0, ens33, enp2s0, enp2s1, eno1, wlan0, wlx18a6f71995d8, tun0, tailscale0, br0",
          "notes": [
            "If no interface specified, all active interfaces will be tested",
            "Loopback interface (lo) is automatically excluded from testing",
            "Supports Predictable Network Interface Names (enp*, ens*, eno*, enx*)",
            "Includes USB wireless adapters (wlx*) and VPN tunnels (tun*, tailscale*)"
          ]
        },
        "name": "dns-leak",
        "outputFormats": {
          "json": "Machine-readable output suitable for automation (use --json flag)",
          "standard": "Human-readable text output with colored status indicators"
        },
        "usage": "dns-leak [OPTIONS] [COMMAND] [ARGS]"
      },
      "errors": [],
      "metadata": {
        "executionTime": 1,
        "hostname": "REDACTED-BUILD-HOST",
        "user": "REDACTED-BUILD-USER"
      },
      "status": "success",
      "timestamp": "2026-06-08T16:22:06.237578762Z",
      "version": "9.0.1",
      "warnings": []
    },
    "flag_e": {
      "command": "examples",
      "data": {
        "categories": [
          {
            "description": "Common operations",
            "examples": [
              {
                "command": "sudo dns-leak discover",
                "description": "List all network interfaces available for DNS leak testing",
                "expectedOutput": "List of all network interfaces"
              },
              {
                "command": "sudo dns-leak discover --json",
                "description": "List interfaces in JSON format for automation",
                "expectedOutput": "JSON response with interface details"
              },
              {
                "command": "sudo dns-leak test",
                "description": "Test all active interfaces for DNS leaks",
                "expectedOutput": "Shows DNS leak status for each interface"
              },
              {
                "command": "sudo dns-leak test --interface eth0",
                "description": "Test specific interface (eth0) for DNS leaks",
                "expectedOutput": "DNS leak test results for eth0"
              },
              {
                "command": "sudo dns-leak test --interface ens33",
                "description": "Test ethernet interface (ens33) for DNS leaks",
                "expectedOutput": "DNS leak test results for ens33"
              },
              {
                "command": "sudo dns-leak test --interface wlan0",
                "description": "Test wireless interface for DNS leaks",
                "expectedOutput": "DNS leak test results for wlan0"
              },
              {
                "command": "sudo dns-leak test --interface wlx18a6f71995d8",
                "description": "Test USB wireless interface for DNS leaks",
                "expectedOutput": "DNS leak test results for USB wireless adapter"
              },
              {
                "command": "sudo dns-leak test --interface tun0",
                "description": "Test VPN tunnel interface for DNS leaks",
                "expectedOutput": "DNS leak test results for VPN tunnel"
              },
              {
                "command": "sudo dns-leak test --interface tailscale0",
                "description": "Test Tailscale VPN interface for DNS leaks",
                "expectedOutput": "DNS leak test results for Tailscale"
              },
              {
                "command": "sudo dns-leak test --interface enp2s0",
                "description": "Test PCIe ethernet interface for DNS leaks",
                "expectedOutput": "DNS leak test results for PCIe ethernet"
              },
              {
                "command": "sudo dns-leak test --interface enp2s1",
                "description": "Test secondary PCIe ethernet interface for DNS leaks",
                "expectedOutput": "DNS leak test results for secondary PCIe ethernet"
              },
              {
                "command": "sudo dns-leak test --interface eno1",
                "description": "Test onboard ethernet interface for DNS leaks",
                "expectedOutput": "DNS leak test results for onboard ethernet"
              },
              {
                "command": "sudo dns-leak test --interface br0",
                "description": "Test bridge interface for DNS leaks",
                "expectedOutput": "DNS leak test results for bridge interface"
              },
              {
                "command": "sudo dns-leak test --json",
                "description": "Run tests with JSON output for automation",
                "expectedOutput": "JSON response with structured data"
              }
            ],
            "id": "1_basic_usage",
            "title": "Basic Usage"
          },
          {
            "description": "Complex operations",
            "examples": [
              {
                "command": "sudo dns-leak report --id dns_leak_results_<TIMESTAMP>",
                "description": "Generate HTML report from test results",
                "expectedOutput": "HTML report saved to results directory",
                "notes": "Replace <TIMESTAMP> with an actual ID from a prior `dns-leak test` run. Use the filename prefix (without .json) as the ID. List available IDs with `ls /opt/kodachi/dashboard/hooks/results/dns_leak_results_*.json`."
              },
              {
                "command": "sudo dns-leak report --id dns_leak_results --json",
                "description": "Generate report with JSON output",
                "expectedOutput": "JSON status of report generation",
                "notes": "Will search for files containing the ID in results directory"
              },
              {
                "command": "sudo dns-leak test --timeout 30 --retry 3",
                "description": "Use custom timeout and retry settings",
                "expectedOutput": "Test with custom timeout and retries"
              },
              {
                "command": "dns-leak --info",
                "description": "Show detailed program information",
                "expectedOutput": "Program details and features"
              },
              {
                "command": "sudo dns-leak results --file dns_leak_results_<TIMESTAMP>.json",
                "description": "Display results from a saved test file",
                "expectedOutput": "Formatted test results display",
                "notes": "Replace <TIMESTAMP> with an actual filename from a prior `dns-leak test` run. Searches in current dir and results directory."
              },
              {
                "command": "sudo dns-leak results --file dns_leak_results.json --json",
                "description": "Display results as JSON",
                "expectedOutput": "JSON formatted results",
                "notes": "Can use just filename if file is in results directory"
              }
            ],
            "id": "2_advanced_usage",
            "title": "Advanced Usage"
          },
          {
            "description": "Examples for automation and scripting",
            "examples": [
              {
                "command": "sudo dns-leak test --json | jq '.data.potential_leak_detected'",
                "description": "Extract leak detection status using jq",
                "expectedOutput": "Boolean indicating whether a DNS leak was detected"
              },
              {
                "command": "sudo dns-leak discover --json | jq '.data.interfaces[].name'",
                "description": "Get list of interface names for scripting",
                "expectedOutput": "List of interface names suitable for loops"
              }
            ],
            "id": "3_automation_examples",
            "title": "Automation Examples"
          },
          {
            "description": "Getting information about the tool",
            "examples": [
              {
                "command": "dns-leak --version",
                "description": "Show version number",
                "expectedOutput": "Version information"
              },
              {
                "command": "dns-leak --version --json",
                "description": "Version in JSON format",
                "expectedOutput": "Structured version data"
              },
              {
                "command": "dns-leak --info",
                "description": "Show detailed program information",
                "expectedOutput": "Program features and requirements"
              },
              {
                "command": "dns-leak --info --json",
                "description": "Program info in JSON format",
                "expectedOutput": "Structured program information"
              },
              {
                "command": "dns-leak --help",
                "description": "Show help information",
                "expectedOutput": "Usage instructions"
              },
              {
                "command": "dns-leak --help --json",
                "description": "Help in JSON format",
                "expectedOutput": "Structured help data"
              },
              {
                "command": "dns-leak --examples",
                "description": "Show usage examples",
                "expectedOutput": "Detailed examples"
              },
              {
                "command": "dns-leak --examples --json",
                "description": "Examples in JSON format",
                "expectedOutput": "Structured example data"
              }
            ],
            "id": "4_program_information",
            "title": "Program Information"
          },
          {
            "description": "Advanced configuration and timeout settings",
            "examples": [
              {
                "command": "sudo dns-leak test --timeout=30 --retry=3",
                "description": "Use custom timeout and retry settings",
                "expectedOutput": "Test with custom timeout (30s) and retry count (3)",
                "notes": "Timeout range: 1-300 seconds, Retry count: 1-20"
              },
              {
                "command": "sudo dns-leak test --dns-timeout=10",
                "description": "Use custom DNS query timeout",
                "expectedOutput": "Test with custom DNS timeout (10s)",
                "notes": "DNS timeout range: 1-60 seconds"
              },
              {
                "command": "sudo dns-leak discover --verbose",
                "description": "Enable verbose output for interface discovery",
                "expectedOutput": "Detailed interface information with additional metadata",
                "notes": "Use -VV for maximum verbosity"
              },
              {
                "command": "sudo dns-leak test --interface=eth0 --verbose",
                "description": "Run DNS leak test with verbose output",
                "expectedOutput": "Detailed test output with debug information"
              }
            ],
            "id": "5_configuration_options",
            "title": "Configuration Options"
          }
        ],
        "description": "Usage examples for dns-leak",
        "name": "dns-leak",
        "quickReference": [
          "dns-leak --help",
          "dns-leak --version",
          "dns-leak --info --json",
          "dns-leak --examples --json"
        ]
      },
      "errors": [],
      "metadata": {
        "executionTime": 1,
        "hostname": "REDACTED-BUILD-HOST",
        "user": "REDACTED-BUILD-USER"
      },
      "status": "success",
      "timestamp": "2026-06-08T16:22:06.358766875Z",
      "version": "9.0.1",
      "warnings": []
    }
  }
}
