Sunday, May 28, 2023

Recovering Data From An Old Encrypted Time Machine Backup

Recovering data from a backup should be an easy thing to do. At least this is what you expect. Yesterday I had a problem which should have been easy to solve, but it was not. I hope this blog post can help others who face the same problem.


The problem

1. I had an encrypted Time Machine backup which was not used for months
2. This backup was not on an official Apple Time Capsule or on a USB HDD, but on a WD MyCloud NAS
3. I needed files from this backup
4. After running out of time I only had SSH access to the macOS, no GUI

The struggle

By default, Time Machine is one of the best and easiest backup solution I have seen. As long as you stick to the default use case, where you have one active backup disk, life is pink and happy. But this was not my case.

As always, I started to Google what shall I do. One of the first options recommended that I add the backup disk to Time Machine, and it will automagically show the backup snapshots from the old backup. Instead of this, it did not show the old snapshots but started to create a new backup. Panic button has been pressed, backup canceled, back to Google.


Other tutorials recommend to click on the Time Machine icon and pressing alt (Option) key, where I can choose "Browse other backup disks". But this did not list the old Time Machine backup. It did list the backup when selecting disks in Time Machine preferences, but I already tried and failed that way.


YAT (yet another tutorial) recommended to SSH into the NAS, and browse the backup disk, as it is just a simple directory where I can see all the files. But all the files inside where just a bunch of nonsense, no real directory structure.

YAT (yet another tutorial) recommended that I can just easily browse the content of the backup from the Finder by double-clicking on the sparse bundle file. After clicking on it, I can see the disk image on the left part of the Finder, attached as a new disk.
Well, this is true, but because of some bug, when you connect to the Time Capsule, you don't see the sparse bundle file. And I got inconsistent results, for the WD NAS, double-clicking on the sparse bundle did nothing. For the Time Capsule, it did work.
At this point, I had to leave the location where the backup was present, and I only had remote SSH access. You know, if you can't solve a problem, let's complicate things by restrict yourself in solutions.

Finally, I tried to check out some data forensics blogs, and besides some expensive tools, I could find the solution.

The solution

Finally, a blog post provided the real solution - hdiutil.
The best part of hdiutil is that you can provide the read-only flag to it. This can be very awesome when it comes to forensics acquisition.


To mount any NAS via SMB:
mount_smbfs afp://<username>@<NAS_IP>/<Share_for_backup> /<mountpoint>

To mount a Time Capsule share via AFP:
mount_afp afp://any_username:password@<Time_Capsule_IP>/<Share_for_backup> /<mountpoint>

And finally this command should do the job:
hdiutil attach test.sparsebundle -readonly

It is nice that you can provide read-only parameter.

If the backup was encrypted and you don't want to provide the password in a password prompt, use the following:
printf '%s' 'CorrectHorseBatteryStaple' | hdiutil attach test.sparsebundle -stdinpass -readonly

Note: if you receive the error "resource temporarily unavailable", probably another machine is backing up to the device

And now, you can find your backup disk under /Volumes. Happy restoring!

Probably it would have been quicker to either enable the remote GUI, or to physically travel to the system and login locally, but that would spoil the fun.
Continue reading

  1. Pentest Tools Linux
  2. Pentest Tools Kali Linux
  3. Pentest Tools Website Vulnerability
  4. Hacker Tools
  5. Hacker Tools Windows
  6. Hacker Techniques Tools And Incident Handling
  7. Pentest Tools Download
  8. Pentest Tools Apk
  9. Pentest Tools Linux
  10. Hacker Tools For Windows
  11. Hacking Tools For Pc
  12. Hackrf Tools
  13. Hacking Tools Windows
  14. Hacking Tools Kit
  15. Hacker
  16. Pentest Tools Github
  17. Hacker Tools List
  18. Hacker Security Tools
  19. Hacking Tools For Windows Free Download
  20. World No 1 Hacker Software
  21. Hacker Tools Mac
  22. Tools Used For Hacking
  23. Beginner Hacker Tools
  24. Growth Hacker Tools
  25. Hackers Toolbox
  26. Pentest Tools
  27. Pentest Tools Android
  28. Hack Tools For Windows
  29. Pentest Tools Framework
  30. Hacking Tools Mac
  31. Pentest Tools Apk
  32. Pentest Tools List
  33. Hack Tools For Windows
  34. New Hack Tools
  35. Hacking Tools And Software
  36. Hacking Tools Hardware
  37. Hacker Search Tools
  38. Hack Apps
  39. Hacker Tool Kit
  40. Wifi Hacker Tools For Windows
  41. Pentest Reporting Tools
  42. Hack Tools Download
  43. Hacker
  44. Pentest Tools Alternative
  45. Beginner Hacker Tools
  46. Hacking Tools Download
  47. Hacker Search Tools
  48. Hacking Tools 2020
  49. Hacker Tools Free Download
  50. Hack Tools For Windows
  51. Hacking Tools Github
  52. Hacking Tools Windows
  53. Pentest Tools Framework
  54. Pentest Tools For Windows
  55. Hacker Tools
  56. New Hack Tools
  57. Hacks And Tools
  58. Growth Hacker Tools
  59. Hacking Tools
  60. Nsa Hacker Tools
  61. Hack Tools For Windows
  62. Hacker Tools List
  63. What Are Hacking Tools
  64. Hacker Hardware Tools
  65. Hacking Tools And Software
  66. Hacking Tools
  67. Blackhat Hacker Tools
  68. Android Hack Tools Github
  69. Hacking Tools Download

No comments: