# [CTI] Shodan

## Introduction

Shodan est un moteur de recherche permettant de trouver des machines exposées sur Internet avec des filtres.

[![image.png](https://wiki.neopipe.fr/uploads/images/gallery/2024-10/scaled-1680-/mDpimage.png)](https://wiki.neopipe.fr/uploads/images/gallery/2024-10/mDpimage.png)

## Manuel

Vous pouvez accéder à l'interface de Shodan :

- [https://www.shodan.io/dashboard](https://www.shodan.io/dashboard)

#### Usage

```
<FILTER>:<VALUE>
```

#### Filtres

Voici quelques filtres courants :

<table border="1" id="bkmrk-filtres-ip-port-org-" style="border-collapse: collapse; width: 100%; height: 119.2px;"><colgroup><col style="width: 100%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td class="align-center" style="height: 29.8px;">**Filtres**  
</td></tr><tr style="height: 29.8px;"><td class="align-center" style="height: 29.8px;">ip  
</td></tr><tr><td class="align-center">port  
</td></tr><tr style="height: 29.8px;"><td class="align-center" style="height: 29.8px;">org  
</td></tr><tr style="height: 29.8px;"><td class="align-center" style="height: 29.8px;">country  
</td></tr><tr><td class="align-center">city  
</td></tr><tr><td class="align-center">product  
</td></tr><tr><td class="align-center">version  
</td></tr><tr><td class="align-center">os  
</td></tr></tbody></table>

Sinon voici la liste complète des filtres :

- [https://www.shodan.io/search/filters](https://www.shodan.io/search/filters)

#### Exemples

- Chercher des informations sur une IP spécifique :

```
ip:8.8.8.8
```

Chercher toutes les machines françaises de l'hébergeur Scaleway :

```
country:FR org:scaleway
```

Chercher toutes les machines Ubuntu ayant un service SSH :

```
os:ubuntu port:22
```

Vous pouvez retrouver plus d'exemples :

- [https://www.shodan.io/search/examples](https://www.shodan.io/search/examples)
- [https://github.com/BushidoUK/OSINT-SearchOperators/blob/main/ShodanQueriesAppliances.csv](https://github.com/BushidoUK/OSINT-SearchOperators/blob/main/ShodanQueriesAppliances.csv)

#### Analyse

Vous pouvez analyser les résultats rapidement grâce à la section **View Report** :

[![shodan-1.png](https://wiki.neopipe.fr/uploads/images/gallery/2024-10/scaled-1680-/shodan-1.png)](https://wiki.neopipe.fr/uploads/images/gallery/2024-10/shodan-1.png)

On voir les ports les plus exposés, les services les plus utilisés, les hébergeurs les plus utilisés pour ces machines etc :

[![image.png](https://wiki.neopipe.fr/uploads/images/gallery/2024-10/scaled-1680-/YsJimage.png)](https://wiki.neopipe.fr/uploads/images/gallery/2024-10/YsJimage.png)

Vous pouvez aussi consulter les statistiques pour cette query dans le temps grâce à l'onglet **Historical Trends** :

[![shodan-4.png](https://wiki.neopipe.fr/uploads/images/gallery/2024-10/scaled-1680-/shodan-4.png)](https://wiki.neopipe.fr/uploads/images/gallery/2024-10/shodan-4.png)

[![shodan-3.png](https://wiki.neopipe.fr/uploads/images/gallery/2024-10/scaled-1680-/shodan-3.png)](https://wiki.neopipe.fr/uploads/images/gallery/2024-10/shodan-3.png)

#### Tracking de serveurs C2

Certains filtres ont été mis en place pour chercher des serveurs de commande et contrôle (C2) :

- [https://github.com/BushidoUK/OSINT-SearchOperators/blob/main/ShodanAdversaryInfa.md](https://github.com/BushidoUK/OSINT-SearchOperators/blob/main/ShodanAdversaryInfa.md)

<table border="1" id="bkmrk-serveurs-c2-filtres-" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td class="align-center">**Serveurs C2**  
</td><td class="align-center">**Filtres**  
</td></tr><tr><td class="align-center">Metasploit

</td><td class="align-center">http.favicon.hash:-12788697

ssl:MetasploitSelfSignedCA

http.html:"msf4"

</td></tr><tr><td class="align-center">Cobalt Strike

</td><td class="align-center">ssl.jarm:07d14d16d21d21d07c42d41d00041d24a458a375eef0c576d23a7bab9a9fb1

port:443

ssl.cert.serial:146473198

product:"Cobalt Strike Beacon"

http.html:"cs4.4"

</td></tr><tr><td class="align-center">Brute Ratel  
</td><td class="align-center">http.html\_hash:-1957161625

product:"Brute Ratel C4"

</td></tr></tbody></table>

Vous pouvez aussi retrouver des **JARM** de C2 qui sont des empreintes des certificats par défaut :

- [https://github.com/BushidoUK/OSINT-SearchOperators/blob/main/ShodanAdversaryInfa.md](https://github.com/BushidoUK/OSINT-SearchOperators/blob/main/ShodanAdversaryInfa.md)

#### API

Pour utiliser l'API, il vous faut payer (une version premium à <span style="text-decoration: underline;">69$</span> payable en une seule fois vous autorise à 100 queries par mois).

Une fois votré clé API récupérée, vous pouvez initialiser shodan :

```bash
shodan init <API_KEY>
```

Pour faire une recherche :

```bash
shodan search "<QUERY>"
```

Pour trouver des informations sur une IP :

```bash
shodan host <IP>
```

Pour télécharger les résultats d'une recherche au format **JSON** :

```bash
shodan download <OUTPUT>.json "<QUERY>"
```

Pour consulter les résultats :

```bash
shodan parse <OUTPUT>.json
```

Ou alors :

```bash
cat <OUTPUT>.json | jq
```