千家信息网

redis配置文件与未授权访问

发表于:2024-09-22 作者:千家信息网编辑
千家信息网最后更新 2024年09月22日,redis配置文件与未授权访问0x00 redis简述REmote DIctionary Server(Redis) 是一个由Salvatore Sanfilippo写的key-value存储系统。R
千家信息网最后更新 2024年09月22日redis配置文件与未授权访问

redis配置文件与未授权访问

0x00 redis简述

REmote DIctionary Server(Redis) 是一个由Salvatore Sanfilippo写的key-value存储系统。
Redis是一个开源的使用ANSI C语言编写、遵守BSD协议、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。它通常被称为数据结构服务器,因为值(value)可以是 字符串(String), 哈希(Map), 列表(list), 集合(sets) 和 有序集合(sorted sets)等类型。

0x01 redis配置文件

配置文件名称:redis.conf
默认路径:/etc/redis.conf
默认端口:6379
redis配置文件中与权限和密码有关的字段:

# bind 192.168.1.100 10.0.0.1# bind 127.0.0.1 ::1# internet, binding to all the interfaces is dangerous and will expose the# following bind directive, that will force Redis to listen only intobind 0.0.0.0# If the master is password protected (using the "requirepass" configuration# requirepass foobared

bind代表允许访问的ip
requirepass 代码访问redis的密码

0x02 那种情况下,redis存在未授权访问

启动方式对应进程配置文件是否存在未授权访问
./redis-server00:00:00 redis-server 0.0.0.0:6379没有配置文件不存在
./redis-server redis.confredis-server 0.0.0.0:6379bind 0.0.0.0存在
./redis-server redis.confredis-server 0.0.0.0:6379默认配置不存在
./redis-server redis.confredis-server 0.0.0.0:6379requirepass foobared; bind 0.0.0.0不存在

综上表名redis未授权访问的条件是:

  • 加载了配置文件(./redis-server redis.conf)
  • 允许任何ip登录,或者自己的ip在允许范围内(bind 0.0.0.0)
  • 未设置密码(#requirepass foobared)
0