Skip to content

Commit daacabc

Browse files
committed
修复没有指定poc时的bug
1 parent bfb7993 commit daacabc

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

cmd/commons/attack/attack.go

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,29 @@ func attack(url string, pocs map[string]interface{}, hashmap map[string]interfac
4444
p := hashmap["Pocs"].(string)
4545
// 以,分割,获取poc name 将其转换为数组
4646
pocsName := strings.Split(p, ",")
47-
var ps []string
48-
for _, v := range pocsName {
49-
log.Debugf("[*] 分割字符串 %s", v)
50-
ps = append(ps, v)
51-
}
47+
//log.Debugf("[*] Pocs: %s", pocsName)
48+
//var ps []string
49+
//if pocsName != nil {
50+
// for _, v := range pocsName {
51+
// log.Debugf("[*] 分割字符串 %s", v)
52+
// ps = append(ps, v)
53+
// }
54+
//}
5255
// 如果没有选定字符串 则默认所有pocs
53-
if len(ps) == 0 {
54-
log.Debugln("[*] attack all pocs")
56+
if len(pocsName) == 1 && pocsName[0] == "" {
57+
log.Info("[*] attack all pocs")
5558
for _, v := range pocs {
59+
log.Debugf("[*] attack poc %s", v)
5660
t := v.(poc.PoC)
5761
t.SendPoc(url, hashmap)
5862
}
5963
} else {
60-
for p := range ps {
61-
pocs[ps[p]].(poc.PoC).SendPoc(url, hashmap)
64+
for _, v := range pocsName {
65+
log.Info("[*] attack poc %s", v)
66+
if v != "" {
67+
t := pocs[v].(poc.PoC)
68+
t.SendPoc(url, hashmap)
69+
}
6270
}
6371
}
6472

cmd/commons/poc/2021/CVE-2021-26084.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (p CVE202126084) SendPoc(target string, hashmap map[string]interface{}) {
4343
if p.CheckExp(resp, target, hashmap) {
4444
context := target + " 存在CVE-2021-26084漏洞!" + target + "testAnt.jsp 蚁剑密码 ant "
4545
log.Info(context)
46-
p.SaveResult(target, file)
46+
p.SaveResult(context, file)
4747
}
4848

4949
}

cmd/commons/poc/2022/CVE-2022-22965.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ func (p CVE202222965) SendPoc(target string, hashmap map[string]interface{}) {
8181
time.Sleep(time.Second * 3)
8282

8383
r, _ := url.Parse(target)
84-
log.Debugf("[+] CVE202222965 poc success")
85-
res := r.Scheme + "://" + r.Host + "/" + shellname + ".jsp" + "?cmd=whoami or" + r.Scheme + "://" + r.Host + "/" + shellname1 + ".jsp 哥斯拉 pass key "
84+
log.Info("[+] CVE202222965 poc success")
85+
res := target + " 可能存在CVE202222965没有进行验证 手动验证: " + r.Scheme + "://" + r.Host + "/" + shellname + ".jsp" + "?cmd=whoami or " + r.Scheme + "://" + r.Host + "/" + shellname1 + ".jsp 哥斯拉 pass key "
8686
p.SaveResult(res, hashmap["Out"].(string))
8787

8888
// 第三个请求

0 commit comments

Comments
 (0)