This commit is contained in:
影舞者 2022-05-12 17:56:32 +08:00
parent 4915539fb3
commit 11fb239c61
4 changed files with 6 additions and 5 deletions

View File

@ -97,11 +97,11 @@ func AddScan(scantype string, info common.HostInfo, ch chan struct{}, wg *sync.W
common.Num += 1
Mutex.Unlock()
ScanFunc(PluginList, scantype, &info)
wg.Done()
Mutex.Lock()
common.End += 1
Mutex.Unlock()
<-ch
wg.Done()
}()
ch <- struct{}{}
}

View File

@ -194,7 +194,6 @@ func executePoc(oReq *http.Request, p *Poc) (bool, error, string) {
for k, v := range rule.Headers {
newRequest.Header.Set(k, v)
}
resp, err := DoRequest(newRequest, rule.FollowRedirects)
if err != nil {
return false, err

View File

@ -12,10 +12,10 @@ import (
)
func Parse(Info *HostInfo) {
ParseScantype(Info)
ParseUser(Info)
ParsePass(Info)
ParseInput(Info)
ParseScantype(Info)
}
func ParseUser(Info *HostInfo) {

View File

@ -11,7 +11,10 @@ func ParsePort(ports string) (scanPorts []int) {
}
slices := strings.Split(ports, ",")
for _, port := range slices {
port = strings.Trim(port, " ")
port = strings.TrimSpace(port)
if port == "" {
continue
}
upper := port
if strings.Contains(port, "-") {
ranges := strings.Split(port, "-")
@ -28,7 +31,6 @@ func ParsePort(ports string) (scanPorts []int) {
port = ranges[1]
upper = ranges[0]
}
}
start, _ := strconv.Atoi(port)
end, _ := strconv.Atoi(upper)