$ nmap -sC -sV -T4 -Pn 10.10.11.241 Starting Nmap 7.93 ( https://nmap.org ) at 2023-11-20 23:28 WET Nmap scan report for hospital.htb (10.10.11.241) Host is up (0.061s latency). Not shown: 980 filtered tcp ports (no-response) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 9.0p1 Ubuntu 1ubuntu8.5 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 256 e14b4b3a6d18666939f7aa74b3160aaa (ECDSA) |_ 256 96c1dcd8972095e7015f20a24361cbca (ED25519) 53/tcp open domain Simple DNS Plus 88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2023-11-21 06:28:22Z) 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: hospital.htb0., Site: Default-First-Site-Name) | ssl-cert: Subject: commonName=DC | Subject Alternative Name: DNS:DC, DNS:DC.hospital.htb | Not valid before: 2023-09-06T10:49:03 |_Not valid after: 2028-09-06T10:49:03 443/tcp open ssl/http Apache httpd 2.4.56 ((Win64) OpenSSL/1.1.1t PHP/8.0.28) |_http-server-header: Apache/2.4.56 (Win64) OpenSSL/1.1.1t PHP/8.0.28 | ssl-cert: Subject: commonName=localhost | Not valid before: 2009-11-10T23:48:47 |_Not valid after: 2019-11-08T23:48:47 |_ssl-date: TLS randomness does not represent time |_http-title: Hospital Webmail :: Welcome to Hospital Webmail | tls-alpn: |_ 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 ldapssl? | ssl-cert: Subject: commonName=DC | Subject Alternative Name: DNS:DC, DNS:DC.hospital.htb | Not valid before: 2023-09-06T10:49:03 |_Not valid after: 2028-09-06T10:49:03 1801/tcp open msmq? 2103/tcp open msrpc Microsoft Windows RPC 2105/tcp open msrpc Microsoft Windows RPC 2107/tcp open msrpc Microsoft Windows RPC 2179/tcp open vmrdp? 3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: hospital.htb0., Site: Default-First-Site-Name) | ssl-cert: Subject: commonName=DC | Subject Alternative Name: DNS:DC, DNS:DC.hospital.htb | Not valid before: 2023-09-06T10:49:03 |_Not valid after: 2028-09-06T10:49:03 3269/tcp open globalcatLDAPssl? | ssl-cert: Subject: commonName=DC | Subject Alternative Name: DNS:DC, DNS:DC.hospital.htb | Not valid before: 2023-09-06T10:49:03 |_Not valid after: 2028-09-06T10:49:03 3389/tcp open ms-wbt-server Microsoft Terminal Services | ssl-cert: Subject: commonName=DC.hospital.htb | Not valid before: 2023-09-05T18:39:34 |_Not valid after: 2024-03-06T18:39:34 | rdp-ntlm-info: | Target_Name: HOSPITAL | NetBIOS_Domain_Name: HOSPITAL | NetBIOS_Computer_Name: DC | DNS_Domain_Name: hospital.htb | DNS_Computer_Name: DC.hospital.htb | DNS_Tree_Name: hospital.htb | Product_Version: 10.0.17763 |_ System_Time: 2023-11-21T06:29:12+00:00 8080/tcp open http Apache httpd 2.4.55 ((Ubuntu)) |_http-server-header: Apache/2.4.55 (Ubuntu) | http-title: Login |_Requested resource was login.php |_http-open-proxy: Proxy might be redirecting requests | http-cookie-flags: | /: | PHPSESSID: |_ httponly flag not set Service Info: Host: DC; OSs: Linux, Windows; CPE: cpe:/o:linux:linux_kernel, 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 100.82 seconds
We know that this machine is a Windows machine, but we are on a Linux subsystem at the moment We can use this exploit to elevate our privileges on the linux subsystem
We can download it and use meterpreter to upload it Then we compile it and run it