支持-u url或者-uf url.txt,进行url批量扫描

This commit is contained in:
shadow1ng
2021-03-04 14:42:10 +08:00
parent 423c0bebea
commit 5e7def5085
16 changed files with 65 additions and 26 deletions
+10
View File
@@ -49,6 +49,16 @@ func Scan(info common.HostInfo) {
AddScan(scantype, info, ch, &wg)
}
}
if common.URL != "" {
info.Url = common.URL
AddScan("1000003", info, ch, &wg)
}
if len(common.Urls) > 0 {
for _, url := range common.Urls {
info.Url = url
AddScan("1000003", info, ch, &wg)
}
}
wg.Wait()
common.WaitSave()
}
+16 -8
View File
@@ -13,19 +13,25 @@ import (
func WebTitle(info *common.HostInfo) error {
var CheckData []WebScan.CheckDatas
if info.Ports == "80" {
info.Url = fmt.Sprintf("http://%s", info.Host)
} else if info.Ports == "443" {
info.Url = fmt.Sprintf("https://%s", info.Host)
if info.Url == "" {
if info.Ports == "80" {
info.Url = fmt.Sprintf("http://%s", info.Host)
} else if info.Ports == "443" {
info.Url = fmt.Sprintf("https://%s", info.Host)
} else {
info.Url = fmt.Sprintf("http://%s:%s", info.Host, info.Ports)
}
} else {
info.Url = fmt.Sprintf("http://%s:%s", info.Host, info.Ports)
if !strings.Contains(info.Url, "://") {
info.Url = fmt.Sprintf("http://%s", info.Url)
}
}
err, result, CheckData := geturl(info, true, CheckData)
if err != nil {
return err
}
if result == "https" {
err, _, CheckData = geturl(info, true, CheckData)
if err != nil {
@@ -43,7 +49,6 @@ func WebTitle(info *common.HostInfo) error {
if common.IsWebCan == false {
WebScan.WebScan(info)
}
return err
}
@@ -58,8 +63,11 @@ func geturl(info *common.HostInfo, flag bool, CheckData []WebScan.CheckDatas) (e
res.Header.Set("Accept", "*/*")
res.Header.Set("Accept-Language", "zh-CN,zh;q=0.9")
res.Header.Set("Accept-Encoding", "gzip, deflate")
if common.Pocinfo.Cookie != "" {
res.Header.Set("Cookie", common.Pocinfo.Cookie)
}
if flag == true {
res.Header.Set("Cookie", "rememberMe=1")
res.Header.Set("Cookie", "rememberMe=1;"+common.Pocinfo.Cookie)
}
res.Header.Set("Connection", "close")
resp, err := lib.Client.Do(res)