MCPcopy Index your code
hub / github.com/SummerSec/SpringExploit / SendPoc

Method SendPoc

cmd/commons/poc/demo.go:13–58  ·  view source on GitHub ↗
(target string, hashmap map[string]interface{})

Source from the content-addressed store, hash-verified

11type Demo struct{}
12
13func (d Demo) SendPoc(target string, hashmap map[string]interface{}) {
14
15 log.Debugf("[+] Running default poc")
16 //reqinfo := req2.NewReqInfo()
17 //reqmap := structs.Map(reqinfo)
18 reqmap := req2.NewReqInfoToMap(hashmap)
19 // TODO 每次传入的url 都是标准的 http(s)://host:port/path
20 // 可以使用 url.Parse 来解析获取 host 和 port
21 // for example:
22 //result, err := url.Parse(target)
23 //if err != nil {
24 // log.Debugln("[-] url parse error")
25 // log.Errorf("[-] url parse error: %s", err)
26 // return
27 //}
28 //target = result.Scheme + "://" + result.Host + result.Port() + "/" + result.Path
29
30 reqmap["url"] = target
31
32 // 请求方法
33 reqmap["method"] = "GET"
34 // 默认随机UA 不需要设置
35 reqmap["headers"] = map[string]string{
36 "User-Agent": utils.GetUA(),
37 }
38 // 请求body
39 reqmap["body"] = ""
40
41 // TODO 可以设置超时时间 重复次数 代理等 下面默认使用默认值
42 //reqmap["timeout"] = hashmap["Timeout"].(int)
43 //reqmap["retry"] = hashmap["Retry"].(int)
44 //reqmap["proxy"] = hashmap["Proxy"].(string)
45 //reqmap["mode"] = hashmap["Mode"].(int)
46 //reqmap["h1"] = hashmap["H1"].(bool)
47 // 发送请求, 获取响应 resp := utils.Send(reqmap)
48
49 resp := utils.Send(reqmap)
50 log.Debugln("[+] resp: ", resp.Dump())
51
52 // TODO check exp
53 d.CheckExp(resp, target, hashmap)
54
55 // TODO 保存结果
56 d.SaveResult(target, hashmap["Out"].(string))
57
58}
59
60func (d Demo) init() {
61 log.Debugln("[+] Registering Demo poc")

Callers

nothing calls this directly

Calls 4

CheckExpMethod · 0.95
SaveResultMethod · 0.95
GetUAFunction · 0.92
SendFunction · 0.92

Tested by

no test coverage detected