| 58 | s.PassWord = password |
| 59 | } |
| 60 | func (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 | } |
| 82 | func (s *Shodan) Login(ReLogin bool) bool { |
| 83 | |
| 84 | return true |