()
| 90 | } |
| 91 | |
| 92 | func (s *Fofa) GetPorts() { |
| 93 | s.result = Result{} |
| 94 | resp := s.send(`ip="` + s.Domain + `" && type=service`) |
| 95 | fofaresult := FofaResult{} |
| 96 | json.Unmarshal(resp, &fofaresult) |
| 97 | for _, v := range fofaresult.Results { |
| 98 | host := v[0] |
| 99 | if strings.Contains(host, "://") { |
| 100 | host = strings.Split(host, "://")[1] |
| 101 | } |
| 102 | s.result[host] = v[1] |
| 103 | } |
| 104 | } |
| 105 | func (s *Fofa) send(query string) []byte { |
| 106 | var result []byte |
| 107 | query = base64.StdEncoding.EncodeToString([]byte(query)) |