Post

DC9 Walkthrough

sqli->fuzz打点,sudo提权

DC9 Walkthrough

Recon

这台机器仅开放标准端口http

image-20251003154536728

http

目录扫描类似于一个cms,逐个功能点看一看

image-20251003154653122

manage.php有一个登录入口

image-20251003194358270

display.php显示了几条数据

image-20251003162825797

search.php存在sqli

image-20251003163923081

在Staff.Users表得到用户名和密码hash

image-20251003185539416

crackstation得到transorbitall

image-20251003185610457

登录后回显File does not exist,猜测此处可能存在文件包含

image-20251003194447708

fuzz得到?file参数

image-20251003194519735

使用/usr/share/wordlists/seclists/Fuzzing/LFI/LFI-etc-files-of-all-linux-packages.txtfuzz目录,发现/etc/knockd.conf

image-20251003200343980

发现可以Port knocking打开ssh

image-20251003200559478

image-20251003201657332

sqlmap导出users.UserDetails表username和password字段

image-20251003201741940

通过awk处理得到账号和密码本

image-20251003202211388

得到三对有效凭证

image-20251003202321300

分别登录这三个用户,sudo -l发现都没有权限

在/home/janitor/.secrets-for-putin中发现passwords-found-on-post-it-notes.txt

image-20251003203433147

查看发现是几个密码,将其添加到密码本中

image-20251003203526790

得到新用户fredf:B4-Tru3-001

image-20251003203700911

登录后发现其有root权限执行/opt/devstuff/dist/test/test的能力

image-20251003204036383

查找test.py查看代码,其接收两个值且都为文件,将值1对应的文件内容append到值2所指的文件路径

比如sudo /opt/devstuff/dist/test/test /etc/shadow /tmp/shadow.txt,执行后/tmp/shadow.txt就被写入了/etc/shadow文件内容

image-20251003210639805

通过生成密码hash,编写passwd格式的字符串写入/etc/passwd提权

image-20251003215000113

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