mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-26 21:21:53 +08:00
initial cleanup
This commit is contained in:
+10
-8
@@ -2,12 +2,13 @@ package Plugins
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/shadow1ng/fscan/WebScan/lib"
|
||||
"github.com/shadow1ng/fscan/common"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/shadow1ng/fscan/WebScan/lib"
|
||||
"github.com/shadow1ng/fscan/common"
|
||||
)
|
||||
|
||||
func Scan(info common.HostInfo) {
|
||||
@@ -23,7 +24,7 @@ func Scan(info common.HostInfo) {
|
||||
web := strconv.Itoa(common.PORTList["web"])
|
||||
ms17010 := strconv.Itoa(common.PORTList["ms17010"])
|
||||
if len(Hosts) > 0 || len(common.HostPort) > 0 {
|
||||
if common.NoPing == false && len(Hosts) > 0 {
|
||||
if !common.NoPing && len(Hosts) > 0 {
|
||||
Hosts = CheckLive(Hosts, common.Ping)
|
||||
fmt.Println("[*] Icmp alive hosts len is:", len(Hosts))
|
||||
}
|
||||
@@ -31,7 +32,7 @@ func Scan(info common.HostInfo) {
|
||||
common.LogWG.Wait()
|
||||
return
|
||||
}
|
||||
common.GC()
|
||||
|
||||
var AlivePorts []string
|
||||
if common.Scantype == "webonly" || common.Scantype == "webpoc" {
|
||||
AlivePorts = NoPortScan(Hosts, info.Ports)
|
||||
@@ -52,7 +53,7 @@ func Scan(info common.HostInfo) {
|
||||
common.HostPort = nil
|
||||
fmt.Println("[*] AlivePorts len is:", len(AlivePorts))
|
||||
}
|
||||
common.GC()
|
||||
|
||||
var severports []string //severports := []string{"21","22","135"."445","1433","3306","5432","6379","9200","11211","27017"...}
|
||||
for _, port := range common.PORTList {
|
||||
severports = append(severports, strconv.Itoa(port))
|
||||
@@ -85,16 +86,17 @@ func Scan(info common.HostInfo) {
|
||||
}
|
||||
}
|
||||
}
|
||||
common.GC()
|
||||
|
||||
for _, url := range common.Urls {
|
||||
info.Url = url
|
||||
AddScan(web, info, &ch, &wg)
|
||||
}
|
||||
common.GC()
|
||||
|
||||
wg.Wait()
|
||||
common.LogWG.Wait()
|
||||
close(common.Results)
|
||||
fmt.Println(fmt.Sprintf("已完成 %v/%v", common.End, common.Num))
|
||||
|
||||
fmt.Printf("Finished %d/%d", common.End, common.Num)
|
||||
}
|
||||
|
||||
var Mutex = &sync.Mutex{}
|
||||
|
||||
Reference in New Issue
Block a user