|
| 1 | +package poc |
| 2 | + |
| 3 | +import ( |
| 4 | + req2 "github.com/SummerSec/SpringExploit/cmd/commons/req" |
| 5 | + "github.com/SummerSec/SpringExploit/cmd/commons/utils" |
| 6 | + "github.com/imroc/req/v3" |
| 7 | + log "github.com/sirupsen/logrus" |
| 8 | +) |
| 9 | + |
| 10 | +type IsAliveUrl struct{} |
| 11 | + |
| 12 | +func (t IsAliveUrl) SendPoc(target string, hashmap map[string]interface{}) { |
| 13 | + //reqmap := req2.NewReqInfoToMap(hashmap) |
| 14 | + //reqmap["url"] = target |
| 15 | + //reqmap["method"] = "HEAD" |
| 16 | + //reqmap["timeout"] = "3" |
| 17 | + //headers := map[string]string{ |
| 18 | + // "User-Agent": utils.GetUA(), |
| 19 | + //} |
| 20 | + //reqmap["headers"] = headers |
| 21 | + //resp := utils.Send(reqmap) |
| 22 | + //if t.CheckExp(resp,target,hashmap) { |
| 23 | + // log.Infof("[+] %s is alive", target) |
| 24 | + //} |
| 25 | + |
| 26 | +} |
| 27 | + |
| 28 | +func (t IsAliveUrl) SaveResult(target string, file string) { |
| 29 | + // nothing to do |
| 30 | +} |
| 31 | + |
| 32 | +func (t IsAliveUrl) CheckExp(resp *req.Response, target string, hashmap map[string]interface{}) bool { |
| 33 | + reqmap := req2.NewReqInfoToMap(hashmap) |
| 34 | + reqmap["url"] = target |
| 35 | + reqmap["method"] = "HEAD" |
| 36 | + headers := map[string]string{ |
| 37 | + "User-Agent": utils.GetUA(), |
| 38 | + } |
| 39 | + reqmap["headers"] = headers |
| 40 | + resp2 := utils.Send(reqmap) |
| 41 | + log.Debug(resp2.Dump()) |
| 42 | + if resp2.Dump() == "" { |
| 43 | + return false |
| 44 | + } |
| 45 | + return true |
| 46 | +} |
0 commit comments