新奇八 2023-11-22 18:36 采纳率: 0%
浏览 10

复现redis漏洞的时候出现了如下报错

求问,在进行复现redis漏洞的时候出现了如下报错
我按照网上的将其几个地方也更改了,但是还是不对,想知道这是为什么
还请各位英雄们能解答一二,感激不尽。
复现redis漏洞的时候出现了如下报错
(error) DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.

  • 写回答

1条回答 默认 最新

  • 一键难忘 全栈领域优质创作者 2023-11-22 18:44
    关注

    该回答参考Chatgpt及结果代码方法已验证可行
    这个错误是由于Redis运行在受保护模式(protected mode)下,并且没有指定绑定地址,也没有为客户端请求身份验证密码。在这种模式下,只有从回环接口接受的连接才会被接受。你可以按照以下几种方式之一解决这个问题:

    1. 禁用保护模式:

      • 在本地连接到Redis,可以使用redis-cli命令行工具。
      • 运行以下命令:CONFIG SET protected-mode no
      • 使用 CONFIG REWRITE 命令使更改永久生效。
    2. 编辑Redis配置文件:

      • 找到并编辑Redis的配置文件(通常是redis.conf)。
      • 找到并修改 protected-mode 选项为 no
      • 重启Redis服务器。
    3. 通过启动选项禁用保护模式:

      • 如果你是手动启动Redis服务器进行测试,可以在启动命令中添加 --protected-mode no 选项。
      • 例如:redis-server --protected-mode no
    4. 设置绑定地址或身份验证密码:

      • 在配置文件中设置 bind 选项为合适的IP地址,使其能够接受来自外部计算机的连接。
      • 或者设置 requirepass 选项,要求客户端提供密码以进行连接。

    请确保在进行这些更改之前理解潜在的安全风险。如果Redis服务器直接暴露在互联网上,禁用保护模式或使用弱密码可能会导致安全漏洞。在生产环境中,建议采取适当的安全措施,例如使用防火墙、身份验证密码等。

    评论

报告相同问题?

问题事件

  • 创建了问题 11月22日

悬赏问题

  • ¥15 单纯型python实现编译报错
  • ¥15 c++2013读写oracle
  • ¥15 c++ gmssl sm2验签demo
  • ¥15 关于模的完全剩余系(关键词-数学方法)
  • ¥15 有没有人懂这个博图程序怎么写,还要跟SFB连接,真的不会,求帮助
  • ¥15 PVE8.2.7无法成功使用a5000的vGPU,什么原因
  • ¥15 is not in the mmseg::model registry。报错,模型注册表找不到自定义模块。
  • ¥15 安装quartus II18.1时弹出此error,怎么解决?
  • ¥15 keil官网下载psn序列号在哪
  • ¥15 想用adb命令做一个通话软件,播放录音