Dimensione: 12301
Commento:
|
Dimensione: 10439
Commento:
|
Le cancellazioni sono segnalate in questo modo. | Le aggiunte sono segnalate in questo modo. |
Linea 1: | Linea 1: |
#page created by wilecoyote | |
Linea 5: | Linea 6: |
<<Informazioni(forum="http://forum.ubuntu-it.org/viewtopic.php?f=46&t=592585"; rilasci="15.10 14.04 12.04")>> | <<Informazioni(forum="http://forum.ubuntu-it.org/viewtopic.php?f=46&t=641551"; rilasci="21.04 20.04 18.04";)>> |
Linea 7: | Linea 8: |
= Introduzione = La seguente guida contiene le istruzioni utili all'installazione di '''Ubuntu''' tramite il CD '''minimale'''.<<BR>> |
= Introduzione = |
Linea 10: | Linea 10: |
Quest'ultimo è una particolare immagine `.iso` di dimensioni molto ridotte (circa 30 MiB, a seconda del rilascio) che ha la particolarità di installare solo i pacchetti desiderati, selezionandoli e scaricandoli direttamente dalla rete. | '''Foremost''' è uno strumento da riga di comando utile per recuperare file basandosi sui loro header, footers e struttura interna dei dati. Questo procedimento è detto ''[[https://en.wikipedia.org/wiki/File_carving|data carving]]''. Foremost può operare sia su file immagine, sia su supporti quali unità flash, hard ddisk, schede di memoria ecc. Supporta diversi tipi di filesystem, inclusi Fat16/32, Ext3/4 e NTFS. |
Linea 12: | Linea 12: |
Analogamente al '''[[Installazione/Alternate|CD Alternate]]''', non è dotato di '''sessione live''' e presenta al posto dell'installer '''[[https://it.wikipedia.org/wiki/Ubiquity|Ubiquity]]''' un'interfaccia semplificata di tipo testuale. | Sviluppato origariamente da enti governativi statunitensi quali United States Air Force Office of Special Investigations and The Center for Information Systems Security Studies and Research, è stato successivamente reso di pubblico dominio. |
Linea 14: | Linea 14: |
Questa modalità di installazione si rivela un'ottima soluzione nei seguenti casi: * '''Per computer datati:''' Il CD minimale è avviabile su macchine con RAM inferiore ai 700 MB. Risulta inoltre essere un'alternativa al '''[[Installazione/Alternate|CD Alternate]]''', disponibile solo per '''Lubuntu''' dalla versione 12.10. * '''Per installazioni personalizzate:''' Con il CD minimale si può ottenere un sistema privo dei pacchetti preinstallati nelle `.iso` ufficiali di Ubuntu e derivate. È dunque possibile creare un sistema altamente customizzato secondo le proprie esigenze (ad esempio fornito esclusivamente di [[AmbienteGrafico/AmbientiDesktop|ambiente DE]] non presente nelle derivate ufficiali, oppure un ambiente grafico minimale senza programmi preinstallati, o anche dotato di sola [[AmministrazioneSistema/RigaDiComando|shell]] ecc.). ||<tablestyle="text-align: justify; width:100%;" style="border:none;" 5%><<Immagine(Icone/Piccole/note.png,,center)>> ||<style="padding:0.5em; border:none;">''Se si desidera procedere con l'installazione della versione minimale, è necessario disporre di una connessione a Internet correttamente configurata e funzionante''. || = Preparativi = Scaricare l'immagine `.iso` adatta alla propria architettura, quindi [[Hardware/DispositiviPartizioni/MasterizzareIso|masterizzarla]] su un CD/DVD vuoto oppure creare un [[Installazione/Unetbootin|pendrive USB avviabile]]: * architetture a '''32 bit''': * [[http://archive.ubuntu.com/ubuntu/dists/wily/main/installer-i386/current/images/netboot/mini.iso|CD minimale di Ubuntu 15.10]] * [[http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-i386/current/images/netboot/mini.iso|CD minimale di Ubuntu 14.04]] * [[http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/current/images/netboot/mini.iso|CD minimale di Ubuntu 12.04]] ## * [[http://archive.ubuntu.com/ubuntu/dists/vivid/main/installer-i386/current/images/netboot/mini.iso|CD minimale di Ubuntu 15.04]] ## * [[http://archive.ubuntu.com/ubuntu/dists/utopic/main/installer-i386/current/images/netboot/mini.iso|CD minimale di Ubuntu 14.10]] ## * [[http://archive.ubuntu.com/ubuntu/dists/saucy/main/installer-i386/current/images/netboot/mini.iso|CD minimale di Ubuntu 13.10]] ## * [[http://archive.ubuntu.com/ubuntu/dists/quantal/main/installer-i386/current/images/netboot/mini.iso|CD minimale di Ubuntu 12.10]] ## * [[http://archive.ubuntu.com/ubuntu/dists/raring/main/installer-i386/current/images/netboot/mini.iso|CD minimale di Ubuntu 13.04]] ## * [[http://archive.ubuntu.com/ubuntu/dists/oneiric/main/installer-i386/current/images/netboot/mini.iso|CD minimale di Ubuntu 11.10]]; ## * [[http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-i386/current/images/netboot/mini.iso|CD minimale di Ubuntu 10.04]]; ## * [[http://archive.ubuntu.com/ubuntu/dists/natty/main/installer-i386/current/images/netboot/mini.iso|CD minimale di Ubuntu 11.04]]; ## * [[http://archive.ubuntu.com/ubuntu/dists/maverick/main/installer-i386/current/images/netboot/mini.iso|CD minimale di ##Ubuntu 10.10]]; ## * [[http://archive.ubuntu.com/ubuntu/dists/karmic/main/installer-i386/current/images/netboot/mini.iso|CD minimale di ##Ubuntu 9.10]]; ## * [[http://archive.ubuntu.com/ubuntu/dists/hardy/main/installer-i386/current/images/netboot/mini.iso|CD minimale di ##Ubuntu 8.04]]. * architetture a '''64 bit''': * [[http://archive.ubuntu.com/ubuntu/dists/wily/main/installer-amd64/current/images/netboot/mini.iso|CD minimale di Ubuntu 15.10]] * [[http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/mini.iso|CD minimale di Ubuntu 14.04]] * [[http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-amd64/current/images/netboot/mini.iso|CD minimale di Ubuntu 12.04]] ## * [[http://archive.ubuntu.com/ubuntu/dists/vivid/main/installer-amd64/current/images/netboot/mini.iso|CD minimale di Ubuntu 15.04]] ## * [[http://archive.ubuntu.com/ubuntu/dists/utopic/main/installer-amd64/current/images/netboot/mini.iso|CD minimale di Ubuntu 14.10]] ## * [[http://archive.ubuntu.com/ubuntu/dists/saucy/main/installer-amd64/current/images/netboot/mini.iso|CD minimale di Ubuntu 13.10]] ##[[http://archive.ubuntu.com/ubuntu/dists/quantal/main/installer-amd64/current/images/netboot/mini.iso|CD minimale di Ubuntu 12.10]] ## * [[http://archive.ubuntu.com/ubuntu/dists/raring/main/installer-amd64/current/images/netboot/mini.iso|CD minimale di Ubuntu 13.04]] ## * [[http://archive.ubuntu.com/ubuntu/dists/oneiric/main/installer-amd64/current/images/netboot/mini.iso|CD minimale di Ubuntu 11.10]]; ## * [[http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/mini.iso|CD minimale di Ubuntu 10.04]]; ## * [[http://archive.ubuntu.com/ubuntu/dists/natty/main/installer-amd64/current/images/netboot/mini.iso|CD minimale di Ubuntu 11.04]]; ## * [[http://archive.ubuntu.com/ubuntu/dists/maverick/main/installer-amd64/current/images/netboot/mini.iso|CD minimale di ##Ubuntu 10.10]]; ## * [[http://archive.ubuntu.com/ubuntu/dists/karmic/main/installer-amd64/current/images/netboot/mini.iso|CD minimale ##di Ubuntu 9.10]]; ## * [[http://archive.ubuntu.com/ubuntu/dists/hardy/main/installer-amd64/current/images/netboot/mini.iso|CD minimale di ##Ubuntu 8.04]]. = Avvio e installazione = 0. [[Installazione/AvvioDaCd|Configurare il BIOS]] affinchè diventi possibile avviare il sistema da lettore CD o pendrive USB. Terminata la configurazione, inserire il dispositivo d'installazione e riavviare il computer. 0. Qualora al riavvio compaia una riga di comando simile alla seguente: {{{ boot: }}} premere '''Invio''' per proseguire. 0. Una volta presente la seguente schermata <<Immagine(./avvio1404.png,600,center)>> selezionare una fra le seguenti opzioni utilizzando i tasti freccia: * '''Install''': avvia il processo di installazione * '''Command-line install''': avvia il processo di installazione di un sistema minimale a riga di comando * '''Advanced options''': mostra le seguenti opzioni: * '''Expert install''': avvia il processo di installazione per esperti * '''Command-line expert install''': avvia il processo di installazione per esperti di un sistema minimale a riga di comando * '''Rescue mode''': avvia la modalità di ripristino * '''Help''': mostra l'aiuto in linea 0. Continuare seguendo le istruzioni a schermo (comprenderanno, fra le altre cose, scelta di lingua e tastiera, configurazione della rete del server da cui scaricare i pacchetti, partizionamento e scelta della partizione, creazione di utente e password) e attendere che si concludano le varie procedure di installazione e configurazione. 0. Dopo l'installazione del sistema di base comparirà la seguente schermata: <<Immagine(./componenti1404.png,600,center)>> Selezionare quindi i componenti che si desidera installare e premere '''Invio''' (la selezione va effettuata tramite la barra spaziatrice; utilizzare il tasto '''TAB''' per spostarsi su '''Continuare'''). ||<tablestyle="text-align: justify; width:100%;" style="border:none;" 5%><<Immagine(Icone/Piccole/note.png,,center)>> ||<style="padding:0.5em; border:none;">''Non selezionare alcuna voce nel caso si preferisca procedere in seguito con l'installazione dei componenti desiderati, compreso l'ambiente desktop''. || 0. Attendere l'installazione degli eventuali elementi selezionati e seguire le restanti istruzioni a schermo (comprendenti l'installazione del bootloader [[AmministrazioneSistema/Grub|GRUB]] e l'orologio di sistema). 0. Ad installazione terminata, come da istruzioni, rimuovere i supporti removibili e riavviare. Se la procedura si è conclusa senza errori, al riavvio sarà disponibile a seconda dei casi: * Il sistema Ubuntu completo dell'ambiente grafico precedentemente selezionato. * Un sistema minimale Ubuntu, dotato di sola [[AmministrazioneSistema/RigaDiComando|shell]] testuale a riga di comando, utilizzabile esclusivamente tramite tastiera. <<Anchor(desktop)>> = Esempi di installazione di un ambiente grafico minimale = Se durante la procedura precedente non si è selezionato nessun ambiente desktop, qualora lo si desideri, è possibile installare un ambiente grafico tramite [[AmministrazioneSistema/RigaDiComando|riga di comando]].<<BR>> Di seguito sono riportati alcuni esempi di installazione di un ambiente grafico minimale. <<BR>> Per ulteriori informazioni relative agli ambienti grafici disponibili per '''Ubuntu''' (requisiti di sistema, installazione, configurazione ecc.) visitare [[AmbienteGrafico|questa pagina]]. <<BR>> Le istruzioni includono anche l'installazione di un [[https://en.wikipedia.org/wiki/X_display_manager_%28program_type%29|display manager]] per effettuare il login dell'utente e selezionare la sessione desktop. Ove possibile viene installato il display manager nativo per l'ambiente grafico selezionato (''gdm'' per '''GNOME''', ''kdm'' per '''KDE''', ''lxdm'' per '''LXDE''' ecc.). Per l'installazione di altri display manager e per la loro configurazione consultare [[AmbienteGrafico/DisplayManager|questa pagina]].<<BR>> Se non si desidera installare alcun display manager, è comunque possibile accedere all'ambiente grafico dopo aver effettuato il login testuale tramite [[AmministrazioneSistema/RigaDiComando|shell]], avviando il '''[[https://it.wikipedia.org/wiki/X_Window_System|server X]]''' con il comando:{{{ startx |
{{{#!wiki note nota. |
Linea 102: | Linea 18: |
<<Anchor(gnome)>> == Installazione di GNOME == |
|
Linea 105: | Linea 19: |
Digitare il seguente comando: {{{ sudo apt-get install gdm gnome-core xorg |
{{{#!wiki important Per evitare sovrascritture accidentali di dati, si raccomanda di eseguire un backup a basso livello del supporto di memoria dal quale si vogliono recuperare i dati usando lo strumento [[AmministrazioneSistema/BackupDelSistema#Backup_con_dd|dd]]. |
Linea 109: | Linea 23: |
Per l'installazione dell'ambiente '''GNOME Shell''' attraverso repository esterni, consultare la [[Installazione/CdMinimale/GnomeShell|relativa guida]]. | = Installazione = |
Linea 111: | Linea 25: |
<<Anchor(kde)>> == Installazione di KDE == |
[[AmministrazioneSistema/InstallareProgrammi|Installare]] il pacchetto [[apt://foremost|foremost]]. |
Linea 114: | Linea 27: |
Per un ambiente '''desktop''' di base digitare il comando:{{{ sudo apt-get install kdm kde-plasma-desktop xorg}}} |
= Utilizzo di base = |
Linea 117: | Linea 29: |
Per un ambiente grafico di base specifico per '''netbook''' digitare il comando:{{{ sudo apt-get install kdm kde-plasma-netbook xorg |
The most basic way to use foremost is by providing a source to scan for deleted files (it can be either a partition or an image file, as those generated with dd). Let’s see an example. Imagine we want to scan the /dev/sdb1 partition: before we begin, a very important thing to remember is to never store retrieved data on the same partition we are retrieving the data from, to avoid overwriting delete files still present on the block device. The command we would run is: $ sudo foremost -i /dev/sdb1 By default, the program creates a directory called output inside the directory we launched it from and uses it as destination. Inside this directory, a subdirectory for each supported file type we are attempting to retrieve is created. Each directory will hold the corresponding file type obtained from the data carving process: output ├── audit.txt ├── avi ├── bmp ├── dll ├── doc ├── docx ├── exe ├── gif ├── htm ├── jar ├── jpg ├── mbd ├── mov ├── mp4 ├── mpg ├── ole ├── png ├── ppt ├── pptx ├── rar ├── rif ├── sdw ├── sx ├── sxc ├── sxi ├── sxw ├── vis ├── wav ├── wmv ├── xls ├── xlsx └── zip When foremost completes its job, empty directories are removed. Only the ones containing files are left on the filesystem: this let us immediately know what type of files were successfully retrieved. By default the program tries to retrieve all the supported file types; to restrict our search, we can, however, use the -t option and provide a list of the file types we want to retrieve, separated by a comma. In the example below, we restrict the search only to gif and pdf files: $ sudo foremost -t gif,pdf -i /dev/sdb1 = Recupero su disco separato = Negli esempi seguenti si ipotizza che i file da recuperare siano sul disco `/dev/sda`, che verranno salvati su un altro disco `/dev/sdb`, ove sarà necessario montare la cartella scrivibile creata a questo scopo, in cui salvare i file recuperati. 0. [[AmministrazioneSistema/ComandiBase#mkdir|Creare]] sul disco `/dev/sda` la cartella `/recovery/foremost`:{{{ sudo mkdir -p /recovery/foremost }}} 0. [[AmministrazioneSistema/ComandiBase#mount|Montare]] il disco `/dev/sdb` nella cartella `/recovery`:{{{ sudo mount /dev/sdb /recovery }}} 0. Avviare '''foremost''' digitando il comando:{{{ sudo foremost -i /dev/sda -o /recovery/foremost }}}{{{#!wiki note Per avviare ''foremost'' su un file immagine sostituire il disco `/dev/sda` col nome dell'immagine. }}} 0. I file recuperati saranno di proprietà dell'utente '''root'''. Per cambiare i [[AmministrazioneSistema/PermessiFile|permessi]] digitare il seguente comando:{{{ sudo chown -R nomeutente:nomegruppo /recovery/foremost }}} «nomeutente:nomegruppo» rappresentano rispettivamente il nome dell'utente e il nome del gruppo di appartenenza (generalmente utente e gruppo hanno lo stesso identificativo). 0. Terminato il recupero, [[AmministrazioneSistema/ComandiBase#umount|smontare]] il disco esterno:{{{ sudo umount /dev/sdb |
Linea 121: | Linea 97: |
<<Anchor(xfce)>> == Installazione di Xfce == |
|
Linea 124: | Linea 98: |
Digitare il seguente comando: {{{ sudo apt-get install xfce4 xorg xinit lightdm }}} |
= Specifying an alternative destination = |
Linea 128: | Linea 100: |
<<Anchor(lxde)>> == Installazione di LXDE == |
As we already said, if a destination is not explicitly declared, foremost creates an output directory inside our cwd. What if we want to specify an alternative path? All we have to do is to use the -o option and provide said path as argument. If the specified directory doesn’t exist, it is created; if it exists but it’s not empty, the program throws a complain: |
Linea 131: | Linea 102: |
Digitare il seguente comando:{{{ sudo apt-get install lxde xinit lxdm xorg }}} |
ERROR: /home/egdoc/data is not empty Please specify another directory or run with -T. |
Linea 135: | Linea 105: |
##=== Installazione su Ubuntu 8.04 === | To solve the problem, as suggested by the program itself, we can either use another directory or re-launch the command with the -T option. If we use the -T option, the output directory specified with the -o option is timestamped. This makes possible to run the program multiple times with the same destination. In our case the directory that would be used to store the retrieved files would be: |
Linea 137: | Linea 107: |
##Aprire il file `/etc/apt/sources.list` con un [[Ufficio/EditorDiTesto|editor di testo]] con i ##[[AmministrazioneSistema/Sudo|privilegi di amministrazione]] e aggiungere in fondo al file le seguenti righe:{{{ ##deb http://ppa.launchpad.net/lxde/ubuntu hardy main ##deb-src http://ppa.launchpad.net/lxde/ubuntu hardy main ##}}} |
/home/egdoc/data_Thu_Sep_12_16_32_38_2019 |
Linea 142: | Linea 109: |
##Per aggiornare la lista dei [[Repository|repository]] e installare '''LXDE''' è sufficiente digitare i seguenti ##comandi in una finestra di terminale: {{{ ##sudo apt-get update ##sudo apt-get install lxde xinit lxdm xorg ##}}} |
= File di configurazione = |
Linea 147: | Linea 111: |
== Installazione di Unity == | The foremost configuration file can be used to specify file formats not natively supported by the program. Inside the file we can find several commented examples showing the syntax that should be used to accomplish the task. Here is an example involving the png type (the lines are commented since the file type is supported by default): |
Linea 149: | Linea 113: |
Per installare una versione minimale dell'interfaccia grafica [[AmbienteGrafico/Unity|Unity]], consultare la [[Installazione/CdMinimale/Unity|relativa guida]]. | # PNG (used in web pages) # (NOTE THIS FORMAT HAS A BUILTIN EXTRACTION FUNCTION) # png y 200000 \x50\x4e\x47? \xff\xfc\xfd\xfe The information to provide in order to add support for a file type, are, from left to right, separated by a tab character: the file extension (png in this case), whether the header and footer are case sensitive (y), the maximum file size in Bytes (200000), the header (\x50\x4e\x47?) and and the footer (\xff\xfc\xfd\xfe). Only the latter is optional and can be omitted. If the path of the configuration file it’s not explicitly provided with the -c option, a file named foremost.conf is searched and used, if present, in the current working directory. If it is not found the default configuration file, /etc/foremost.conf is used instead. == Aggiungere altri formati di file == By reading the examples provided in the configuration file, we can easily add support for a new file type. In this example we will add support for flac audio files. Flac (Free Lossless Audio Coded) is a non-proprietary lossless audio format which is able to provide compressed audio without quality loss. First of all, we know that the header of this file type in hexadecimal form is 66 4C 61 43 00 00 00 22 (fLaC in ASCII), and we can verify it by using a program like hexdump on a flac file: $ hexdump -C blind_guardian_war_of_wrath.flac|head 00000000 66 4c 61 43 00 00 00 22 12 00 12 00 00 00 0e 00 |fLaC..."........| 00000010 36 f2 0a c4 42 f0 00 4d 04 60 6d 0b 64 36 d7 bd |6...B..M.`m.d6..| 00000020 3e 4c 0d 8b c1 46 b6 fe cd 42 04 00 03 db 20 00 |>L...F...B.... .| 00000030 00 00 72 65 66 65 72 65 6e 63 65 20 6c 69 62 46 |..reference libF| 00000040 4c 41 43 20 31 2e 33 2e 31 20 32 30 31 34 31 31 |LAC 1.3.1 201411| 00000050 32 35 21 00 00 00 12 00 00 00 54 49 54 4c 45 3d |25!.......TITLE=| 00000060 57 61 72 20 6f 66 20 57 72 61 74 68 11 00 00 00 |War of Wrath....| 00000070 52 45 4c 45 41 53 45 43 4f 55 4e 54 52 59 3d 44 |RELEASECOUNTRY=D| 00000080 45 0c 00 00 00 54 4f 54 41 4c 44 49 53 43 53 3d |E....TOTALDISCS=| 00000090 32 0c 00 00 00 4c 41 42 45 4c 3d 56 69 72 67 69 |2....LABEL=Virgi| As you can see the file signature is indeed what we expected. Here we will assume a maximum file size of 30 MB, or 30000000 Bytes. Let’s add the entry to the file: flac y 30000000 \x66\x4c\x61\x43\x00\x00\x00\x22 The footer signature is optional so here we didn’t provide it. The program should now be able to recover deleted flac files. Let’s verify it. To test that everything works as expected I previously placed, and then removed, a flac file from the /dev/sdb1 partition, and then proceeded to run the command: $ sudo foremost -i /dev/sdb1 -o $HOME/Documents/output As expected, the program was able to retrieve the deleted flac file (it was the only file on the device, on purpose), although it renamed it with a random string. The original filename cannot be retrieved because, as we know, files metadata is contained in the filesystem, and not in the file itself: /home/egdoc/Documents └── output ├── audit.txt └── flac └── 00020482.flac The audit.txt file contains information about the actions performed by the program, in this case: Foremost version 1.5.7 by Jesse Kornblum, Kris Kendall, and Nick Mikus Audit File Foremost started at Thu Sep 12 23:47:04 2019 Invocation: foremost -i /dev/sdb1 -o /home/egdoc/Documents/output Output directory: /home/egdoc/Documents/output Configuration file: /etc/foremost.conf ------------------------------------------------------------------ File: /dev/sdb1 Start: Thu Sep 12 23:47:04 2019 Length: 200 MB (209715200 bytes) Num Name (bs=512) Size File Offset Comment 0: 00020482.flac 28 MB 10486784 Finish: Thu Sep 12 23:47:04 2019 1 FILES EXTRACTED flac:= 1 ------------------------------------------------------------------ Foremost finished at Thu Sep 12 23:47:04 2019 |
Linea 153: | Linea 184: |
* [[https://help.ubuntu.com/community/Installation/MinimalCD|Documento originale]] * [[Hardware/DispositiviPartizioni/MasterizzareIso|Come masterizzare un'immagine ISO]] * [[AmbienteGrafico|Ambienti grafici disponibili per Ubuntu]] |
* [[http://foremost.sourceforge.net/|Pagina ufficiale del progetto]] * [[https://en.wikipedia.org/wiki/Foremost_(software)|Voce enciclopedica]] (in inglese) * [[http://manpages.ubuntu.com/manpages/focal/en/man8/foremost.8.html|Pagina man]] * [[https://linuxconfig.org/how-to-recover-deleted-files-with-foremost-on-linux | Guida originae]] (in inglese) * [[AmministrazioneSistema/RecuperoDati|Portale recupero dati]] |
Linea 158: | Linea 193: |
CategoryInstallazioneSistema | CategoryHomepage ##CategoryGrafica |
Problemi in questa pagina? Segnalali in questa discussione
Introduzione
Foremost è uno strumento da riga di comando utile per recuperare file basandosi sui loro header, footers e struttura interna dei dati. Questo procedimento è detto data carving. Foremost può operare sia su file immagine, sia su supporti quali unità flash, hard ddisk, schede di memoria ecc. Supporta diversi tipi di filesystem, inclusi Fat16/32, Ext3/4 e NTFS.
Sviluppato origariamente da enti governativi statunitensi quali United States Air Force Office of Special Investigations and The Center for Information Systems Security Studies and Research, è stato successivamente reso di pubblico dominio.
nota.
Per evitare sovrascritture accidentali di dati, si raccomanda di eseguire un backup a basso livello del supporto di memoria dal quale si vogliono recuperare i dati usando lo strumento dd.
Installazione
Installare il pacchetto foremost.
Utilizzo di base
The most basic way to use foremost is by providing a source to scan for deleted files (it can be either a partition or an image file, as those generated with dd). Let’s see an example. Imagine we want to scan the /dev/sdb1 partition: before we begin, a very important thing to remember is to never store retrieved data on the same partition we are retrieving the data from, to avoid overwriting delete files still present on the block device. The command we would run is:
$ sudo foremost -i /dev/sdb1
By default, the program creates a directory called output inside the directory we launched it from and uses it as destination. Inside this directory, a subdirectory for each supported file type we are attempting to retrieve is created. Each directory will hold the corresponding file type obtained from the data carving process:
output ├── audit.txt ├── avi ├── bmp ├── dll ├── doc ├── docx ├── exe ├── gif ├── htm ├── jar ├── jpg ├── mbd ├── mov ├── mp4 ├── mpg ├── ole ├── pdf ├── png ├── ppt ├── pptx ├── rar ├── rif ├── sdw ├── sx ├── sxc ├── sxi ├── sxw ├── vis ├── wav ├── wmv ├── xls ├── xlsx └── zip
When foremost completes its job, empty directories are removed. Only the ones containing files are left on the filesystem: this let us immediately know what type of files were successfully retrieved. By default the program tries to retrieve all the supported file types; to restrict our search, we can, however, use the -t option and provide a list of the file types we want to retrieve, separated by a comma. In the example below, we restrict the search only to gif and pdf files:
$ sudo foremost -t gif,pdf -i /dev/sdb1
Recupero su disco separato
Negli esempi seguenti si ipotizza che i file da recuperare siano sul disco /dev/sda, che verranno salvati su un altro disco /dev/sdb, ove sarà necessario montare la cartella scrivibile creata a questo scopo, in cui salvare i file recuperati.
Creare sul disco /dev/sda la cartella /recovery/foremost:
sudo mkdir -p /recovery/foremost
Montare il disco /dev/sdb nella cartella /recovery:
sudo mount /dev/sdb /recovery
Avviare foremost digitando il comando:
sudo foremost -i /dev/sda -o /recovery/foremost
Per avviare foremost su un file immagine sostituire il disco /dev/sda col nome dell'immagine.
I file recuperati saranno di proprietà dell'utente root. Per cambiare i permessi digitare il seguente comando:
sudo chown -R nomeutente:nomegruppo /recovery/foremost
«nomeutente:nomegruppo» rappresentano rispettivamente il nome dell'utente e il nome del gruppo di appartenenza (generalmente utente e gruppo hanno lo stesso identificativo).Terminato il recupero, smontare il disco esterno:
sudo umount /dev/sdb
Specifying an alternative destination
As we already said, if a destination is not explicitly declared, foremost creates an output directory inside our cwd. What if we want to specify an alternative path? All we have to do is to use the -o option and provide said path as argument. If the specified directory doesn’t exist, it is created; if it exists but it’s not empty, the program throws a complain:
ERROR: /home/egdoc/data is not empty
- Please specify another directory or run with -T.
To solve the problem, as suggested by the program itself, we can either use another directory or re-launch the command with the -T option. If we use the -T option, the output directory specified with the -o option is timestamped. This makes possible to run the program multiple times with the same destination. In our case the directory that would be used to store the retrieved files would be:
/home/egdoc/data_Thu_Sep_12_16_32_38_2019
File di configurazione
The foremost configuration file can be used to specify file formats not natively supported by the program. Inside the file we can find several commented examples showing the syntax that should be used to accomplish the task. Here is an example involving the png type (the lines are commented since the file type is supported by default):
# PNG (used in web pages) # (NOTE THIS FORMAT HAS A BUILTIN EXTRACTION FUNCTION) # png y 200000 \x50\x4e\x47? \xff\xfc\xfd\xfe
The information to provide in order to add support for a file type, are, from left to right, separated by a tab character: the file extension (png in this case), whether the header and footer are case sensitive (y), the maximum file size in Bytes (200000), the header (\x50\x4e\x47?) and and the footer (\xff\xfc\xfd\xfe). Only the latter is optional and can be omitted.
If the path of the configuration file it’s not explicitly provided with the -c option, a file named foremost.conf is searched and used, if present, in the current working directory. If it is not found the default configuration file, /etc/foremost.conf is used instead.
Aggiungere altri formati di file
By reading the examples provided in the configuration file, we can easily add support for a new file type. In this example we will add support for flac audio files. Flac (Free Lossless Audio Coded) is a non-proprietary lossless audio format which is able to provide compressed audio without quality loss. First of all, we know that the header of this file type in hexadecimal form is 66 4C 61 43 00 00 00 22 (fLaC in ASCII), and we can verify it by using a program like hexdump on a flac file:
$ hexdump -C blind_guardian_war_of_wrath.flac|head 00000000 66 4c 61 43 00 00 00 22 12 00 12 00 00 00 0e 00 |fLaC..."........| 00000010 36 f2 0a c4 42 f0 00 4d 04 60 6d 0b 64 36 d7 bd |6...B..M.`m.d6..| 00000020 3e 4c 0d 8b c1 46 b6 fe cd 42 04 00 03 db 20 00 |>L...F...B.... .| 00000030 00 00 72 65 66 65 72 65 6e 63 65 20 6c 69 62 46 |..reference libF| 00000040 4c 41 43 20 31 2e 33 2e 31 20 32 30 31 34 31 31 |LAC 1.3.1 201411| 00000050 32 35 21 00 00 00 12 00 00 00 54 49 54 4c 45 3d |25!.......TITLE=| 00000060 57 61 72 20 6f 66 20 57 72 61 74 68 11 00 00 00 |War of Wrath....| 00000070 52 45 4c 45 41 53 45 43 4f 55 4e 54 52 59 3d 44 |RELEASECOUNTRY=D| 00000080 45 0c 00 00 00 54 4f 54 41 4c 44 49 53 43 53 3d |E....TOTALDISCS=| 00000090 32 0c 00 00 00 4c 41 42 45 4c 3d 56 69 72 67 69 |2....LABEL=Virgi|
As you can see the file signature is indeed what we expected. Here we will assume a maximum file size of 30 MB, or 30000000 Bytes. Let’s add the entry to the file:
flac y 30000000 \x66\x4c\x61\x43\x00\x00\x00\x22
The footer signature is optional so here we didn’t provide it. The program should now be able to recover deleted flac files. Let’s verify it. To test that everything works as expected I previously placed, and then removed, a flac file from the /dev/sdb1 partition, and then proceeded to run the command:
$ sudo foremost -i /dev/sdb1 -o $HOME/Documents/output
As expected, the program was able to retrieve the deleted flac file (it was the only file on the device, on purpose), although it renamed it with a random string. The original filename cannot be retrieved because, as we know, files metadata is contained in the filesystem, and not in the file itself:
/home/egdoc/Documents └── output
- ├── audit.txt └── flac
- └── 00020482.flac
The audit.txt file contains information about the actions performed by the program, in this case:
Foremost version 1.5.7 by Jesse Kornblum, Kris Kendall, and Nick Mikus Audit File
Foremost started at Thu Sep 12 23:47:04 2019 Invocation: foremost -i /dev/sdb1 -o /home/egdoc/Documents/output Output directory: /home/egdoc/Documents/output Configuration file: /etc/foremost.conf
File: /dev/sdb1 Start: Thu Sep 12 23:47:04 2019 Length: 200 MB (209715200 bytes)
Num Name (bs=512) Size File Offset Comment
0: 00020482.flac 28 MB 10486784 Finish: Thu Sep 12 23:47:04 2019
1 FILES EXTRACTED
flac:= 1
Foremost finished at Thu Sep 12 23:47:04 2019
Ulteriori risorse
Voce enciclopedica (in inglese)
Guida originae (in inglese)