前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >如何使用ODBParser搜索Elasticsearch和MongoDB目录数据

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

作者头像
FB客服
发布2021-11-16 10:23:59
1K0
发布2021-11-16 10:23:59
举报
文章被收录于专栏:FreeBuf

关于ODBParser

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

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

功能介绍

识别开放数据库

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

导出选项

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

后渗透处理

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

其他功能

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

工具安装

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

代码语言:javascript
复制
git clone https://github.com/citcheese/ODBParser.git

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

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

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

工具使用

代码语言:javascript
复制
Examples: python ODBParser.py -cn US -p 8080 -t users --elastic --shodan --csv --limit 100
              python ODBParser.py -ip 192.168.2:8080 --mongo --ignorelogs --nosizelimits
    Damage to-date: 0 servers parsed | 0 databases dumped | 0 records pulled

    _____________________________________________________________________________
optional arguments:

  -h, --help            show this help message and exit

Query Options:
  --shodan, -sh         Add this flag if using Shodan. Specify ES or MDB w/flags.
  --binary, -be         Add this flag if using BinaryEdge. Specify ES or MDB w/ flags.
  --ip , -ip            Query one server. Add port like so '192.165.2.1:8080' or will use default ports for each db type. Add ES or MDB flags to specify parser.
  --file , -f           Load line-separated IPs from file. Add port or will assume default ports for each db type. Add ES or MDB flags to specify parser.
  --paste, -v           Query line-separated IPs from clipboard. Add port or will assume default ports for each db type, e.g. 9200 for ES. Add ES or MDB flags to specify parser.

Shodan/BinaryEdge Options:
  --limit , -l          Max number of results per query. Default is 500.
  --port , -p           Filter by port.
  --country , -cn       Filter by country (two-letter country code).
  --terms , -t          Enter any additional query terms you want here, e.g.'users'

Dump Options:
  --mongo, -mdb         Use for IP, Shodan, BinaryEdge & Paste methods to specify parser.
  --elastic, -es        Use for IP, Shodan, BinaryEdge & Paste methods to specify parser.
  --properjson, -pj     Add this flag if would like out put to be proper JSON file. Default is one JSON string object per line.
  --database , -db      Specify database you want to grab. For MDB must be in format format 'db:collection'. Use with IP arg & 'es' or 'mdb' flag
  --getall, -g          Get all indices regardless of fields and collection/index names (overrides selections in config file).
  --ignorelogs          Connect to a server you've already checked out.
  --nosizelimits, -n    Dump index no matter how big it is. Default max doc count is 800,000.
  --csv                 Convert JSON dumps into CSV format on the fly. (Puts JSON files in backup folder in case there is issue with coversion)

CSV/Post-processing Options:
  --convertToCSV , -c   Convert JSON file or folder of JSON dumps to CSVs after the fact. Enter full path or folder name in current working directory
  --dontflatten         Use if run into memory issues converting JSON files to CSV during post-processing.
  --basic               Use with --convertToCSV flag if your JSON dumps are not true JSON files, but rather line separated JSON objects that you got from other sources.
  --dontclean, -dc      Choose if want to keep useless data when convert to CSV. See docs for more info.
项目地址

https://github.com/citcheese/ODBParser

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2021-11-06,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 FreeBuf 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 关于ODBParser
  • 功能介绍
    • 识别开放数据库
      • 后渗透处理
        • 其他功能
        • 工具安装
        • 工具使用
        相关产品与服务
        文件存储
        文件存储(Cloud File Storage,CFS)为您提供安全可靠、可扩展的共享文件存储服务。文件存储可与腾讯云服务器、容器服务、批量计算等服务搭配使用,为多个计算节点提供容量和性能可弹性扩展的高性能共享存储。腾讯云文件存储的管理界面简单、易使用,可实现对现有应用的无缝集成;按实际用量付费,为您节约成本,简化 IT 运维工作。
        领券
        问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档