{"record":{"id":"26901f37d8eccf68","repo":"bettercap/bettercap","slug":"could-not-find-original-destination-in-pf-state-ta","errorCode":null,"errorMessage":"could not find original destination in pf state table for %s -> %s","messagePattern":"could not find original destination in pf state table for (.+?) -> (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/ssh_proxy/ssh_origdst_darwin.go","lineNumber":79,"sourceCode":"\t\t\t\tarrowPositions = append(arrowPositions, i)\n\t\t\t}\n\t\t}\n\n\t\tif len(arrowPositions) >= 2 {\n\t\t\t// The field before the first arrow is the source\n\t\t\t// The field between the two arrows is the original destination\n\t\t\torigDstIdx := arrowPositions[0] + 1\n\t\t\tif origDstIdx < len(fields) {\n\t\t\t\torigDst := fields[origDstIdx]\n\t\t\t\t// Validate it looks like host:port\n\t\t\t\tif _, _, err := net.SplitHostPort(origDst); err == nil {\n\t\t\t\t\treturn origDst, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn \"\", fmt.Errorf(\"could not find original destination in pf state table for %s -> %s\", remoteAddr, localAddr)\n}\n","sourceCodeStart":61,"sourceCodeEnd":81,"githubUrl":"https://github.com/bettercap/bettercap/blob/8eca2820f3c41d2004434ed5a291d87462caeeb7/modules/ssh_proxy/ssh_origdst_darwin.go#L61-L81","documentation":"Raised in getOriginalDst (macOS) after parsing the pf state table when no entry matches the connection's remote->local pair or the candidate field does not look like host:port. The connection was not created by an pf rdr rule (or its state already expired), so the original destination cannot be recovered.","triggerScenarios":"Thrown at modules/ssh_proxy/ssh_origdst_darwin.go:79 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the pf rdr rule matches the proxied traffic","Set ssh.address explicitly to hardcode the upstream destination"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8eca2820f3c41d2004434ed5a291d87462caeeb7","analyzedAt":"2026-09-02T12:49:00.712Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}