Advertisement
metalx1000

FLS Notes on More than one partition

Nov 30th, 2017
809
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.20 KB | None | 0 0
  1. #Sleuthkit - tools for forensics analysis on volume and filesystem
  2. #FLS Notes on More than one partition
  3. sudo apt install sleuthkit
  4.  
  5. #create empty img file
  6. dd bs=512 count=500 if=/dev/zero of=test.img
  7.  
  8. #create partitions
  9. #becareful running fdisk like this
  10. echo -e "n\np\n1\n\n+50K\nt\nb\nn\np\n\n\n\nt\n2\nb\nw\n" |fdisk test.img
  11.  
  12. #list partition info
  13. fdisk -l test.img
  14.  
  15. #you can see that there are 2 partitions in the image now
  16. #and the sector size is 512
  17. #so we find the "Start" and multiple that by 512
  18. #and now we can mount those as loops with losetup
  19. mkdir mnt{0..1}
  20. sudo losetup -o 512 /dev/loop0 test.img
  21. sudo losetup -o 52224 /dev/loop1 test.img
  22.  
  23. sudo mkfs.vfat /dev/loop0
  24. sudo mkfs.vfat /dev/loop1
  25.  
  26. sudo mount /dev/loop0 mnt0
  27. sudo mount /dev/loop1 mnt1
  28.  
  29. #make files and folder
  30. sudo mkdir mnt0/folder_{1..5}/
  31. sudo touch mnt0/folder_{1..5}/file_{A..G}.txt
  32. sudo mkdir mnt1/folder_{A..M}/
  33. sudo touch mnt1/folder_{A..M}/MyFiles{1..9}.txt
  34.  
  35. #Unmount the partitions
  36. sudo umount mnt{0..1}
  37.  
  38. #removed loop devices
  39. sudo losetup -d /dev/loop{0..1}
  40.  
  41. #view partition files and folders with fls
  42. #use fdisk so get offsets for each partition "Start"
  43. fls -rp -o 1 test.img
  44. fls -rp -o 102 test.img
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement