windowsInternal

Enumeration:

Port Scanning:

┌──(kali㉿kali)-[~/…/Machines/OffsecPG/Practice/Internal]
└─$ sudo nmap -sCV -p- --min-rate 4000 -oA nmap/services -vv 192.168.171.40
Starting Nmap 7.95 ( https://nmap.org ) at 2025-11-11 00:56 EST
Nmap scan report for 192.168.171.40                                                   
Host is up, received reset ttl 125 (0.11s latency).                
Scanned at 2025-11-11 00:56:22 EST for 95s                                            
Not shown: 65522 closed tcp ports (reset)                                             
PORT      STATE SERVICE       REASON          VERSION                                 
53/tcp    open  domain        syn-ack ttl 125 Microsoft DNS 6.0.6001 (17714650) (Windows Server 2008 SP1)                                                                   
| dns-nsid:                                                                           
|_  bind.version: Microsoft DNS 6.0.6001 (17714650)                                                                                                                         
135/tcp   open  msrpc         syn-ack ttl 125 Microsoft Windows RPC                   
139/tcp   open  netbios-ssn   syn-ack ttl 125 Microsoft Windows netbios-ssn                                                                                                 
445/tcp   open  microsoft-ds  syn-ack ttl 125 Windows Server (R) 2008 Standard 6001 Service Pack 1 microsoft-ds (workgroup: WORKGROUP)                                      
3389/tcp  open  ms-wbt-server syn-ack ttl 125 Microsoft Terminal Service              
|_ssl-date: 2025-11-11T05:57:57+00:00; 0s from scanner time.                          
| ssl-cert: Subject: commonName=internal                                              
| Issuer: commonName=internal                                                         
| Public Key type: rsa                                                                
| Public Key bits: 2048                                                               
| Signature Algorithm: sha1WithRSAEncryption                                         
| Not valid before: 2025-07-24T21:18:58                                               
| Not valid after:  2026-01-23T21:18:58                                                                                                                                     
| MD5:   d2d9:1772:60cd:2a6b:1cd0:ed66:27ab:b8cd                                      
| SHA-1: d5f0:03cb:2df3:c4c2:b6a7:2f5e:39b2:6c6f:491c:0587                            
| -----BEGIN CERTIFICATE-----                                                         
| MIIC1DCCAbygAwIBAgIQofLukS/50Z5CIQMgxLeN3jANBgkqhkiG9w0BAQUFADAT
<snipped>
|_-----END CERTIFICATE-----
| rdp-ntlm-info: 
|   Target_Name: INTERNAL
|   NetBIOS_Domain_Name: INTERNAL
|   NetBIOS_Computer_Name: INTERNAL
|   DNS_Domain_Name: internal
|   DNS_Computer_Name: internal
|   Product_Version: 6.0.6001
|_  System_Time: 2025-11-11T05:57:49+00:00
5357/tcp  open  http          syn-ack ttl 125 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Service Unavailable
|_http-server-header: Microsoft-HTTPAPI/2.0 
49152/tcp open  msrpc         syn-ack ttl 125 Microsoft Windows RPC
49153/tcp open  msrpc         syn-ack ttl 125 Microsoft Windows RPC
49154/tcp open  msrpc         syn-ack ttl 125 Microsoft Windows RPC
49155/tcp open  msrpc         syn-ack ttl 125 Microsoft Windows RPC
49156/tcp open  msrpc         syn-ack ttl 125 Microsoft Windows RPC
49157/tcp open  msrpc         syn-ack ttl 125 Microsoft Windows RPC
49158/tcp open  msrpc         syn-ack ttl 125 Microsoft Windows RPC
Service Info: Host: INTERNAL; OS: Windows; CPE: cpe:/o:microsoft:windows_server_2008::sp1, cpe:/o:microsoft:windows, cpe:/o:microsoft:windows_server_2008:r2

<snipped>

We have only smb, and port 5357 which has nothing.

I will check some versioning info via nxc, then run smb-vuln scripts with nmap to search for smb related CVEs:

It is an old operating system so we could find a cve for that.

As stated our target is vulnerable, and it is in srv2.sys.

Search for public exploits for that:

We will find one, mirror it to our current directory:

Read it to understand what we should adjust to fit our needs, or if it has any malicious data:

First we need to modify the shellcode to ours, second add parenthesis to the print functions, because we want to use python3, finally prepend b to search row after buff+= to instruct python that those are bytes instead of a string.

Generate our shellcode:

Our final script after modification:

Setup multi handler to receive the connection from the target:

Run the exploit:

Wait for like 2 minutes, and then:

Get the flags:

Last updated