> For the complete documentation index, see [llms.txt](https://ret2basic.gitbook.io/ctfnote/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ret2basic.gitbook.io/ctfnote/web/prerequisites/information-gathering/editor.md).

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