From 9ef5cac5784db0f02590dae73979a23c4ee87364 Mon Sep 17 00:00:00 2001 From: sairson Date: Sun, 9 Jan 2022 14:42:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dping=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E9=97=AE=E9=A2=98,=E5=A2=9E=E5=8A=A0switch?= =?UTF-8?q?=E4=B8=AD=E7=9A=84default=E5=8F=82=E6=95=B0=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=97=A5=E5=BF=97=E5=90=8D=E4=B8=BA=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E7=9A=84Yasso.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/all.go | 4 +++- cmd/logger.go | 2 +- main.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/all.go b/cmd/all.go index 9ac0213..4dc5a9e 100644 --- a/cmd/all.go +++ b/cmd/all.go @@ -34,6 +34,9 @@ func init() { } func allRun(hostString string, portString string, log bool, runtime int, noping bool) { + defer func() { + fmt.Println("[Yasso] scan task is completed") + }() var ( ips []string ports []int @@ -124,5 +127,4 @@ func allRun(hostString string, portString string, log bool, runtime int, noping fmt.Println("----- [Yasso] Start do web service scan -----") DisMapScan(alive, webports) } - fmt.Println("[Yasso] scan task is completed") } diff --git a/cmd/logger.go b/cmd/logger.go index 4076b3c..640a965 100644 --- a/cmd/logger.go +++ b/cmd/logger.go @@ -15,7 +15,7 @@ func Println(s string) { fmt.Println("[!] open log file failed", err) return } - file.WriteString("\n" + s) + _, _ = file.WriteString("\n" + s) } func CreateLogFile(filename string) { diff --git a/main.go b/main.go index 056beeb..ac4d2a7 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,7 @@ import ( ) func init() { - cmd.CreateLogFile("result.txt") + cmd.CreateLogFile("Yasso.log") } func main() {