Mata Kuliah: Digital Forensic for Military Purposes (Forensik Digital untuk Keperluan Militer)
SKS: 3 SKS
Pertemuan: 09
Topik: Teknik Recovery Data dan File Carving
Pengampu: Anindito, S.Kom., S.S., S.H., M.TI., CHFI
Setelah menyelesaikan modul ini, mahasiswa diharapkan mampu:
Penghapusan File (File Deletion) adalah proses yang menandai ruang penyimpanan sebagai tersedia untuk digunakan kembali, tetapi tidak secara fisik menghapus data dari media penyimpanan hingga area tersebut ditimpa oleh data baru.
Ketika sebuah file βdihapusβ, yang sebenarnya terjadi adalah:
| Tipe Penghapusan | Mekanisme | Recoverable? | Tingkat Kesulitan |
|---|---|---|---|
| Normal Delete | Pointer dihapus, data tetap ada | Ya | Mudah |
| Shift+Delete | Bypass Recycle Bin, pointer dihapus | Ya | Mudah |
| Format Quick | Rebuild file system table | Ya | Sedang |
| Format Full | Overwrite dengan zeros | Sebagian | Sulit |
| Secure Delete | Multiple overwrite passes | Tidak | Sangat Sulit |
| TRIM (SSD) | Block deallocated & garbage collected | Tidak | Hampir Mustahil |

Gambar 9.1: Proses penghapusan file pada sistem operasi
Data Remnants adalah sisa-sisa data yang masih dapat ditemukan setelah file dihapus atau sistem direset. Lokasi-lokasi di mana data remnants dapat ditemukan:
Unallocated Space adalah area pada media penyimpanan yang tidak dialokasikan untuk file aktif mana pun, tetapi mungkin berisi data dari file yang telah dihapus.
Slack Space adalah ruang yang tidak terpakai di akhir cluster terakhir yang dialokasikan untuk sebuah file.
Ada dua jenis slack space:
Contoh Cluster (4 KB = 8 sektor @ 512 bytes):
File aktual: 2,100 bytes
ββ Sektor 1: 512 bytes (Data)
ββ Sektor 2: 512 bytes (Data)
ββ Sektor 3: 512 bytes (Data)
ββ Sektor 4: 512 bytes (Data)
ββ Sektor 5: 52 bytes (Data)
β ββ RAM Slack: 460 bytes β Dapat berisi data sensitif!
ββ Sektor 6: 512 bytes (File Slack) β Data dari file sebelumnya
ββ Sektor 7: 512 bytes (File Slack)
ββ Sektor 8: 512 bytes (File Slack)
Total Slack Space: 460 + 1,536 = 1,996 bytes
Area yang telah dialokasikan sebelumnya tetapi sekarang ditandai sebagai available. Berbeda dengan unallocated space, free space masih memiliki metadata yang menunjukkan pernah digunakan.
Sektor yang ditandai sebagai βbadβ atau tidak dapat digunakan. Sering kali masih berisi data yang dapat dibaca dengan tools khusus.
Soal: File berukuran 3,000 bytes disimpan pada sistem dengan cluster size 4 KB (4,096 bytes). Hitung berapa besar slack space yang terbentuk!
Penyelesaian:
Step 1: Identifikasi parameter
Step 2: Hitung space yang dialokasikan
Step 3: Hitung slack space
Jawaban: Slack space yang terbentuk adalah 1,096 bytes atau sekitar 26.8% dari cluster size. Space ini dapat berisi remnants dari file sebelumnya dan merupakan sumber penting untuk forensik digital.
Soal: Jelaskan mengapa file yang βdihapusβ dengan Shift+Delete masih dapat di-recover!
Penyelesaian:
Step 1: Analisis proses Shift+Delete
Ketika file dihapus dengan Shift+Delete:
Step 2: Identifikasi data yang tersisa
Yang masih ada:
Step 3: Mekanisme recovery
Recovery dimungkinkan karena:
Jawaban: File yang dihapus dengan Shift+Delete masih dapat di-recovery karena hanya pointer dan metadata yang dihapus, sedangkan data sebenarnya masih tersimpan di cluster hingga area tersebut ditimpa oleh file baru. Tools forensik dapat men-scan unallocated space dan mengidentifikasi file berdasarkan signatures atau partial metadata.
Setiap sistem file memiliki karakteristik berbeda yang mempengaruhi kemampuan recovery:
| Sistem File | Recovery Potential | Faktor Kunci | Tantangan |
|---|---|---|---|
| FAT32 | Sangat Tinggi | Simple structure, minimal metadata | Fragmentation, no journaling |
| NTFS | Tinggi | MFT records, journaling, $LogFile | Compressed files, TRIM on SSD |
| ext4 | Sedang-Tinggi | Journaling, inode structure | Deleted entries zeroed |
| APFS | Rendah-Sedang | Encryption by default, snapshots | Snapshot management, encryption |
| exFAT | Tinggi | Similar to FAT, no journaling | Limited metadata |

Gambar 9.2: Perbandingan recovery potential berbagai sistem file
Soal: Sistem file mana yang memberikan kemungkinan recovery tertinggi dan mengapa?
Penyelesaian:
Step 1: Evaluasi karakteristik setiap sistem file
FAT32:
NTFS:
ext4:
Step 2: Ranking berdasarkan recovery potential
Jawaban: FAT32 memberikan kemungkinan recovery tertinggi karena:
Untuk investigasi forensik, FAT32 adalah sistem file paling βforensics-friendlyβ meskipun memiliki keterbatasan untuk penggunaan modern.
File Carving adalah teknik untuk mengekstrak file dari unallocated space atau image forensik tanpa menggunakan metadata sistem file, melainkan berdasarkan struktur internal file (signatures, headers, footers).
File carving diperlukan ketika:
Setiap tipe file memiliki file signature atau magic bytes yang unik di header dan/atau footer file.
| File Type | Extension | Header (Hex) | Footer (Hex) | Offset |
|---|---|---|---|---|
| JPEG | .jpg, .jpeg | FF D8 FF |
FF D9 |
0 |
| PNG | .png | 89 50 4E 47 0D 0A 1A 0A |
49 45 4E 44 AE 42 60 82 |
0 |
| GIF | .gif | 47 49 46 38 (GIF8) |
00 3B |
0 |
25 50 44 46 (%PDF) |
25 25 45 4F 46 (%%EOF) |
0 | ||
| ZIP | .zip | 50 4B 03 04 (PK..) |
50 4B 05 06 |
0 |
| DOCX | .docx | 50 4B 03 04 |
50 4B 05 06 |
0 |
| RAR | .rar | 52 61 72 21 1A 07 (Rar!) |
- | 0 |
| MP4 | .mp4 | 00 00 00 XX 66 74 79 70 |
- | 0 |
| EXE | .exe | 4D 5A (MZ) |
- | 0 |
| SQLite | .db, .sqlite | 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 |
- | 0 |
Contoh Analisis Header JPEG:
Offset Hex ASCII
-------- ---------------------------------------------- ----------------
00000000 FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 ΓΏΓΓΏΓ ..JFIF......
00000010 48 00 48 00 00 FF DB 00 43 00 03 02 02 03 02 H.H..ΓΏΓ.C.......
β β β β β β β β
β β β β βββββββββββββ JFIF identifier
β β βββββββββββββββββββββββββββ Application marker
ββββββββββββββββββββββββββββββββ JPEG SOI (Start of Image)

Gambar 9.3: Visualisasi file signatures untuk berbagai tipe file
Soal: Diberikan hex dump berikut dari awal sebuah file. Identifikasi tipe file dan jelaskan analisis Anda!
00000000: 25 50 44 46 2D 31 2E 34 0A 25 E2 E3 CF D3 0A 0A
00000010: 31 20 30 20 6F 62 6A 0A 3C 3C 2F 54 79 70 65 2F
Penyelesaian:
Step 1: Analisis bytes awal
25 50 44 46 2D = %PDF-
31 2E 34 = 1.4
Step 2: Identifikasi signature
25 50 44 46 = %PDF dalam ASCIIStep 3: Analisis struktur tambahan
25 50 44 46 2D 31 2E 34 = %PDF-1.4
Menunjukkan PDF versi 1.4
Step 4: Verifikasi dengan tabel signatures
| Byte Pattern | ASCII | Tipe File |
|---|---|---|
| 25 50 44 46 | PDF Document |
Jawaban: File ini adalah PDF Document versi 1.4. Identifikasi dilakukan berdasarkan:
25 50 44 46 yang merupakan %PDF dalam ASCII2D 31 2E 34 yang merupakan -1.431 20 30 20 6F 62 6A (1 0 obj) yang merupakan karakteristik PDF structureSoal: Mengapa file carving berdasarkan extension saja tidak cukup dan harus menggunakan file signatures?
Penyelesaian:
Step 1: Identifikasi masalah dengan extension-based identification
Masalah:
Step 2: Keuntungan signature-based identification
Keuntungan:
Step 3: Contoh kasus
Skenario: File bernama document.pdf tetapi header: FF D8 FF E0 (JPEG)
Jawaban: File carving harus menggunakan signatures karena:
Dalam forensik digital militer, signature-based identification adalah critical untuk mendeteksi:
Teknik paling umum yang mencari pasangan header dan footer yang sesuai.
Algorithm:
1. Scan image untuk header signature
2. Ketika ditemukan:
a. Catat offset awal
b. Scan forward untuk footer signature
c. Extract data dari header ke footer
d. Validasi extracted file
3. Continue scanning
Limitations:
Untuk file yang tidak memiliki footer tetapi size information dalam header.
Contoh: PNG Files
PNG Header:
89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52
β β β
ββ PNG Signature β ββ IHDR chunk
ββ Chunk length (13 bytes)
Algorithm:
1. Scan untuk header signature
2. Parse header untuk size information
3. Extract berdasarkan calculated size
4. Validate dengan footer (jika ada)
Untuk file yang sangat fragmented, carving dilakukan per block dan kemudian di-reassemble.
Challenges:
Menggunakan analisis statistik untuk mengidentifikasi file boundaries tanpa signatures.
Soal: Sebuah PNG file memiliki header berikut. Hitung total size file yang harus di-extract!
89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52
00 00 02 00 00 00 01 80 08 02 00 00 00 ...
Width: 512 pixels, Height: 384 pixels, Bit depth: 8, Color type: 2 (RGB)
Penyelesaian:
Step 1: Parse PNG header
89 50 4E 47 0D 0A 1A 0A = PNG signature
00 00 00 0D = IHDR chunk length (13 bytes)
49 48 44 52 = "IHDR"
00 00 02 00 = Width (512)
00 00 01 80 = Height (384)
08 = Bit depth (8)
02 = Color type (RGB = 3 channels)
Step 2: Hitung raw image data size
Pixels = Width Γ Height = 512 Γ 384 = 196,608 pixels
Bytes/pixel = 3 (RGB) Γ 1 (8-bit) = 3 bytes
Raw data = 196,608 Γ 3 = 589,824 bytes
Step 3: Estimasi compressed size
PNG menggunakan DEFLATE compression (ratio typically 2:1 to 4:1)
Estimated compressed = 589,824 / 3 β 196,608 bytes
Step 4: Tambahkan overhead
PNG overhead:
- Signature: 8 bytes
- IHDR chunk: 25 bytes (13 + 12)
- IDAT chunks: ~196,608 bytes
- IEND chunk: 12 bytes
Total: ~196,653 bytes
Jawaban: File PNG ini akan berukuran sekitar 197 KB (196,653 bytes). Untuk carving purposes:
Carving tools harus menggunakan footer 49 45 4E 44 AE 42 60 82 (IEND chunk) untuk menentukan exact endpoint.
Recuva adalah tool recovery yang user-friendly untuk Windows, cocok untuk quick recovery dari deleted files.
1. Launch Recuva
2. Pilih file type (atau All Files)
3. Pilih location (specific folder atau entire drive)
4. Enable Deep Scan untuk better results
5. Scan dan preview results
6. Select files to recover
7. Choose recovery destination (JANGAN ke drive yang sama!)
| Status | Icon | Meaning | Recovery Chance |
|---|---|---|---|
| Excellent | π’ | File fully recoverable | 95-100% |
| Good | π‘ | Partially overwritten | 60-90% |
| Poor | π΄ | Heavily overwritten | 10-50% |
| Unrecoverable | β« | Completely overwritten | <5% |
Soal: Mengapa saat melakukan file recovery, kita TIDAK boleh menyimpan hasil recovery ke drive yang sama dengan sumber?
Penyelesaian:
Step 1: Analisis risiko
Ketika melakukan recovery:
Step 2: Skenario disaster
Scenario:
- 100 deleted photos di drive C:
- Start recovery ke C:\Recovered\
- Photo 1-20: Recovered successfully
- Photo 21-80: Overwritten by recovered photo 1-20
- Photo 81-100: Incomplete recovery
Result: Net loss data!
Step 3: Best practice
β CORRECT: Recovery dari C: ke D: (external drive) β WRONG: Recovery dari C: ke C:\Recovered\
Jawaban: Kita TIDAK boleh menyimpan hasil recovery ke drive yang sama karena:
Best Practice Forensik:
PhotoRec adalah tool open-source powerful untuk file carving yang bekerja pada berbagai platform dan file systems.
| Category | Formats |
|---|---|
| Images | jpg, png, gif, bmp, tiff, raw (cr2, nef, dng) |
| Video | mp4, avi, mov, mkv, flv, wmv |
| Audio | mp3, wav, flac, ogg, m4a |
| Documents | pdf, doc, docx, xls, xlsx, ppt, pptx |
| Archives | zip, rar, 7z, tar, gz |
| Databases | sqlite, mdb, pst |
| Executables | exe, dll, elf |
# Interactive mode
photorec /dev/sda1
# Command line mode
photorec /d /path/to/recovery/dir /log /dev/sda1
# Specify file types
photorec /d /path/to/recovery/dir /log /cmd /dev/sda1 fileopt,jpg,enable,fileopt,png,enable,search
βββββββββββββββββββββββββββββββββββββββββββ
β 1. Select Source β
β - Physical drive β
β - Partition β
β - Image file (.dd, .E01) β
βββββββββββββββββββββββββββββββββββββββββββ€
β 2. Select File System Type β
β - FAT/NTFS/ext2/ext3/etc β
β - Whole (ignore file system) β
βββββββββββββββββββββββββββββββββββββββββββ€
β 3. Select Search Space β
β - Free: Unallocated space only β
β - Whole: Entire partition β
βββββββββββββββββββββββββββββββββββββββββββ€
β 4. Select Destination β
β - MUST be different drive! β
βββββββββββββββββββββββββββββββββββββββββββ€
β 5. Start Recovery β
β - Monitor progress β
β - Review log file β
βββββββββββββββββββββββββββββββββββββββββββ
Soal: PhotoRec recovered 500 files dari USB drive 8GB. Hasil recovery menunjukkan struktur folder recup_dir.1, recup_dir.2, dst. Mengapa PhotoRec tidak mempertahankan struktur folder dan nama file asli?
Penyelesaian:
Step 1: Understand PhotoRecβs carving methodology
PhotoRec menggunakan signature-based carving:
Step 2: Analisis file system metadata
File system metadata yang hilang:
MFT/FAT Entry contains:
ββ Filename βββββββββββββ NOT RECOVERED
ββ Directory path βββββββ NOT RECOVERED
ββ Timestamps βββββββββββ NOT RECOVERED
ββ Permissions βββββββββββ NOT RECOVERED
ββ Data clusters βββββββββ RECOVERED (via signature)
Step 3: PhotoRec recovery structure
Destination:
ββ recup_dir.1/
β ββ f0000001.jpg β Generic name
β ββ f0000002.pdf
β ββ ... β Up to 500 files per dir
ββ recup_dir.2/
β ββ f0000501.png
β ββ ...
ββ report.xml β Recovery report
Step 4: Keuntungan dan keterbatasan
Keuntungan:
Keterbatasan:
Jawaban: PhotoRec tidak mempertahankan struktur folder dan nama file asli karena:
f0000001, f0000002, dst.)recup_dir.X folders untuk organizationTrade-off:
Untuk investigation purposes:
Foremost adalah command-line carving tool yang originally developed oleh US Air Force.
Installation (WSL Ubuntu):
sudo apt update
sudo apt install foremost
Configuration File: /etc/foremost.conf
# Contoh configuration
jpg y 150000000 \xff\xd8\xff\xe0\x00\x10 \xff\xd9
png y 10000000 \x89\x50\x4e\x47 \x49\x45\x4e\x44\xae\x42\x60\x82
pdf y 10000000 \x25\x50\x44\x46 \x25\x45\x4f\x46
Format: <type> <case_sensitive> <max_size> <header> <footer>
Usage:
# Basic recovery
foremost -t jpg,png,pdf -i evidence.dd -o /output/dir
# All file types
foremost -t all -i /dev/sdb1 -o /output/dir
# Custom config
foremost -c custom.conf -i image.dd -o /output/dir
# Verbose mode
foremost -v -t all -i evidence.dd -o /output/dir
Scalpel adalah fork dari Foremost dengan performa lebih baik untuk large images.
Installation:
sudo apt install scalpel
Configuration: /etc/scalpel/scalpel.conf
# Scalpel config (similar to Foremost)
jpg y 200000000 \xff\xd8\xff \xff\xd9
png y 20000000 \x89PNG IEND\xae\x42\x60\x82
zip y 50000000 PK\x03\x04 PK\x05\x06
Key Differences from Foremost:
| Feature | Foremost | Scalpel |
|---|---|---|
| Threading | Single-threaded | Multi-threaded |
| Speed | Slower | Faster (2-3x) |
| Memory | Lower | Higher |
| Preview | No | Yes (with -p) |
| Best For | Small images | Large images |
Usage:
# Basic carving
scalpel -b -o /output/dir evidence.dd
# Specific file types
scalpel -b -c custom.conf -o /output/dir evidence.dd
# Preview mode (no extraction)
scalpel -p -o /output/dir evidence.dd
# Verbose
scalpel -b -v -o /output/dir evidence.dd
Soal: Anda memiliki forensic image sebesar 500 GB. Tool mana yang lebih cocok: Foremost atau Scalpel? Jelaskan reasoning Anda!
Penyelesaian:
Step 1: Analisis karakteristik image
Image size: 500 GB
Expected carving time:
- Single-threaded: ~20-30 hours
- Multi-threaded: ~8-10 hours
Step 2: Bandingkan tools
| Kriteria | Foremost | Scalpel | Winner |
|---|---|---|---|
| Threading | Single | Multi | Scalpel |
| Speed | ~100 MB/s | ~250 MB/s | Scalpel |
| Memory usage | ~100 MB | ~300 MB | Foremost |
| Preview capability | No | Yes | Scalpel |
Step 3: Calculate time estimates
Foremost:
500 GB / 100 MB/s = 5,000 seconds / 60 = ~83 minutes per pass
With overhead: ~2-3 hours
Scalpel:
500 GB / 250 MB/s = 2,000 seconds / 60 = ~33 minutes per pass
With overhead: ~1 hour
Step 4: Rekomendasi
Untuk 500 GB image: SCALPEL
Alasan:
Jawaban: Untuk forensic image 500 GB, Scalpel adalah pilihan lebih baik karena:
Scalability: Designed untuk large images dengan efficient memory management
Preview capability: Dapat melakukan dry-run tanpa extraction (flag -p)
Exception: Gunakan Foremost jika:
Best Practice:
Autopsy memiliki built-in file carving capability yang terintegrasi dengan case management.
Ingest Modules:
ββ File Type Identification
ββ Extension Mismatch Detector
ββ Photorec Carver
ββ Tika MIME Type Detection
1. Add Data Source ke Case
ββ Select disk image atau physical device
2. Configure Ingest Modules
ββ Enable "Photorec Carver"
ββ Enable "File Type Identification"
ββ Enable "Extension Mismatch Detector"
3. Run Ingest (Automatic carving)
ββ Monitor progress di Ingest Inbox
4. Review Results
ββ Views > File Types > By Extension
ββ Views > File Types > By MIME Type
ββ Tags > Carved Files
5. Export Carved Files
ββ Right-click > Extract File(s)
| Feature | Command-Line | Autopsy |
|---|---|---|
| GUI | No | Yes |
| Integration | Separate | Unified |
| Timeline | Manual | Automatic |
| Reporting | Manual | Built-in |
| Hash Database | External | Integrated |
| Tagging | No | Yes |
| Case Management | No | Yes |
Soal: Dalam konteks investigasi forensik militer, apa keuntungan menggunakan Autopsy dibanding command-line tools (PhotoRec, Foremost, Scalpel)?
Penyelesaian:
Step 1: Identifikasi kebutuhan investigasi militer
Kebutuhan:
Step 2: Evaluasi Autopsy capabilities
Case Management:
Case Information:
ββ Case name, number
ββ Investigator details
ββ Organization
ββ Notes dan documentation
ββ Multiple data sources
Integrated Workflow:
Autopsy Workflow:
1. Create case βββββββββββ Documentation
2. Add evidence βββββββββββ Chain of custody
3. Automated analysis βββββ Consistency
4. Tagging & notes ββββββββ Investigation tracking
5. Timeline βββββββββββββββββ Correlation
6. Generate report ββββββββ Presentation
Step 3: Perbandingan praktis
Command-Line Approach:
# Step 1: Carve with PhotoRec
photorec evidence.dd
# Step 2: Organize results (manual)
organize-recovered-files.sh
# Step 3: Document findings (manual)
vim investigation-notes.txt
# Step 4: Create report (manual)
generate-report.py
# Step 5: Maintain chain of custody (manual)
update-custody-log.xlsx
Autopsy Approach:
All steps integrated in single platform:
- Automatic documentation
- Built-in reporting
- Integrated timeline
- Tag-based organization
Jawaban: Untuk investigasi forensik militer, Autopsy lebih cocok karena:
1. Chain of Custody Integration
2. Professional Reporting
3. Timeline Analysis
4. Team Collaboration
5. Military-Specific Benefits
Command-line tools (PhotoRec, Scalpel) tetap valuable untuk:
Best Practice: Gunakan hybrid approach:
HxD adalah free hex editor untuk Windows yang powerful untuk manual analysis dan carving.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Offset β Hex View β ASCII View β
βββββββββββββΌβββββββββββββββββββββββββΌβββββββββββββββββββ€
β 00000000 β FF D8 FF E0 00 10 4A β ΓΏΓΓΏΓ ..J β
β 00000010 β 46 49 46 00 01 01 01 β FIF..... β
β 00000020 β 00 48 00 48 00 00 FF β .H.H...ΓΏ β
βββββββββββββ΄βββββββββββββββββββββββββ΄βββββββββββββββββββ
β β
Hexadecimal ASCII
Step 1: Open Image/Drive
ββ File > Open
ββ Select disk image atau physical drive
ββ Read-only mode (recommended)
Step 2: Search for File Signature
ββ Search > Find (Ctrl+F)
ββ Search type: Hex values
ββ Enter signature: FF D8 FF E0 (JPEG)
ββ Find All untuk multiple occurrences
Step 3: Identify File Boundaries
ββ Mark header offset
ββ Search for footer: FF D9 (JPEG)
ββ Calculate size
ββ Verify integrity
Step 4: Extract File
ββ Select byte range
ββ Edit > Copy
ββ File > New
ββ Edit > Paste
ββ Save extracted file
Step 5: Validate
ββ Open dengan appropriate viewer
ββ Check for corruption
ββ Document findings
Soal: Anda menemukan hex pattern berikut dalam unallocated space. Extract file JPEG secara manual dan hitung size-nya!
Offset Hex Dump
0x00000000 FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 48
0x00000010 00 48 00 00 FF DB 00 43 00 03 02 02 03 02 02 03
...
[many lines]
...
0x00012450 B2 C1 A4 8F 23 1A 45 67 FF D9 00 00 00 00 00 00
Penyelesaian:
Step 1: Identifikasi JPEG signatures
Header:
FF D8 FF E0 = JPEG SOI (Start of Image)
4A 46 49 46 = "JFIF"
β Valid JPEG header di offset 0x00000000
Footer:
FF D9 = JPEG EOI (End of Image)
β Valid JPEG footer di offset 0x00012450 + 0x09 = 0x00012459
Step 2: Calculate file size
Header offset: 0x00000000
Footer offset: 0x00012459
Footer marker: FF D9 (2 bytes)
File ends at: 0x00012459 + 0x02 = 0x0001245B
File size = End - Start
= 0x0001245B - 0x00000000
= 0x0001245B
= 74,843 bytes (decimal)
= 73.09 KB
Step 3: Manual extraction steps
HxD Procedure:
1. Goto offset 0x00000000
2. Begin Selection
3. Goto offset 0x0001245A (last byte sebelum footer FF D9)
4. Select Through (includes footer)
5. Edit > Copy
6. File > New
7. Edit > Paste
8. Save As: recovered_image_001.jpg
Step 4: Verification
Verification steps:
1. Check file size: 74,843 bytes β
2. Verify header: FF D8 FF E0 β
3. Verify footer: FF D9 β
4. Open dengan image viewer β
5. Calculate hash: SHA-256 untuk documentation
Jawaban:
File Size: 74,843 bytes (73.09 KB)
Extraction Range:
Validation:
File: recovered_image_001.jpg
Size: 74,843 bytes
Type: JPEG image
Header: FF D8 FF E0 (JFIF)
Footer: FF D9 (EOI)
Status: β Valid JPEG file
Documentation untuk Chain of Custody:
EXTRACTED FILE RECORD
======================
Source: [Source image/drive]
Location: Unallocated space, offset 0x00000000
File Type: JPEG image
Size: 74,843 bytes (73.09 KB)
Extracted By: [Investigator Name]
Date/Time: [Timestamp]
Hash (SHA-256): [Calculate hash]
Notes: Complete JPEG file with valid header/footer
Critical Steps:
JPEG Structure:
FF D8 FF E0 β SOI + APP0 marker
00 10 β APP0 length
4A 46 49 46 00 β "JFIF"
01 01 β Version
...
[Image data with multiple segments]
...
FF D9 β EOI marker
PNG Structure:
89 50 4E 47 0D 0A 1A 0A β PNG signature
00 00 00 0D β Chunk length
49 48 44 52 β "IHDR"
[Width, Height, etc]
...
[IDAT chunks with image data]
...
00 00 00 00 β Chunk length
49 45 4E 44 β "IEND"
AE 42 60 82 β IEND CRC
PDF Structure:
25 50 44 46 2D 31 2E 34 β "%PDF-1.4"
...
[PDF objects and streams]
...
25 25 45 4F 46 β "%%EOF"
Signs of fragmented files:
Fragmented JPEG Detection:
Offset 0x00000000: FF D8 FF E0 (SOI) β
Offset 0x00001000: FF D8 FF E0 (SOI again) β Fragment!
Should be FF DA (SOS) or FF D9 (EOI)
Encrypted files memiliki characteristics:
Example: TrueCrypt Volume
54 52 55 45 43 52 59 50 54 β "TRUECRYPT"
...
[High entropy data]
...
Cannot carve internal structure without decryption!
Soal: Dalam investigasi insiden keamanan di Kodam Jaya, ditemukan hex pattern berikut di USB drive seorang prajurit yang dicurigai. Analisis pattern ini dan identifikasi file type beserta implikasi keamanannya!
00000000: 50 4B 03 04 14 00 01 00 63 00 8D 51 4C 55 AA BB
00000010: CC DD EE FF 00 11 22 33 44 55 66 77 88 99 AA BB
[... many lines of random-looking bytes ...]
00012450: 50 4B 01 02 14 00 14 00 01 00 63 00 8D 51 4C 55
Penyelesaian:
Step 1: Identifikasi file signature
50 4B 03 04 = ZIP file header ("PK..")
Ini adalah ZIP archive atau ZIP-based format (DOCX, XLSX, APK, PPTX, dll).
Step 2: Analisis encryption indicators
50 4B 03 04 β ZIP signature
14 00 β Version needed
01 00 β General purpose bit flag
^^^
βββββββββββββββββ Bit 0 set = ENCRYPTED!
Bit flag 0x0001 = 0000 0001 binary
ββββββββββ Bit 0: Encryption flag
Step 3: Analyze data pattern
Random-looking bytes:
AA BB CC DD EE FF 00 11 22 33 44 55 66 77 88 99 AA BB
High entropy = consistent dengan encrypted data.
Step 4: Identify central directory
50 4B 01 02 = Central directory file header
Confirms valid ZIP structure.
Step 5: Security Implications untuk konteks militer
Temuan:
Red Flags:
Jawaban:
File Type: Password-protected ZIP archive (atau ZIP-based format seperti DOCX)
Technical Details:
File Signature: 50 4B 03 04 (ZIP/PK format)
Encryption: YES (bit flag 0x0001 set)
Encryption Method: Likely AES-256
Size: ~74 KB (approximate dari offset range)
Status: ENCRYPTED - Cannot carve internal contents
Security Implications (Konteks Militer):
IMMEDIATE CONCERNS:
RECOMMENDED ACTIONS:
IMMEDIATE:
ββ Preserve evidence (forensic image USB)
ββ Document chain of custody
ββ Report ke security officer
ββ Initiate formal investigation
INVESTIGATION:
ββ Interview subject
ββ Request password (with proper authority)
ββ Examine device registration logs
ββ Check network exfiltration logs
ββ Correlate dengan access logs
TECHNICAL ANALYSIS:
ββ Attempt password recovery
β ββ Hashcat/John the Ripper
β ββ Dictionary attack
β ββ Known password patterns
ββ Examine metadata
β ββ Creation time
β ββ Modification time
β ββ Tool signatures
ββ Context analysis
ββ Other files pada USB
ββ Timeline correlation
ββ Subject's role & access
LEGAL CONSIDERATIONS:
CONCLUSION: File ini adalah HIGH PRIORITY EVIDENCE yang memerlukan:
Cannot proceed dengan carving tanpa decryption, requires:
SQLite adalah embedded database yang umum digunakan di:
SQLite File Format:
βββββββββββββββββββββββββββββββββββββββ
β File Header (100 bytes) β
β - Magic: "SQLite format 3" β
β - Page size β
β - Database size in pages β
βββββββββββββββββββββββββββββββββββββββ€
β Page 1: Database Schema β
β - sqlite_master table β
β - CREATE TABLE statements β
βββββββββββββββββββββββββββββββββββββββ€
β Pages 2-N: Data Pages β
β - B-tree structures β
β - Actual table data β
βββββββββββββββββββββββββββββββββββββββ
53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00
"S Q L i t e f o r m a t 3 \0"
# 1. Carve SQLite databases
foremost -t sqlite -i evidence.dd -o /output
# 2. Validate recovered databases
sqlite3 recovered_db.sqlite "PRAGMA integrity_check;"
# 3. Extract schema
sqlite3 recovered_db.sqlite ".schema"
# 4. Query data
sqlite3 recovered_db.sqlite "SELECT * FROM table_name;"
# 5. Export to CSV
sqlite3 -csv recovered_db.sqlite "SELECT * FROM table_name;" > output.csv
| Tool | Purpose | Platform |
|---|---|---|
| DB Browser for SQLite | GUI database viewer | Windows/Linux/Mac |
| sqlite3 | Command-line shell | All |
| SQLite Analyzer | Database structure analysis | Windows |
| Undark | Recover deleted SQLite records | Linux |
Soal: Ditemukan file dengan header berikut dalam evidence image. Identifikasi database type dan jelaskan cara mengekstrak informasi dari database tersebut!
00000000: 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00
00000010: 10 00 01 01 00 40 20 20 00 00 00 03 00 00 00 02
Penyelesaian:
Step 1: Identify database signature
53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00
= "SQLite format 3\0"
β This is a SQLite database file (version 3)
Step 2: Parse header information
Byte 16-17: 10 00 = Page size (0x1000 = 4096 bytes)
Byte 18: 01 = Write format (1 = legacy)
Byte 19: 01 = Read format (1 = legacy)
Byte 20: 00 = Reserved space
Byte 28-31: 00 00 00 03 = Database size in pages (3 pages)
Byte 32-35: 00 00 00 02 = First freelist trunk page (page 2)
Step 3: Extraction procedure
# Step A: Extract database file
# (Using hex editor atau carving tool)
# Step B: Validate integrity
sqlite3 extracted.db "PRAGMA integrity_check;"
# Expected: "ok"
# Step C: Extract schema
sqlite3 extracted.db ".schema"
# Example output:
# CREATE TABLE users (
# id INTEGER PRIMARY KEY,
# username TEXT,
# password_hash TEXT,
# last_login TIMESTAMP
# );
# Step D: Query data
sqlite3 extracted.db "SELECT * FROM users;"
# Step E: Export results
sqlite3 -header -csv extracted.db "SELECT * FROM users;" > users_export.csv
Step 4: Forensic analysis techniques
-- Examine table struktur
.tables
-- Count records
SELECT COUNT(*) FROM users;
-- Check for deleted records (if available)
-- Requires specialized tools like Undark
-- Export timeline
SELECT
datetime(last_login, 'unixepoch') as login_time,
username
FROM users
ORDER BY last_login DESC;
Jawaban:
Database Type: SQLite version 3
Technical Details:
Signature: 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33
Page Size: 4096 bytes (0x1000)
Database Size: 3 pages = 12,288 bytes
Format: Legacy (Write: 1, Read: 1)
Extraction Procedure:
Step 1: Identify & Extract
ββ Locate header: 53 51 4C 69 74 65...
ββ Calculate size: 3 pages Γ 4096 = 12,288 bytes
ββ Extract complete database
ββ Save as .sqlite or .db
Step 2: Validate
ββ PRAGMA integrity_check β Must return "ok"
ββ .schema β View table structures
ββ Check for corruption
Step 3: Forensic Analysis
ββ Extract all tables
ββ Timeline reconstruction
ββ Deleted record recovery (Undark)
ββ Correlation dengan evidence lain
Step 4: Documentation
ββ Table schemas
ββ Record counts
ββ Extracted data (CSV)
ββ Timeline analysis
Common SQLite Locations (Forensic Context):
Android:
ββ /data/data/[package]/databases/
ββ SMS: mmssms.db
ββ Contacts: contacts2.db
ββ Call log: calllog.db
ββ App-specific databases
iOS:
ββ SMS: sms.db
ββ Call history: call_history.db
ββ Safari: History.db
ββ App containers
Browsers:
ββ Firefox: places.sqlite (history/bookmarks)
ββ Chrome: History (SQLite)
ββ Edge: History (SQLite)
Forensic Value:
PST (Personal Storage Table) dan OST (Offline Storage Table) adalah format Microsoft Outlook untuk menyimpan email, contacts, calendars.
PST File Format:
βββββββββββββββββββββββββββββββββββββββ
β File Header β
β - Magic: !BDN β
β - Version indicator β
βββββββββββββββββββββββββββββββββββββββ€
β Metadata Block β
β - Folder tree β
β - Message index β
βββββββββββββββββββββββββββββββββββββββ€
β Data Blocks β
β - Email messages β
β - Attachments β
β - Properties β
βββββββββββββββββββββββββββββββββββββββ
# PST (ANSI format)
21 42 44 4E = "!BDN"
# PST (Unicode format - Outlook 2003+)
21 42 44 4E (same signature, but format differs)
| Tool | Type | Capability |
|---|---|---|
| Kernel PST Viewer | Free viewer | Read PST files |
| PST Walker | Free viewer | Browse PST structure |
| Outlook | Commercial | Native viewer |
| readpst | Open-source | Convert PST to MBOX |
# Using readpst (Linux/WSL)
sudo apt install pst-utils
# Extract PST to MBOX format
readpst -r -o /output/dir mailbox.pst
# Extract with subdirectories
readpst -D -r -e -o /output/dir mailbox.pst
# Options:
# -D: include deleted items
# -r: recursive subdirectories
# -e: separate files for emails
# -o: output directory
Soal: Dalam investigasi kebocoran dokumen militer di Mabes TNI, ditemukan fragmen hex berikut. Identifikasi tipe file dan jelaskan nilai forensiknya!
00000000: 21 42 44 4E 53 4D 04 0E 04 B5 01 B5 00 00 00 00
00000010: 05 00 00 00 10 00 00 00 01 00 00 00 00 00 00 00
Penyelesaian:
Step 1: Identify file signature
21 42 44 4E = "!BDN"
β This is a PST (Personal Storage Table) file - Microsoft Outlook data
Step 2: Parse header details
21 42 44 4E β "!BDN" magic
53 4D β "SM" (signature)
04 0E β wVer (version)
04 B5 β Client version
01 B5 β Magic
Version analysis:
04 0E = Version 14 = Outlook 2003/2007/2010 (Unicode PST)Step 3: Forensic value assessment
PST/OST Contains:
Step 4: Investigation approach
Investigation Workflow:
ββ Extract PST file completely
ββ Validate file integrity
ββ Open dengan Outlook atau PST viewer
ββ Extract key evidence:
β ββ Emails dengan attachments
β ββ Timeline dari sent/received
β ββ Contacts (potential accomplices)
β ββ Deleted items
ββ Search for keywords:
β ββ "rahasia", "confidential"
β ββ Military terms
β ββ Target organization names
β ββ File transfer references
ββ Correlation dengan evidence lain
Jawaban:
File Type: Microsoft Outlook PST (Personal Storage Table), Unicode format
Technical Details:
Signature: 21 42 44 4E ("!BDN")
Version: Unicode PST (Outlook 2003+)
Format: Outlook 2007/2010/2013
Size: Cannot determine dari fragment
Status: Requires complete extraction
Forensic Value - Konteks Kebocoran Militer:
HIGH-VALUE EVIDENCE karena PST contains:
1. Communication Records:
ββ Email correspondence
ββ To/From/CC addresses
ββ Subject lines
ββ Message content
ββ Timestamps (UTC)
2. Attachments:
ββ Dokumen yang ditransmit
ββ Original filenames
ββ File metadata
ββ Possible classified documents
3. Metadata:
ββ Email headers (IP addresses)
ββ Send/receive times
ββ Read receipts
ββ Original file paths
4. Deleted Items:
ββ Attempt to conceal
ββ Recoverable dengan tools
ββ Shows consciousness of guilt
5. Contacts Database:
ββ Accomplices
ββ External contacts
ββ Potential buyers
ββ Network analysis
Investigation Priority Items:
HIGH PRIORITY:
1. Emails mentioning classified documents
2. Attachments dengan military classification
3. External email addresses (non-.mil)
4. Emails dalam timeframe insiden
5. Deleted items (intent to conceal)
MEDIUM PRIORITY:
6. Calendar entries (meeting times)
7. Task lists (planned actions)
8. Contacts (network mapping)
9. Auto-archive configurations
LOW PRIORITY:
10. Personal correspondence (baseline)
11. Spam/junk items
Extraction Procedure:
# Step 1: Extract complete PST file
# (Menggunakan carving tools atau hex editor)
# Step 2: Validate
pst-info mailbox.pst
# Step 3: Convert untuk analysis
readpst -D -r -e -o /evidence/pst mailbox.pst
# Output structure:
/evidence/pst/
ββ Inbox/
ββ Sent Items/
ββ Deleted Items/ β High priority!
ββ Drafts/
ββ Attachments/
# Step 4: Timeline extraction
# (Using Python/custom tools)
# Step 5: Keyword search
grep -r "rahasia\|confidential\|RAHASIA" /evidence/pst/
Legal Considerations:
CHAIN OF CUSTODY:
ββ Source: [Device/Media description]
ββ Location: [Exact location]
ββ Extracted by: [Investigator]
ββ Date/Time: [Timestamp]
ββ Hash: [SHA-256 dari PST file]
ββ Preservation: [Write-block details]
ANALYSIS DOCUMENTATION:
ββ Tools used: readpst, PST Walker, Outlook
ββ Extraction method
ββ Findings summary
ββ Attachments inventory
ββ Timeline reconstruction
Red Flags untuk Insider Threat:
CONCLUSION: PST file dalam konteks kebocoran militer adalah CRITICAL EVIDENCE yang dapat provide:
Requires immediate preservation dan comprehensive analysis!
TRIM adalah command yang memberi tahu SSD bahwa data blocks tidak lagi digunakan dan dapat di-erase secara internal.
| Aspect | HDD | SSD |
|---|---|---|
| Delete | Mark as available | Mark + TRIM |
| Overwrite | Direct write | Write to new block |
| Recovery | High success | Low success |
| TRIM | N/A | Immediate data loss |
| Garbage Collection | N/A | Background cleanup |
File Deletion on SSD:
βββββββββββββββββββββββββββββββββββββββ
β Step 1: User deletes file β
β - File system marks space available β
βββββββββββββββββββββββββββββββββββββββ€
β Step 2: OS sends TRIM command β
β - SSD controller receives command β
βββββββββββββββββββββββββββββββββββββββ€
β Step 3: SSD marks blocks invalid β
β - Blocks queued for erasure β
βββββββββββββββββββββββββββββββββββββββ€
β Step 4: Garbage Collection β
β - Background process erases blocks β
β - CANNOT be recovered! β
βββββββββββββββββββββββββββββββββββββββ

Gambar 9.4: Perbandingan recovery success antara HDD, SSD tanpa TRIM, dan SSD dengan TRIM
Garbage Collection adalah background process di SSD controller yang secara aktif mencari dan menghapus invalid blocks untuk mempertahankan performa write.
Garbage Collection Process:
1. SSD monitors free space
2. When threshold reached:
ββ Identify invalid blocks
ββ Read valid data dari blocks
ββ Write valid data ke new location
ββ Erase entire old blocks
3. Process continues in background
Result: Original data PERMANENTLY ERASED
Soal: Laptop dengan SSD Samsung 980 Pro (TRIM enabled) digunakan dalam insider threat incident. File βdokumen_rahasia.pdfβ dihapus 3 jam lalu. OS: Windows 11 dengan TRIM enabled. Evaluate kemungkinan recovery dan explain langkah-langkah yang harus dilakukan!
Penyelesaian:
Step 1: Assess TRIM impact
TRIM Timeline:
T = 0: File deleted
T = 0-5sec: TRIM command sent to SSD
T = 5sec: SSD marks blocks invalid
T = ?: Garbage collection (unpredictable)
Time elapsed: 3 hours
Status: LIKELY already garbage collected
Step 2: Recovery probability analysis
Factors affecting recovery:
NEGATIVE FACTORS (Against recovery):
- β TRIM enabled di OS
- β Modern SSD (aggressive GC)
- β 3 hours elapsed
- β Samsung 980 Pro (high-performance = aggressive TRIM)
- β Windows 11 (automatic TRIM)
POSITIVE FACTORS (For recovery):
- β If laptop was in sleep mode (GC paused)
- β If SSD was near empty (less GC pressure)
- β Possible RAM remnants (if not rebooted)
Recovery Probability: 5-15% (Very Low)
Step 3: Immediate Actions (Time-Critical!)
CRITICAL ACTIONS (DO IMMEDIATELY):
1. POWER OFF device immediately
ββ Prevent further garbage collection
2. PRESERVE volatile data (if not yet done):
ββ RAM dump (may contain file remnants)
ββ Network connections
ββ Running processes
ββ Open file handles
3. DO NOT:
β Reboot
β Write anything to SSD
β Run recovery tools on live system
β Connect to network
Step 4: Forensic Recovery Procedure
PROCEDURE:
A. VOLATILE DATA ACQUISITION (Before power off):
ββ Memory dump: FTK Imager
ββ String search untuk "dokumen_rahasia"
ββ Extract PDF remnants dari RAM
B. SSD IMAGING:
ββ Write-blocker MANDATORY
ββ Create forensic image (E01/dd)
ββ Hash verification
ββ Multiple copies
C. RECOVERY ATTEMPTS:
1. Quick scan (unallocated space):
photorec evidence.dd
2. Signature-based carving:
scalpel -c pdf.conf evidence.dd
3. Manual hex search untuk PDF signature:
hexdump -C evidence.dd | grep "25 50 44 46"
4. NTFS MFT analysis:
Check $MFT records untuk file metadata
(Filename, size, timestamps may persist)
D. ALTERNATIVE SOURCES:
If SSD recovery fails, investigate:
ββ Volume Shadow Copies (if enabled)
ββ Cloud backup (OneDrive, etc.)
ββ Email attachments
ββ Temporary internet files
ββ PDF viewer cache
ββ Print spooler remnants
ββ Network share copies
Step 5: Realistic Expectations
LIKELY OUTCOMES:
Best Case (10-15% chance):
ββ Partial file recovery
ββ PDF structure intact
ββ Some content readable
ββ Enough untuk investigation
Most Likely (85-90% chance):
ββ No recoverable data dari SSD
ββ TRIM has erased blocks
ββ Only metadata available
ββ Must rely on alternative sources
Worst Case (5% chance):
ββ Complete erasure
ββ No metadata
ββ No alternative sources
Jawaban:
Recovery Probability: 5-15% (Very Low)
Assessment:
CRITICAL FACTORS:
ββ TRIM: ENABLED β
ββ Time elapsed: 3 hours β
ββ SSD type: Samsung 980 Pro (aggressive GC) β
ββ OS: Windows 11 (auto-TRIM) β
ββ File type: Single PDF (not fragmented) β
CONCLUSION: Data likely UNRECOVERABLE from SSD
Recommended Action Plan:
PRIORITY 1 (IMMEDIATE):
1. Power off laptop IMMEDIATELY
2. DO NOT attempt recovery on live system
3. Preserve volatile data if still possible:
- Memory dump (may contain file content)
- Swap file analysis
- Hibernation file (hiberfil.sys)
PRIORITY 2 (FORENSIC IMAGING):
4. Create write-protected forensic image
5. Work ONLY on image copies, not original
6. Document all actions untuk chain of custody
PRIORITY 3 (RECOVERY ATTEMPTS):
7. Automated carving: PhotoRec, Scalpel
8. Manual hex analysis
9. MFT record analysis untuk metadata
10. Cluster analysis (check reallocated blocks)
PRIORITY 4 (ALTERNATIVE SOURCES):
11. Volume Shadow Copies (vssadmin list shadows)
12. Windows.old folder (if recent upgrade)
13. Cloud backup services
14. Browser cache (if viewed in browser)
15. PDF viewer temporary files:
- %TEMP%
- AppData\Local\Temp
16. Print spooler: C:\Windows\System32\spool\PRINTERS
17. Email (if received/sent via email)
18. Network shares atau file servers
19. Backup systems (if organizational)
20. Recipient copies (if shared)
Realistic Outcome:
FROM SSD:
- File content: 5-15% chance
- File metadata: 30-40% chance (dari MFT)
- Filename, size, timestamps: 60-70% chance
FROM ALTERNATIVE SOURCES:
- Volume Shadow Copies: 40-50% chance
- Cloud backups: 30-40% chance
- Cache/temp files: 20-30% chance
- Email/network: Variable (depends pada case)
Lesson Learned - Forensic Best Practices:
PREVENTION (Future Cases):
1. Disable TRIM pada suspected devices:
fsutil behavior set DisableDeleteNotify 1
2. Immediate power-off setelah seizure
3. Boot dari external write-protected USB
4. Prioritize volatile data acquisition
5. Understand SSD behavior:
- TRIM timing varies per manufacturer
- Garbage collection is unpredictable
- Recovery window: Minutes to hours (not days)
Reporting untuk Investigation:
FINDINGS REPORT:
ββ Recovery attempts: Documented
ββ Success rate: Low (as expected dengan TRIM)
ββ Metadata recovered: [List items]
ββ Alternative sources: [List options]
ββ Recommendations: [Next steps]
ββ Technical limitations: [TRIM impact explained]
CRITICAL TAKEAWAY: Dengan modern SSDs dan TRIM enabled, window untuk successful recovery is EXTREMELY SHORT (minutes to hours). Investigations harus:
| Damage Type | Impact | Recovery Possibility | Method |
|---|---|---|---|
| Scratched platter (HDD) | Read errors | Moderate | Professional recovery lab |
| Bad sectors | Local corruption | High | Sector-by-sector imaging |
| Firmware corruption | Drive not detected | Low | Firmware flashing |
| Burnt PCB | No power | Moderate | PCB replacement |
| Water damage | Corrosion | Low-Moderate | Professional cleaning |
| Physical shock | Head crash | Very Low | Clean room recovery |
# Using ddrescue for damaged media
ddrescue -f -n /dev/sdb evidence.img evidence.log
# Options:
# -f: Force (overwrite output)
# -n: No-scrape (skip bad sectors first pass)
# -r 3: Retry bad sectors 3 times
# Phase 1: Quick pass (skip bad sectors)
ddrescue -f -n /dev/sdb evidence.img evidence.log
# Phase 2: Retry bad sectors
ddrescue -f -d -r 3 /dev/sdb evidence.img evidence.log
# Phase 3: Aggressive read
ddrescue -f -d -A /dev/sdb evidence.img evidence.log
Soal: External hard drive 1TB ditemukan di TKP dengan physical damage. Drive terdeteksi di BIOS tetapi tidak mount di Windows. Smartctl menunjukkan 2,458 bad sectors. Bagaimana approach untuk melakukan imaging dengan data loss minimal?
Penyelesaian:
Step 1: Assess drive condition
# Check SMART status
smartctl -a /dev/sdb
Output indicators:
ββ Reallocated Sectors: 2,458
ββ Current Pending Sectors: 342
ββ Offline Uncorrectable: 116
ββ Overall Health: FAILING
Status: Drive is FAILING - Act immediately!
Step 2: Choose appropriate imaging strategy
Strategy: Multi-pass ddrescue
Reasons:
Step 3: Imaging procedure
# PREPARATION:
# 1. Destination must be >= source size
# 2. Use write-blocker
# 3. Destination should be reliable SSD/HDD
# PHASE 1: Quick forward pass (skip errors)
ddrescue -f -n -v /dev/sdb evidence.img evidence.log
# Expected behavior:
# - Skip bad sectors immediately
# - Fast initial image (~30-60 minutes)
# - Log bad sector locations
# PHASE 2: Backward pass (different head approach)
ddrescue -f -R -v /dev/sdb evidence.img evidence.log
# -R: Reverse direction
# May recover some sectors missed in forward
# PHASE 3: Retry bad sectors (limited)
ddrescue -f -r 1 -v /dev/sdb evidence.img evidence.log
# -r 1: Only 1 retry per sector
# Minimize drive stress
# PHASE 4: Trim edge (if time allows)
ddrescue -f -m evidence.img -v /dev/sdb evidence.img evidence.log
# -m: Trim edges around bad sectors
# May recover additional data
Step 4: Analyze results
# Check ddrescue log
cat evidence.log
# Example log:
# rescued: 984,237,891,584 bytes (984 GB)
# errsize: 15,762,108,416 bytes (16 GB)
# errors: 2,458 sectors
Recovery rate: 984 GB / 1 TB = 98.4% SUCCESS
Step 5: Post-imaging analysis
# Mount image (read-only)
mount -o ro,loop evidence.img /mnt/evidence
# Check file system
fsck -n /dev/loop0
# List files
ls -laR /mnt/evidence > file_list.txt
# Identify corrupted files
# (Files in bad sectors akan unreadable)
Jawaban:
Imaging Approach: Multi-Phase ddrescue Strategy
Step-by-Step Procedure:
PHASE 1: INITIAL ASSESSMENT (5 mins)
ββ SMART check: Identify bad sectors count
ββ Drive condition: Evaluate health
ββ Time estimate: Calculate imaging time
ββ Destination prep: Prepare target storage
PHASE 2: QUICK IMAGING (30-60 mins)
ββ ddrescue -f -n (forward, skip bad)
ββ Maximize readable data quickly
ββ Log bad sector locations
ββ Get ~95% data immediately
PHASE 3: REVERSE PASS (30-60 mins)
ββ ddrescue -f -R (reverse direction)
ββ Different head approach
ββ Recover additional ~2-3%
ββ Update log file
PHASE 4: TARGETED RETRY (15-30 mins)
ββ ddrescue -f -r 1 (single retry)
ββ Focus pada recoverable bad sectors
ββ Minimize drive stress
ββ Recover final ~0.5-1%
PHASE 5: VERIFICATION (10 mins)
ββ Hash calculation (dari good sectors)
ββ File system check
ββ Identify corrupted files
ββ Document recovery rate
Expected Results:
Best Case:
ββ 98-99% data recovered
ββ Most files intact
ββ Few corrupted files (in bad sectors)
ββ Usable evidence
Typical Case:
ββ 95-97% data recovered
ββ Some files corrupted
ββ File system partially damaged
ββ Majority evidence preserved
Worst Case:
ββ 85-90% data recovered
ββ File system severely damaged
ββ File carving required
ββ Manual reconstruction needed
Critical Considerations:
DO:
β Use write-blocker
β Work in phases
β Monitor drive temperature
β Document everything
β Create multiple copies when possible
DON'T:
β Retry excessively (damages drive)
β Use Windows tools (writes logs)
β Power cycle repeatedly
β Delay imaging (drive deteriorating)
β Run CHKDSK (may worsen damage)
File Recovery Priority (jika tidak semua recoverable):
PRIORITY 1: Critical Evidence
ββ Documents dalam investigation scope
ββ Images/videos relevant to case
ββ Email databases
ββ Browser history/cache
PRIORITY 2: Supporting Evidence
ββ System files (untuk timeline)
ββ Application data
ββ User profiles
ββ Logs
PRIORITY 3: General Data
ββ Personal files
ββ Media files
ββ Installed applications
Reporting:
IMAGING REPORT:
ββ Source: 1TB External HDD, 2,458 bad sectors
ββ Method: Multi-pass ddrescue
ββ Duration: ~2-3 hours
ββ Success Rate: XX% (calculate dari log)
ββ Corrupted Files: [List if identifiable]
ββ Hash: SHA-256 (dari good sectors)
ββ Next Steps: [File system analysis, carving]
LESSON: Damaged media requires PATIENT, SYSTEMATIC approach. Donβt rush, donβt retry excessively - balance between data recovery and preventing further damage.
Soal: Jelaskan mengapa FAT32 lebih βforensics-friendlyβ dibanding NTFS untuk file recovery!
Soal: Diberikan hex: 89 50 4E 47 0D 0A 1A 0A. Identifikasi file type!
Soal: File 5,678 bytes pada cluster 8KB. Hitung slack space!
Soal: USB 32GB diformat quick format. Strategi recovery yang paling efektif?
Soal: Forensic image 250GB. Pilih: Foremost atau Scalpel? Mengapa?
Soal: SSD dengan TRIM enabled, file dihapus 1 jam lalu. Langkah-langkah recovery?
Soal: SQLite database corrupt. Bagaimana recover individual records?
Soal: Large video file (4GB) terfragmentasi. Carving strategy?
Soal: TrueCrypt volume di unallocated space. Approach untuk identifikasi dan analysis?
Soal: Laptop Kodam dengan SSD, suspected data exfiltration, file dihapus 2 hari lalu. Comprehensive investigation plan?
| Topik | Key Points | Tools |
|---|---|---|
| File Deletion | Data remains until overwritten | - |
| File Signatures | Magic bytes identify file types | HxD, 010 Editor |
| Slack Space | Hidden data source | Forensic tools |
| Unallocated Space | Primary recovery target | Carving tools |
| Header/Footer Carving | Most common technique | PhotoRec, Foremost |
| Recovery Tools | Recuva (GUI), PhotoRec (CLI) | Recuva, PhotoRec |
| Advanced Carving | Foremost, Scalpel | Foremost, Scalpel |
| Autopsy Integration | Case management + carving | Autopsy |
| Manual Carving | Hex analysis | HxD, 010 Editor |
| Database Recovery | SQLite, PST/OST | DB Browser, readpst |
| SSD Challenges | TRIM, garbage collection | - |
| Damaged Media | ddrescue multi-pass | ddrescue |
Carrier, B. (2005). File System Forensic Analysis. Addison-Wesley Professional. Chapter 12-14.
Casey, E. (2022). Digital Evidence and Computer Crime: Forensic Science, Computers, and the Internet (4th ed.). Academic Press. Chapter 7.
Phillips, A., Nelson, B., & Steuart, C. (2022). Guide to Computer Forensics and Investigations (7th ed.). Cengage Learning. Chapter 8.
Nikkel, B. (2021). Practical Forensic Imaging: Securing Digital Evidence with Linux Tools. No Starch Press. Chapter 8-10.
Hargreaves, C., & Chivers, H. (2008). βRecovery of Encryption Keys from Memory Using a Linear Scan.β Third International Conference on Availability, Reliability and Security.
Wei, M., Grupp, L. M., Spada, F. E., & Swanson, S. (2011). βReliably Erasing Data from Flash-Based Solid State Drives.β FAST.
Garfinkel, S. L. (2007). βCarving Contiguous and Fragmented Files with Fast Object Validation.β Digital Investigation.
Richard III, G. G., & Roussev, V. (2005). βScalpel: A Frugal, High Performance File Carver.β DFRWS 2005.
NIST. (2006). Test Results for Digital Data Acquisition Tool: FTK Imager 2.5.3. NIST Computer Forensics Tool Testing Program.
Fairbanks, K., Lee, C., & Owen, H. (2012). βForensic Implications of Solid State Drives.β Journal of Digital Forensics, Security and Law.
Β© 2026 Anindito. Licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
You are free to:
Under the following terms:
https://creativecommons.org/licenses/by/4.0/