{"record":{"id":"b9b4c35e5171766d","repo":"projectdiscovery/nuclei","slug":"headless-mode-headless-is-required-if-ho-sb","errorCode":null,"errorMessage":"headless mode (-headless) is required if -ho, -sb, -sc or -lha are set","messagePattern":"headless mode \\(-headless\\) is required if -ho, -sb, -sc or -lha are set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/runner/options.go","lineNumber":160,"sourceCode":"\n// validateOptions validates the configuration options passed\nfunc ValidateOptions(options *types.Options) error {\n\tif err := validateOptions.Struct(options); err != nil {\n\t\tif _, ok := err.(*validator.InvalidValidationError); ok {\n\t\t\treturn err\n\t\t}\n\t\terrs := []string{}\n\t\tfor _, err := range err.(validator.ValidationErrors) {\n\t\t\terrs = append(errs, err.Namespace()+\": \"+err.Tag())\n\t\t}\n\t\treturn errors.Wrap(errors.New(strings.Join(errs, \", \")), \"validation failed for these fields\")\n\t}\n\tif options.Verbose && options.Silent {\n\t\treturn errors.New(\"both verbose and silent mode specified\")\n\t}\n\n\tif (options.HeadlessOptionalArguments != nil || options.ShowBrowser || options.UseInstalledChrome) && !options.Headless {\n\t\treturn errors.New(\"headless mode (-headless) is required if -ho, -sb, -sc or -lha are set\")\n\t}\n\n\tif options.FollowHostRedirects && options.FollowRedirects {\n\t\treturn errors.New(\"both follow host redirects and follow redirects specified\")\n\t}\n\tif options.ShouldFollowHTTPRedirects() && options.DisableRedirects {\n\t\treturn errors.New(\"both follow redirects and disable redirects specified\")\n\t}\n\t// loading the proxy server list from file or cli and test the connectivity\n\tif err := loadProxyServers(options); err != nil {\n\t\treturn err\n\t}\n\tif options.Validate {\n\t\tvalidateTemplatePaths(options.Logger, config.DefaultConfig.TemplatesDirectory, options.Templates, options.Workflows)\n\t}\n\tif options.DAST {\n\t\tif err := validateDASTOptions(options); err != nil {\n\t\t\treturn err","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/internal/runner/options.go#L142-L178","documentation":"Nuclei configures its network dialer during protocol state initialization. When both -source-ip and -interface are set, isIpAssociatedWithInterface must confirm the IP is assigned to that interface; a mismatch aborts startup. This prevents binding traffic to an address the OS would not route through that interface.","triggerScenarios":"nuclei -source-ip 192.168.1.10 -interface eth0 where eth0 holds a different address or only IPv6; equivalent lib/nuclei options with both fields set.","commonSituations":"VPN environments where the IP lives on utun/wg0 while the flag names eth0; container or NAT setups; command lines copied between machines.","solutions":["Run ip addr show <interface> and use one of its addresses in -source-ip","Point -interface at the interface that actually owns the IP","Drop one of the two flags and let the other drive selection alone"],"exampleFix":"# before\nnuclei -source-ip 10.0.0.5 -interface eth0   # eth0 actually has 192.168.1.20\n# after\nnuclei -source-ip 192.168.1.20 -interface eth0","handlingStrategy":"validation","validationCode":"import \"net\"\n\nfunc ipOnInterface(ip, iface string) bool {\n    i, err := net.InterfaceByName(iface)\n    if err != nil {\n        return false\n    }\n    addrs, _ := i.Addrs()\n    for _, a := range addrs {\n        if ipnet, ok := a.(*net.IPNet); ok && ipnet.IP.String() == ip {\n            return true\n        }\n    }\n    return false\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive -source-ip from ip addr output instead of hard-coding","In scripts, resolve the interface's address dynamically","Drop -interface when unsure; -source-ip alone is enough"],"tags":["network","cli","configuration","startup"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}