Solr未授权访问

1、漏洞简介

Solr是一个高性能,采用Java开发,基于Lucene的全文搜索服务器。Solr的管理界面通常包含如下信息:solr的配置信息(包括路径,用户名,系统版本信息),数据库的配置信息(地址,用户名,密码),数据库搜索数据等。solr未授权访问的危害很大,轻则可查询所有数据库信息,重则可读取系统任意文件,设置getshell.

2、漏洞检测

敏感目录扫描时加上一条/solr/admin

http://xx.xx.com/solr/admin

https://xx.xx.com/solr/admin

3、漏洞修复

  • 配置solr访问控制权限;

  • 禁止将solr暴露在公网;

4、solr访问控制权限

1)apache-tomcat-9/conf下的tomcat-users.xml中添加

<user username="admin" password="ifwadmin" roles="admin,manager"/>

2)apache-tomcat-9/webapps/solr/WEB-INF下的web.xml配置

<security-constraint>
    <web-resource-collection>
        <web-resource-name>Restrict access to Solr admin</web-resource-name>
        <url-pattern>/admin/*</url-pattern>
        <http-method>DELETE</http-method>
        <http-method>GET</http-method>
        <http-method>POST</http-method>
        <http-method>PUT</http-method>
    </web-resource-collection>
    <auth-constraint>
        <role-name>manager</role-name>
    </auth-constraint>
    <user-data-constraint>
        <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
</security-constraint>
<login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>default</realm-name>
</login-config>
posted @ 2022-05-09 17:34  LalaTina  阅读(3056)  评论(0)    收藏  举报