> For the complete documentation index, see [llms.txt](https://j0luuuu.gitbook.io/ctf/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://j0luuuu.gitbook.io/ctf/kpmg-ctf-2023/otp-portal-intrigue.md).

# OTP Portal Intrigue

## Description

> Your mission, should you choose to accept it, is to infiltrate a mysterious portal secured by OTP authentication.\
> `159.65.146.255`

## Solution

* We are provided with an IP address: `159.65.146.255`
* Performing an `nmap` scan on it, we find the FTP port open.
* We can login to the FTP server using anonymous.
* Upon listing the files in the FTP server, we find a file named `my_database.sql`.
* We can download the file and view its contents. `mget my_database.sql`
* On opening the file, we find the credentials`admin:admin` and a `TOTP`\
  `YDTN2JY6CWKSK6PB3HNOAY4APASUVREM`

![sql file](/files/M4fo4ctDKtWosvGP3Koj)

* On doing some research on TOTP, we find that it is a Time-based One-Time Password algorithm.
* We can add `YDTN2JY6CWKSK6PB3HNOAY4APASUVREM` to Google Authenticator and login with the credentials we found from the **SQL** file.
* We are asked for an OTP.
* Entering the OTP which is displayed in the Google Authenticator app, we get the flag.
* Flag:\
  `KPMG_CTF{324b7e52953f62f1624fb64a2e8202e4}`


---

# 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:

```
GET https://j0luuuu.gitbook.io/ctf/kpmg-ctf-2023/otp-portal-intrigue.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.
