Il post seguente è stato tradotto per gentile concessione di Zackery Fretty

Uno qualunque dei miei amici direbbe che sono un pazzo paranoide per quanto riguarda gli utenti malintenzionati, soprattutto quando si tratta di vendere la mia vecchia elettronica. Sono il tipo di ragazzo che preferisce mettere una pietra sopra al vecchio dispositivo. Purtroppo sono anche il tipo che ama comprare i nuovi Nexus non appena escono, quindi preferisco vendere i miei vecchi dispositivi per finanziare i miei nuovi acquisti. Per poterlo fare ho dovuto trovare un modo per sentirmi tranquillo. Ora so che un modo davvero semplice è abilitare la crittografia e poi formattare. Per qualche ragione quando ho venduto il mio HTC One X la cifratura non ha funzionato e la scheda SD non era rimovibile, quindi avevo bisogno di trovare un modo per tranquillizzarmi e vendere il dispositivo, ecco perché sono giunto a questa soluzione.

Non sono sicuro al 100% ma credo che potrebbe essere necessario aver installato BusyBox/Root, o semplicemente utilizzare Android SDK (che sarà utile in seguito); ma presumo che chiunque sappia che il Ripristino dati di fabbrica del vostro dispositivo in realtà non rimuove nessun dato, sia lo stesso tipo di persona che effettuerebbe il rooting dei dispositivi Android.

Anche solo come nota a margine, non sto dicendo che questa sia la cosa più sicura al mondo; ma è quello che faccio io e che mi fa sentire abbastanza tranquillo. Ho verificato usando Recuva in modalità d’analisi profonda e non sono stato in grado di recuperare i dati da /sdcard; in ogni caso, non ho modo di confermare per la partizione /data. Sto solo ipotizzando che funzioni altrettanto bene come per la scheda SD interna.

Questo processo comprende essenzialmente due fasi

  1. Formattazione memoria
  2. Zeroing /sdcard e /data

Quindi, iniziamo…

Fase 1 – Formattazione memoria

Operazione piuttosto semplice e quando si acquista un telefono usato online, è probabile che l’altro utente abbia protetto i dati; il che, vi assicuro, non è granché. Tutto questo per dire al sistema operativo che dove una volta erano presenti i vostri dati, ora sono “scrivibili”, in modo che il sistema operativo possa scrivervi ancora. Se doveste usare uno strumento come Recuva dopo l’esecuzione del Ripristino dati di fabbrica, sarete in grado di recuperare gran parte dei file. Questo non riguarda solo Android: si applica a tutti i supporti per l’archiviazione, anche se non tanto ai media con Flash come i dischi rigidi. La ragione per cui ho usato questo come punto di partenza è informare l’SO che tutto è “disponibile” per la scrittura, che è ciò che vogliamo. Per fare questo è possibile utilizzare il recupero, o andare su Impostazioni> Backup e Ripristino> Ripristino dati di fabbrica e lasciare che l’SO faccia il suo dovere .

Fase 2 – Zeroing /sdcard e /data

Ora che abbiamo reso scrivibili tutti i dati sul dispositivo, è il momento di iniziare l'”azzeramento”. Ciò significa, essenzialmente, scrivere degli 0 sui dati che abbiamo precedentemente contrassegnato come “scrivibili”. Se qualcuno tentasse di ripristinare i dati, recupererebbe degli 0 e non i vostri dati personali. Sugli HDD più vecchi sarebbe una buona idea farlo più volte ma molti esperti hanno suggerito che un solo passaggio è sufficiente nei media con flash.

La prima cosa che vorrete fare è lanciare l’SDK di Android utilizzando la riga di comando e passare alla cartella platform-tools dove troverete fastboot e adb . Si trova in /androidsdk/platform-tools.

Quando sarete negli strumenti della piattaforma eseguite il seguente comando:

./adb devices

Se otterrete una schermata con un numero di serie siete a posto: significa che il computer riesce a leggere il telefono. Se non otterrete nulla, andate in impostazioni per sviluppatori e abilitate Debug USB

Quando il telefono e l’SDK comunicheranno, digitate il seguente comando per accedere alla shell del dispositivo:

./adb shell

Dovreste avere un bash, come mostrato nell’immagine sotto :

Screen Shot 2013-02-16 at 1.10.14 PM

Non appena sarete nella riga di comando del vostro telefono, eseguite il seguente comando:

dd if=/dev/urandom of=/sdcard/junkfile

Non otterrete risposta per un po’: in sostanza, verrà creato un file pieno di dati casuali sulla scheda SD del vostro telefono fino a quando non sarà completamente piena; a quel punto si fermerà. Potrete verificare andando in Impostazioni> Memoria e guardando la % libera sulla scheda SD che continua a diminuire.

Quando il processo sarà completato, dovreste avere un messaggio simile al seguente, che descrive la quantità di spazio scritto. Dovrebbe essere pari alla dimensione della vostra scheda SD.

Screen Shot 2013-02-16 at 5.01.55 PM

Una volta che il processo sarà completo, proveremo a ripetere la stessa riga, con una leggera modifica, come segue:

dd if=/dev/urandom of=/data/junkfile

Questo creerà un altro junk file sul vostro dispositivo con dati casuali, ma non sarà in /sdcard, bensì in /data. /data, dove sono memorizzate tutte le impostazioni delle vostre varie app. Per verificare che questo processo fosse ancora in esecuzione, ho aperto una nuova finestra del terminale e ho usato la shell ./adb per eseguire ls -all -h per guardare la dimensione del file che continuava a crescere, come illustrato di seguito:

Screen Shot 2013-02-16 at 4.59.52 PM

Potrete vedere la dimensione del “junkfile” andare da 600MB a 1.5GB. Una volta che la cartella /data sarà completamente piena, non solo otterrete una conferma sulla shell ma il vostro dispositivo Android dovrebbe mandarvi un messaggio nella finestra di notifica che la partizione dati è piena e che le funzioni di sistema potrebbero essere compromesse, per una volta questo è bene!

Quindi, a questo punto, avrete correttamente saturato le vostre cartelle /data e /sdcard, le due principali aree in cui le informazioni personali sono memorizzate su Android, con un mucchio di dati casuali.

Il passo successivo, e finale, del processo è quello di tornare semplicemente al punto 1 e fare Ripristino dati di fabbrica per l’ultima volta. Questo marcherà i dati come “scrivibili” e regalerà al nuovo proprietario del vostro dispositivo un’esperienza da “nuovo telefono”. Non è necessario, suppongo, ma immagino che l’acquirente del telefono non prenderebbe troppo bene il fatto di trovare, all’accensione, un telefono pieno di messaggi di errore. 😉

Non sono esperto, però, come ho detto prima, usando software di recupero non sono stato in grado di recuperare i dati dal mio HTC One X, quando l’ho venduto; quindi direi che questo metodo è piuttosto comodo per ripulire il dispositivo del 99,9% degli utenti là fuori.

Un po’ sopra le righe? Sicuramente. Esattamente come piace a me!

Fonte: Secure Erasing Android Devices Guide for the Super Paranoid Seller
Any of my friends would tell you that I’m crazy paranoid about malicious users–especially when I sell off my old electronics. I’m the type of guy who’d prefer to put a nail through an old device. Unfortunately I’m also the type of guy that likes to buy the new Nexus devices every time they release–so I prefer to sell my old devices to help fund my new purchases. To do this I had to come up with a way to make myself feel good about selling my old devices. Now I know one really easy way to do this is to enable encryption on your device and then format it. For some reason when selling my HTC One X the encryption just kept failing and the SD card is non removable so I needed to find a way to get piece of mind and still sell the device–which led me to come up with this method.

I’m not 100% sure, but I believe you might need BusyBox/Root installed to do this–or it’s possible you can do it using just using the Android SDK (which, you will need) but I am going to assume anyone who understand that factory resetting your device doesn’t actually remove any data are more than likely the same type of people who’d be rooting their android devices.

Also just as a side note, I’m not saying this is the most secure thing in the world but it’s what I do and it makes me feel pretty good. I’ve confirmed by running Recuva in deep scan mode that I wasn’t able to recover any data from the /sdcard, however, I have no way to confirm for the /data partition. I’m just assuming it works just as well as it did for the internal SD card.

This process essentially includes 2 steps

  1. Formatting the Storage
  2. Zeroing out /sdcard, and /data

So let’s get started…

Step 1 — Formatting the Storage

This is a pretty basic deal and when you buy a phone online that’s used it’s likely as far as the other user has gone to secure the data–which I assure you isn’t much at all. All this is going to do is tell the OS that where your data used to be is now “Available” so that the OS can write over it. If you were to run a tool like Recuva after running a simple Factory Reset you’ll be able to recover much of the files. This isn’t just an Android thing–it applies to all storage mediums though not so much to flash media as hard drives. The reason I used this as a starting point is to tell the OS that everything is “available” for writing, which is how we want it. To do this you can either use your recovery or by going to Settings > Backup and Reset > Factory Reset and let the OS do its thing.

Step 2 — Zeroing out /sdcard and /data

Now that we’ve labeled all the data on the device as available for the writing, it’s time to start “Zeroing Out” the data. Which essentially means writing 0’s over the data that we previously marked as “Available”. Ideally after doing this if someone attempts to restore your data they’ll be restoring the 0’s and not your personal data. On older HDD’s it’s a good idea to do this multiple times but many experts have suggested one pass is all that’s necessary on flash media.

First thing you’ll want to do is fire up the Android SDK using the command line and navigate to the platform-tools folder where you’ll find fastboot and adb. It’s found in /androidsdk/platform-tools.

Once in your platform tools run the following command:

./adb devices

If you get a print out with a serial number you are good to go–this means that your computer is reading your phone just fine. If you don’t get anything be sure to go into your Developer Settings and enable USB Debugging.

Once you’ve got the phone and the SDK speaking together type the following command to access the shell of your device:

./adb shell

You should be greeted by a bash as shown in the image below:

Screen Shot 2013-02-16 at 1.10.14 PM

Once in your phones command line run the following command:

dd if=/dev/urandom of=/sdcard/junkfile

You won’t get a response for a while, what this is essentially doing is creating a file filled with random data on your phones SD Card until it’s completely full–at which point it will be brought to a hault. You can verify this by going into Settings > Storage and watching the % free on your SD card continue to go down.

When the process is all done you should get a message like the following, that details the amount of space written. It should resemble the size of your SD Card.

Screen Shot 2013-02-16 at 5.01.55 PM

Once the process is complete we’ll want to repeat the same line, with a slight modification as follows:

dd if=/dev/urandom of=/data/junkfile

This will create another junk file on your device with random data, except rather than being in /sdcard it’ll be in /data. /data is where all the settings for your various apps are stored. The way that I verified this process was still running was by opening a another terminal window and using ./adb shell to run ls -all -h to watch the size of the file continue to grow as shown below:

Screen Shot 2013-02-16 at 4.59.52 PM

You can see the size of “junkfile” going from ~600MB to ~1.5GB. Once the /data folder is completely full you’ll not only get a confirmation on the shell but your Android device should pop down a message in your notification window that the data partition is full and system functions might start breaking–for once this is good!

So at this point you’ve successfully filled your /data and /sdcard folders, the two main areas where personal information is stored on Android, with a bunch of random data.

The next and final step of the process is to simply return to Step 1 and Factory Reset the phone one last time. This will mark the data as “Available” and give the new owner of your device a “new phone” experience. It’s not necessary I suppose, but I’m guessing the buyer of your phone won’t take too kindly to turning on a phone filled with error messages. 😉

I’m not expert, however, as I stated before when running recovery software I was unable to recover any data from my HTC One X when I sold it–so I’d say this method is pretty handy at cleaning the device from 99.9% of users out there.

A little over the top? Definitely. That’s exactly how I like it!

Source: Secure Erasing Android Devices Guide for the Super Paranoid Seller

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.