mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-09-14 14:06:44 +08:00
feat: tcp端口扫描支持socks5
This commit is contained in:
parent
03b21f92f1
commit
0511acb2d9
@ -407,8 +407,8 @@ func (i *Info) Write(msg []byte) error {
|
||||
_, err := i.Conn.Write(msg)
|
||||
if err != nil && strings.Contains(err.Error(), "close") {
|
||||
i.Conn.Close()
|
||||
// 连接关闭时重试
|
||||
i.Conn, err = net.DialTimeout("tcp4", fmt.Sprintf("%s:%d", i.Address, i.Port), time.Duration(6)*time.Second)
|
||||
// 连接关闭时重试 - 支持SOCKS5代理
|
||||
i.Conn, err = Common.WrapperTcpWithTimeout("tcp", fmt.Sprintf("%s:%d", i.Address, i.Port), time.Duration(6)*time.Second)
|
||||
if err == nil {
|
||||
i.Conn.SetWriteDeadline(time.Now().Add(time.Second * time.Duration(WrTimeout)))
|
||||
_, err = i.Conn.Write(msg)
|
||||
|
@ -6,7 +6,6 @@ import (
|
||||
"github.com/shadow1ng/fscan/Common"
|
||||
"golang.org/x/sync/errgroup"
|
||||
"golang.org/x/sync/semaphore"
|
||||
"net"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
@ -53,8 +52,8 @@ func EnhancedPortScan(hosts []string, ports string, timeout int64) []string {
|
||||
g.Go(func() error {
|
||||
defer sem.Release(1)
|
||||
|
||||
// 连接测试
|
||||
conn, err := net.DialTimeout("tcp", addr, to)
|
||||
// 连接测试 - 支持SOCKS5代理
|
||||
conn, err := Common.WrapperTcpWithTimeout("tcp", addr, to)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user