目录
- ①常见语法及其功能
- Ⅰ关键词:搜索内容
- Ⅱ逻辑运算符使用
- 1. `AND` 运算符
- 2. `OR` 运算符
- 3. `NOT` 运算符
- @综合示例
 
 
 
- ②综合搜索案例
- 案例 1:查找某网站的登录页面
- 案例 2:查找包含密码的 Excel 文件
- 案例 3:查找某网站的所有 PDF 文件
- 案例 4:查找标题包含“管理”的网页
- 案例 5:查找某地的天气信息
- 案例 6:查找公开的摄像头
- 案例 7:查找 Google 缓存的某个页面
- 案例 8:查找默认登录页面
- 案例 9:查找某站点的基本信息
- 案例 10:查找与特定网站相关的链接
 
 
 
- ③复杂搜索案列
- 实例 1:查找包含密码的 Excel 文件
- 实例 2:查找公开的目录列表,并且目录标题包含敏感词
- 实例 3:查找包含 SQL 错误信息的网页
- 实例 4:查找未授权访问的 phpMyAdmin 登录页面
- 实例 5:查找暴露的 Apache 服务器状态页面
- 实例 6:查找包含信用卡信息的文本文件
- 实例 7:查找公共的 Google Drive 文件
 
 
 
①常见语法及其功能
Ⅰ关键词:搜索内容
-  site: 找到与指定网站有联系的 URL,缩小搜索范围。 site:example.com
-  inurl: 返回 URL 中存在关键词的页面。 inurl:admin
-  intext: 搜索正文中出现指定关键词的网页。 intext:"confidential"
-  intitle: 搜索标题中包含指定关键词的网页。 intitle:"index of"
-  filetype: 搜索指定类型的文件。 filetype:pdf
-  cache: 搜索 Google 里关于某些内容的缓存。 cache:example.com
-  define: 搜索某个词语的定义。 define:hacking
-  info: 查找指定站点的一些基本信息。 info:example.com
-  link: 返回所有和指定网站做了链接的 URL。 link:example.com
-  index of: 找目录遍历会用到。 intitle:"index of" "parent directory"
-  allintitle: 查找标题中包含多个关键词的页面。 allintitle:login password
-  allinurl: 查找 URL 中包含多个关键词的页面。 allinurl:php?id=
-  weather: 查找某地的天气信息。 weather:New York
-  map: 查找某地的地图。 map:New York
-  phonebook: 查找电话号码。 phonebook:John Doe
-  stocks: 查找股票信息。 stocks:GOOG
-  movie: 查找电影信息。 movie:Inception
-  daterange: 搜索特定日期范围内的页面(需要使用 Julian 日期格式)。 daterange:2451545-2455197
-  before: 查找某个日期之前的页面。 before:2020
-  after: 查找某个日期之后的页面。 after:2020
-  AROUND(X): 查找两个关键词在页面中相隔不超过 X 个单词的页面。 security AROUND(5) network
Ⅱ逻辑运算符使用
在 Google Hacking 中,逻辑运算符用于组合多个搜索条件,以便更精确地过滤搜索结果。常用的逻辑运算符包括 AND、OR 和 NOT,在 Google 搜索中分别表示为 空格、| 和 -。以下是这些逻辑运算符的详细讲解及示例:
1. AND 运算符
 
AND 运算符表示搜索结果必须同时包含多个关键词。在 Google 搜索中,AND 运算符可以通过空格来表示。
filetype:pdf confidential
- 解释:搜索文件类型为 PDF,且正文中包含 “confidential” 的页面。
site:example.com login password
- 解释:搜索 example.com网站上,正文中同时包含 “login” 和 “password” 的页面。
2. OR 运算符
 
OR 运算符表示搜索结果可以包含多个关键词中的任意一个。在 Google 搜索中,OR 运算符使用竖线 | 表示。
intext:"sql syntax error" | intext:"unexpected T_STRING"
- 解释:搜索正文中包含 “sql syntax error” 或 “unexpected T_STRING” 的页面。
intitle:login | intitle:signin
- 解释:搜索标题中包含 “login” 或 “signin” 的页面。
3. NOT 运算符
 
NOT 运算符表示排除包含特定关键词的页面。在 Google 搜索中,NOT 运算符使用减号 - 表示。
site:example.com -inurl:admin
- 解释:搜索 example.com网站上,URL 中不包含 “admin” 的页面。
intitle:"index of" -inurl:admin
- 解释:搜索标题中包含 “index of” 且 URL 中不包含 “admin” 的页面。
@综合示例
示例 1:查找包含 SQL 错误信息或 PHP 错误信息的页面,但排除特定站点
(intext:"sql syntax error" | intext:"unexpected T_STRING") -site:example.com
- 解释:搜索正文中包含 “sql syntax error” 或 “unexpected T_STRING”,且排除来自 example.com的页面。
示例 2:查找包含密码的 Excel 文件,但排除特定站点
filetype:xls inurl:"password" -site:example.com
- 解释:搜索包含 “password” 的 Excel 文件,且排除来自 example.com的结果。
示例 3:查找目录列表页面,同时标题包含特定关键词,但排除包含管理关键词的页面
intitle:"index of" "parent directory" -inurl:admin
- 解释:搜索标题中包含 “index of” 和 “parent directory”,且 URL 中不包含 “admin” 的页面。
示例 4:查找包含敏感信息的 PDF 文件,标题包含多个关键词之一
filetype:pdf (intitle:confidential | intitle:sensitive)
- 解释:搜索文件类型为 PDF,且标题中包含 “confidential” 或 “sensitive” 的页面。
②综合搜索案例
案例 1:查找某网站的登录页面
site:example.com inurl:login 
搜索 example.com网站中包含 "login" 的页面。
案例 2:查找包含密码的 Excel 文件
filetype:xls inurl:"password"
搜索包含密码的 Excel 文件
案例 3:查找某网站的所有 PDF 文件
site:example.com filetype:pdf
搜索 `example.com` 网站上的所有 PDF 文件。
案例 4:查找标题包含“管理”的网页
intitle:管理
搜索标题中包含“管理”的网页。
案例 5:查找某地的天气信息
weather:New York
搜索纽约的天气信息。
案例 6:查找公开的摄像头
inurl:"view/view.shtml"
搜索公开的摄像头页面。
案例 7:查找 Google 缓存的某个页面
cache:example.com
查看 `example.com` 的 Google 缓存页面。
案例 8:查找默认登录页面
intitle:"login" inurl:admin
搜索标题包含 "login" 并且 URL 包含 "admin" 的页面。
案例 9:查找某站点的基本信息
info:example.com
查找 `example.com` 的基本信息。
案例 10:查找与特定网站相关的链接
link:example.com
返回所有与 `example.com` 做了链接的 URL。
③复杂搜索案列
实例 1:查找包含密码的 Excel 文件
filetype:xls inurl:"password" -site:example.com
- 解释:搜索包含 “password” 的 Excel 文件,并排除来自 example.com网站的结果。
- 操作符: - filetype:xls:限定文件类型为 Excel 文件。
- inurl:"password":URL 中包含 “password” 关键词。
- -site:example.com:排除来自- example.com的结果。
 
实例 2:查找公开的目录列表,并且目录标题包含敏感词
intitle:"index of" "parent directory" intext:"confidential"
- 解释:搜索目录列表页面,这些页面的标题包含 “index of” 和 “parent directory”,正文中包含 “confidential”。
- 操作符: - intitle:"index of" "parent directory":标题包含 “index of” 和 “parent directory”。
- intext:"confidential":正文中包含 “confidential”。
 
实例 3:查找包含 SQL 错误信息的网页
intext:"sql syntax error" | intext:"unexpected T_STRING" | intext:"SQLSTATE[HY000]"
- 解释:搜索包含常见 SQL 错误信息的网页,以发现潜在的 SQL 注入漏洞。
- 操作符: - intext:"sql syntax error":正文中包含 “sql syntax error”。
- |:逻辑或操作符。
- intext:"unexpected T_STRING":正文中包含 “unexpected T_STRING”。
- intext:"SQLSTATE[HY000]":正文中包含 “SQLSTATE[HY000]”。
 
实例 4:查找未授权访问的 phpMyAdmin 登录页面
intitle:"phpMyAdmin" "login" -site:phpmyadmin.net
- 解释:搜索 phpMyAdmin 的登录页面,并排除来自官方 phpMyAdmin 网站的结果。
- 操作符: - intitle:"phpMyAdmin":标题包含 “phpMyAdmin”。
- "login":包含 “login” 关键词。
- -site:phpmyadmin.net:排除来自- phpmyadmin.net的结果。
 
实例 5:查找暴露的 Apache 服务器状态页面
intitle:"Apache Status" "Server Status" -site:apache.org
- 解释:搜索 Apache 服务器状态页面,并排除来自官方 Apache 网站的结果。
- 操作符: - intitle:"Apache Status":标题包含 “Apache Status”。
- "Server Status":包含 “Server Status” 关键词。
- -site:apache.org:排除来自- apache.org的结果。
 
实例 6:查找包含信用卡信息的文本文件
filetype:txt intext:"credit card" intext:"number" -site:example.com
- 解释:搜索包含 “credit card” 和 “number” 关键词的文本文件,并排除来自 example.com的结果。
- 操作符: - filetype:txt:限定文件类型为文本文件。
- intext:"credit card":正文中包含 “credit card”。
- intext:"number":正文中包含 “number”。
- -site:example.com:排除来自- example.com的结果。
 
实例 7:查找公共的 Google Drive 文件
site:drive.google.com "Confidential" -site:docs.google.com
- 解释:搜索 Google Drive 上包含 “Confidential” 关键词的文件,并排除来自 Google Docs 的结果。
- 操作符: - site:drive.google.com:限定搜索范围为 Google Drive。
- "Confidential":包含 “Confidential” 关键词。
- -site:docs.google.com:排除来自 Google Docs 的结果。