fix: 修复长驻插件启动竞态,删除重复的 bashrc 插件

- 修复 forwardshell/reverseshell/socks5proxy 因竞态导致主进程提前退出
- 删除与 shellenv 功能重复的 bashrc 插件
This commit is contained in:
ZacharyZcR
2026-05-16 00:12:21 +08:00
parent a42f074b00
commit 5af8682d22
4 changed files with 7 additions and 113 deletions
+7
View File
@@ -227,12 +227,19 @@ func executeScanTask(ctx context.Context, session *common.ScanSession, pluginNam
// 长驻插件不进 WaitGroup,通过 ctx 管理生命周期
if longRunningPlugins[pluginName] {
ready := make(chan struct{}, 1)
go func() {
plugin := plugins.Get(pluginName)
if plugin != nil {
// 给主线程一点时间让 state 标记生效
go func() {
time.Sleep(500 * time.Millisecond)
ready <- struct{}{}
}()
plugin.Scan(ctx, &target, session)
}
}()
<-ready
return
}