Charlie-belmer/nosqli

GitHub: Charlie-belmer/nosqli

nosqli 是一款用 Go 实现的 CLI 工具,专注于检测和验证 MongoDB 相关的 NoSQL 注入漏洞。

Stars: 403 | Forks: 44

# NoSQL 注入器 [![推文](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/share?text=NoSQLi%20Injection%20Security%20Scanner&url=https://github.com/Charlie-belmer/nosqli&hashtags=nosql,infosec) ![Header Img](https://nullsweep.com/content/images/2020/12/NoSQLi.png) 一个快速的 NoSQL 扫描器和注入工具。用于发现易受 NoSQL 注入(尤其是 Mongo)影响的网站。 ## 关于 Nosqli 我想要一个更好的 NoSQL 注入工具,使用简洁、完全基于命令行并且可配置。为此,我开始开发 nosqli——一个用 Go 编写的简单 NoSQL 注入工具。 它旨在快速、准确且高度可用,拥有易于理解的命令行界面。 ## 功能 Nosqli 当前支持 MongoDB 的 NoSQL 注入检测。它会运行以下测试: * 基于错误的注入 - 注入各种字符和负载,搜索响应中已知的 Mongo 错误 * 布尔盲注入 - 使用真/假负载注入参数,尝试确定是否存在注入 * 时序注入 - 尝试在服务器上注入时延,以测量响应时间 ## 安装 [Download the latest binary version](https://github.com/Charlie-belmer/nosqli/releases) 适用于你的操作系统,并将其安装到你的路径中,或从本地文件夹运行。 ## 路线图 我计划添加数据提取功能。如果你想看到其他功能或配置选项,请提交拉取请求或 issue! ## 使用 nosqli 只需运行命令并阅读帮助文件,即可自我文档化。 ``` $ nosqli NoSQLInjector is a CLI tool for testing Datastores that do not depend on SQL as a query language. nosqli aims to be a simple automation tool for identifying and exploiting NoSQL Injection vectors. Usage: nosqli [command] Available Commands: help Help about any command scan Scan endpoint for NoSQL Injection vectors version Prints the current version Flags: --config string config file (default is $HOME/.nosqli.yaml) -d, --data string Specify default post data (should not include any injection strings) -h, --help help for nosqli -p, --proxy string Proxy requests through this proxy URL. Defaults to HTTP_PROXY environment variable. -r, --request string Load in a request from a file, such as a request generated in Burp or ZAP. -t, --target string target url eg. http://site.com/page?arg=1 -u, --user-agent string Specify a user agent Use "nosqli [command] --help" for more information about a command. $ nosqli scan -t http://localhost:4000/user/lookup?username=test Running Error based scan... Running Boolean based scan... Found Error based NoSQL Injection: URL: http://localhost:4000/user/lookup?=&username=test param: username Injection: username=' ``` 你可以使用我的易受攻击的 Node.js 应用或其他 NoSQL 注入实验室来测试此工具。 在选择目标 URL 时,请确保所有可测试的参数都出现在 URL 中。例如,假设网站在 /user/lookup 有一个搜索表单。输入数据后,URL 会变为 /user/lookup?username=。如果只扫描 /user/lookup,工具将找不到可能的注入。要正确扫描,请确保使用包含所有参数的完整 URL(在本例中为 /user/lookup?username=)。 ## 从源代码构建 如果你更喜欢从源代码构建,或你的平台没有编译好的二进制文件,可以通过克隆仓库、安装依赖并手动构建项目来实现。这需要最近的 Go 版本以及相应的 GOPATH 环境变量。 ``` $ git clone https://github.com/Charlie-belmer/nosqli $ cd nosqli $ go get -u -d ./... $ go install $ nosqli -h ``` ## 运行测试 项目中包含了相当完整的测试套件。通过在根目录运行 `go test`,可以运行单元测试以及简单的注入覆盖测试: ``` go test ./... ``` 还有集成测试,可针对本地运行的已知易受攻击的应用进行注入测试。要使用集成测试,请安装并运行 [vulnerable nodejs Mongo injection app](https://github.com/Charlie-belmer/vulnerable-node-app) 和我的 [vulnerable PHP lab fork](https://github.com/Charlie-belmer/nosqlilab)(来自 [digininja](https://digi.ninja/projects/nosqli_lab.php))。记得浏览每个站点并重置数据库!然后传入 `integrations` 标志: ``` go test ./... -args -integrations=true ``` 如果未找到环境,集成测试将被其中一个测试用例禁用,以加快测试运行速度。 ## 贡献 欢迎贡献!请提交拉取请求或打开 issue 进行讨论。 ### 贡献者许可 除非你另有说明,否则默认你授予 nosqli 项目无限的、非排他性的权利,以重新使用、修改和重新许可你贡献的代码。该项目将始终保持开源,但这点很重要,因为无法重新许可代码曾导致其他自由软件项目(如 KDE 和 NASM)出现严重问题。如果你希望为你的贡献指定特殊的许可条件,只需在发送时说明即可。
标签:AST, Bug Hunting, CI/CD, CLI, EVTX分析, Go语言, meg, MongoDB安全, NoSQL注入, SAST, Web安全扫描, WiFi技术, 代码质量, 信息安全, 多语言支持, 安全扫描, 安全测试框架, 开源安全工具, 数据泄露防护, 文档结构分析, 日志审计, 时序注入, 盲注攻击, 程序破解, 网络安全, 网络探测, 自动化测试, 语义分析, 逆向工程平台, 错误基检测, 隐私保护, 静态代码分析