Update memcached.go

This commit is contained in:
影舞者 2023-11-13 10:47:36 +08:00 committed by GitHub
parent 9d02632dcc
commit 88745f55a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,22 +2,21 @@ package Plugins
import (
"fmt"
"github.com/shadow1ng/fscan/common"
"strings"
"time"
"github.com/shadow1ng/fscan/common"
)
func MemcachedScan(info common.HostInfo, flags common.Flags) (err error) {
func MemcachedScan(info *common.HostInfo) (err error) {
realhost := fmt.Sprintf("%s:%v", info.Host, info.Ports)
client, err := common.WrapperTcpWithTimeout("tcp", realhost, common.Socks5{Address: flags.Socks5Proxy}, time.Duration(flags.Timeout)*time.Second)
client, err := common.WrapperTcpWithTimeout("tcp", realhost, time.Duration(common.Timeout)*time.Second)
defer func() {
if client != nil {
client.Close()
}
}()
if err == nil {
err = client.SetDeadline(time.Now().Add(time.Duration(flags.Timeout) * time.Second))
err = client.SetDeadline(time.Now().Add(time.Duration(common.Timeout) * time.Second))
if err == nil {
_, err = client.Write([]byte("stats\n")) //Set the key randomly to prevent the key on the server from being overwritten
if err == nil {