MCPcopy Create free account
hub / github.com/code-scan/Goal / GetResult

Method GetResult

Gsensor/CrtSh.go:39–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37}
38
39func (s *CrtSh) GetResult() Result {
40 s.result = Result{}
41 if s.Type != "subdomain" {
42 return s.result
43 }
44
45 s.http.Get("https://crt.sh/?q=" + s.Domain)
46 s.http.Execute()
47 defer s.http.Close()
48 ret, err := s.http.Text()
49 if err != nil {
50 log.Println("[!] GetResult Error: ", err)
51 return s.result
52 }
53 reg := regexp.MustCompile(`<TD>(.*?)</TD>`)
54 r := reg.FindAllString(ret, -1)
55 for _, v := range r {
56 if strings.Contains(v, s.Domain) {
57 v = strings.ReplaceAll(v, "<TD>", "")
58 v = strings.ReplaceAll(v, "</TD>", "")
59 vs := strings.Split(v, "<BR>")
60 for _, d := range vs {
61 d = strings.ReplaceAll(d, "*.", "")
62 s.result[d] = "未解析"
63 }
64 }
65 }
66
67 return s.result
68}
69
70func (s *CrtSh) Login(_ bool) bool {
71 return true

Callers 1

TestCrtFunction · 0.95

Calls 4

GetMethod · 0.80
ExecuteMethod · 0.80
TextMethod · 0.80
CloseMethod · 0.45

Tested by 1

TestCrtFunction · 0.76