# Bulk extractor

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2FX2ugSkhQBjvUTAe0b2am%2Fbulk_extract.png?alt=media&#x26;token=35261922-b4d4-4ff1-b870-4633040586c3" alt=""></div>

### 1. Introduction

> In this lab, a disk image file “evidence.img” is provided in the home directory of the root user (/root/). There is a file on this image which contains the email and phone number of “evil” user. The email of the user is “<evil@attacker.co.uk>” and the phone number is the flag for this lab.

Extract the files from the disk image using the [**bulk extractor tool**](https://github.com/simsong/bulk_extractor) and retrieve the flag!

### 2. Bulk extractor

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2FYpOJHy4C9pDlsQTWuBvL%2Fbulk_extract1.png?alt=media&#x26;token=433a43aa-f220-4908-baa0-193ca45a8324" alt=""></div>

We have to use bulk\_extractor to extract the files from the given image

> bulk\_extractor evidence.img -o output

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2FqgoUXyp9fXji99w2SYbY%2Fbulk_extract2.png?alt=media&#x26;token=7a24365b-1364-411c-b92f-30fcbc7c4a02" alt=""></div>

It depense on the image size, but the extraction process will take some time…

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2FHMrKAAk1YpYxMFJWj5hA%2Fbulk_extract3.png?alt=media&#x26;token=819e9f80-949a-4ec6-8eeb-a9ce23a9c139" alt=""></div>

### 3. Retrieve the flag

Instead of checking every file manually I’ll use grep for a string search

`grep -irn 'evil@attacker.co.uk' . --color`

![](https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2FxtdLXgnFHQtbZslT282j%2Fbulk_extract4.png?alt=media\&token=3f8494d7-4766-4658-ba54-daa8ef1c4c79)

### 4. Summary

{% embed url="<https://vimeo.com/676640013>" %}
