mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-09-14 14:06:44 +08:00
增加silent 静默扫描模式
This commit is contained in:
parent
cd53258f0d
commit
ef6a196de7
@ -39,6 +39,7 @@ func Flag(Info *HostInfo) {
|
||||
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.BoolVar(&Silent, "silent", false, "silent scan")
|
||||
flag.StringVar(&URL, "u", "", "url")
|
||||
flag.StringVar(&UrlFile, "uf", "", "urlfile")
|
||||
flag.StringVar(&Pocinfo.PocName, "pocname", "", "use the pocs these contain pocname, -pocname weblogic")
|
||||
|
@ -15,6 +15,7 @@ var Start = true
|
||||
var LogSucTime int64
|
||||
var LogErrTime int64
|
||||
var WaitTime int64
|
||||
var Silent bool
|
||||
var LogWG sync.WaitGroup
|
||||
|
||||
func LogSuccess(result string) {
|
||||
@ -29,7 +30,9 @@ func LogSuccess(result string) {
|
||||
|
||||
func SaveLog() {
|
||||
for result := range Results {
|
||||
if Silent == false {
|
||||
fmt.Println(result)
|
||||
}
|
||||
if IsSave {
|
||||
WriteFile(result, Outputfile)
|
||||
}
|
||||
@ -52,12 +55,14 @@ 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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func CheckErrs(err error) bool {
|
||||
|
Loading…
Reference in New Issue
Block a user