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

Method GetPorts

Gsensor/FofaSensor.go:92–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

90}
91
92func (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}
105func (s *Fofa) send(query string) []byte {
106 var result []byte
107 query = base64.StdEncoding.EncodeToString([]byte(query))

Callers 1

GetResultMethod · 0.95

Calls 1

sendMethod · 0.95

Tested by

no test coverage detected