“Formatting” An iPhone To Wipe Data



It appears people are recovering data off old iPhones. Whoops- looks like you can pull data out of memory using forensics tools, just like any other platform. While your Mac includes the ability to overwrite old data when formatting your hard drive to prevent recovery (very cool that this is included in a consumer operating system), there is no equivalent mechanism to clear off that “ancient” original iPhone when you trade up to the 3G version next month.

For those of you who aren’t just convincing your spousees to take your “old” iPhone off your hands to justify that new toy, Securosis presents a simple process to minimize the chances of recovery. It’s not perfect, but it’s easy and should offer enough protection for those of you forced to eBay your once-precious-but-now-obsolete device:

  1. Restore the iPhone from within iTunes.
  2. On the “Info” tab, un-check all options so you don’t synchronize calendars, email, bookmarks, and contacts.
  3. On the Photos, Podcasts, and Video tabs, uncheck “Sync …”.
  4. Create 3 big playlists at large as the storage capacity of your iPhone.
  5. On the Music tab, select the first of your 3 playlists to sync. Make sure the storage bar at the bottom looks full after syncing.
  6. Sync your iPhone, change to the next playlist, sync again, and repeat one last time.

This will hopefully overwrite any of the free space on your phone, helping prevent recovery of any of those love letters and bad jokes lingering from old emails. I won’t have a chance to test this anytime soon, and odds are high some fragments will survive depending on how the iPhone allocates at the file system level, but this should be more than sufficient to prevent casual recovery of sensitive stuff if you’d like to hock your “old” phone.

Posted on

51 comments

  1. Jonathan Zdziarski May 21

    Incomplete. Try again.

  2. rabbit May 21

    iPhone has two partitions, applications are stored on the other partition than music. Is data stored on the same partition?

  3. rmogull May 21

    Great question, and the reason I said in the article I’m uncertain exactly what data can linger. My guess is that user data is on the same partition as music, or the partitions dynamically resize since there isn’t a different limit for email/photos/etc. over music- just one big storage limit.

  4. Finde May 21

    To save you a bit of time, couldn’t you just make 2 playlists and switch?

  5. rmogull May 21

    Probably, that should work. I just didn’t think of it.

  6. Finde May 21

    Sorry didn’t mean to sound rude, it’d just save you a bit of time, that’s all.

  7. fractured May 21

    I believe the data is kept in the \root folder. I think it shares the partition with the \media folder. I don’t believe this is overwritten by Apple data from currently sanctioned apps and media such as music or video. I think you might be able to do it by jailbreaking a cleanly restored iPhone and loading it up with apps. I could be wrong, but I think that stands a better chance than adding music.

  8. maXimus May 21

    After restoring your iPhone, jailbreak it and install OpenSSH. Then ssh into the phone and load up the /root folder with meaningless files. Whatever data stored there previously will get overwritten. Do this in conjunction with mogull’s method to be completely thorough.

  9. AE May 22

    is it really necessary to overwrite the data 3 times? Considering the fact that the iPhone uses Flash Memory…

  10. rmogull May 22

    From what I know, yes. NAND flash swaps blocks in and out of use to limit the number of writes on any single bock. The 3 times should hit enough to make the data hard or impossible to recover.

    Again, no promises this works until someone with forensics tools tries it out. Considering how low the risk is to any individual, I’ve been pretty surprised how far this is spreading.

  11. Rabbit May 22

    considering the ridiculous amount of links this post gets, can’t someone with a bit of working knowledge confirm if the email data is stored on the music partition or not? the app partition has ~300MB on my 4GB iphone. If email data is stored on that partition, I can erase it by sending myself 300MB worth of emails (3 times :)
    although I would just rather use terminal and copy a random file enough times to overwrite everything in that partition.

  12. rmogull May 22

    Rabbit,

    No argument here. I can do the research next week, but am leaving for a trip today and haven’t had the time to jailbreak and explore the file system.

    I have no idea why this post is pulling in so much attention considering how low a risk this is. NOt that I’m complaining about new readers…

  13. Alex Jun 3

    After i restore it then the Set up iphone screen comes up and says set up iphone if i set it up arent i at square 1 again?

  14. rabbit Jun 10

    all this discussion is wrong…

    so there are two partitions. use df to get
    root# df
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/disk0s1 307200 172700 131428 57% /
    devfs 18 18 0 100% /dev
    /dev/disk0s2 3657400 708020 2949380 20% /private/var

    so apps are on \ , data is on \private\var
    mail and sms and notes sit on \private\var, see http://forums.iphonehacks.com/showthread.php?p=261

    after erasing my email accounts, the mail files were still there.. so overwriting the empty spaces won’t help - you first have to manually remove the emails. same with sms, notes, everything else.
    /private/var/mobile/Library/Mail/Envelope Index

  1. Network Security Blog » Network Security Podcast, Episode 105
  2. Network Security Podcast » Blog Archive » Network Security Podcast, Episode 105
  3. How to properly erase an iPhone
  4. » “Formateando” tu iPhone » iPhoneFan
  5. AppleRag » Blog Archive » How to properly erase an iPhone
  6. Apple iPhone SDK - How to Better Erase an iPhone When Selling/Repairing | iFones.com - Apple iPhone App Reviews
  7. Comment bien formater son iPhone avant la revente.
  8. Como apagar corretamente os dados do iPhone | iPhone ! Desvendando a Tecnologia! - Informações, Notícias e Tutoriais!
  9. Formatear y borrar iPhone eficazmente - AppleHOY
  10. How to "format" an iPhone to clear your data completely - Tech|noob
  11. How to “format” an iPhone to clear your data completely | gadget news
  12. » How to “format” an iPhone to clear your data completely NoCostScripts.com:
  13. How to “format” an iPhone to clear your data completely - iklangadget.com
  14. How to “format” an iPhone to clear your data completely
  15. How to “format” an iPhone to clear your data completely | PhetchIt - Only The Best of the Web.
  16. iPhones are like elephants: they never forget
  17. Solved! - How To Remove All Private iPhone Data | Gear Diary
  18. iPhone Spark » How to "format" an iPhone to clear your data completely
  19. » Wipe your iPhone » Social iPhone software » phOLO
  20. How to “format” an iPhone to clear your data completely | Best iPhone News
  21. The Link Farm | .craig
  22. Zero Day mobile edition
  23. How To Erase Your iPhone - For good! | Enjoy an Apple
  24. How to Better Erase an iPhone When Selling/Repairing [Iphone Security] | blogGadgets.nl
  25. Securely Formatting / Erasing an iPhone | The "Break it Down" Blog
  26. How to "format" an iPhone to clear your data completely | blogGadgets.nl
  27.   Format the iPhone and wipe all the data completely? — winandmac.com
  28. Formatear por completo iPhone | Apple iPhone
  29. How to Fully Erase all the Info on your iPhone « aGEEKspot
  30. CrunchGear » Archive » Selling your old iPhone could put you at risk for identity theft
  31. How to “format” an iPhone to clear your documents completely | Technology & Gadget News
  32. Apple iPhone SDK - How to properly erase an iPhone | iFones.com - Apple iPhone App Reviews
  33. iPhones remanufacturados llevan muchísima información sobre el usuario anterior | Tecnologia AMPM
  34. “Format” Your iPhone | Touch Podium
  35. links for 2008-05-30 :: User First Web
  36. Cult of Mac » Blog Archive » Tutorial: How to Sell your iPhone Online
  37. MySecured.com · Wipe the iPhone - Methods Roundup!

Leave a reply

Related Posts

Metasploit Is Ready For Your iPhone Exploits
Metasploit Includes Exploit For iPhone 1.1.1- Using Same Vulnerability As Jailbreak
Update To The iPhone Security Tip