Google Hacking与智能蠕虫防治
文章作者:[email]zhenghui@ccert.edu.cn[/email]CERNET Computer Emergency Response Team
[email]zhenghui@ccert.edu.cn[/email]
主要内容
Google Hacking的工作原理的工作原理
智能蠕虫的传播机制
防范措施
讨论
Google Hacking的含义
原指:
- 利用Google Google搜索引擎搜索信息来进行_blank>入侵的_blank>技术和行为;
现指:
- 利用各种搜索引擎搜索信息来进行_blank>入侵的_blank>技术和行为;
Google的历史
Google([url]www.Google.com[/url])是一个搜索引擎。
由两个斯坦福大学博士生Larry Page与Sergey Brin于1998年9月发明。
Google Inc. 于1999年创立。
2000年7月份,Google 替代Inktomi 成为成为Yahoo公司的搜索引擎,同年9月份,Google成为中国网易公司的搜索引擎。
98年至今,Google已经获得30多项业界大奖。
[url]http://www.Google.com/press/index.html[/url]
Google能搜到什么
Google支持多达132种语言,包括简体中文和繁体中文;
Google检索网页数量达30亿;
Google的专利网页级别_blank>技术PageRank能够提供准确率极高的搜索结果;
Google具有独到的图片搜索功能;
Google具有强大的_blank>新闻组搜索功能;
Google具有二进制文件搜索功能( PDF,DOC,SWF等);
Google的"网页快照"功能,能从Google _blank>服务器里直接取出缓存的网页。
Google 搜索基本指令
+ :强制包含检索项:
- :排除某检索项:
" :组合多个检索词作为一个检索项:
. :匹配任意字符:
* :匹配任意检索词:
| :或:
() :分割各检索项:
Google 搜索高级指令
filetype
inurl, allinurl
site
intitle, allintitle
intext, allintext
numrange, daterange
基于Google 的信息搜集_blank>技术
针对站点
针对_blank>服务器
针对目录
针对缺省配置
- Web页面:Apache, Netscape ,IIS
- 文档
针对错误信息
针对登陆页面
针对口令信息
针对管理页面
Web_blank>服务器指纹
--根据测试页信息判断_blank>服务器版本
allintitle:Netscape FastTrack Server Home Page - Unknown Netscape server
allintitle:Netscape Enterprise Server Home Page - Many Netscape servers
allintitle:Welcome to Windows XP" target=_blank>XP Server Internet Services - IIS 6.0
allintitle:Welcome to Windows 2000 Internet Services - IIS 5.0
allintitle:Welcome to Internet Information Server - IIS 4.0
intitle:welcome.to.IIS.4.0 - IIS 4.0
itle:"Under construction" "does not currently have" - Unknown IIS server
intitle:welcome.to intitle:internet IIS - Many IIS servers
Intitle:Simple.page.for.Apache Apache.Hook.Functions - Apache SSL/TLS SSL/TLS
Intitle:Simple.page.for.Apache Apache.Hook.Functions - Apache 2.0
Intitle:Test.Page.for.Apache seeing.this.instead - Apache 1.3.11 1.3.26
Intitle:Test.Page.for.Apache It.worked this.web.site - Apache 1.3.0 -1.3.9
常规Google Hacking _blank>技术
目标:搜索_blank>漏洞主机
功能:CGI 扫描
功能:端口扫描
功能:翻译( Translate Translate)
功能:缓存(Cache Cache)
高级Google Hacking _blank>技术
搜集安全_blank>工具结果:
- Locating Nessus Scans
- Locating ISS Scans
- IDS Data: ACID
搜集已有_blank>攻击结果
- 后门
- 远程控制
搜集敏感信息
- SSH Host Keys
- PGP Private Keys
- Credit card
Google Hacking 的特点
快速:
- 搜索引擎预先准备了大量处理好的信息以供检索;
准确:
- 搜索引擎做了关联性、重要性等各种过滤处理措施;
隐蔽:
- 搜索、查询都是通过搜索引擎的_blank>数据库进行;
智能:
- 搜索引擎自身的智能特性;
缓存:
- 保留了已经实际不存在的敏感信息;
GHDB & googledork
Google Hacking Database
- 查询条件集合查询条件集合
Googledork (肉鸡?) : An inept or foolish person as revealed by Google.
查询条件分类(14 )
Advisories and Vulnerabilities 公告和_blank>漏洞
Error Messages 错误信息
Files containing juicy info 有价值的文件
Files containing passwords 口令文件
Files containing usernames 用户名文件
Footholds 演示页面
Pages containing login portals 登录页面
Pages containing network or vulnerability data 安全相关文件
Sensitive Directories 敏感目录
Sensitive Online Shopping Info 在线商业信息
Various Online Devices 在线设备
Vulnerable Files 有_blank>漏洞的文件
Vulnerable Servers 有_blank>漏洞主机
Web Server Detection 网站_blank>服务器检测
最常用的10 个查询条件
index.of.password
"access denied for user" "using password"
"http://*:*@www" " domainname
auth_blank>_user_blank>_file.txt
The Master List
allinurl: admin mdb
passlist.txt (a better way)
"A syntax error has occurred" filetype:ihtml
"# -FrontPage-" inurl:service.pwd
ORA-00921: unexpected end of SQL command
最新的10 个查询条件
filetype:blt "buddylist "
intitle:"index of" inurl:ftp (pub | incoming)
filetype:cnf inurl:_blank>_vti_blank>_pvt access.cnf
allinurl:"/*/_blank>_vti_blank>_pvt/" | /" | allinurl:"/*/_blank>_vti_blank>_cnf/"
inurl:"install/install.php"
intitle:"welcome.to.squeezebox"
intext:""BiTBOARD v2.0" BiTSHiFTERS Bulletin Board"
intitle:Login intext:"RT is © Copyright"
ext:php program_blank>_listing
intitle:MythWeb.Program.Listing
intitle:index.of abyss.conf
Google Hacking Tools
Gooscan
SiteDigger
Athena
Apollo **
Apollo
基于Apollo 的Google Hacking 测试
"仅处理前10个结果"
_blank>密码查询
- 查询条件:"filetype:xls site:cn _blank>密码"
- 得到_blank>密码近120个;
_blank>数据库下载
- 查询条件: "filetype:mdb site:cn inurl:adm"
- 下载_blank>数据库5个,得到_blank>密码12 个;
关键信息
- 查询条件:"filetype:inc site:cn conn "
- 根据inc 文件下载_blank>数据库3个;
Google Hacking 流程的自动化
Santy 蠕虫
描述:
- 2004 12月21 日发现,截止到12 月22日,google 可以统计到被santy 蠕虫破坏的网站已经达到26000多;
- 利用论坛系统phpBB的漏洞传播;
智能特性:
- 从搜索引擎google得到攻击站点列表;
存在形式:
- 脚本代码;
Santy 蠕虫工作流程
(附图:Santy 蠕虫工作流程.bmp)
攻击目标列表构造
构造查询请求
- 随机字符插入
- @ts = qw/t p topic/, $ts[int(rand(@ts))], int(rand(30000));
- _qdr=all&q=allinurl%3A+%22viewtopic.php%22+%22topic%3D1234%22&btnG=Search">http://www.google.com/search?num=100&hl=en&lr=&as_qdr=all&q=allinurl%3A+%22viewtopic.php%22+%22topic%3D1234%22&btnG=Search
返回结果处理
- 仅保留IP地址或URL
生成攻击目标列表
Santy.B 蠕虫
AOL
- 错误:
[url]http://search.aol.com/aolcom/search?q=viewtopic.php%3Ft%3D1234&Stage=0&page=2[/url]
- 正确:
[url]http://search.aol.com/aolcom/search?query=viewtopic.php%3Ft%3D1234&Stage=0&page=2[/url]
Yahoo:
- [url]http://cade.search.yahoo.com/search?p=viewtopic.php%3Ft%3D1234&ei=UTF-8&fl=0&all=1&pstart=1&b=2[/url]
Google 封锁Santy 蠕虫的技术分析
如果请求字符串同时满足如下条件:
- 含有高级检索命令"inurl:";
- 检索项中含有".php";
- 检索请求含有其它请求参数如"num"或"start "等;
则判断为是蠕虫发出的请求,给出提示并中断连接;
搜索引擎针对 MyDoom.O的屏蔽方法
Google:整个请求字符串的完全匹配:
- [url]http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=%s[/url]
Altavista:整个请求字符串的完全匹配:
- [url]http://www.altavista.com/web/results?q=%s&kgs=0&kls=0[/url]
Yahoo:已经去掉屏蔽:
- [url]http://search.yahoo.com/search?p=%s&ei=UTF-8&fr=fp-tab-web-t&cop=mss&tab=Lycos[/url]:整个请求字符串的完全匹配:
- [url]http://search.lycos.com/default.asp?lpv=1&loc=searchhp&tab=web&query=%s[/url]
测试日期:2005.1.8
Santy Santy蠕虫引出的新问题
如何检测智能蠕虫?
- 不需扫描,流量无明显异常;
- 查询条件的无穷组合;
- 脚本代码的任意变化;
如何防治智能蠕虫?
- IPv6 的抗扫描特性不再适用;
- 封锁搜索引擎?海量信息如何查找;
- 搜索引擎屏蔽?查询合法性的不可判定;
多个搜索引擎卷入
- search.aol.com
- cade.search.yahoo.com
(附图:sql injection worm.bmp)
防范主体
Web 应用提供者
搜索引擎服务提供商
网络运营服务提供商
Web 应用提供者
涉及平台
- Web site
- 应用系统
- 桌面
涵盖人群
- 团体:军队、G0vernment、企业、学校...
- 个人:网管人员、行政人员...
Web 应用提供者防范措施
信息发布的严格审核与责任追查;
- 控制搜索引擎可检索信息内容;
- 关于公司;关于雇员;
利用相关工具进行在互联网进行搜索,如果有信息被滥用,则要求搜索引擎服务提供商删除这些信息;
利用标志文件如:robots.txt ,拒绝搜索引擎,机器人的查询。
周期性的自动检测是否有关于本单位的敏感周期性的自动检测是否有关于本单位的敏感信息在网上被公开;
避免被搜索引擎搜集
动态 URL
动态页面
深层次网站结构
网站监测
代码md5 校验
代码监测系统
Web应用提供者防范措施
停用不必要Web应用;
应用系统版本升级
其他措施:
- 禁用脚本解释器;
- 屏蔽本机对搜索引擎的访问;
搜索引擎服务提供商防范措施
屏蔽特定查询
- 正常使用者也被屏蔽
限制搜索引擎功能
- Cache 侵犯版权
- 可能面临的诉讼
扩展搜索引擎功能
- 检测机制
- 告警机制
扩展搜索引擎功能
入侵检测
- 基于检索条件
- 基于请求频度
异常监测
- 基于页面内容统计
- 基于网站结构变化
- 基于用户行为统计
告警机制
- 本站显著位置
- 相关团体
网络运营服务提供商防范措施
恶意网络流量控制
搜索引擎流量控制
关键服务控制
Goopot
基于 Google支持的honeypot;
根据Google Hacking 检索条件(如GHDB)
构造网站结构、页面;
Google Hacker 在请求某个页面时会发送相当多的客户端信息;
通过统计这些信息研究Google Hacker 的行为;
Goopot Goopot->另类联盟?
防范措施的有效性?
对抗智能
- 蠕虫利用搜索引擎的返回结果构造攻击目标列表,通过利用搜索引擎的智能特性使蠕虫自身具有了智能。这将是以后蠕虫发展的一个趋势,
也将成为搜索引擎门户网站的一个梦魇。
对抗查询
- google 目前已经屏蔽了santy 蠕虫发出的查询请求,但如果santy santy蠕虫的变种利用其他搜索引擎构造攻击目标列表,则蠕虫可以继续
传播; santy 蠕虫的变种针对google 屏蔽也可以构造合理查询,正如病毒的不可判定性,查询请求是否合法也是不可判定的。
执行环境
- santy 蠕虫利用了perl 解释器,如果系统没有解释器,如果系统没有perl 解释器,则蠕虫无解释器,则蠕虫无法工作。但phpBB 系统是需
要php 解释器支持的,如果santy 蠕虫利用php 解释器,将造成更大的麻烦;
攻击效果
- 很少的国内phpBB论坛deface,主要的原因应该是国内的大多论坛在 google上的 pagerank比较低,从而不在蠕虫查询的返回结果中,并不
是安全方面做得更好。蠕虫的查询条件设计的相对简单,如果增加中文字符在查询条件里,效果将明显不同。
Internet 的悖论
管理员的工具=黑客的武器
用户的便利=黑客的捷径
越高效=越危险
...
维护 Internet安全
是大家共同的责任
References
phack 信息安全的隐患-GoogleHacking 原理和防范,[url]http://www.xfocus.net/articles/200412/770.html[/url]
Ecore 三则黑客的Google 搜索技巧简介,[url]https://www.xfocus.net/bbs/index.php?act[/url] [url]www.xfocus.net/bbs/index.php?act=ST&f=2&t=44572[/url]
薛丁谔, Google搜索从入门到精通v4.0,[url]http://www.risker.org/tech/GoogleHacking/files/google.txt[/url]
Johnny Long. Google Hacking Mini-Guide,[url]http://www.informit.com/articles/printerfriendly.asp?p=170880[/url]
吴鲁加, 利用google进行入侵与渗透,[url]http://www.risker.org/tech/index.html[/url]
Johnny Long, You found that on Google?,[url]http://risker.org/tech/GoogleHacking/files/bh-us-04-long-googlehacking.ppt[/url]
Patrick Chambet, Google attacks, _attacks.pdf">http://www.risker.org/tech/GoogleHacking/files/bh-us-04-chambet-google_attacks.pdf
John John Battelle Battelle, The , The MyDoom MyDoom Attack(s Attack(s), ),
[url]http://battellemedia.com/archives/000751.php[/url] [url]http://battellemedia.com/archives/000751.php[/url]
References
Robert Masse, Jian Hui Wang. Hacking with Google for fun and profit!
[url]http://www.gosecure.ca/SecInfo/library/WebApplication/GOOGLE-HACKING-GS1004.ppt[/url]
Winny. "Google Haking"所引发的全球保密危机.[url]http://www.pconline.com.cn/news/hy/0402/308875.html[/url]
xclusive, GOOGLE TRICKS AND HACKS , http://security [url]http://security-protocols.com/modules.php?name=News&file=article&sid=1629[/url]
ComSec, Google a Dream come true, [url]http://gray-world.net/etc/passwd/googletut1.txt[/url]
郑辉,Santy蠕虫分析报告。[url]http://202.112.50.218/doc/spark/santywormanalysis.doc[/url]
化柏林,搜索引擎技术简析。[url]http://www.channel7.cn/2004/10-11/111156.html[/url]
Mimi, Apollo for Google Hacking,[url]http://worm.ccert.edu.cn/GoogleHacking/Apollo/index.html[/url]
Caleb Sima. Exploits & Vulnerabilities . - New Trends.
_Exploits_NewTrends.pdf">http://www.issa.org/anniversary/presentations/Vuln_Exploits_NewTrends.pdf
谢谢!
页:
[1]