From ModMyiFone - Wiki
Have an iPhone? Want to sell it but afraid of access to your previous files. Even after a restore? Since a restore still leaves behind many things, NerveGas/BigBoss have came through with this Wipe tool. PLEASE READ ALL DIRECTIONS BEFORE USING!
This will 100% wipe your iPhone, if you want to bring a iPhone back to Apple but are truly paranoid, i suppose this would work to. But this is ment for those selling their iPhones upcoming the 3G iPhone release. The iPhones system and partitions will be zeroed by this and will require a restore after using. Here is the Wipe tool, load this on to your iPhone via SSH. http://thebigboss.org/repofiles/nonrepo/Wipe.zip
1. Obtain a working copy of the iPhone Utility Client (iPHUC) on your desktop
machine. iPHUC can be downloaded from http://code.google.com/p/iphuc/
2. Use iPHUC to place the device into recovery mode by using the 'enterrecovery'
command, or force the device into recovery mode by holding in the home and
power buttons simultaneously until the restore screen appears.
3. Once the device is in restore mode, exit iPHUC, then re-enter it. This will
enable recovery commands. Issue the following commands to load and run the
wipe software:
$ ./iphuc
recovery callback: Connected in Recovery Mode
recovery callback: Entering shell in Recovery Mode.
#: filecopytophone Wipe.bin
filecopytophone: 0
#: cmd setenv\ boot-args\ rd=md0\ -x\ -s\ pmd0=0x9340000.0xA00000
#: cmd saveenv
#: cmd bootx
#: exit
4. The wipe tool will load and execute. You will be given a 30-second warning
prior to commencing wipe to change your mind. After this, ALL DATA WILL BE
DESTROYED.
Guide made by NerveGas, posted on MMi by me :)