From 19d969acd2d39740a327a176ce7c24fd278c2403 Mon Sep 17 00:00:00 2001 From: shadow1ng Date: Mon, 25 Dec 2023 17:57:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=8F=E8=94=BDgo=E5=86=85=E9=83=A8=E5=BA=93?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebScan/lib/client.go | 7 +++---- common/log.go | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/WebScan/lib/client.go b/WebScan/lib/client.go index 7bdb0c8..cbc5754 100644 --- a/WebScan/lib/client.go +++ b/WebScan/lib/client.go @@ -9,11 +9,10 @@ import ( "github.com/shadow1ng/fscan/common" "golang.org/x/net/proxy" "gopkg.in/yaml.v2" - "io/ioutil" - "log" "net" "net/http" "net/url" + "os" "strings" "time" ) @@ -35,7 +34,7 @@ func Inithttp() { } err := InitHttpClient(common.PocNum, common.Proxy, time.Duration(common.WebTimeout)*time.Second) if err != nil { - log.Fatal(err) + panic(err) } } @@ -247,7 +246,7 @@ func SelectPoc(Pocs embed.FS, pocname string) []string { func LoadPocbyPath(fileName string) (*Poc, error) { p := &Poc{} - data, err := ioutil.ReadFile(fileName) + data, err := os.ReadFile(fileName) if err != nil { fmt.Printf("[-] load poc %s error3: %v\n", fileName, err) return nil, err diff --git a/common/log.go b/common/log.go index 9c41662..7f48f51 100644 --- a/common/log.go +++ b/common/log.go @@ -4,6 +4,8 @@ import ( "encoding/json" "fmt" "github.com/fatih/color" + "io" + "log" "os" "strings" "sync" @@ -13,7 +15,6 @@ import ( var Num int64 var End int64 var Results = make(chan *string) -var Start = true var LogSucTime int64 var LogErrTime int64 var WaitTime int64 @@ -28,6 +29,7 @@ type JsonText struct { } func init() { + log.SetOutput(io.Discard) LogSucTime = time.Now().Unix() go SaveLog() }