From fead00683037a63dd8539bd0f2950e6fcc5db142 Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Sun, 10 Aug 2025 06:06:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=8D=E5=BC=B9shel?= =?UTF-8?q?l=E8=BF=9E=E6=8E=A5=E5=86=B2=E7=AA=81=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E7=A7=92=E6=96=AD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除Connect方法中的连通性测试,避免抢占反弹shell连接通道 - 清理未使用的time包导入 - 提高反弹shell连接的稳定性和成功率 --- Plugins/local/reverseshell/plugin.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Plugins/local/reverseshell/plugin.go b/Plugins/local/reverseshell/plugin.go index 6a9dd9a..aeab707 100644 --- a/Plugins/local/reverseshell/plugin.go +++ b/Plugins/local/reverseshell/plugin.go @@ -11,7 +11,6 @@ import ( "runtime" "strconv" "strings" - "time" "github.com/shadow1ng/fscan/common" "github.com/shadow1ng/fscan/plugins/base" @@ -106,13 +105,9 @@ func (c *ReverseShellConnector) Connect(ctx context.Context, info *common.HostIn baseConn := localConn.(*local.LocalConnection) - // 测试目标地址连通性 - conn, err := net.DialTimeout("tcp", fmt.Sprintf("%s:%d", c.host, c.port), 5*time.Second) - if err != nil { - return nil, fmt.Errorf("无法连接到目标地址 %s:%d: %v", c.host, c.port, err) - } - conn.Close() - + // 跳过连通性测试,避免抢占反弹shell连接通道 + // 反弹shell会在实际使用时进行连接,这里不需要预先测试 + reverseShellConn := &ReverseShellConnection{ LocalConnection: baseConn, Target: fmt.Sprintf("%s:%d", c.host, c.port),