如何使用ODBParser搜索Elasticsearch和MongoDB目录数据

安全 数据安全 MongoDB
ODBParser的主要目标是创建一个一站式公开资源情报工具,用于搜索、解析和分析开放数据库,以便识别第三方服务器上的PII泄漏。

[[433669]]

关于ODBParser

ODBParser是一款公开资源情报工具,可以帮助广大研究人员从Elasticsearch和MongoDB目录中搜索、解析并导出我们感兴趣的数据。除此之外,这款工具还可以帮助广大研究人员从开放数据库中搜索出曝光的个人可标识信息(PII)。

ODBParser的主要目标是创建一个一站式公开资源情报工具,用于搜索、解析和分析开放数据库,以便识别第三方服务器上的PII泄漏。

功能介绍

(1) 识别开放数据库

  • 使用所有可行的参数查询Shodan和BinaryEdge,可通过国家、端口号和其他内容过滤查询结果;
  • 指定单个IP地址;
  • 加载IP地址列表文件;
  • 从剪贴板粘贴IP地址列表;

导出选项:

  • 解析所有的数据库/集合来识别指定的数据;
  • 获取目标服务器中托管的所有数据;
  • 获取集合/索引数据;
  • 使用Ctrl + C跳过特定索引;

(2) 后渗透处理

  • 将JSON导出数据转换为CSV;
  • 从CSV中移除特定的列;

(3) 其他功能

  • 跟踪查询的所有IP地址和数据库以及有关每个服务器的信息;
  • 对于每个记录总数超过限制的数据库,脚本将在一个特殊文件中创建一个条目以及5个示例记录,以便你可以查看并决定数据库是否值得抓取;
  • 默认输出是行分隔的JSON文件,每行上有一个JSON对象。你可以使用“properjson”标志选择让它输出一个“适当的JSON”文件;

工具安装

首先,我们需要使用下列命令将该项目源码克隆至本地:

  1. git clone https://github.com/citcheese/ODBParser.git 

接下来,我们需要自行获取Shodan和BinaryEdge的API密钥,并在ODBconfig.py文件中配置相应的参数。

最后,根据项目目录中的requirements.txt安装并配置该工具所需的依赖组件。

我建议广大研究人员创建一个ODBParser的虚拟环境,该工具目前尽在Windows 10(Python 3.7.3)环境中进行过测试。

工具使用

  1. Examples: python ODBParser.py -cn US -p 8080 -t users --elastic --shodan --csv --limit 100 
  2.               python ODBParser.py -ip 192.168.2:8080 --mongo --ignorelogs --nosizelimits 
  3.     Damage to-date: 0 servers parsed | 0 databases dumped | 0 records pulled 
  4.  
  5.     _____________________________________________________________________________ 
  6. optional arguments: 
  7.  
  8.   -h, --help            show this help message and exit 
  9.  
  10. Query Options: 
  11.  
  12.   --shodan, -sh         Add this flag if using Shodan. Specify ES or MDB w/ 
  13.                         flags. 
  14.   --binary, -be         Add this flag if using BinaryEdge. Specify ES or MDB 
  15.                         w/ flags. 
  16.  
  17.   --ip , -ip            Query one server. Add port like so '192.165.2.1:8080' 
  18.  
  19.                         or will use default ports for each db type. Add ES or 
  20.  
  21.                         MDB flags to specify parser. 
  22.  
  23.   --file , -f           Load line-separated IPs from file. Add port or will 
  24.  
  25.                         assume default ports for each db type. Add ES or MDB 
  26.  
  27.                         flags to specify parser. 
  28.  
  29.   --paste, -v           Query line-separated IPs from clipboard. Add port or 
  30.  
  31.                         will assume default ports for each db type, e.g. 9200 
  32.  
  33.                         for ES. Add ES or MDB flags to specify parser. 
  34.  
  35. Shodan/BinaryEdge Options: 
  36.  
  37.   --limit , -l          Max number of results per query. Default is 
  38.  
  39.                         500. 
  40.  
  41.   --port , -p           Filter by port. 
  42.  
  43.   --country , -cn       Filter by country (two-letter country code). 
  44.  
  45.   --terms , -t          Enter any additional query terms you want here, e.g. 
  46.                         'users' 
  47. Dump Options: 
  48.  
  49.   --mongo, -mdb         Use for IP, Shodan, BinaryEdge & Paste methods to 
  50.  
  51.                         specify parser. 
  52.  
  53.   --elastic, -es        Use for IP, Shodan, BinaryEdge & Paste methods to 
  54.  
  55.                         specify parser. 
  56.  
  57.   --properjson, -pj     Add this flag if would like out put to be proper JSON 
  58.  
  59.                         file. Default is one JSON string object per line. 
  60.  
  61.   --database , -db      Specify database you want to grab. For MDB must be in 
  62.  
  63.                         format format 'db:collection'. Use with IP arg & 'es' 
  64.  
  65.                         or 'mdb' flag 
  66.  
  67.   --getall, -g          Get all indices regardless of fields and 
  68.  
  69.                         collection/index names (overrides selections in config 
  70.  
  71.                         file). 
  72.  
  73.   --ignorelogs          Connect to a server you've already checked out. 
  74.  
  75.   --nosizelimits, -n    Dump index no matter how big it is. Default max doc 
  76.  
  77.                         count is 800,000. 
  78.  
  79.   --csv                 Convert JSON dumps into CSV format on the fly. (Puts 
  80.  
  81.                         JSON files in backup folder in case there is issue 
  82.  
  83.                         with coversion) 
  84.  
  85.   
  86.  
  87. CSV/Post-processing Options: 
  88.  
  89.   --convertToCSV , -c   Convert JSON file or folder of JSON dumps to CSVs 
  90.  
  91.                         after the fact. Enter full path or folder name in 
  92.  
  93.                         current working directory 
  94.  
  95.   --dontflatten         Use if run into memory issues converting JSON files to 
  96.  
  97.                         CSV during post-processing. 
  98.  
  99.   --basic               Use with --convertToCSV flag if your JSON dumps are 
  100.  
  101.                         not true JSON files, but rather line separated JSON 
  102.  
  103.                         objects that you got from other sources. 
  104.  
  105.   --dontclean, -dc      Choose if want to keep useless data when convert to 
  106.  
  107.                         CSV. See docs for more info. 

项目地址

ODBParser:【GitHub传送门

 

责任编辑:赵宁宁 来源: FreeBuf
相关推荐

2016-10-08 15:42:02

ElasticsearcAdvisorDocke

2022-05-30 07:31:38

SpringBoot搜索技巧

2021-06-09 09:36:18

DjangoElasticSearLinux

2015-10-22 14:02:58

ElasticsearKafkaCassandra

2021-06-15 15:03:21

MongoDBNode.jsCRUD

2012-04-19 10:04:20

ibmdw

2023-12-11 07:37:08

mongodb经纬度性能

2021-12-20 07:31:19

Java ElasticSea搜索

2018-09-17 10:47:28

MongoDB存储Docker

2023-10-09 07:31:25

2020-03-17 23:08:32

数据Elasticsear存储

2021-04-12 08:17:12

ElasticSear分词中文

2022-10-21 15:47:59

测试工具鸿蒙

2023-05-08 16:19:47

2021-07-09 18:26:41

PythonMySQL MongoDB

2023-10-10 08:52:36

射与分析相开源

2021-10-08 10:05:31

DorkifyGoogle Dork漏洞

2020-04-20 08:08:23

MongoDBElasticsear数据库

2019-08-14 09:42:06

LinuxElasticsearKibana

2018-07-05 22:38:23

大数据搜索引擎SEO
点赞
收藏

51CTO技术栈公众号