> For the complete documentation index, see [llms.txt](https://www.pentestwiki.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pentestwiki.com/post-exploit/protocols/6379-redis.md).

# 6379 - redis

redis는 데이터를 디스크가 아닌 메모리에 저장한 뒤, 스냅샷 등의 방식으로 영속성도 지원하는 오픈소스 데이터베이스 서비스입니다.

일반적으로 사용자 토큰을 저장하는 목적으로 데이터베이스 앞 단에 두어 캐시 히트(cache hit)를 기대하기 때문에, redis 내부에서 사용자 토큰을 탈취할 수 있습니다.

{% hint style="info" %}
redis는 기본적으로 익명 연결을 허용합니다.
{% endhint %}

## Abuse

<pre class="language-bash"><code class="lang-bash"><strong># 데이터 슬롯 변경 (0~15까지 존재)
</strong>select '&#x3C;slot-number>'

<strong># 현재 슬롯의 모든 key 조회
</strong>keys *

<strong># strings 데이터 기반 값조회
</strong>get '&#x3C;string-key>'

<strong># hashes 데이터 기반 값조회
</strong>hgetall '&#x3C;hashes-key>'
</code></pre>
