【OSCP系列】OSCP靶机—Vegeta
一、主机发现
二、端口扫描
1、全端口扫描
只开放22、80端口,加上UDP扫描
2、服务版本探测
80的Apache 使用 2.4.38版本,有关这个版本在一定条件下是存在漏洞的,系统跑在Linux 4.x|5.x
3、漏洞探测
80端口只扫了一些目录
三、HTTP信息收集
1、首页源代码
首页就一张图片
看过了,没捆绑没隐写
2、目录扫描
gobuster扫描结果,发现四个目录,其中admin 令我们很感兴趣
/admin 里面只有一个 admin.php 文件
推测有类似ctf 那样有源码泄露的地方,但是这个文件夹就它一个文件,且字节大小只有9
robots.txt 文件给出了提示
指向了一个Vegeta-1.0
的提示
在页面源代码给出了base64编码的内容
1 | <!-- aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQU1nQUFBRElDQVlBQUFDdFdLNmVBQUFIaGtsRVFWUjRuTzJad1k0c09RZ0U1LzkvK3UyMU5TdTdCd3JTaVN0QzhoR2M0SXBMOTg4L0FGanljem9BZ0RNSUFyQUJRUUEySUFqQUJnUUIySUFnQUJzUUJHQURnZ0JzUUJDQURRZ0NzQUZCQURhRUJmbjUrUmwvbk9aTFAxeER6K3g5VTA1cWJoWjFkcjRzSFQyejkwMDVxYmxaMU5uNXNuVDB6TjQzNWFUbVpsRm41OHZTMFRONzM1U1RtcHRGblowdlMwZlA3SDFUVG1wdUZuVjJ2aXdkUGJQM1RUbXB1Vm5VMmZteWRQVE0zamZscE9hdVhKUVRUamxkSHZ0YmxvNDZOUWp5UjV4eUlvZ09CUGtqVGprUlJBZUMvQkdubkFpaUEwSCtpRk5PQk5HQklIL0VLU2VDNkVDUVArS1VFMEYwakJWRS9aSGM4SEhkUHZ1RWQwZVF3N003MWFtelRIaDNCRGs4dTFPZE9zdUVkMGVRdzdNNzFhbXpUSGgzQkRrOHUxT2RPc3VFZDBlUXc3TTcxYW16VEhoM0JEazh1MU9kT3N1RWQwZVFJcWJNNENUcmhKMGhTQkZUWmtDUUdBaFN4SlFaRUNRR2doUXhaUVlFaVlFZ1JV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dmVubFh1TURvMGRRNU8rWnp5dUowMUx0ZTNoVXVNSG8wZGM2TytaeXlPQjMxcnBkM2hRdU1IazJkczJNK3B5eE9SNzNyNVYzaEFxTkhVK2QwMnN1VUxOTnpJb2h4M1ExWnB1ZEVFT082RzdKTXo0a2d4blUzWkptZUUwR002MjdJTWowbmdoalgzWkJsZWs0RU1hNjdJY3YwbkFoU3hKUVoxRDJuZkMvTEhKWExjQm9ZUVR4NlR2bGVsamtxbCtFME1JSjQ5Snp5dlN4elZDN0RhV0FFOGVnNTVYdFo1cWhjaHRQQUNPTFJjOHIzc3N4UnVReW5nUkhFbytlVTcyV1pvM0laVGdNamlFZlBLZC9MTWtmbE1weVk4bEVxSC9zSlRoODZnaFNBSUxVZ1NQT2kxQ0JJTFFqU3ZDZzFDRklMZ2pRdlNnMkMxSUlnell0U2d5QzFJRWp6b3RRZ1NDMElVckNvS1NjN245TmVzcHplZmNVTTJmbFMvU29EVERrZEMzYWF3U2tuZ2d3OEhRdDJtc0VwSjRJTVBCMExkcHJCS1NlQ0REd2RDM2Fhd1NrbmdndzhIUXQybXNFcEo0SU1QQjBMZHByQktlZnJCQUY0RXdnQ3NBRkJBRFlnQ01BR0JBSFlnQ0FBR3hBRVlBT0NBR3hBRUlBTkNBS3dBVUVBTmlBSXdBWUVBZGp3SHlVRnd2VnIwS3ZGQUFBQUFFbEZUa1N1UW1DQw== --> |
对其二次base64解密发现文件头存在png
更改png后缀发现是二维码,二维码解析器查看给了一个密码
现在差个用户名,cewl 收集一波关键字
尝试一波爆破,很明显失败了
3、进一步的信息收集
我们用一个大点的字典再次做了目录扫描,发现一个新的端点
里面是一个wav 格式的文件,是个音频
浅听了一下,嘀嘀嘀的断点声,摩斯密码欸,在线解码下:Morse Code Adaptive Audio Decoder | Morse Code World
1 | USER : TRUNKS PASSWORD : US3R<KN>S IN DOLLARS SYMBOL) |
推测密码应该是US3R 这部分,但是尝试却是失败的;
四、Getshell
丢给AI 分析一下
把密码里面的S改成美元$符号,再次尝试
果然,成功getshell
五、权限提升
1、信息收集
历史命令中有点东西昂
我是否可以向/etc/passwd 文件中写入用户呢?
查看/etc/passwd 文件的权限
啊?,trunks 用户具有/etc/passwd 的读写权限,那这就好办了
2、提权至root
直接向/etc/passwd 文件中写入管理员用户
成功提权至root
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Lusen的小窝!
评论