{"record":{"id":"ddab4cff43297818","repo":"shadow1ng/fscan","slug":"webscan-nuclei-no-http-rules","errorCode":"webscan_nuclei_no_http_rules","errorMessage":"webscan_nuclei_no_http_rules","messagePattern":"webscan_nuclei_no_http_rules","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"webscan/lib/poc_adapter.go","lineNumber":272,"sourceCode":"\t\t\t\tHeaders: httpReq.Headers,\n\t\t\t\tBody:    httpReq.Body,\n\t\t\t}\n\n\t\t\t// 转换matchers为expression\n\t\t\tif len(httpReq.Matchers) > 0 {\n\t\t\t\texpr := convertNucleiMatchers(httpReq.Matchers, httpReq.MatchersCondition)\n\t\t\t\trule.Expression = expr\n\t\t\t} else {\n\t\t\t\t// 默认检查200状态码\n\t\t\t\trule.Expression = \"response.status == 200\"\n\t\t\t}\n\n\t\t\tpoc.Rules = append(poc.Rules, rule)\n\t\t}\n\t}\n\n\tif len(poc.Rules) == 0 {\n\t\treturn nil, fmt.Errorf(\"%s\", i18n.GetText(\"webscan_nuclei_no_http_rules\"))\n\t}\n\n\treturn poc, nil\n}\n\nfunc normalizeNucleiPath(path string) string {\n\tpath = strings.TrimSpace(path)\n\tpath = strings.TrimPrefix(path, \"{{BaseURL}}\")\n\tpath = strings.TrimPrefix(path, \"{{RootURL}}\")\n\tif path == \"\" {\n\t\treturn \"/\"\n\t}\n\treturn path\n}\n\n// convertNucleiMatchers 转换Nuclei matchers为fscan expression\nfunc convertNucleiMatchers(matchers []NucleiMatcher, matchersCondition string) string {\n\tvar conditions []string","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/webscan/lib/poc_adapter.go#L254-L290","documentation":"ToFscanPoc converts a NucleiPoc into fscan-style rules by mapping each nuclei HTTP request definition to a Rule. If no HTTP request rules could be extracted (the nuclei template only contains non-HTTP protocols or nothing mappable), the conversion fails with webscan_nuclei_no_http_rules rather than returning an empty POC.","triggerScenarios":"Calling ToFscanPoc on a NucleiPoc whose Requests/Rules contain zero convertible HTTP entries — e.g., dns://, network://, or workflows-only templates — leaving poc.Rules empty after conversion.","commonSituations":"Converting nuclei template bundles wholesale; many community templates target DNS/TCP/network protocols that fscan rules can't represent; templates using only matchers without an http block.","solutions":["Only convert nuclei templates that contain http: request blocks; filter templates by protocol first.","Skip or log non-HTTP templates (dns/network/workflow) instead of converting them.","If a template should be convertible, check its http block structure against the mapping code above the len(poc.Rules)==0 check.","Write an equivalent fscan POC manually for non-HTTP targets."],"exampleFix":"// before\nfor _, tpl := range templates {\n    fpoc, err := tpl.ToFscanPoc() // fails for dns/network templates\n    ...\n}\n\n// after\nfor _, tpl := range templates {\n    if !tpl.HasHTTPRequests() { continue }\n    fpoc, err := tpl.ToFscanPoc()\n    ...\n}","handlingStrategy":"validation","validationCode":"func hasHTTPRules(np *NucleiPoc) bool {\n    for _, r := range np.Requests {\n        if strings.EqualFold(r.Type, \"http\") || r.Type == \"\" {\n            return true\n        }\n    }\n    return false\n}","typeGuard":null,"tryCatchPattern":"fpoc, err := np.ToFscanPoc()\nif err != nil {\n    if strings.Contains(err.Error(), \"webscan_nuclei_no_http_rules\") {\n        return nil // non-HTTP template, skip\n    }\n    return err\n}","preventionTips":["Filter nuclei templates to http-protocol ones before conversion.","Skip dns/network/workflow templates explicitly and log them.","Prefer templates with concrete http request blocks over matcher-only templates."],"tags":["poc","nuclei","conversion","empty-result"],"backgroundTag":"empty-result-set","analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}