mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-29 16:10:54 +00:00
131 lines
5.7 KiB
Markdown
131 lines
5.7 KiB
Markdown
# Acquisition d'Image & Montage
|
|
|
|
{% hint style="success" %}
|
|
Apprenez et pratiquez le Hacking AWS :<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**Formation HackTricks AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
|
|
Apprenez et pratiquez le Hacking GCP : <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**Formation HackTricks GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
|
|
|
<details>
|
|
|
|
<summary>Soutenir HackTricks</summary>
|
|
|
|
* Consultez les [**plans d'abonnement**](https://github.com/sponsors/carlospolop)!
|
|
* **Rejoignez le** 💬 [**groupe Discord**](https://discord.gg/hRep4RUj7f) ou le [**groupe telegram**](https://t.me/peass) ou **suivez** nous sur **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
|
|
* **Partagez des astuces de hacking en soumettant des PRs aux** [**HackTricks**](https://github.com/carlospolop/hacktricks) et [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) dépôts github.
|
|
|
|
</details>
|
|
{% endhint %}
|
|
|
|
<figure><img src="https://pentest.eu/RENDER_WebSec_10fps_21sec_9MB_29042024.gif" alt=""><figcaption></figcaption></figure>
|
|
|
|
{% embed url="https://websec.nl/" %}
|
|
|
|
## Acquisition
|
|
|
|
### DD
|
|
```bash
|
|
#This will generate a raw copy of the disk
|
|
dd if=/dev/sdb of=disk.img
|
|
```
|
|
### dcfldd
|
|
```bash
|
|
#Raw copy with hashes along the way (more secur as it checks hashes while it's copying the data)
|
|
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
|
|
```
|
|
### FTK Imager
|
|
|
|
Vous pouvez [**télécharger le FTK imager ici**](https://accessdata.com/product-download/debian-and-ubuntu-x64-3-1-1).
|
|
```bash
|
|
ftkimager /dev/sdb evidence --e01 --case-number 1 --evidence-number 1 --description 'A description' --examiner 'Your name'
|
|
```
|
|
### EWF
|
|
|
|
Vous pouvez générer une image disque en utilisant les [**ewf tools**](https://github.com/libyal/libewf).
|
|
```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
|
|
#Compression level: fast
|
|
|
|
#Then use default values
|
|
#It will generate the disk image in the current directory
|
|
```
|
|
## Mount
|
|
|
|
### Plusieurs types
|
|
|
|
Dans **Windows**, vous pouvez essayer d'utiliser la version gratuite d'Arsenal Image Mounter ([https://arsenalrecon.com/downloads/](https://arsenalrecon.com/downloads/)) pour **monter l'image d'analyse**.
|
|
|
|
### Raw
|
|
```bash
|
|
#Get file type
|
|
file evidence.img
|
|
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
|
|
```
|
|
### EWF
|
|
```bash
|
|
#Get file type
|
|
file evidence.E01
|
|
evidence.E01: EWF/Expert Witness/EnCase image file format
|
|
|
|
#Transform to raw
|
|
mkdir output
|
|
ewfmount evidence.E01 output/
|
|
file output/ewf1
|
|
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
|
|
```
|
|
### ArsenalImageMounter
|
|
|
|
C'est une application Windows pour monter des volumes. Vous pouvez la télécharger ici [https://arsenalrecon.com/downloads/](https://arsenalrecon.com/downloads/)
|
|
|
|
### Erreurs
|
|
|
|
* **`cannot mount /dev/loop0 read-only`** dans ce cas, vous devez utiliser les options **`-o ro,norecovery`**
|
|
* **`wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.`** dans ce cas, le montage a échoué car le décalage du système de fichiers est différent de celui de l'image disque. Vous devez trouver la taille du secteur et le secteur de départ :
|
|
```bash
|
|
fdisk -l disk.img
|
|
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
|
|
```
|
|
Notez que la taille du secteur est **512** et le début est **2048**. Ensuite, montez l'image comme ceci :
|
|
```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/" %}
|
|
|
|
{% hint style="success" %}
|
|
Apprenez et pratiquez le hacking AWS :<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
|
|
Apprenez et pratiquez le hacking GCP : <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
|
|
|
<details>
|
|
|
|
<summary>Soutenir HackTricks</summary>
|
|
|
|
* Consultez les [**plans d'abonnement**](https://github.com/sponsors/carlospolop) !
|
|
* **Rejoignez le** 💬 [**groupe Discord**](https://discord.gg/hRep4RUj7f) ou le [**groupe telegram**](https://t.me/peass) ou **suivez-nous sur** **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
|
|
* **Partagez des astuces de hacking en soumettant des PR au** [**HackTricks**](https://github.com/carlospolop/hacktricks) et [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) dépôts github.
|
|
|
|
</details>
|
|
{% endhint %}
|