mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-26 05:01:53 +08:00
feat: SDK agent integration + UDP plugin framework + SNMP plugin
SDK enhancements for endpoint agent embedding: - ScanWithController for pause/resume and live stats - OnProgress callback for periodic progress reporting - TaskID injection into every scan result - ScanController with goroutine-safe pause/resume/stats - Multi-target stats aggregation (race-free) UDP plugin infrastructure: - PluginTypeUDP registry with dedicated dispatch path - DialUDP on ScanSession with rate limiting and packet counting - UDP plugins bypass TCP port scan, probe targets directly - FilterService excludes UDP plugins from TCP port matching SNMP plugin (first UDP plugin): - SNMPv2c GetRequest probe for sysDescr detection - Community string brute force (public/private/community/etc) - Pure stdlib implementation (encoding/asn1) - Registered as safe default plugin on port 161/UDP Tests: 95.7% SDK coverage, race-free, 50+ new test cases
This commit is contained in:
@@ -211,6 +211,12 @@ func ExecuteScanTasks(ctx context.Context, session *common.ScanSession, targets
|
||||
default:
|
||||
}
|
||||
|
||||
if session.PauseGate != nil {
|
||||
if err := session.PauseGate(ctx); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
targetPort := target.Port
|
||||
|
||||
for _, pluginName := range pluginsToRun {
|
||||
@@ -262,6 +268,12 @@ func executeScanTask(ctx context.Context, session *common.ScanSession, pluginNam
|
||||
default:
|
||||
}
|
||||
|
||||
if session.PauseGate != nil {
|
||||
if err := session.PauseGate(ctx); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 长驻插件不进 WaitGroup,通过 ctx 管理生命周期
|
||||
if longRunningPlugins[pluginName] {
|
||||
ready := make(chan struct{}, 1)
|
||||
|
||||
Reference in New Issue
Block a user