HMV-Fromytoy靶机复盘

2026-3-15 62 3/15

端口扫描

开放了22,80,3000

80端口无东西

打开3000端口,发现是个wordpress站点,且在网页最下面发现了/wp-content/plugins/simple-file-list/

进入http://192.168.186.207:3000/wp-content/plugins/simple-file-list/readme.txt

发现版本为4.0

找个脚本,searchsploit看看

发现了48449.py

使用后会生成一个php马并给出路径和密码

不过这个马默认执行php代码,我反弹不了shell,总之我尝试了许多方法没成功

把马改了,可以给ai修改,我这里是多加了一段base64转换,防止了反弹shell代码中的各种字符带来的问题

 

获得shell

www-data@949d50994487:/var/www/html/wp-content/uploads$ ls
ls
2026
server_backup_info.txt
simple-file-list

发现了server_backup_info.txt,但是打不开

找找其它的

find / -perm -u=s -type f 2>/dev/null

发现了/usr/local/lib/.sys_log_rotator

经过查找,这是一个能打开文件的命令,只不过是左右反转了

 

 

可以使用两次,就转正了

www-data@949d50994487:/var/www/html/wp-content/uploads$ /usr/local/lib/.sys_log_rotator server_backup_info.txt | /usr/local/lib/.sys_log_rotator

<r_backup_info.txt | /usr/local/lib/.sys_log_rotator
Backup Date: 2025-01-10
Status: Pending verification
Note for Sysadmin:
The SSH key rotation failed. Reverted to temporary credentials for host 'fromytoy'.
User: miku
Password: V0cal0id_M1ku_39

我们目前位于容器中,可以在wordpress下发现wp-config-docker.php

ssh可以连接到主机

 

 

miku@fromytoy:~$ sudo -l
Matching Defaults entries for miku on fromytoy:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User miku may run the following commands on fromytoy:
(ALL) NOPASSWD: /usr/bin/python3 /usr/local/lib/python_scripts/cleanup_task.py

发现了重要的东西

miku@fromytoy:~$ find / -writable -type d -not -path "/proc/*" -not -path "/sys/*" -not -path "/var/*" 2>/dev/null

/usr/local/lib/python_scripts/__pycache__

可以写入,那么就能毒化字节码,注入恶意代码

先删除原来的system_utils.cpython-39.pyc

把目录/usr/local/lib/python_scripts/system_utils.py给ai

让ai生成一个能够生成恶意的system_utils.cpython-39.pyc的python代码,执行后获得恶意system_utils.cpython-39.pyc

放回原来的位置上

接着sudo /usr/bin/python3 /usr/local/lib/python_scripts/cleanup_task.py

root@fromytoy:/usr/local/lib/python_scripts#

- THE END -

sanoplluser

3月15日19:00

最后修改:2026年3月15日
0

非特殊说明,本博所有文章均为博主原创。

共有 0 条评论