Post

GoldenEye Walkthrough

pop3爆破,moodle后台打点,内核提权

GoldenEye Walkthrough

Recon

这台机器开放smtp、http以及两个未知高位端口

image-20251017231644763

http

网页前端有一个路径sev-home,访问后弹出basic认证

image-20251018012521652

网页源代码中发现terminal.js,其中泄露了boris密码,解码后得到InvincibleHack3r

image-20251018012642698

登陆后提示这个系统做了很严格的安全配置,其中把pop3服务部署在了高位端口上

image-20251018015528796

pop3

侦察阶段得到的两个高位端口使用nc连接,能确定55007端口开放pop3

image-20251018015637172

源代码中提示超级管理员是natalya和boris

image-20251018015723972

Blasting POP3 to get Boris’s credentials

使用hydra爆破,得到boris:secret1!

image-20251018015813914

共有3封邮件,但内容没什么有趣的

image-20251018021126422

image-20251018021203572

Blasting POP3 to get natalya’s credentials

进一步爆破natalya用户,得到natalya:bird

image-20251018021245172

认证后其中有两封邮件,第二封泄露了xenia:RCP90rulez!凭证,并且暴露了/gnocertdir路径,提示需要写入/etc/hosts后访问

image-20251018021711388

访问后是一个Moodle学习平台,使用xenia用户登录

image-20251018021912807

在message中看到历史对话中doak教授提到可以通过他的email用户名doak与他联系

image-20251019152724384

Blasting POP3 to get doak’s credentials

爆破doak得到doak:goat

image-20251019205551918

有1封邮件,其中包含dr_doak:4England!凭证

image-20251019205641934

登陆后发现存在private files

image-20251019210219688

其中存在s3cret.txt

image-20251019210240825

内容说明一位特工已经获得了admin的明文凭证,通过/dir007key/for-007.jpg将会发现Something juicy

image-20251019210401357

下载这张图片,通过exiftool在Image Description中得到base64编码,解码得到xWinter1995x!

image-20251019210903371

shell as www-data by moodle-admin

登录moodle后台后可以通过aspell getshell,它是moodle编辑内容时使用的editor的拼写检查器

将path to aspell填入反弹shell的命令

image-20251019213331832

然后需要在plugins -> Text editors -> TinyMCE HTML editor中将Spell Engine改为PSpellShell

image-20251019214228716

然后在editor中触发拼写检查,即可得到反弹shell

image-20251019214330277

image-20251019214404173

shell as root by kernel privileged esclate

枚举系统信息,是ubuntu 14.0.4.1 LTS,内核版本为3.13.0-32-negeric,存在提权漏洞

image-20251019220746039

使用37292.c

image-20251019220846067

但发现目标机器没有gcc,使用cc代替

但编译后执行发现报错

image-20251019220948996

这是由于exp内编译lib还是使用的gcc,手动修改代码改为cc后重新上传编译执行即可 image-20251019221203324

image-20251019221238913

This post is licensed under CC BY 4.0 by the author.