hacktricks/generic-methodologies-and-resources/basic-forensic-methodology/image-acquisition-and-mount.md

126 lines
5.9 KiB
Markdown
Raw Normal View History

# Acquisizione e Montaggio Immagine
2022-04-28 16:01:33 +00:00
<details>
<summary><strong>Impara l'hacking AWS da zero a esperto con</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
* Lavori in una **azienda di sicurezza informatica**? Vuoi vedere la **tua azienda pubblicizzata su HackTricks**? o vuoi avere accesso all'**ultima versione del PEASS o scaricare HackTricks in PDF**? Controlla i [**PIANI DI ABBONAMENTO**](https://github.com/sponsors/carlospolop)!
* Scopri [**La Famiglia PEASS**](https://opensea.io/collection/the-peass-family), la nostra collezione di [**NFT esclusivi**](https://opensea.io/collection/the-peass-family)
* Ottieni il [**merchandising ufficiale PEASS & HackTricks**](https://peass.creator-spring.com)
* **Unisciti al** [**💬**](https://emojipedia.org/speech-balloon/) [**gruppo Discord**](https://discord.gg/hRep4RUj7f) o al [**gruppo telegram**](https://t.me/peass) o **seguimi** su **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Condividi i tuoi trucchi di hacking inviando PR al [repo hacktricks](https://github.com/carlospolop/hacktricks) e al [repo hacktricks-cloud](https://github.com/carlospolop/hacktricks-cloud)**.
2022-04-28 16:01:33 +00:00
</details>
<figure><img src="https://pentest.eu/RENDER_WebSec_10fps_21sec_9MB_29042024.gif" alt=""><figcaption></figcaption></figure>
{% embed url="https://websec.nl/" %}
2024-02-10 13:03:23 +00:00
## Acquisizione
2022-04-28 16:01:33 +00:00
2022-09-09 12:03:08 +00:00
### DD
2021-01-05 13:06:39 +00:00
```bash
#This will generate a raw copy of the disk
dd if=/dev/sdb of=disk.img
```
### dcfldd
2021-01-05 13:06:39 +00:00
```bash
2022-09-09 12:03:08 +00:00
#Raw copy with hashes along the way (more secur as it checks hashes while it's copying the data)
2021-01-05 13:06:39 +00:00
dcfldd if=<subject device> of=<image file> bs=512 hash=<algorithm> hashwindow=<chunk size> hashlog=<hash file>
dcfldd if=/dev/sdc of=/media/usb/pc.image hash=sha256 hashwindow=1M hashlog=/media/usb/pc.hashes
```
2022-09-09 12:03:08 +00:00
### FTK Imager
2021-01-05 13:06:39 +00:00
2024-02-10 13:03:23 +00:00
Puoi [**scaricare FTK Imager da qui**](https://accessdata.com/product-download/debian-and-ubuntu-x64-3-1-1).
2021-01-05 13:06:39 +00:00
```bash
ftkimager /dev/sdb evidence --e01 --case-number 1 --evidence-number 1 --description 'A description' --examiner 'Your name'
```
2022-09-09 12:03:08 +00:00
### EWF
2021-01-05 13:06:39 +00:00
2024-02-10 13:03:23 +00:00
Puoi generare un'immagine del disco utilizzando gli [**strumenti ewf**](https://github.com/libyal/libewf).
2021-01-05 13:06:39 +00:00
```bash
ewfacquire /dev/sdb
#Name: evidence
#Case number: 1
#Description: A description for the case
#Evidence number: 1
#Examiner Name: Your name
#Media type: fixed
#Media characteristics: physical
#File format: encase6
#Compression method: deflate
2022-05-01 12:41:36 +00:00
#Compression level: fast
2021-01-05 13:06:39 +00:00
#Then use default values
#It will generate the disk image in the current directory
```
## Mounta
2021-01-05 13:06:39 +00:00
2024-02-10 13:03:23 +00:00
### Diversi tipi
2021-01-05 13:06:39 +00:00
In **Windows** puoi provare a utilizzare la versione gratuita di Arsenal Image Mounter ([https://arsenalrecon.com/downloads/](https://arsenalrecon.com/downloads/)) per **montare l'immagine forense**.
2021-04-01 21:44:54 +00:00
2022-09-09 12:03:08 +00:00
### Raw
2021-01-05 13:06:39 +00:00
```bash
#Get file type
2024-02-10 13:03:23 +00:00
file evidence.img
2021-01-05 13:06:39 +00:00
evidence.img: Linux rev 1.0 ext4 filesystem data, UUID=1031571c-f398-4bfb-a414-b82b280cf299 (extents) (64bit) (large files) (huge files)
#Mount it
mount evidence.img /mnt
```
2022-09-09 12:03:08 +00:00
### EWF
2021-01-05 13:06:39 +00:00
```bash
#Get file type
2024-02-10 13:03:23 +00:00
file evidence.E01
2021-01-05 13:06:39 +00:00
evidence.E01: EWF/Expert Witness/EnCase image file format
#Transform to raw
mkdir output
ewfmount evidence.E01 output/
2024-02-10 13:03:23 +00:00
file output/ewf1
2021-01-05 13:06:39 +00:00
output/ewf1: Linux rev 1.0 ext4 filesystem data, UUID=05acca66-d042-4ab2-9e9c-be813be09b24 (needs journal recovery) (extents) (64bit) (large files) (huge files)
#Mount
mount output/ewf1 -o ro,norecovery /mnt
```
2022-09-09 12:03:08 +00:00
### ArsenalImageMounter
2021-05-28 17:29:30 +00:00
È un'applicazione Windows per montare volumi. Puoi scaricarla [qui](https://arsenalrecon.com/downloads/)
2021-05-28 17:29:30 +00:00
2024-02-10 13:03:23 +00:00
### Errori
2021-01-05 13:06:39 +00:00
2024-02-10 13:03:23 +00:00
* **`impossibile montare /dev/loop0 in sola lettura`** in questo caso è necessario utilizzare i flag **`-o ro,norecovery`**
* **`tipo fs errato, opzione errata, superblock errato su /dev/loop0, pagina di codice mancante o programma di assistenza, o altro errore.`** in questo caso il mount è fallito poiché l'offset del filesystem è diverso rispetto a quello dell'immagine disco. È necessario trovare la dimensione del settore e il settore di avvio:
2021-01-05 13:06:39 +00:00
```bash
2024-02-10 13:03:23 +00:00
fdisk -l disk.img
2021-01-05 13:06:39 +00:00
Disk disk.img: 102 MiB, 106954648 bytes, 208896 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00495395
Device Boot Start End Sectors Size Id Type
disk.img1 2048 208895 206848 101M 1 FAT12
```
Nota che la dimensione del settore è **512** e l'inizio è **2048**. Quindi monta l'immagine in questo modo:
2021-01-05 13:06:39 +00:00
```bash
mount disk.img /mnt -o ro,offset=$((2048*512))
```
<figure><img src="https://pentest.eu/RENDER_WebSec_10fps_21sec_9MB_29042024.gif" alt=""><figcaption></figcaption></figure>
{% embed url="https://websec.nl/" %}
2022-04-28 16:01:33 +00:00
<details>
<summary><strong>Impara l'hacking AWS da zero a eroe con</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
* Lavori in una **azienda di sicurezza informatica**? Vuoi vedere la **tua azienda pubblicizzata su HackTricks**? o vuoi avere accesso all'**ultima versione del PEASS o scaricare HackTricks in PDF**? Controlla i [**PIANI DI ABBONAMENTO**](https://github.com/sponsors/carlospolop)!
* Scopri [**The PEASS Family**](https://opensea.io/collection/the-peass-family), la nostra collezione di esclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
2024-02-10 13:03:23 +00:00
* Ottieni il [**merchandising ufficiale di PEASS & HackTricks**](https://peass.creator-spring.com)
* **Unisciti al** [**💬**](https://emojipedia.org/speech-balloon/) [**gruppo Discord**](https://discord.gg/hRep4RUj7f) o al [**gruppo telegram**](https://t.me/peass) o **seguimi** su **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Condividi i tuoi trucchi di hacking inviando PR al [repo hacktricks](https://github.com/carlospolop/hacktricks) e al [repo hacktricks-cloud](https://github.com/carlospolop/hacktricks-cloud)**.
2022-04-28 16:01:33 +00:00
</details>