> For the complete documentation index, see [llms.txt](https://alham-rizvi.gitbook.io/alhamrizvi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alham-rizvi.gitbook.io/alhamrizvi/picoctf-writeups/picoctf/web-exploitation/north-south.md).

# North-South writeup

the application uses geo-based routing. only users from a specific region are allowed to access the real backend that contains the flag, while everyone else is redirected to a dummy service.

we are given an Nginx configuration. inspecting it reveals that routing depends on the client’s country code.

the logic is straightforward:

* if country code = `IS` → request goes to **North (real service)**
* otherwise → request goes to **South (fake service)**

so the entire challenge comes down to identifying what `IS` represents and bypassing the geo restriction.

looking up the country code:

```id="qk6n9x"
IS → Iceland
```

this means only requests coming from Iceland are routed to the actual backend.

instead of attacking the application directly, we manipulate our **apparent location**.

the simplest way is to use a VPN and connect to an Iceland server.

after switching the IP location to Iceland and reloading the application, the request is now routed to the **North server**, which contains the real functionality.

<img src="https://github.com/user-attachments/assets/83cf2b63-2bad-42fe-99ca-ba6b8a5a4d5c" alt="image" height="521" width="935">

## result

once routed correctly, the application returns the flag:

```id="8v1c9o"
picoCTF{g30_b453d_r0u71n9_6030bc08}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://alham-rizvi.gitbook.io/alhamrizvi/picoctf-writeups/picoctf/web-exploitation/north-south.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
