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

Method GetResult

Gsensor/ShodanSensor.go:60–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58 s.PassWord = password
59}
60func (s *Shodan) GetResult() Result {
61 var result = Result{}
62 if s.Type != "ports" {
63 return result
64 }
65 uri := fmt.Sprintf("https://api.shodan.io/shodan/host/%s?key=MM72AkzHXdHpC8iP65VVEEVrJjp7zkgd&minify=true", s.Domain)
66 s.http.New("GET", uri)
67 s.http.Execute()
68 defer s.http.Close()
69 ret, _ := s.http.Byte()
70 shodanResult := ShodanResult{}
71 err := json.Unmarshal(ret, &shodanResult)
72 if err != nil {
73 log.Println("Shodan GetResult Error: ", err, " Domain: ", s.Domain)
74 return result
75 }
76 for _, v := range shodanResult.Ports {
77 port := Gconvert.Int2String(v)
78 result[s.Domain+":"+port] = s.Domain
79 }
80 return result
81}
82func (s *Shodan) Login(ReLogin bool) bool {
83
84 return true

Callers 1

TestShodanFunction · 0.95

Calls 5

Int2StringFunction · 0.92
NewMethod · 0.80
ExecuteMethod · 0.80
ByteMethod · 0.80
CloseMethod · 0.45

Tested by 1

TestShodanFunction · 0.76