[TOC]
描述:google搜索引它有别于百度、搜狗等内容搜索引擎,其在安全界有着非同一般的地位,甚至在网络安全专业有一名词为google hacking用来形容google与网络安全非同寻常的关系
搜索基础:
*在谷歌搜索的时候只能当做一个单词使用Google基本语法:
#Google语法
intext: #将返回所有在网页正文部分包含关键词的网页
allintext: #使用方法和intext类似.
intitle: #将返回所有网页标题中包含关键词的网页
alltitle: #字词出现的位置(网页网址中)
inurl: #搜索我们指定的字符是否存在于URL中
allinurl: #也同inurl类似,可指定多个字符.
inanchor: #寻找链接的锚点,inanchor 寻找链接的锚点
allinanchor: #指向网页的链接中字词出现位置
cache: #搜索google里关于某些内容的缓存(直接跳转到页面的缓存版本)
define: #搜索某个词语的定义
filetype: #搜索特定后缀的文件 ,如:.bak,.mdb,.inc等
ext: #与filetype是同义词
info: #查找指定站点的一些基本信息
Link: #可以返回所有和thief.one做了链接的URL link:thief.one
site: #将返回所有和这个站有关的URL(精确到特定的网站) site:thief.one
numberange #搜索一个数字(需要两个参数,一个低位数字,一个高位数字,中间用连字符分割) 注意: ..是numberange的简写形式
datarange # 搜索在特定日期范围内发布的页谷歌每次重新抓取一个网页网页的日期就会刷新(不如使用谷歌的高级搜索引擎实现)
related #显示相关站点参数是一个URL
phonebook
rphonebook
bphonebook
uthor
group
msgid
insubject
stocks
#Google通配符
+ 把google可能忽略的字列如查询范围
- 把某个字忽略,例子:新加 -坡
~ 同意词
. 单一的通配符
* 通配符,可代表多个字母
"" 精确查询
| 匹配多个条件Google关键字使用
#(1)搜索国家及地区顶级域名 (ccTLD) 则显示他们得网站
#台湾站-日本站
inurl:tw|jp
#下面这样也行范围比较广
site:.jp inurl:robots.txt
#(2)使用它可以直接进入网站首页下的所有文件和文件夹中(多用于查找目录遍历文件泄露)
site:domain.com intitle:Index.of
#(3)查找站点相应的多个路径
inurl:conf OR inurl:config OR inurl:cfg #组合其他的通用的命名规则来查找其他等价的命名规则
#(4)按照范围时间进行查找
site:domain.com numberange:12344-12346 #为了找到12345
site:domain.com datarange:
WeiyiGeek.
十大简单有效的安全搜索
一、site:
在一个安全评估的信息收集阶段,site运算符应该作为一个基础的搜索而不是一个单独的搜索
谷歌会将最受欢迎的页面浮动到搜索结果的最上方site 搜索能够搜集由一个目标维护的服务器和主机的信息
实例:site:nytimes.com -site:www.nytimes.com
这个查询很快就找到了在 mytimes.com 而不在 www.nytimes.com 域中的主机,得到的这些可能是主机也可能是子域
二、intitle:index.of 解释见前文
三、error|warning
错误信息会泄露大量的关于目标的信息,我们常常将其与site结合在一起使用
实例:"for more information"|"noot found") (error|warning)
四、login|logon
关联到登录入口的文档列出了email 电话 或者是帮助忘记密码的用户重获权限的人工助手的URL,这些人工助手或许就是社会工程攻击的完美目标,安全系统最大的弱点是键盘后面的人
login trouble 也是很有价值的
五、username|userid|employee.ID “your username is” 有很多的方法能从目标系统获取用户名,即使用户名是大多数认证机制中不太重要的部分
六、password|passcode|”your password is” reminder forgotten 某些情况下,这种查询与site结合会找到提供创建密码策略信息的帮助页面,这对后面的密码的猜解提供了巨大的帮助
七、admin|administrator
我们还可以加上 contact you/contact your (system) administrator返回的结果可能会涉及本地、公司、网站、部门、服务器、系统、网络、数据库、email 等
实例:"administrative login"|"admin login"
注意:另一种方式就是用inurl 在URL查找adminstrator 类似的词语,十有八九就是网站的登录界面
八、-ext:html|-ext:htm|-ext:shtml|-ext:asp|-ext:php 描述:ext 是filetype类型的同义词,上面的查询也是一个否定查询,要和site结合起来用,单独使用是没有效果的
但是如果site搜索与排除了前十个最常见文件类型的搜索组合使用的话,就能直接找到有趣的文档,这能给攻击者节省大量的时间
九、inurl:temp|inurl:tmp|inurl:backup|inurl:bak 与site 相结合就能在一个服务器上查找备份和临时文件,尽管临时和备份文件可能会被命名成奇怪的样子,但是他们的格式是不会变的
十、intrnet|help.desk intranet 已经变成了描述一个小团体中局域网的通用名词,这个名词代表着封闭的网络,不对外开放 但是现在很多的站点已经配置了从因特网访问一个局域网的入口,这就把攻击者与封闭网络拉近了距离
注意点:
文件类信息搜寻
目录列表的查找以及列目录泄露版本系统指纹
#列目录找寻(扩展遍历技术)
#进入网页中存在弱点得目录中(列目录)
# index of /
# index of /upload #upload目录
# index of /config
# index of /db
site:Domain.com intitle:index.of #这里的.符代表的是单个字母的通配符
site:Domain.com intitle:index.of "parent directory"
site:Domain.com 转到父目录
site:Domain.com "server at" intitle:index.of
#常常是数据库配置文件以及web页面的备份文件
site:Domain.com inurl:conf.php.bak
site:Domain.com intitle:index.of index.php.bak
site:Domain.com intitle:index.of config.php.bak
#(特定版本的)服务器,还可以确定服务器的操作系统、模块和其他信息(会把操作系统写在括号里)
intitle:index.of "Apache/1.3.27 Server at"
"Apache/2.4.12 Server at" "-intitle:index.of intitle:inf"
"Apache/2/4/12 Server at" intitle:index.of intitle:error
# 敏感文件快速搜寻
intitle:"index of" data
intitle:"index of" etc
intitle:"Index of" .sh_history
intitle:"Index of" .bash_history
intitle:"index of" passwd
intitle:"index of" people.lst
intitle:"index of" pwd.db
intitle:"index of" etc/shadow
intitle:"index of" spwd
intitle:"index of" master.passwd
intitle:"index of" htpasswd
intitle:"index of" dbf
inurl:(Server|authors|administrators) ext:pwd
intext:(password|passcode|pass) intext:(username|userid|user)
WeiyiGeek.
文件查找以及配置文件查找
#Filetype是常见的文件类型
site:Domain.com filetype:mdb | ini | inc | db | doc | docx | pdf | xls | ppt | rtf | swf | conf | sql
site:Domain.com filetype:mdb OR filetype:ini OR filetype:inc OR filetype:db OR filetype:doc OR filetype:docx OR filetype:pdf OR filetype:xls OR filetype:ppt OR filetype:rtf OR filetype:swf OR filetype:conf OR filetype:sql
#查看服务器使用的程序
site:Domain.com filetype:asp
site:Domain.com filetype:php
site:Domain.com filetype:jsp
site:Domain.com filetype:aspx
#日志查找
filetype:log inurl:log
filetype:log username putty
intitle:index.of install.log
filetype:log inurl:install.log
ext:log log
#特殊文档下载
filetype:xls inurl:password.xls
filetype:xls username password email搜索站点后台路径和数据库
#指定站点找寻后台登录路径
site:Domain.com intext:管理
site:Domain.com inurl:login
site:Domain.com intitle:login intext:版权信息
site:Domain.com intext:管理|后台|登录|用户名|密码|验证码|系统|账号|后台管理|后台登录
#数据库的转储,攻击者可以搜索转储的标题
# Dumping data for table(user|username|password|pass) 攻击者可以搜索转储的标题
filetype:sql sql user
#攻击者还能直接搜索到数据库本身,但是并不适合所有的数据库系统(利用google暴库可以搜索到互联网上可以直接下载到的数据库文件)
inurl:Domain.com filetype:mdb
inurl:data filetype:mdb
inurl:editor/db/
inurl:eWebEditor/db/
inurl:bbs/data/
inurl:databackup/
inurl:blog/data/
inurl:\boke\data
inurl:bbs/database/
inurl:conn.asp
inurl:conf.php
inurl:database filetype:mdb
inurl:data filetype:inc
allinurl:bbs data
WeiyiGeek.
网站的敏感信息以及错误信息收集
#(1)数据库的错误消息能够用来分析操作系统和web服务器的版本,还可能有注入的情况
intext:"SQL command not properly ended" filetype:php #表示没有在sql语句的最后找到正确的终止符,所以可能会被用于注入攻击
intext:"expects parameter 1 to be resource, boolean given" filetype:php #报错语法
#(2)CMS-Error Sql注入报错搜寻
inurl:demo.browse.php intitle:getid3 #目录遍历
inurl:index of driver.php?id= #西安CMS错注入
inurl:"id=" & intext:"MySQL Error: 1064" & "Session halted." #sql注入
intitle:"Struts Problem Report" intext:"development mode is enabled." cn #开发模式的structsgoogle搜索C段服务器信息,可通过google可获取218.87.21.0/24网络的服务信息。
site:218.87.21.* #此技巧来自lostwolf
WeiyiGeek.
与之相关联得站点信息
link:Domain.com #其他得站点做了该地址得link都将显示
relate:Domain.com #相似的网站搜寻
WeiyiGeek.
#查看上传漏洞
site:Domain.com inurl:file
site:Domain.com inurl:load
site:Domain.com inurl:upload.jsp
#下载文件漏洞
site:Domain.com inurl:dowload.jsp filetype:doc
inurl:ftp filetype:xls site:microsoft.com "password"
inurl:Server.pwd
filetype:xls inurl:password.xls
filetype:xls username password email
#查找注射点
site:Domain.com filetype:asp?id=Google特殊信息搜寻公司人员信息
#GOOGLE搜索(微博、QQ、领英、支付宝、贴吧、博客论坛、微信等等)
北京的电子商务公司 ----- 北京 intitle:电子商务 intext:法人 intext:电话
阿里网站上的背脊公司联系人 ----- 北京 site:alibaba.com inurl:contact
塞班司法方案的PDF文档 ----- SOX filetype:pdf
法国的支付相关页面 ----- payment site:frGoogle寻找Github中敏感信息技巧: Github之邮件配置信息泄露很多网站及系统都会使用pop3和smtp发送来邮件,不少开发者由于安全意识不足会把相关的配置信息也放到Github上,所以如果这时候我们动用一下google搜索命令语句,构造一下关键字,就能把这些信息给找出来了。
#我的各种姿势:
site:Github.com smtp
site:Github.com smtp @qq.com
site:Github.com smtp @baidu.com #我们也可以锁定域名搜索结合厂商域名 灵活运用例如搜百度的
site:Github.com smtp @126.com
site:Github.com smtp @163.com
site:Github.com smtp @sina.com.cn
site:Github.com smtp password
site:Github.com String password smtp
#Github之数据库信息泄露#
site:Github.com sa password
site:Github.com root password
site:Github.com User ID='sa';Password
#Github之svn信息泄露#
site:Github.com svn
site:Github.com svn username
site:Github.com svn password
site:Github.com svn username password
#Github之数据库备份文件:
site:Github.com inurl:sql
#Github之综合信息泄露#
site:Github.com password
site:Github.com ftp ftppassword
site:Github.com 密码
site:Github.com 内部
".git" intitle:"Index of"
"*.git/config" intitle:"Index of"Google信息刺探

WeiyiGeek.
谷歌在一个信息收集框架中的身影
# 所有的搜索都遵循几个步骤
# 1.定义一个原始的搜索项
# 2.扩展该搜索项
# 3.从数据源获得数据
# 4.语义分析该数据
# 5.把该数据加工成信息(1)原始搜索项 清晰的定一个目标是搜索中最困难的一项,聪明的搜索不会获得一个不明确的目标,记住:无用输入,无用输出。 目标的分解工作尤为重要
(2)扩展搜索项 自动化搜索的真正的力量在于想象出人操作的过程并翻译成某种形式的算法
1.Email地址:很多网站都会尝试模糊处理email来欺骗数据挖掘程序,因为很多的垃圾邮件的发送者会通过数据挖掘程序来收集email地址。 当然我们有办法解决
#email 地址可以扩展,比如:
qazwsx@k0rz3n.com
qazwsx at k0rz3n.com
qazwsx at k0rz3n dot com
qazwsx@k0rz3n dot com
qazwsx_at_k0rz3n.com
qazwsx_at_k0rz3n dot com
qazwsx_at_k0rz3n_dot_com
qazwsx@k0rz3n.remove.com
qazwsx@_removethis_k0rz3n.com
#注意:
1.@符号能被篡改成很多的形式,比如说: -(at) at -at- 这也同样适用与dot
2.@ 和 dot 会被搜索引擎忽略
#验证一个email的地址
Linux上使用host 命令 host -t xxx.gmail.com
windows上使用nslookup -qutype = xxx.gmail.com电话号码:email地址是有格式的,但是电话号码没有
在一定的范围内查找结果中包含电话号码的有趣的地方是,你可以使用google 的numrange运算符,最好的方法就是指定起始数字然后在数字最后带上(..是numberange的简写形式) 例如:252793..9999
3.人员信息:找到某人信息最好的方法就是google他们,最常见的方式就是直接放到google中,但是这样会存在大量的无用结果,我们需要增加信息然后联合国内的一些社交平台(微博、QQ、领英、支付宝、贴吧、博客论坛、微信等等)
filetype:ctt messager #MSN信使联系人列表
filetype:blt blt + intext:screenname #AIM好友列表4.更多组合:我们可以把自己的搜索与能获取更好的结果的搜索项一起使用 当查找email时,能添加类似 通讯录 邮件 电子邮件 发送这种关键词 查找电话号码的时候可以使用一些类似 电话 移动电话 通讯录 数字 手机
(3)使用特别的运算符
扩展名有时候能使用布尔运算符再次组合起来 实例:filetype:ppt or filetype:doc site:xxxx.gov
(4)从数据源获取数据
自行挖掘请求和接受响应的几个自动化的工具
#Netcat(nc):TCP/IP的瑞士军刀,功能异常强大,但是这里我们仅仅用它来接收响应:
$(echo "GET/HTTP/1.0"; echo "Host:www.google.com";echo)|nc www.google.com 80 -vv
#当然我们也可以把请求头写入文件1.txt
GET /HTTP/1.1
Host:www.google.com
~
~
#注意:这两个波浪线代表两个空行
nc www.google.com 80 -vv < 1.txt >2.txt #直接把响应写入了2.txt
#wget:我们还能够指定请求头的参数来规避谷歌的反爬虫机制
wget "http://www.baidu.com" -O output.txt
wget -U my_diesel_driven_browser "https://www.google.com" -O output.txt
#curl:curl就更加简单了,带有一个可选的参数-A 代表 UA
curl -A xxxx "https://www.google.com"
#lynx:Linux命令学习中用到Kail里面也使用到过
纯文本模式的网页浏览器,不支持图形、音视频等多媒体信息。
用法参见http://man.linuxde.net/lynx使用其他的搜索引擎如 bing 思考:如何发现一个透明代理: 1.telnet到网络外面的一些随机的ip地址的80端口,如果你每次都能获得一个连接的话,你就在一个透明代理后面 2.直接telnet 到网站里,然后发送GET/HTTP/1.0 查看响应,不要给Host参数(一些代理使用Host:header 确定你想去的位置,如果你不给就会报出400的错误)
描述:GHDB是世界广大的黑客朋友们自发维护的一个汇集着各种已经被优化的查询语句的数据库,每天都在不断地更新,如果你对如何驾驭Google Hacking 的语法感到迷茫,或者是想提升自己的查询能力,再或者是想发现一些新的姿势,这里绝对是你的不二之选。 Google Hacking Database(GHDB)项目地址:https://www.exploit-db.com/google-hacking-database/
语句分类 在首页的实例语句的下方有着很多的分类,每种分类都有不同的语句条数。

WeiyiGeek.
分类从左往右从上到下分别是
在搜索框左边的下拉菜单中也有着详细的分类,如下图

WeiyiGeek.
搜索 描述:在这一部分我会把常见的漏洞搜索语句列举出来。
#一、寻找目录列表中的敏感文件或者目录:
#基本语句:
#查找目录列表的敏感文件**
1.(site:域名)intitle:"index.of"(|intitle:...) (intext:)"敏感文件名/敏感后缀名" (|intext:...) (-忽略的文件名)
#查找url中能访问的敏感文件或者目录**
1.(site:域名) inurl:"敏感文件名/目录名"|inurl:... (-忽略的文件名)
2.(site:域名) filetype:后缀名 inurl:文件名(|inurl:...) (-忽略的文件名)
3.(site:域名) intext:"文件中独一无二的短语" (-忽略的文件名)
#查找特定的服务器版本的网站**
(site:域名) intext:"Apache/1.3.27 Server at" (-忽略的文件名)
#查找登录入口/后台**
(site:域名) inurl:"login"|inurl:"logon"|inurl:"admin"|inurl:"manage"|inurl:"manager"|inurl:"member"|inurl:"admin_login"|inurl:"ad_login"|inurl:"ad_manage"|inurl:"houtai"|inurl:"guanli"|inurl:"htdl"|inurl:"htgl"|inurl:"members"|inurl:"system"(|inurl:...) (-忽略的文件名)
#错误消息
(site:域名) intext:"error"|intext:"warning"|intext:"for more information"|intext:"not found"|intext:"其他错误消息" (-排除的信息)
#数据库的转储
(site:域名) # Dumping data for table(user|username|password|pass) (-排除的信息)
#查找子域名
site:"主机名" -site:"www.主机名" (-排除的信息)
#查找网站中泄露出的邮箱地址
site:域名 intext:"email"(|intext:...) (-排除的信息)
#查找网站中的人的信息
site:域名 intext:"人的信息"(|intext:...) (-排除的信息)
#用户名相关**
(site:域名) intext:"username"|intext:"userid"|intext:"employee.ID"(|intext:...) "your username is" (-排除的信息)
#密码相关
(site:域名) intext:"password"|intext:"passcode"(|intext:...) "your password is" "reminder forgotten" (-排除的信息)
#公司相关
site:域名 intext:"admin"|intext:"administrator"|intext:"contact your system"|intext:"contact your administrator" (-排除的信息)
#web 服务器的软件错误消息
site:域名 intitle:"Object not found!" "think this is a server error" (-排除的信息)
#默认页面、文档
site:域名 inurl:"默认页面、文档"(|inurl:...) (-排除的信息)
#各种网络硬件设备
"Version Info" "BootVesion" "Internet Settings" 能找到 Belkin Cable/DSL路由器
#注册表信息
filetype:reg HKEY_CURRENT_USER|(其他注册表文件) (username|其他细节信息)1.目录列表和丢失的索引文件 .htaccess 可以来防止目录的内容未授权的访问,但是不当的配置还会让这个文件可见甚至可读 在 apache 的服务器上可以通过 httpd.conf文件中的单词indexs前加一个连字符或者减号来禁止目录列表
2.robots.txt
#开头的行会被认为是注释,每一个不以#开头的行都会以User-agent 或者是一个disallow 声明开头,表示禁止爬虫爬行的位置,但是也可以允许特定的爬虫访问
User-agent: dotbot
Disallow: /
User-agent:*
Allow: /
Allow: /archives/
Allow: /about/
Disallow: /images/
Disallow: /fonts/
Disallow: /*.js
Disallow: /*.css
Sitemap: http://weiyigeek.github.io/sitemap.xml
Sitemap: http://weiyigeek.github.io/baidusitemap.xml3.NOARCHIVE缓存杀手
有时候你希望google住抓取某个页面但是又不希望对页面的副本进行缓存,或者搜索结果中显示缓存链接,这个要求可以通过META实现
<META NAME= "ROBOTS" CONTENT= "NOARCHIVE">
如果你只想阻止谷歌对文件的缓存,可以在HEAD节里使用
<META NAME="GOOGLEBOT" CONTENT="NOINDEX,NOFOLLOW">4.NOSNIPPET 去除摘要另外这个功能还有个副作用,就是谷歌也不能缓存,一举两得。
<META NAME="GOOGLEBOT" CONTENT="NOSNIPPET">5.十五条防止信息泄露和服务器入侵的措施
推荐Google的渗透测试的两个好朋友
附件一(后缀名/隐藏文件):
".vscode"
".env"
".Trash"
".bashrc"
".git"
".ftpconfig"
".ds_store"
".ssh"
".mysql_history"
"WS_FTP.ini"
"admin.zip"
"dead.letter"
"secring.skr"
"secring.pgp"
"secring.bak"
".bash_history"
"README.md"
"README.MD"
"README"
"phpinfo.php"
"test.php"
"database.propertie"
"web.xml"
".gitignore"
"_viminfo"
".bak_Edietplus"
".viminfo"
".swp"
".swo"
".swn"
".swm"
".swl"
".save1"
".save2"
".save3"
".svn"
".hg"
".bzr"
".xml"
".yml"
".mail"
".password"
".letter"
".bak"
".back"
".pwd"
".config"
".conf"
".cgi"
".mdb"
".db"
".json"
".ini"
".reg"
".txt"
".zip"
".rar"
".tar.gz"
".7z"
".cab"
".jar"
".lzh"
".ace"
".gzip"
".uue"
".bz2"
".arj"
".iso"
".z"
"~"
".idle"
".inc"
".yaml"
".cfg"
".dump"
".sql"
".doc"
".xls"
".pptx"
".docx"
".ppt"
".ssh"
".mdb"
".cfg"
".gov"
".sh"
".desk"
".cnf"
".pl"
".dll"
".nsf"
".cfm"
".ctl"附件二(目录):
"home/000~root~000/"
"logs"
"log"
"lighttpd"
"admin"
"siteadmin"
"administrator"
"gadmin"
"system"
"webadmin"
"wwwboard"
"fileadmin"
"manager"
"file"
"userfiles/file"
"users"
"user"
"root"
"sym/root"
"database"
"db"
"mdb"
"backup"
"back"
"login"
"ect"
"sys"
"var"
"bin"
"sbin"
"scripts"
"tmp"
"temp"
"home"
"dev"
"api"
"app"
"config"
"conf"
"www"
"wncry"
"group"
"server"
"client"
"uc_client"
"uc_server"
"source"
"install"
"data"
"template"
"archiver"
"html/js/editor/fckeditor/editor/filemanager/connectors"
"dump"
"wp-content/uploads/userpro"
"eyeos"
"owncloud"
"pwd"
"password"
"passwords"
"passwd"
"passcode"
"passcodes"
"__MACOSX"
"awstats/data"
"cgi"
"pubs"
"ftp"
"webman"
"myshare"
"web"
"list"
"lists"
"modules"
"com_jobline"
"upload"
"uploads"
"soft"
"fckeditor"
"demo"
"store"
"parent directory"
"phpMyAdmin"
"network"
"last modified"
"lck"
"firewall"
"login"
"logon"
"logout"
"webapps"
"web-console"
"iissamples"
"default"
"root"
"license"
"changelog"
"ckfinder"
"download"
"error_log"
"phpinfo"
"fs_admin"
"updown"
"asusvnc"
"net2ftp"
"content"
"cgi-bin"
"VHost"
"volumes"
"shell"
"messages"
"configuration"
"details"
"register"
"_layouts"
"settings"
"catalog"
"modified"
"htpasswd"
"proftpd"
"access"
"gateway"
"printenv"
"server-status"
"servlet"
"SnoopServlet"
"webmin"
"phpsysinfo"
"changepassword"
"inc"
"htaccess"
"robots"
"proc"
"self"
"cwd "
"info"
"iptable"
"miniProxy"
"_catalogs"
"private"
"authors"
"userid"
"putty"附件三(操作系统)
Unix
CentOS
Debian
Debian GNU/Linux
Fedora
FreeBSD
Linux/SUSE
Linux/SuSE
NETWRE
Red Hat
Ubuntu
UNIX
Win32附件四(注册表)
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_CURRENT_CONFIG