> For the complete documentation index, see [llms.txt](https://nbl.gitbook.io/nbl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nbl.gitbook.io/nbl/ctf-writeups/2025/ara-ctf-6.0.md).

# ARA CTF 6.0

Writeup for GeoGuessr Challenge.

{% embed url="<https://www.instagram.com/ara_its/>" %}

{% hint style="info" %} <mark style="color:green;">Problem Setter</mark>

Solve: <mark style="color:yellow;">1</mark> / <mark style="color:yellow;">128</mark>
{% endhint %}

| Challenge     | Category | Points |
| ------------- | -------- | ------ |
| GeoGuessr-Pro | Misc     | 500    |

## Misc

### GeoGuessr-Pro

#### Description

> How pro are you at the GeoGuessr? I challenge you to figure out the name of the area. But, this is a different GeoGuessr.
>
> flag format: ARA6{area\_name}
>
> replace spaces with underscores and use lowercase.
>
> Author: `nblirwn`

#### TL;DR

Reverse output gdal2tiles via tilemapresource.xml

#### Solve

Several files are provided:

* **original-modified.pgw**: A file containing spatial information for the raster image.
* **original-modified.png.aux.xml**: A metadata file from ArcGIS used to store additional information about the raster image.
* **original-modified.png**: The raster image file.
* **original-modified.png.ovr**: A file containing pyramid data for the raster image.
* **original-modified.png.xml**: An XML file containing metadata for the raster image.

Notice the **tile-output** folder. It contains file **tilemapresource.xml** and several directories. Therefore, **tile-output** folder is the output of the command `gdal2tiles -z 0-5 original.tif tile-output`.

{% hint style="info" %}
**gdal2tiles** is a tool for converting a raster file into a tile layer map (tile-output folder).
{% endhint %}

<figure><img src="https://1171059021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDs2RvECxJcIRt2CHIzzu%2Fuploads%2FhbkoMwBOTbKoU3J7Rc85%2FScreenshot%202025-02-09%20161901.png?alt=media&amp;token=76eae027-0cd6-4488-b453-0a4cf3b6d2ea" alt=""><figcaption></figcaption></figure>

Look at `<title>original.tif</title>`

By default, **gdal2tiles** places the original file name, which has been converted into a tile map, in the title of **tilemapresource.xml**.

How can player know this? You can search for what **tilemapresource.xml** is. You could even ask an AI.

<figure><img src="https://1171059021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDs2RvECxJcIRt2CHIzzu%2Fuploads%2FxU6tewrDQDUIgXacmKTP%2FScreenshot%202025-02-09%20162429.png?alt=media&amp;token=3f475e3d-6dda-4b61-9fba-4cafaeaa3ae4" alt=""><figcaption><p>I love ChatGPT</p></figcaption></figure>

Or, watch this video: <https://www.youtube.com/watch?v=31J3pPCStKw>

Resources:

{% embed url="<https://gdal.org/en/stable/programs/>" %}

So what do you need to do? first, check the raster file using **gdalinfo**.

```sh
gdalinfo original-modified.png
```

<figure><img src="https://1171059021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDs2RvECxJcIRt2CHIzzu%2Fuploads%2FqcQRS86OfjFF2GMww8D4%2FScreenshot%202025-02-09%20170433.png?alt=media&amp;token=0aa16ab1-3953-45ac-92ba-812e701a451c" alt=""><figcaption></figcaption></figure>

There is an invalid angle, so the raster file does not appear in the correct location when opened using ArcGIS, Tile Map, or other tools.

There are many ways to fix it. I fixed it by converting the **.png** extension to **.tif**, then using the corner coordinates data from original.tif, which can be obtained through **tilemapresource.xml**:

```xml
<BoundingBox minx="8.49940967600014" miny="44.68120028221342" maxx="11.42827153744795" maxy="46.63789675900006"/>
```

1. Convert to .**tif** using **gdal\_translate**:

```sh
gdal_translate -of GTiff original-modified.png original-modified.tif
```

2. Repair coordinates using **gdal\_edit**:

```sh
gdal_edit -a_ullr 8.49940967600014 46.63789675900006 11.42827153744795 44.68120028221342 original-modified.tif
```

Check using **gdalinfo**, and the invalid angle will disappear, file was fixed. Last, open the .**tif** using ArcGIS or convert the .**tif** to a tile map with 10-12 zoom level (to be able to see that area, because it is very small.).&#x20;

```sh
gdal2tiles -z 10-12 original-modified.tif solve
```

<figure><img src="https://1171059021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDs2RvECxJcIRt2CHIzzu%2Fuploads%2Fbmjo3CDEFYbUJrj8ELV6%2FScreenshot%202025-02-09%20171224.png?alt=media&amp;token=4757ae4d-8595-41d1-9731-c8952b0824a8" alt=""><figcaption><p>Output gdal2tiles</p></figcaption></figure>

Then, you will see that the raster points to Lentate sul Seveso.

<figure><img src="https://1171059021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDs2RvECxJcIRt2CHIzzu%2Fuploads%2FeGikE2YY1TOV0lO6Q8eg%2Fimage.png?alt=media&amp;token=96d3fc3d-1d0d-4a1d-84f3-724e38004154" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Flag: ***ARA6{lentate\_sul\_seveso}***
{% endhint %}
