# John Hammond

## Spy Cam <a href="#spy-cam" id="spy-cam"></a>

### Énoncé <a href="#enonce" id="enonce"></a>

Oh no! I found some spyware on my laptop. Can you find out what the attacker saw?

[capture.pcap](https://onosh.github.io/ctf/bsidesbos/download/capture.pcap)

### Analyse du trafic <a href="#analyse-du-trafic" id="analyse-du-trafic"></a>

Dans cette capture, nous avons un grand trafic TCP avec une seule et unique requête http :

![](https://i.imgur.com/rWyfrJ2.png)

Cette requête HTTP vient interroger un serveur web qui écoute sur le port 8081 pour récupérer une image :

![](https://i.imgur.com/ryiDB6N.png)

Nous avons la réponse à cette demande dans les trames TCP qui suivent. Il va donc falloir reconstituer l'image...

![](https://i.imgur.com/uWUnJVG.png)

### Récupération de l'image <a href="#recuperation-de-limage" id="recuperation-de-limage"></a>

Nous savons que l'émetteur de l'image est le serveur qui écoute sur le port 8081... nous devons donc récupérer les trames TCP qui proviennent de ce port :

J'applique le filtre tcp.srcport == 8081

![](https://i.imgur.com/y6AEaDu.png)

2000 trames ressortent, ça va être compliqué de faire ça à la main... un peu de tshark s'impose !

J'utilise la commande suivante pour extraitre les données et reconstituer l'image :

```
tshark -r capture.pcap -T fields -e tcp.segment_data -Y "tcp.srcport == 8081" |xxd -r -p >myimage.jpg
```

Petit problème, on a un bout de la requête HTTP dans le fichier image :

![](https://i.imgur.com/tIocpoe.png)

Du coup je l'enlève à la mano, et maintenant j'ai bien une image au format jpeg :

![](https://i.imgur.com/qi0yMHZ.png)

### Analyse de l'image <a href="#analyse-de-limage" id="analyse-de-limage"></a>

Nous pouvons maintenant ouvrir l'image

![](https://i.imgur.com/W9TpCha.png)

Okay cool... un téléphone ?... et maintenant ?

### Récupération de données dans l'image <a href="#recuperation-de-donnees-dans-limage" id="recuperation-de-donnees-dans-limage"></a>

Le challenge est dans la catégorie forensic, je décide d'extraire quelques infos avec foremost !

![](https://i.imgur.com/Usdu0uA.png)

Haha, il y avait des images cachés !

![](https://i.imgur.com/lQuhqms.png)

Le téléphone à l'air de faire défiler un texte...

Il ne reste plus qu'a reconstituer le flag :

![](https://i.imgur.com/0ECUjgs.png)

![](https://i.imgur.com/lQofyOI.png)

![](https://i.imgur.com/rqQUvdC.png)

![](https://i.imgur.com/mcs9m3X.png)

![](https://i.imgur.com/atG9bA3.png)

![](https://i.imgur.com/r6Udbd7.png)

![](https://i.imgur.com/U9c5lva.png)

**flag{i\_spy\_with\_my\_little\_eye}**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.onosh.ovh/ctf/john-hammond.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
