├── .gitignore ├── .github ├── ISSUE_TEMPLATE │ ├── 自定义问题模板.md │ ├── 功能需求.md │ └── bug报告.md ├── dependabot.yml └── workflows │ ├── rust_build.yml │ └── rust_build_test.yml ├── src ├── main.rs ├── api.rs ├── gpt.rs ├── common.rs └── quake.rs ├── SECURITY.md ├── Cargo.toml ├── CHANGELOG.md ├── LICENSE ├── README.md └── Cargo.lock /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .idea/ 3 | todo.md 4 | *.txt 5 | /node_modules -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/自定义问题模板.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 自定义问题模板 3 | about: 非 bug、需求类问题可以使用此模板。 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | mod api; 2 | mod common; 3 | mod gpt; 4 | mod quake; 5 | fn main() { 6 | // 谦者,众善之基;傲者,众恶之魁。 7 | // Humility is the foundation of all good; pride is the leader of all evil. 8 | // ------------------------------------------------------------------------ 9 | env_logger::init(); 10 | common::ArgParse::parse(); 11 | } 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/功能需求.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 功能需求 3 | about: 为这个项目提出一个想法(需求)。 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **您的功能请求是否与问题有关?请描述** 11 | 对问题所在的清晰简洁的描述。Ex.当〔…〕 12 | 13 | **描述您想要的解决方案** 14 | 对你想要发生的事情的清晰简洁的描述。 15 | 16 | **描述你考虑过的替代方案** 17 | 对您考虑过的任何替代解决方案或功能的清晰简洁的描述。 18 | 19 | **附加上下文** 20 | 在此处添加有关功能请求的任何其他上下文或屏幕截图。 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug报告.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug报告 3 | about: 创建Bug报告以帮助我们改进 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **描述错误** 11 | 12 | 清晰简洁地描述错误是什么。将错误内容复制出来。 13 | 14 | **重现方式** 15 | 16 | 1. 17 | 18 | 2. 19 | 20 | 3. 21 | 22 | **预期行为** 23 | 24 | 对您期望发生的事情进行清晰简洁的描述。 25 | 26 | 27 | **截图** 28 | 29 | 如果适用,请添加屏幕截图以帮助解释您的问题。 30 | 31 | 32 | **桌面(请填写以下信息)** 33 | 34 | - OS: [e.g. iOS] 35 | - Version [e.g. 22] 36 | 37 | 38 | **其他** 39 | 在此处添加有关该问题的任何其他上下文。 40 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Reporting a Vulnerability 16 | 17 | Use this section to tell people how to report a vulnerability. 18 | 19 | Tell them where to go, how often they can expect to get an update on a 20 | reported vulnerability, what to expect if the vulnerability is accepted or 21 | declined, etc. 22 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "quake" 3 | version = "3.1.1" 4 | authors = ["360 Quake Team "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | reqwest = { version = "^0.12.15", features = ["blocking", "json"] } 11 | serde = { version = "^1.0.219", features = ["derive"] } 12 | serde_json = "^1.0.140" 13 | clap = {version="^3.2.23", features=["cargo", "derive"]} 14 | dirs = "^6.0.0" 15 | log = "^0.4.27" 16 | env_logger = "^0.11.6" 17 | ansi_term = "^0.12.1" 18 | chrono = "^0.4.41" 19 | regex = "^1.11.1" 20 | ipaddress = "^0.1.1" 21 | 22 | [profile.release] 23 | lto = true 24 | opt-level = 'z' 25 | codegen-units = 1 -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "cargo" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | # 添加拉取请求的标签 13 | labels: 14 | - "dependencies" 15 | # 允许的更新类型 16 | open-pull-requests-limit: 10 17 | # 允许的更新类型 18 | allow: 19 | - dependency-type: "direct" 20 | - dependency-type: "indirect" 21 | # 移除不在架构内的 auto-merge 配置 22 | # auto-merge: 23 | # enabled: true 24 | # merge-method: "squash" 25 | -------------------------------------------------------------------------------- /.github/workflows/rust_build.yml: -------------------------------------------------------------------------------- 1 | # 工作流名称 2 | name: rust_build 3 | 4 | # 权限设置,允许写入仓库内容 5 | permissions: 6 | contents: write 7 | 8 | # 触发工作流的事件 9 | on: 10 | push: 11 | # 当推送的标签以 "v" 开头时触发 12 | tags: 13 | - "v*" 14 | 15 | jobs: 16 | # 标记版本发布的任务 17 | tagged-release: 18 | name: "Tagged Release" 19 | runs-on: "ubuntu-latest" 20 | steps: 21 | # ... 22 | # 检出代码到工作目录 23 | - name: Checkout Code 24 | # 使用固定版本的 action 以提高稳定性 25 | uses: actions/checkout@v4 26 | 27 | # 创建版本发布 28 | - name: Create Release 29 | # 使用固定版本的 action 以提高稳定性 30 | uses: "marvinpinto/action-automatic-releases@v1.2.1" 31 | with: 32 | repo_token: "${{ secrets.GITHUB_TOKEN }}" 33 | prerelease: false 34 | 35 | # 上传资产的任务 36 | upload-assets: 37 | name: "Upload assets" 38 | # 矩阵策略,在不同操作系统上运行任务 39 | strategy: 40 | matrix: 41 | os: 42 | - ubuntu-latest 43 | - macos-latest 44 | - windows-latest 45 | runs-on: ${{ matrix.os }} 46 | steps: 47 | # 检出代码到工作目录 48 | - name: Checkout Code 49 | # 使用固定版本的 action 以提高稳定性 50 | uses: actions/checkout@v4 51 | # 上传 Rust 二进制文件 52 | - name: "upload rust binary action" 53 | uses: taiki-e/upload-rust-binary-action@v1 54 | with: 55 | ref: ${{ github.ref }} 56 | bin: quake 57 | tar: unix 58 | zip: windows 59 | token: ${{ secrets.GITHUB_TOKEN }} 60 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 更新日志 2 | 3 | - 2024-12-04 v3.2.0: 4 | - 优化了不同 os 下的兼容性 5 | - 2024-07-02 v3.1.9: 6 | - 跟上 tag 的标签号 7 | - 2024-07-02 v3.1.8: 8 | - 升级依赖 9 | - 2023-08-21 v3.1.7: 10 | - 修复无components字段问题 11 | - 2023-08-03 v3.1.6: 12 | - 新增查询返回剩余积分 13 | - 2023-07-28 v3.1.5: 14 | - 修复workflow,支持GitHub action编译bin文件 15 | - 2023-07-27 v3.1.4: 16 | - 修复 serach -u无数据问题 17 | - 2023-07-07 v3.1.3: 18 | - 修复 domain 查询是-c 不接参数值报错的 bug 19 | - 2023-05-08 v3.1.2: 20 | - 新增 gpt 自动转换 quake 语法功能 21 | - 2023-04-07 v3.1.1: 22 | - 修复-l 参数无法查询最新数据的 bug 23 | - 2023-03-31 v3.1.0: 24 | - 增加-t product_name_cn,version,protocol 参数 25 | - 2022-12-02 v3.0.3: 26 | - 修复 domain 查询是-c 不接参数值报错的 bug 27 | - 2022-10-17 v3.0.2: 28 | - 修复文件读取时最后一行为空无法生成搜索语句 bug 29 | - 2022-10-13 v3.0.1: 30 | - 更新 clap 到 4.x 版本 31 | - 2022-10-09 v2.2.3: 32 | - 完成 host 批量查询功能 33 | - 2022-09-27 v2.2.2: 34 | - 修复 code 转 i32 时出现 unwrap 的 bug 35 | - 完成批量查询自动翻页功能 36 | - 2022-09-19 v2.2.1: 37 | - 优化批量查询的功能,读取 txt 中查询语句,将结果发回到新的 txt 中 38 | - 删除部分冗余代码 39 | - 2022-09-16 v2.2: 40 | - 添加批量查询的功能 41 | - 读取 txt 中查询语句,将结果发回到新的 txt 中 42 | - 2022-08-25 v2.1: 43 | - 优化新增排除 cdn、排除蜜罐、显示最新数据参数 44 | - 新增 workflows 工作流打包成 release 45 | - 2021-08-12 v2.0.3: 46 | - 新增排除蜜罐、排除 CDN、使用最新数据功能 47 | - 新增过滤无效请求和数据去重功能 48 | - 2021-04-06 v2.0.2: 49 | - 修复域名搜不到的问题。 :) 50 | - 2021-04-06 v2.0.1: 51 | - 优化搜索结果,去除重复数据。 52 | - 添加文件上传搜索功能。 53 | - 添加指定时间搜索功能。 54 | - 优化代码。 55 | - 2021-01-22 v1.0.5: 56 | - 修复 TLS 解构解析不一致的问题。 57 | - 修复命令行工具被杀软报毒问题。 58 | - 2021-01-15 v1.0.4: 59 | - 优化 title 显示,删除不可见字符。 60 | - host 命令新增地理位置、设备信息和更新时间字段。 61 | - 修复域名查询,出现无关域名的问题。 62 | - 2021-01-08 v1.0.3: 63 | - 修复 init 命令 bug 64 | - 新增证书域名提取。 65 | - 2020-12-25 v1.0.2 : 66 | - 添加 info 和 honeypot 子命令,可以查看个人信息和进行蜜罐识别。 67 | -------------------------------------------------------------------------------- /.github/workflows/rust_build_test.yml: -------------------------------------------------------------------------------- 1 | # 工作流名称,用于标识该 GitHub Actions 工作流 2 | name: rust_build_test 3 | 4 | # 工作流所需的权限,允许对仓库内容进行写入操作 5 | permissions: 6 | contents: write 7 | 8 | # 触发工作流的事件,当代码推送到 build_test 分支时触发 9 | on: 10 | push: 11 | branches: 12 | - "build_test" 13 | 14 | jobs: 15 | # 标记版本发布测试的任务 16 | tagged-release-test: 17 | name: "Tagged Release Test" 18 | # 指定运行该任务的环境为最新的 Ubuntu 系统 19 | runs-on: "ubuntu-latest" 20 | steps: 21 | # ... 22 | # 检出代码到工作目录,使用固定版本 v4 提高稳定性 23 | - name: Checkout Code 24 | uses: actions/checkout@v4 25 | 26 | # 创建版本发布,使用固定版本 v1.2.1 提高稳定性 27 | - name: Create Release 28 | uses: "marvinpinto/action-automatic-releases@v1.2.1" 29 | with: 30 | # 使用 GitHub 提供的令牌进行认证 31 | repo_token: "${{ secrets.GITHUB_TOKEN }}" 32 | # 自动发布的标签名称 33 | automatic_release_tag: "latest" 34 | # 版本发布的标题 35 | title: "Rust Build Test" 36 | # 标记为预发布版本 37 | prerelease: true 38 | 39 | # 上传资产测试的任务 40 | upload-assets-test: 41 | name: "Upload assets" 42 | # 使用矩阵策略,在不同的操作系统和目标平台上运行任务 43 | strategy: 44 | matrix: 45 | include: 46 | - target: aarch64-unknown-linux-gnu 47 | os: ubuntu-latest 48 | - target: aarch64-apple-darwin 49 | os: macos-latest 50 | - target: x86_64-unknown-linux-gnu 51 | os: ubuntu-latest 52 | - target: x86_64-apple-darwin 53 | os: macos-latest 54 | # 支持 macOS 通用二进制文件 55 | - target: universal-apple-darwin 56 | os: macos-latest 57 | # 根据矩阵策略选择运行环境 58 | runs-on: ${{ matrix.os }} 59 | steps: 60 | # 检出代码到工作目录,使用固定版本 v4 提高稳定性 61 | - name: Checkout Code 62 | uses: actions/checkout@v4 63 | # 上传 Rust 二进制文件 64 | - name: "upload rust binary action" 65 | uses: taiki-e/upload-rust-binary-action@v1 66 | with: 67 | # 当前 Git 引用 68 | ref: ${{ github.ref }} 69 | # 要上传的二进制文件路径 70 | bin: ./target/release/quake 71 | # 目标平台 72 | target: ${{ matrix.target }} 73 | # 使用 GitHub 提供的令牌进行认证 74 | token: ${{ secrets.GITHUB_TOKEN }} 75 | -------------------------------------------------------------------------------- /src/api.rs: -------------------------------------------------------------------------------- 1 | // 引入文件系统操作相关模块 2 | use std::fs::{create_dir, File}; 3 | // 引入路径操作模块 4 | use std::path::Path; 5 | // 引入文件系统和输入输出相关模块 6 | use std::{fs, io}; 7 | 8 | // 引入公共模块中的输出工具和服务结构体 9 | use crate::common::{Output, Service}; 10 | // 引入 Quake 模块中的 Quake 结构体 11 | use crate::quake::quake::Quake; 12 | // 引入写入操作的 trait 13 | use std::io::Write; 14 | 15 | /// ApiKey 结构体,用于管理 API 密钥和 GPT API 密钥的初始化、设置和获取操作 16 | pub struct ApiKey; 17 | 18 | impl ApiKey { 19 | /// 初始化 Quake API 密钥 20 | /// 21 | /// # 参数 22 | /// - `api_key`: 要设置的 Quake API 密钥 23 | pub fn init(api_key: String) { 24 | // 写入 API 密钥 25 | if Self::set_api(api_key) { 26 | Output::success("成功初始化"); 27 | } else { 28 | Output::error("错误: 无效的 API 密钥"); 29 | } 30 | } 31 | 32 | /// 初始化 GPT API 密钥 33 | /// 34 | /// # 参数 35 | /// - `gpt_key`: 要设置的 GPT API 密钥 36 | pub fn gptinit(gpt_key: String) { 37 | // 写入 API 密钥 38 | if Self::set_gptapi(gpt_key) { 39 | Output::success("成功初始化"); 40 | } else { 41 | Output::error("错误: 无效的 API 密钥"); 42 | } 43 | } 44 | 45 | /// 获取用户主目录路径 46 | /// 47 | /// # 返回值 48 | /// 用户主目录的路径字符串 49 | fn get_path() -> String { 50 | let path = dirs::home_dir() 51 | .unwrap() 52 | .as_path() 53 | .to_str() 54 | .unwrap() 55 | .to_string(); 56 | path 57 | } 58 | 59 | /// 检查 Quake API 密钥是否可用 60 | /// 61 | /// # 参数 62 | /// - `apikey`: 要检查的 Quake API 密钥 63 | /// 64 | /// # 返回值 65 | /// 如果密钥可用返回 `true`,否则返回 `false` 66 | fn check_api(apikey: String) -> bool { 67 | let (local, one_years_ago) = Quake::getdate(); 68 | let s = Service { 69 | ip_list: Vec::new(), 70 | query: String::from("port:80"), 71 | start: 1, 72 | size: 1, 73 | ignore_cache: false, 74 | latest: false, 75 | start_time: one_years_ago, 76 | end_time: local, 77 | shortcuts: Vec::new(), 78 | }; 79 | let res = match Quake::new(apikey).search(s) { 80 | Ok(_) => true, 81 | Err(_) => false, 82 | }; 83 | res 84 | } 85 | 86 | /// 检查 GPT API 密钥是否可用 87 | /// 88 | /// # 参数 89 | /// - `apikey`: 要检查的 GPT API 密钥 90 | /// 91 | /// # 返回值 92 | /// 目前总是返回 `true`,可根据实际需求实现检查逻辑 93 | fn check_gptapi(_apikey: String) -> bool { 94 | true 95 | } 96 | 97 | /// 创建配置目录 98 | /// 99 | /// # 参数 100 | /// - `path`: 要创建的目录路径 101 | fn create_config_dir(path: &str) { 102 | if !Path::exists(Path::new(path)) { 103 | match create_dir(Path::new(path)) { 104 | Err(e) => { 105 | Output::error(&format!("创建路径失败: {}. {}", path, e.to_string())); 106 | std::process::exit(1); 107 | } 108 | _ => {} 109 | } 110 | } 111 | } 112 | 113 | /// 设置 Quake API 密钥 114 | /// 115 | /// # 参数 116 | /// - `apikey`: 要设置的 Quake API 密钥 117 | /// 118 | /// # 返回值 119 | /// 如果密钥设置成功返回 `true`,否则返回 `false` 120 | pub fn set_api(apikey: String) -> bool { 121 | let path = Self::get_path(); 122 | let config_path = format!("{}/.config/", path); 123 | let quake_path = format!("{}/.config/quake/", path); 124 | let api_path = format!("{}/.config/quake/api_key", path); 125 | 126 | Self::create_config_dir(&config_path); 127 | Self::create_config_dir(&quake_path); 128 | 129 | if Self::check_api(apikey.clone()) { 130 | let mut file: File = match File::create(Path::new(&api_path)) { 131 | Ok(f) => f, 132 | Err(e) => { 133 | Output::error(&format!("文件创建失败: {}", e.to_string())); 134 | std::process::exit(1); 135 | } 136 | }; 137 | return match file.write_all(apikey.as_bytes()) { 138 | Ok(_) => true, 139 | Err(e) => { 140 | Output::error(&format!("文件写入失败: {}", e.to_string())); 141 | std::process::exit(1); 142 | } 143 | }; 144 | } 145 | false 146 | } 147 | 148 | /// 获取 Quake API 密钥 149 | /// 150 | /// # 返回值 151 | /// 包含 Quake API 密钥的 `Result` 类型,可能包含错误信息 152 | pub fn get_api() -> Result { 153 | let path = format!("{}/.config/quake/api_key", Self::get_path()); 154 | fs::read_to_string(path) 155 | } 156 | 157 | /// 设置 GPT API 密钥 158 | /// 159 | /// # 参数 160 | /// - `apikey`: 要设置的 GPT API 密钥 161 | /// 162 | /// # 返回值 163 | /// 如果密钥设置成功返回 `true`,否则返回 `false` 164 | pub fn set_gptapi(apikey: String) -> bool { 165 | let path = Self::get_path(); 166 | let config_path = format!("{}/.config/", path); 167 | let quake_path = format!("{}/.config/quake/", path); 168 | let api_path = format!("{}/.config/quake/gptapi_key", path); 169 | 170 | Self::create_config_dir(&config_path); 171 | Self::create_config_dir(&quake_path); 172 | 173 | if Self::check_gptapi(apikey.clone()) { 174 | let mut file: File = match File::create(Path::new(&api_path)) { 175 | Ok(f) => f, 176 | Err(e) => { 177 | Output::error(&format!("文件创建失败: {}", e.to_string())); 178 | std::process::exit(1); 179 | } 180 | }; 181 | return match file.write_all(apikey.as_bytes()) { 182 | Ok(_) => true, 183 | Err(e) => { 184 | Output::error(&format!("文件写入失败: {}", e.to_string())); 185 | std::process::exit(1); 186 | } 187 | }; 188 | } 189 | false 190 | } 191 | 192 | /// 获取 GPT API 密钥 193 | /// 194 | /// # 返回值 195 | /// 包含 GPT API 密钥的 `Result` 类型,可能包含错误信息 196 | pub fn get_gptapi() -> Result { 197 | let path = format!("{}/.config/quake/gptapi_key", Self::get_path()); 198 | fs::read_to_string(path) 199 | } 200 | } 201 | -------------------------------------------------------------------------------- /src/gpt.rs: -------------------------------------------------------------------------------- 1 | // 引入 API 密钥模块 2 | use crate::api::ApiKey; 3 | // 引入公共模块中的输出工具 4 | // 引入同步请求客户端 5 | use reqwest::blocking::Client; 6 | // 引入请求头相关模块 7 | use reqwest::header::{HeaderMap, HeaderValue}; 8 | // 引入 JSON 处理库 9 | use serde_json::json; 10 | use serde_json::Value; 11 | // 引入错误处理模块 12 | use std::error::Error; 13 | 14 | /// Gpt 结构体,用于与 OpenAI GPT 进行交互 15 | pub struct Gpt; 16 | 17 | /// 移除字符串中的控制字符 18 | /// 19 | /// # 参数 20 | /// - `s`: 输入的字符串 21 | /// 22 | /// # 返回值 23 | /// 移除控制字符后的字符串 24 | fn remove_control_characters(s: &str) -> String { 25 | s.chars().filter(|c| !c.is_control()).collect::() 26 | } 27 | 28 | impl Gpt { 29 | /// 向 GPT 发送查询请求,将输入文本转换为符合 Quake 测绘引擎语法的查询语句 30 | /// 31 | /// # 参数 32 | /// - `query_string`: 输入的查询文本 33 | /// 34 | /// # 返回值 35 | /// 包含转换后查询语句的字符串,或者错误信息 36 | pub fn query_gpt(query_string: &str) -> Result> { 37 | // 创建请求头映射 38 | let mut header = HeaderMap::new(); 39 | // 定义 GPT API 的基础 URL 40 | const GPT_URL: &str = "https://api.openai.com/v1/chat/completions"; 41 | 42 | // 初始化请求 URL 43 | let mut url: String = String::new(); 44 | // 获取 GPT API 密钥 45 | let api = ApiKey::get_gptapi().expect("Failed to read GPTapikey:\t"); 46 | // 拼接请求 URL 47 | url.push_str(GPT_URL); 48 | 49 | // 设置 Authorization 请求头 50 | header.insert( 51 | "Authorization", 52 | HeaderValue::from_str(&format!("Bearer {}", api)).unwrap(), 53 | ); 54 | // 设置 Content-Type 请求头 55 | header.insert("Content-Type", HeaderValue::from_static("application/json")); 56 | 57 | // 创建请求客户端 58 | let client = Client::new(); 59 | 60 | // 定义系统提示文本,指导 GPT 如何将输入文本转换为 Quake 语法 61 | let text = r#" 62 | 作为精通Quake测绘引擎语法的AI助手,我将接收一段文字,并将其转化为简洁的、符合Quake测绘引擎语法的查询语句。然后,我将以文本形式返回结果,确保没有额外文字或多余的回车换行。 63 | 64 | 你熟练掌握了以下语法参考: 65 | 66 | app:"Apache"Apache服务器产品 67 | country:"CN":搜索国家地区资产,可以使用国家缩写" 68 | country_cn:"中国":用于搜索中文国家名称 69 | province:"beijing":用于搜索英文省份名称" 70 | province_cn:"北京":用于搜索中文省份名称" 71 | city:"changsha":用于搜索英文省份名称" 72 | city_cn:"长沙":用于搜索中文城市名称" 73 | ssl:"google":搜索ssl证书存在"google"字符串的资产,常常用来提过公司名及产品来搜索对应的资产 74 | ip:"8.8.8.8":搜索指定IPv4地址相关资产 75 | ip:"2600:3c00::f03c:91ff:fefc:574a":搜索指定IPv6地址相关资产 76 | ip:52.2.254.36/24:支持检索单个IP、CIDR地址段、支持IPv6地址 77 | org:"No.31,Jin-rong Street":自治域归属组织名称 78 | asn:"12345":自治域号码 79 | isp:"China Mobile":搜索相关网络服务提供商的资产,可结合org数据相互补充 80 | asn:42893:搜索对应ASN(Autonomous system number)自治系统编号相关IP资产 81 | port:80:搜索相关端口资产 82 | ports:80,8080,9999:搜索多端口资产 83 | port:>或=或<=:搜索满足某个端口范围的主机 84 | port:<80:查询开放端口小于80的主机 85 | port:[80 TO 1024]:查询开放的端口介入80和1024之间的主机 86 | port:>=80:查询开放端口包含且大于80端口的主机 87 | hostname:google.com:搜索相关IP"主机名"的资产 88 | service:"ssh":搜索对应服务协议的资产,常见服务协议包括:http、ftp、ssh、telnet等等 89 | os:"RouterOS":搜索相关操作系统,常见系统包括Linux、Windows、RouterOS、IOS、JUNOS等等 90 | title:"Cisco":搜索html内容里标题中存在"Cisco"的数据 91 | favicon_hash:"f3418a443e7d841097c714d69ec4bcb8":通过 md5 方式对目标数据进行解析,根据图标搜索相关内容的资产,搜索包含“google”图标的相关资产 92 | html_hash:"69d7683445fed9e517e33750615f46c0":网页html的md5值 93 | headers:"ThinkPHP":http headers字符串 94 | body:"奇虎":网页body内容 95 | powered_by:PHP:网站开发语言(http headers里面的X-Powered-By) 96 | response:"220 ProFTPD 1.3.5a Server":端口原生返回数据中包含"220 ProFTPD 1.3.5a Server"字符串的主机 97 | 98 | 如果出现的关键词可能出现在上面的语法里,请带上语法词,比如输入一个IP,直接使用ip:x.x.x.xx ,如果提交的关键词可能出现在标题里可以使用title:xxx ,如果关键词可能出现在证书里,请使用ssl:xxxx 等 99 | 100 | 注意不要用上面语法参考里没有包含的语法词! 101 | 102 | 在quake搜索中,用or表示or运算,用and表示and运算,用not表示not运算,括号表示优先处理! 103 | 104 | 注意: 105 | 遇到搜索“可能”属于xxx的资产时候,要使用or运算(也就是空格),应该考虑title、ssl、hostname、org、isp等语法,最终输出的quake查询语法:(title:"xxx" ssl:"xxx" hostname:"xxx" org:"xxx" isp:"xxx") 106 | 107 | 下面这是一些学习的例子: 108 | 109 | 提示词:"搜索1.1.1.1c段地址" 110 | 输出结果:"ip:1.1.1.1/24" 111 | 112 | 提示词:"搜索1.1.1.1b段地址" 113 | 输出结果:"ip:1.1.1.1/16" 114 | 115 | 提示词:"不要来自某个国下的某个省的数据" 116 | 输出结果:country_cn:"某个国" and not province_cn:"某个省" 117 | 118 | 提示词:"不要来自香港的数据" 119 | 输出结果:"not city_cn:"香港" AND country: "China"" 120 | 121 | 提示词:"不要来自台湾的数据apache数据" 122 | 输出结果:"not province_cn:"台湾省" AND country: "China" and app:Apache" 123 | 124 | 提示词:"不要来自澳门的数据" 125 | 输出结果:"not city_cn:"澳门" AND country: "China"" 126 | 127 | 提示词:"美国开放80或者443端口的主机" 128 | 输出结果:country:"US" and (port:"80" port:"443") 129 | 提示词:"我需要湖南省长沙市所有使用ChatGPT的网站" 130 | 提示词:"Russian hosts running RDP or FTP" 131 | 输出结果:country:"RU" and (service:"rdp" service:"ftp") 132 | 133 | 提示词:"我需要湖南省长沙市所有使用ChatGPT的网站" 134 | 输出结果:country:"中国" and province_cn:"湖南" and city_cn:"长沙" and title:"ChatGPT" 135 | 136 | 提示词:"搜索存在目录遍历的资产" 137 | 输出结果:title:"Index of /" 138 | 139 | 提示词:"不要来自美国的数据" 140 | 输出结果:country:"US"" 141 | 142 | 提示词:"xxxx年xx月到xxxx年xxx月" 143 | 输出结果:--time_start xxxx-xx --time_end xxxx-xxx"(前面不要加and符号) 144 | 145 | 提示词:"搜索使用GoAhead的Web服务器" 146 | 输出结果:"Server: GoAhead" 147 | 148 | 提示词:"返回包存在xxx" 149 | 输出结果:"response:xxx" 150 | 151 | 提示词:"xx条或者xx个" 152 | 输出结果:"--size xx"(前面不要加and符号) 153 | 154 | 提示词:"xx一打" 155 | 输出结果:"--size 12"(前面不要加and符号) 156 | 157 | 提示词:"导出到当前目录下a.txt" 158 | 输出结果:"--output ./a.txt"(前面不要加and符号) 159 | 160 | 提示词:"导出到xxxx" 161 | 输出结果:"--output xxxx"(前面不要加and符号) 162 | 163 | 164 | 提示词:"状态码xxx" 165 | 输出结果:"status_code:xxx" 166 | 167 | 请认真学习并记住这些案例,请特别注意如果输入的是Web服务器如Apache、IIS、nginx、GoAhead等,明确是用于Web服务器的,请使用http头里的关键词,如"server: Server: Microsoft-IIS/7.5",而不能使用server:"Microsoft-IIS/7.5" 168 | 169 | 注意:台湾是中国的一个省,禁止当作国家处理,要用province_cn:"台湾省"这个代表,禁止使用country_cn或country参数。 170 | 注意:香港和澳门是中国的一个省或者城市,禁止当作国家处理,要用province_cn:"xx"这个代表或者city_cn:"xx",禁止使用country_cn或country参数。 171 | 172 | 注意:在--size和--start_time和--end_time标签前禁止加and。 173 | 注意:quake使用or表示“或者”,禁止使用|或者||。 174 | 注意:禁止返回额外文字与多余的回车换行和\符号,只需要返回quake搜索语法。"#; 175 | 176 | // 移除系统提示文本中的控制字符 177 | let text1 = remove_control_characters(text); 178 | // 待查询的文本 179 | let sj = query_string; 180 | 181 | // 构建请求的 JSON 数据 182 | let json_data = json!({ 183 | "model": "gpt-3.5-turbo", 184 | "messages": [ 185 | { 186 | "content": format!("{} \n\n {}",text1,sj), 187 | "role": "user" 188 | } 189 | ] 190 | }); 191 | 192 | // 发送请求并获取响应文本 193 | let response = client 194 | .post(&url) 195 | .headers(header) 196 | .json(&json_data) 197 | .send()? 198 | .text(); 199 | 200 | match response { 201 | Ok(res) => { 202 | // 将响应文本解析为 JSON 值 203 | let res: Value = serde_json::from_str(&res)?; 204 | // 提取转换后的查询语句 205 | let code = res["choices"][0]["message"]["content"].to_string(); 206 | Ok(code) 207 | } 208 | Err(err) => { 209 | // 打印错误信息 210 | eprintln!("Error: {}", err); 211 | Err(err.into()) 212 | } 213 | } 214 | } 215 | } 216 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Quake Command-Line Application 2 | 3 | ## 安装 4 | 5 | 1. 直接下载即可使用 6 | 7 | 8 | 9 | 2. 或者本地编译: 10 | 11 | ```bash 12 | // 安装rust后使用cargo编译 13 | cargo build --release 14 | ``` 15 | 16 | ## 问题反馈 17 | 18 | 请添加微信:quake_360 邀您加入技术交流群 :) 19 | 20 | ## 使用方法 21 | 22 | ```bash 23 | Quake Command-Line Application 1.0.4 24 | Author: soap 25 | Dose awesome things. 26 | 27 | USAGE: 28 | quake.exe 29 | 30 | OPTIONS: 31 | -h, --help Print help information 32 | -V, --version Print version information 33 | 34 | SUBCOMMANDS: 35 | domain View all available information for a domain. 36 | gpt Artificial intelligence engine, directly say what you want to check without 37 | grammar 38 | gptinit Initialize the gtpapi 39 | help Print this message or the help of the given subcommand(s) 40 | honeypot Check whether the IP is a honeypot or not. 41 | host View all available information for an IP address 42 | info Shows general information about your account 43 | init Initialize the Quake command-line 44 | search Search the Quake database 45 | ``` 46 | 47 | #### 1. 初始化 48 | 49 | _ApiKey 请到 Quake 个人中心查看_ 50 | 51 | ```bash 52 | quake init apikey 53 | ``` 54 | 55 | 如果需要使用 gpt 参数需要先初始化 chatgpt api 56 | chatgpt 的 api 请到该网站获取: 57 | 58 | ```bash 59 | quake gptinit apikey 60 | ``` 61 | 62 | #### 2. 域名查询 63 | 64 | ```bash 65 | ┬─[kali@kali:~/q/t/release]─[09:29:44 PM]─[G:master=] 66 | ╰─>$ ./quake domain 67 | quake-domain 68 | View all available information for a domain. 69 | 70 | USAGE: 71 | quake domain [FLAGS] [OPTIONS] [DOMAIN_NAME] 72 | 73 | FLAGS: 74 | -h, --help Prints help information 75 | -V, --version Prints version information 76 | 77 | OPTIONS: 78 | -o, --output Output result to file. 79 | --size The size of the number of responses, up to a maximum of 100 (Default 10). 80 | --start Starting position of the query (Default 0). 81 | -t, --type Fields displayed:domain,ip,port,title. (Default domain, ip) 82 | 83 | ARGS: 84 | The domain name to be queried.163.251.254 extsign-b.browser.360.cn 85 | ``` 86 | 87 | 域名查询可以查询某个域名的子域名和相似域名,或者域名周含有某些关键子的域名,如:oa、vpn 等,可以设置 start 和 size 参数进行翻页,可以使用-o/--output,将查询结果保存至文件。 88 | -t 参数可以控制显示的字段,有 domain、ip、端口和站点 title 等。 89 | 90 | ##### Example 91 | 92 | ```bash 93 | ┬─[kali@kali:~/q/t/release]─[09:33:10 PM]─[G:master=] 94 | ╰─>$ ./quake domain 360.cn --start 10 --size 10 95 | [+] Search with domain:"*.360.cn" 96 | [+] Successful. 97 | [+] count: 10 total: 11586 98 | 221.130.199.210 audit-s.scan.shouji.360.cn 99 | 112.65.68.50 mall.safe.360.cn 100 | 112.65.68.51 mall.safe.360.cn 101 | 27.115.124.94 salesvideotest.crm.360.cn 102 | 101.198.192.187 salesvideotest.crm.360.cn 103 | 111.206.65.160 0479ae.link.yunpan.360.cn 104 | 111.206.65.160 0479ae.link.yunpan.360.cn 105 | 112.64.200.118 hb065779_893.fx.sj.360.cn 106 | 112.64.200.118 hb065779_893.fx.sj.360.cn 107 | 180.163.235.141 up-q.f.360.cn 108 | 109 | ┬─[kali@kali:~/q/t/release]─[09:33:19 PM]─[G:master=] 110 | ╰─>$ ./quake domain 360.cn --start 10 --size 10 -t ip,port,domain,title 111 | [+] Search with domain:*.360.cn 112 | [+] Successful. 113 | [+] count: 10 total: 11586 114 | 221.130.199.210 443 audit-s.scan.shouji.360.cn 115 | 112.65.68.50 80 mall.safe.360.cn 安全卫士-360商城 116 | 112.65.68.51 443 mall.safe.360.cn 安全卫士-360商城 117 | 27.115.124.94 80 salesvideotest.crm.360.cn 403 Forbidden 118 | 101.198.192.187 443 salesvideotest.crm.360.cn 400 The plain HTTP request was sent to HTTPS port 119 | 111.206.65.160 80 0479ae.link.yunpan.360.cn 安全存储的云盘_360安全云盘 120 | 111.206.65.160 443 0479ae.link.yunpan.360.cn 安全存储的云盘_360安全云盘 121 | 112.64.200.118 80 hb065779_893.fx.sj.360.cn 122 | 112.64.200.118 443 hb065779_893.fx.sj.360.cn 123 | 180.163.235.141 80 up-q.f.360.cn 403 Forbidden 124 | ``` 125 | 126 | #### 3. IP 查询 127 | 128 | ```bash 129 | ┬─[kali@kali:~/q/t/release]─[09:35:45 PM]─[G:master=] 130 | ╰─>$ ./quake host 131 | quake-host 132 | View all available information for an IP address 133 | 134 | USAGE: 135 | quake host [OPTIONS] [ip] 136 | 137 | FLAGS: 138 | -h, --help Prints help information 139 | -V, --version Prints version information 140 | 141 | OPTIONS: 142 | -o, --output Save the host information in the given file (append if file exists). 143 | -q, --query_host_file Quake Host file (Only support --size); Example: quake search -q hosts.txt 144 | --size The size of the number of responses, up to a maximum of 100 (Default 10). 145 | --start Starting position of the query (Default 0). 146 | 147 | ARGS: 148 | View all available information for an IP address 149 | ``` 150 | 151 | 可以快速查询某个 IP 或 IP 段下开放的端口和服务。start/size 参数支持翻页,-o/--output 支持将搜索结果保存至文件。 152 | 153 | ##### Example 154 | 155 | ```bash 156 | ┬─[kali@kali:~/q/t/release]─[10:14:57 PM]─[G:master=] 157 | ╰─>$ ./quake host 5.188.34.101 158 | [+] Search with ip:5.188.34.101 159 | [+] Successful. 160 | [+] count: 1 total: 1 161 | IP: 5.188.34.101 Country: Singapore Province: Singapore City: Singapore 162 | | Port Protocol time 163 | | 3306 mysql 2020-10-03T03:23:14.385Z 164 | | 8080 http 2020-10-29T01:11:01.721Z 165 | | 80 http 2020-10-30T16:19:33.698Z 166 | | 25 smtp 2020-11-05T15:10:57.932Z 167 | | 22 ssh 2020-12-11T03:02:01.624Z 168 | 169 | ┬─[kali@kali:~/q/t/release]─[10:15:06 PM]─[G:master=] 170 | ╰─>$ ./quake host 5.188.34.101/24 171 | [+] Search with ip:5.188.34.101/24 172 | [+] Successful. 173 | [+] count: 10 total: 222 174 | IP: 5.188.34.203 Country: Singapore Province: Singapore City: Singapore 175 | | Port Protocol time 176 | | 80 http 2020-12-21T14:44:17.322Z 177 | 178 | 179 | IP: 5.188.34.17 Country: Singapore Province: Singapore City: Singapore 180 | | Port Protocol time 181 | | 22 ssh 2020-06-30T07:14:12.077Z 182 | | 111 rpcbind 2020-12-22T15:56:07.436Z 183 | | 123 ntp 2020-12-24T12:53:05.514Z 184 | 185 | 186 | IP: 5.188.34.41 Country: Singapore Province: Singapore City: Singapore 187 | | Port Protocol time 188 | | 22 ssh 2021-01-06T16:30:24.237Z 189 | 190 | 191 | IP: 5.188.34.252 Country: Singapore Province: Singapore City: Singapore 192 | | Port Protocol time 193 | | 995 pop3 2020-12-14T21:23:37.832Z 194 | | 80 auto 2020-12-21T22:42:56.926Z 195 | 196 | 197 | IP: 5.188.34.218 Country: Singapore Province: Singapore City: Singapore 198 | | Port Protocol time 199 | | 143 imap 2020-12-17T02:45:47.230Z 200 | | 25 smtp 2020-12-21T12:54:12.368Z 201 | | 3306 mysql 2020-12-28T02:10:44.445Z 202 | ... 203 | 204 | ┬─[kali@kali:~/q/t/release]─[10:15:06 PM]─[G:master=] 205 | ╰─>$ ./quake host -q host.txt -o host_result.txt 206 | [+] Search with ip:"111.229.238.63" OR ip:"111.229.238.64" OR ip:"111.229.231.63/26" OR ip:"111.229.232.63/24" 207 | [+] Successfully saved 284 pieces of data to host_result.txt 208 | 209 | ┬─[kali@kali:~/q/t/release]─[10:15:06 PM]─[G:master=] 210 | ╰─>$ ./quake host -q host.txt 211 | [+] Search with ip:"111.229.238.63" OR ip:"111.229.238.64" OR ip:"111.229.231.63/26" OR ip:"111.229.232.63/24" 212 | IP: 111.229.231.62 Country: China Province: Shanghai City: Shanghai City 213 | | Port Protocol time 214 | | 8080 2020-03-05T22:12:19.869Z 215 | | 10134 orcus-rat 2020-05-14T20:49:03.507Z 216 | | 12000 entextxid 2021-10-12T04:13:47.479Z 217 | | 10626 http 2021-10-12T04:13:48.936Z 218 | | 1112 icp 2021-10-12T04:13:51.914Z 219 | | 10778 http 2021-10-12T04:13:50.894Z 220 | | 30089 http 2022-07-07T07:37:31.263Z 221 | | 51001 http 2022-09-23T07:56:39.626Z 222 | | 51002 http 2022-09-23T07:33:44.401Z 223 | | 52869 http 2022-09-27T11:40:48.949Z 224 | | 8091 http 2022-10-01T20:46:58.201Z 225 | | 11712 http 2022-10-02T16:37:29.825Z 226 | | 11210 http 2022-10-02T17:07:48.967Z 227 | | 10020 http 2022-10-03T17:57:45.262Z 228 | | 9943 http 2022-10-04T08:06:36.923Z 229 | | 7070 http 2022-10-04T16:09:54.222Z 230 | | 12028 unknown 2022-10-06T12:25:34.912Z 231 | | 1025 http 2022-10-07T16:54:59.403Z 232 | 233 | IP: 111.229.231.5 Country: China Province: Shanghai City: Shanghai City 234 | | Port Protocol time 235 | | 80 http 2020-03-04T07:42:10.798Z 236 | | 8888 http 2020-01-10T21:19:47Z 237 | | 88 http 2021-12-06T14:26:32.224Z 238 | | 110 http 2022-09-03T21:56:02.495Z 239 | | 2121 http 2022-09-16T23:20:46.420Z 240 | | 119 http 2022-09-21T22:05:34.596Z 241 | | 25 http 2022-09-27T08:17:06.244Z 242 | | 49665 msrpc 2022-10-06T02:45:55.275Z 243 | | 23 http 2022-10-07T09:19:16.701Z 244 | ... 245 | 246 | ``` 247 | 248 | #### 3. 搜索查询 249 | 250 | ```bash 251 | ┬─[kali@kali:~/q/t/release]─[09:44:34 PM]─[G:master=] 252 | ╰─>$ ./quake search 253 | quake-search 254 | Search the Quake database 255 | 256 | USAGE: 257 | quake search [OPTIONS] [query_string] 258 | 259 | FLAGS: 260 | -h, --help Prints help information 261 | -V, --version Prints version information 262 | 263 | OPTIONS: 264 | -c, --cdn Exclude cdn data when parameter is 1,Not excluded by default 265 | -d, --deduplication When the parameter is 1, data deduplication is performed, and no deduplication is 266 | performed by default. 267 | -f, --filter Filter search results with more regular expressions. 268 | Example: quake search 'app:"exchange 2010"' -t ip,port,title -f "X-OWA-Version: 269 | (.*)" 270 | -r, --filter_request When the parameter is 1, invalid requests are filtered, such as 400, 401, 403 and 271 | other request data, the default is not filtered 272 | -m, --honey_jar Exclude honey_jar data when parameter is 1,Not excluded by default 273 | -l, --latest_data Display latest data when parameter is 1,Not up to date by default 274 | -o, --output Save the host information in the given file (append if file exists). 275 | -q, --query_file Quake Querystring file; Example: quake search -q test.txt 276 | --size The size of the number of responses, up to a maximum of 100 (Default 10). 277 | --start Starting position of the query (Default 0). 278 | -e, --end_time