mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
优化报错处理
This commit is contained in:
+2
-2
@@ -40,8 +40,8 @@ func PortScan(hostslist []string, ports string, timeout int64) []string {
|
||||
sort.Ints(probePorts)
|
||||
}
|
||||
workers := common.Threads
|
||||
Addrs := make(chan Addr, len(hostslist)*len(probePorts))
|
||||
results := make(chan string, len(hostslist)*len(probePorts))
|
||||
Addrs := make(chan Addr, 100)
|
||||
results := make(chan string, 100)
|
||||
var wg sync.WaitGroup
|
||||
|
||||
//接收结果
|
||||
|
||||
@@ -112,6 +112,11 @@ func AddScan(scantype string, info common.HostInfo, ch *chan struct{}, wg *sync.
|
||||
}
|
||||
|
||||
func ScanFunc(name *string, info *common.HostInfo) {
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
fmt.Printf("[-] %v:%v scan error: %v\n", info.Host, info.Ports, err)
|
||||
}
|
||||
}()
|
||||
f := reflect.ValueOf(PluginList[*name])
|
||||
in := []reflect.Value{reflect.ValueOf(info)}
|
||||
f.Call(in)
|
||||
|
||||
Reference in New Issue
Block a user