IMPORTANTE: AirOS Security Exploit - Updated Firmware

Prodotti embedded (RouterStation, Routerstation Pro, Litestation, MiniStation) e Mini-PCI (XR & SR Series)

IMPORTANTE: AirOS Security Exploit - Updated Firmware

Messaggiodi admin » 20 dicembre 2011, 17:17

Scoperta importante vulnerabilità di alcuni prodotti Ubiquiti:

Hi All,
Today we have discovered a vulnerability which may grant remote users administrative access to Ubiquiti equipment running AirOS v3/4 and AirOS v5 without requiring authentication.

We have quickly fixed this issue and released an updated firmware with this vulnerability patched.

You can find the updated firmware here:
http://ubnt.com/support/downloads

Affected versions:

802.11 Products - AirOS v3.6.1/v4.0 (previous versions not affected)
AirMax Products - AirOS v5.x (all versions)

Updated versions are

v4.0.1 - 802.11 ISP Products
v5.3.5 - AirMax ISP Products
v5.4.5 - AirSync Firmware

We recommend anyone with AirOS devices accessible publicly (via HTTP) to upgrade as soon as possible to prevent this exploit from happening.

If you have any questions or require previous versions of firmware, please email us (support@ubnt.com).
__________________
Matt Hardy
Ubiquiti Networks


Hi guys,
There are two things here:

A vulnerability with the http server, allowing users to bypass authentication and run commands.
A worm that has been taking advantage of #1 to spread itself.

The new firmware will prevent #1, which also prevents #2.

If the worm has already presented itself, it will:

Rename admin.cgi to adm.cgi (you can check with web browser after logging in)
Create startup script in /etc/persistent (you can check by running ls -la /etc/persistent and looking for .Skynet)

We are working on a patch now that will remove the worm, but here's how to do it manually:

SSH into device
cd /etc/persistent
rm rc.poststart
rm -rf .Skynet
cfgmtd -w -p /etc/
reboot

This will not prevent the worm from coming back, you'll need the updated firmware to prevent this.

-Matt


Da altre fonti, da verificare, qualche dettaglio in più sulla vulnerabilità:

Dear customers,

We contact you in order to inform that a very important vulneability has been detected on the Ubiquiti Networks devices

(NanoStation, Loco, Bullet, Nanobridge, Powerbridge, Powerstation, Picostation, etc ...) with the following firmware versions:

802.11 products - AirOS v3.6.1/v4.0 (previous versions are not affected)
AirMax products- AirOS v5.x (all versions)

This vulnerability allows access to the computer without a password and a virus called Skynet can be installed in the Ubiquiti

machine, this virus acts sending messages on the traffic generated through the port: 80 (http://), redirecting traffic to certain websites

and saturating wireless device memory, which causes unexpected reboots.

How is the virus?

The virus is a Linux script that is installed in a hidden directory and after a reboot, begins to act.

How to detect if your computer is infected Ubiquiti?

Try opening the page http://wxyx/admin.cgi (where wxyz is the IP address of Ubiquiti)

If the page does not open, the computer has been infected since the virus renames it adm.cgi

How do if my computer IS NOT INFECTED?

Immediately update their firmware version Ubiquiti equipment, you can download the lastest firmware versions that have eliminated

the vulnerability at the following address:

http://ubnt.com/support/downloads

How to proceed if my computer IS INFECTED?

There are three options:

1) Ubiquiti has pledged to launch within 24 hours, a tool to eliminate the virus in an easy and fast way.
2) Reset the computer to "factory defaults" and then upgrade the firmware version.
3) Remove the script Skynet manually following the instructions detailed below:

Access to the computer via SSH and run the following commands:

rm / etc / persistent / rc.poststart
rm-rf. skynet
save
reboot

After removing the script skynet (virus) using the procedure, proceed to ename the file adm.cgi to the original admin.cgi and upgrade the firmware to the latest available to the team at the following address:

http://ubnt.com/support/downloads


UPDATE
Per chi usa l'SDK ed è pratico, ecco un patch dal sito ufficiale:
http://www.ubnt.com/downloads/XN-fw-int ... -fix.patch

Codice: Seleziona tutto
Index: packages-other/lighttpd/patches/500-mod-airos.patch
===================================================================
--- packages-other/lighttpd/patches/500-mod-airos.patch   (revision 11238)
+++ packages-other/lighttpd/patches/500-mod-airos.patch   (working copy)
@@ -1,6 +1,6 @@
--- a/configure.ac
+++ b/configure.ac
-@@ -637,14 +637,15 @@ AC_CONFIG_FILES([Makefile src/Makefile
+@@ -638,14 +638,15 @@ AC_CONFIG_FILES([Makefile src/Makefile
         tests/docroot/www/expire/Makefile \
         distribute.sh])
  AC_OUTPUT
@@ -18,7 +18,7 @@
  else
--- a/src/Makefile.am
+++ b/src/Makefile.am
-@@ -303,7 +303,11 @@ proc_open_CPPFLAGS= -DDEBUG_PROC_OPEN
+@@ -304,7 +304,11 @@ proc_open_CPPFLAGS= -DDEBUG_PROC_OPEN
  #evalo_SOURCES = buffer.c eval.c
  #bench_SOURCES = buffer.c bench.c
  #ajp_SOURCES = ajp.c
@@ -32,7 +32,7 @@
+mod_airos_la_LIBADD = $(TDB_LIB)  $(common_libadd)
--- /dev/null
+++ b/src/mod_airos.c
-@@ -0,0 +1,1006 @@
+@@ -0,0 +1,1031 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
@@ -572,6 +572,28 @@
+}
+
+static int
++phy_is_in_list(const physical* uri, const array* list) {
++   size_t k, ct_len;
++   data_string* ds;
++   size_t uri_len = uri->path->used - 1;
++
++   for (k = 0; k < list->used; k++) {
++      ds = (data_string *)list->data[k];
++      ct_len = ds->value->used - 1;
++
++      if (ct_len < 1) continue;
++      if (ct_len > uri_len) continue;
++
++      if (strncasecmp(uri->path->ptr + uri_len - ct_len,
++            ds->value->ptr, ct_len) == 0) {
++         return 1;
++      }
++   }
++
++   return 0;
++}
++
++static int
+is_ajax_request(const request* req) {
+   data_string* header;
+   if (req == NULL)
@@ -946,8 +968,10 @@
+   data_string* ds;
+   session_t* session = NULL;
+   int is_uri_cachable = 0;
++   int is_phy_allowed = 0;
+
-+   is_uri_cachable = uri_is_in_list(&con->uri, p->conf.cachable);
++   is_uri_cachable = phy_is_in_list(&con->physical, p->conf.cachable);
++   is_phy_allowed = phy_is_in_list(&con->physical, p->conf.allowed);
+
+   if (is_uri_cachable) {
+      time_t expires = srv->cur_ts + DEFAULT_CACHE_AGE;
@@ -981,7 +1005,8 @@
+   }
+
+   /* check session authorization */
-+   if (session_is_authenticated(session) && !session_is_authorized(session, srv, con)) {
++   if ((!is_phy_allowed && (!session_is_authenticated(session) || !session_is_authorized(session, srv, con)))
++      || (session_is_authenticated(session) && !session_is_authorized(session, srv, con))) {
+       free(session);
+       session = NULL;
+       con->http_status = 403;


Link forum ufficiale

Lo staff.
ps: grazie all'utente brasile80 per la segnalazione
Avatar utente
admin
Site Admin
 
Messaggi: 1286
Iscritto il: 12 marzo 2009, 11:16

Re: IMPORTANTE: AirOS Security Exploit - Updated Firmware

Messaggiodi brasile80 » 21 dicembre 2011, 1:16

Ciao a tutti.

Alcune precisazioni:

Non e' un exploit del firmware o del server web lighttpd . Piu' volgarmente qualcuno ha dimenticato di aggiornare il rewrite rule !

Fin dalla versione 2.2 , e' sempre stata presente una pagina admin.cgi , che serviva per gestire l'apparato per utenti avanzati.Passando da BOA a Lighttpd ( a partire dalla 3.6.1 e da 5.x ) non sono state aggiornate le regole che bloccavano l'accesso ai file con estensione .gif , png , jpg , css senza inserire la password , quindi scrivendo sulla riga del browser http://ip_del_UBNT/admin.cgi/.gif ( o le altre ) si accede alla pagina di gestione avanzata senza PASSWORD.

Sfruttando questa involontaria backdoor , alcuni 'soggetti' hanno preparato uno script malevolo chiamato skynet , che viene iniettato su un apparato UBNT ed eseguito attraverso admin.cgi. A quel punto il file si duplica su tutti gli apparati UBNT che riesce a trovare , scarica alcuni software , sniffa e traccia il traffico scaricando informazioni su server remoti , satura la memoria e provoca crash random .


Ma si puo' fare anche molto di piu' ........ :-)



saluti

brasileottanta

p.s. date sempre uno sguardo anche al forum ufficiale.
brasile80
User
 
Messaggi: 2
Iscritto il: 19 dicembre 2011, 14:01

Re: IMPORTANTE: AirOS Security Exploit - Updated Firmware

Messaggiodi admin » 21 dicembre 2011, 15:20

brasile80 ha scritto:Ciao a tutti.

Alcune precisazioni:

Non e' un exploit del firmware o del server web lighttpd . Piu' volgarmente qualcuno ha dimenticato di aggiornare il rewrite rule !

Fin dalla versione 2.2 , e' sempre stata presente una pagina admin.cgi , che serviva per gestire l'apparato per utenti avanzati.Passando da BOA a Lighttpd ( a partire dalla 3.6.1 e da 5.x ) non sono state aggiornate le regole che bloccavano l'accesso ai file con estensione .gif , png , jpg , css senza inserire la password , quindi scrivendo sulla riga del browser http://ip_del_UBNT/admin.cgi/.gif ( o le altre ) si accede alla pagina di gestione avanzata senza PASSWORD.

Sfruttando questa involontaria backdoor , alcuni 'soggetti' hanno preparato uno script malevolo chiamato skynet , che viene iniettato su un apparato UBNT ed eseguito attraverso admin.cgi. A quel punto il file si duplica su tutti gli apparati UBNT che riesce a trovare , scarica alcuni software , sniffa e traccia il traffico scaricando informazioni su server remoti , satura la memoria e provoca crash random .


Ma si puo' fare anche molto di piu' ........ :-)



saluti

brasileottanta

p.s. date sempre uno sguardo anche al forum ufficiale.


Grazie per le precisazioni ;)
Avatar utente
admin
Site Admin
 
Messaggi: 1286
Iscritto il: 12 marzo 2009, 11:16

Re: IMPORTANTE: AirOS Security Exploit - Updated Firmware

Messaggiodi thema3x » 21 dicembre 2011, 18:56

:emo_pic_105:

incredibile ..
Avatar utente
thema3x
Broadband Boss
 
Messaggi: 7119
Iscritto il: 26 marzo 2011, 2:19
Località: Tradate - Varese - Lombardia - Nord Italia

Re: IMPORTANTE: AirOS Security Exploit - Updated Firmware

Messaggiodi admin » 21 dicembre 2011, 21:27

UPDATE
Per chi usa l'SDK ed è pratico, ecco un patch dal sito ufficiale:
http://www.ubnt.com/downloads/XN-fw-int ... -fix.patch

Codice: Seleziona tutto
Index: packages-other/lighttpd/patches/500-mod-airos.patch
===================================================================
--- packages-other/lighttpd/patches/500-mod-airos.patch   (revision 11238)
+++ packages-other/lighttpd/patches/500-mod-airos.patch   (working copy)
@@ -1,6 +1,6 @@
--- a/configure.ac
+++ b/configure.ac
-@@ -637,14 +637,15 @@ AC_CONFIG_FILES([Makefile src/Makefile
+@@ -638,14 +638,15 @@ AC_CONFIG_FILES([Makefile src/Makefile
         tests/docroot/www/expire/Makefile \
         distribute.sh])
  AC_OUTPUT
@@ -18,7 +18,7 @@
  else
--- a/src/Makefile.am
+++ b/src/Makefile.am
-@@ -303,7 +303,11 @@ proc_open_CPPFLAGS= -DDEBUG_PROC_OPEN
+@@ -304,7 +304,11 @@ proc_open_CPPFLAGS= -DDEBUG_PROC_OPEN
  #evalo_SOURCES = buffer.c eval.c
  #bench_SOURCES = buffer.c bench.c
  #ajp_SOURCES = ajp.c
@@ -32,7 +32,7 @@
+mod_airos_la_LIBADD = $(TDB_LIB)  $(common_libadd)
--- /dev/null
+++ b/src/mod_airos.c
-@@ -0,0 +1,1006 @@
+@@ -0,0 +1,1031 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
@@ -572,6 +572,28 @@
+}
+
+static int
++phy_is_in_list(const physical* uri, const array* list) {
++   size_t k, ct_len;
++   data_string* ds;
++   size_t uri_len = uri->path->used - 1;
++
++   for (k = 0; k < list->used; k++) {
++      ds = (data_string *)list->data[k];
++      ct_len = ds->value->used - 1;
++
++      if (ct_len < 1) continue;
++      if (ct_len > uri_len) continue;
++
++      if (strncasecmp(uri->path->ptr + uri_len - ct_len,
++            ds->value->ptr, ct_len) == 0) {
++         return 1;
++      }
++   }
++
++   return 0;
++}
++
++static int
+is_ajax_request(const request* req) {
+   data_string* header;
+   if (req == NULL)
@@ -946,8 +968,10 @@
+   data_string* ds;
+   session_t* session = NULL;
+   int is_uri_cachable = 0;
++   int is_phy_allowed = 0;
+
-+   is_uri_cachable = uri_is_in_list(&con->uri, p->conf.cachable);
++   is_uri_cachable = phy_is_in_list(&con->physical, p->conf.cachable);
++   is_phy_allowed = phy_is_in_list(&con->physical, p->conf.allowed);
+
+   if (is_uri_cachable) {
+      time_t expires = srv->cur_ts + DEFAULT_CACHE_AGE;
@@ -981,7 +1005,8 @@
+   }
+
+   /* check session authorization */
-+   if (session_is_authenticated(session) && !session_is_authorized(session, srv, con)) {
++   if ((!is_phy_allowed && (!session_is_authenticated(session) || !session_is_authorized(session, srv, con)))
++      || (session_is_authenticated(session) && !session_is_authorized(session, srv, con))) {
+       free(session);
+       session = NULL;
+       con->http_status = 403;
Avatar utente
admin
Site Admin
 
Messaggi: 1286
Iscritto il: 12 marzo 2009, 11:16

Re: IMPORTANTE: AirOS Security Exploit - Updated Firmware

Messaggiodi margiatec » 9 marzo 2012, 0:11

Scusate io ho l'airgrid M5 con firmware 5.3.5 ho bisogno di aggiornare la patch ?
Non ho capito in inglese in cosa consite la vulnerabilita.

grazie
margiatec
Beginner
 
Messaggi: 63
Iscritto il: 25 febbraio 2012, 20:26

Re: IMPORTANTE: AirOS Security Exploit - Updated Firmware

Messaggiodi thema3x » 9 marzo 2012, 0:58

Ciao,

con la 5.3.5 sei ok.

Sostanzialmente c' erano delle voci di menù lasciate aperte, cioè digitando il link diretto alla pagina l' accesso veniva autorizzato senza richiesta di pass.

Una volta sulla pagina era possibile caricare file nell' antenna ( sempre senza pass ).

Una dimenticanza di programmazione sostanzialmente :fifi:

Ciao

TheMa3x
Avatar utente
thema3x
Broadband Boss
 
Messaggi: 7119
Iscritto il: 26 marzo 2011, 2:19
Località: Tradate - Varese - Lombardia - Nord Italia

Re: IMPORTANTE: AirOS Security Exploit - Updated Firmware

Messaggiodi margiatec » 9 marzo 2012, 7:59

Grazie Gentilissimo :eheh:
margiatec
Beginner
 
Messaggi: 63
Iscritto il: 25 febbraio 2012, 20:26

Re: IMPORTANTE: AirOS Security Exploit - Updated Firmware

Messaggiodi thema3x » 10 marzo 2012, 18:55

De nada :)
Avatar utente
thema3x
Broadband Boss
 
Messaggi: 7119
Iscritto il: 26 marzo 2011, 2:19
Località: Tradate - Varese - Lombardia - Nord Italia

IMPORTANTE AirOS Security Exploit Updated Firmware

Messaggiodi IrricaCab » 16 giugno 2020, 6:25

This solution works great. I have one query: how can I disable/re-enable the Wifi or disconnect from a connection, without rebooting or unplugging the USB Wifi dongle?
IrricaCab
User
 
Messaggi: 21
Iscritto il: 27 ottobre 2017, 4:09


Torna a Embedded System & Mini-PCI

Chi c’è in linea

Visitano il forum: Nessuno

cron