# Editor

## gedit Tilde Files (flag\~)

gedit generates a backup file with the `~` suffix when a file gets edited. For example, if the file `flag` was edited in gedit, gedit would generate a backup file named `flag~`. This file might be accessbile through URL:

```
http://<ip>:<port>/flag~
```

## Vim Swap Files (.flag.swp)

When vim crashes, it generates a swap file (.swp) to backup the content being editing. For example, if vim crashes when editing the file `flag`, it generates a backup file named `.flag.swp`. If we have access to this backup file, we can recover the flag:

```bash
$ wget <path>/.flag.swp
$ touch flag
$ vim -r flag
```

Interestingly enough, vim assigns different names for different crashes:

* **First crash:** `.flag.swp`
* **Second crash:** `.flag.swo`
* **Third crash:** `.flag.swn`


---

# 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://ret2basic.gitbook.io/ctfnote/web/prerequisites/information-gathering/editor.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.
