mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-25 12:41:53 +08:00
增加-silent 静默扫描模式
This commit is contained in:
+1
-1
@@ -38,7 +38,7 @@ func Flag(Info *HostInfo) {
|
||||
flag.BoolVar(&Ping, "ping", false, "using ping replace icmp")
|
||||
flag.StringVar(&TmpOutputfile, "o", "result.txt", "Outputfile")
|
||||
flag.BoolVar(&TmpSave, "no", false, "not to save output log")
|
||||
flag.Int64Var(&WaitTime, "debug", 120, "every time to LogErr")
|
||||
flag.Int64Var(&WaitTime, "debug", 60, "every time to LogErr")
|
||||
flag.BoolVar(&Silent, "silent", false, "silent scan")
|
||||
flag.StringVar(&URL, "u", "", "url")
|
||||
flag.StringVar(&UrlFile, "uf", "", "urlfile")
|
||||
|
||||
+6
-8
@@ -30,7 +30,7 @@ func LogSuccess(result string) {
|
||||
|
||||
func SaveLog() {
|
||||
for result := range Results {
|
||||
if Silent == false {
|
||||
if Silent == false || strings.Contains(result, "[+]") || strings.Contains(result, "[*]") {
|
||||
fmt.Println(result)
|
||||
}
|
||||
if IsSave {
|
||||
@@ -55,13 +55,11 @@ func WriteFile(result string, filename string) {
|
||||
}
|
||||
|
||||
func LogError(errinfo interface{}) {
|
||||
if Silent == false {
|
||||
if WaitTime == 0 {
|
||||
fmt.Println(fmt.Sprintf("已完成 %v/%v %v", End, Num, errinfo))
|
||||
} else if (time.Now().Unix()-LogSucTime) > WaitTime && (time.Now().Unix()-LogErrTime) > WaitTime {
|
||||
fmt.Println(fmt.Sprintf("已完成 %v/%v %v", End, Num, errinfo))
|
||||
LogErrTime = time.Now().Unix()
|
||||
}
|
||||
if WaitTime == 0 {
|
||||
fmt.Println(fmt.Sprintf("已完成 %v/%v %v", End, Num, errinfo))
|
||||
} else if (time.Now().Unix()-LogSucTime) > WaitTime && (time.Now().Unix()-LogErrTime) > WaitTime {
|
||||
fmt.Println(fmt.Sprintf("已完成 %v/%v %v", End, Num, errinfo))
|
||||
LogErrTime = time.Now().Unix()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user