{"record":{"id":"babe4dbc646365fc","repo":"shadow1ng/fscan","slug":"i18n-gettext-ms17010-port-only","errorCode":null,"errorMessage":"i18n.GetText(\"ms17010_port_only\")","messagePattern":"i18n\\.GetText\\(\"ms17010_port_only\"\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"plugins/services/ms17010.go","lineNumber":46,"sourceCode":"// NewMS17010Plugin 创建MS17010插件\nfunc NewMS17010Plugin() *MS17010Plugin {\n\treturn &MS17010Plugin{\n\t\tBasePlugin: plugins.NewBasePlugin(\"ms17010\"),\n\t}\n}\n\n// GetPorts 实现Plugin接口\n\n// Scan 执行MS17-010扫描\nfunc (p *MS17010Plugin) Scan(ctx context.Context, info *common.HostInfo, session *common.ScanSession) *ScanResult {\n\ttarget := info.Target()\n\n\t// 检查端口\n\tif info.Port != 445 {\n\t\treturn &ScanResult{\n\t\t\tSuccess: false,\n\t\t\tService: \"ms17010\",\n\t\t\tError:   fmt.Errorf(\"%s\", i18n.GetText(\"ms17010_port_only\")),\n\t\t}\n\t}\n\n\t// 执行MS17010漏洞检测\n\tvulnerable, osVersion, hasBackdoor, err := p.checkMS17010Vulnerability(ctx, info.Host, session)\n\tif err != nil {\n\t\treturn &ScanResult{\n\t\t\tSuccess: false,\n\t\t\tService: \"ms17010\",\n\t\t\tError:   err,\n\t\t}\n\t}\n\n\tif vulnerable {\n\t\tmsg := fmt.Sprintf(\"MS17-010 %s\", target)\n\t\tif osVersion != \"\" {\n\t\t\tmsg += fmt.Sprintf(\" [%s]\", osVersion)\n\t\t}","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/services/ms17010.go#L28-L64","documentation":"The MS17-010 (EternalBlue) plugin only supports SMB on TCP port 445. During Scan, if info.Port is anything other than 445, it immediately returns an unsuccessful ScanResult with the localized 'ms17010_port_only' message instead of attempting the check.","triggerScenarios":"A plugin dispatch/scan entry passes a HostInfo whose Port != 445 — e.g. the scan targets 139 (NetBIOS) or an arbitrary port where SMB was detected.","commonSituations":"Scanning legacy hosts exposing SMB only over NetBIOS port 139; service-discovery mapping SMB to a nonstandard port behind NAT/port-forwarding; misconfigured scan target lists.","solutions":["Ensure the target list contains hosts with port 445 open (or scan 445 explicitly)","If SMB is only on 139, port-forward or test 445 directly; the check requires native port 445","Fix upstream service-detection so SMB hosts are reported with their 445 endpoint","For nonstandard forwarded ports, adjust the plugin check to accept the mapped port knowingly"],"exampleFix":"// before (target spec)\nhosts: [{host: \"10.0.0.5\", port: 139}]\n// after\nhosts: [{host: \"10.0.0.5\", port: 445}]","handlingStrategy":"validation","validationCode":"if info.Port != 445 {\n    return errors.New(\"ms17010 check requires port 445\")\n}","typeGuard":"func isSMBTarget(info HostInfo) bool {\n    return info.Port == 445\n}","tryCatchPattern":"res := plugin.Scan(ctx, info, session)\nif res.Error != nil && strings.Contains(fmt.Sprint(res.Error), \"port\") {\n    log.Infof(\"skipping MS17-10 on %s:%d — needs 445\", info.Host, info.Port)\n    return nil\n}","preventionTips":["Filter scan targets to hosts with 445/tcp open before dispatching the plugin","Ensure service discovery reports the SMB endpoint on 445, not 139","For NAT/port-forwarded SMB, remap targets to the original 445 port"],"tags":["ms17010","smb","port","precondition"],"backgroundTag":"invalid-argument-value","analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}