How to Secure your iPhone
Although many jailbreakers are tech-savvy enough to know how to lock down their devices to protect themselves from attack, there are quite a few who have simply followed online instructions such as these to perform the jailbreak. This group, while arguably somewhat tech-savvy, doesn't necessarily know all the nitty-gritty details about the iPhone filesystem or its security mechanisms.
To make it easy on these users, we've provided steps on how to change your iPhone's root password - the common denominator required in order for the malware to gain access to your device.
While some may argue there's no need to change your root password if you haven't also installed the SSH program, another necessary element for these attacks to work, we think that's a little short-sighted. It would be easy enough for a malicious hacker to trick jailbreakers into installing SSH by bundling it with some other third-party application offered through underground App Stores like Cydida or Icy. By masquerading as something innocent like a wallpaper-changer or ringtone bundle, a hacker could easily set up a number of jailbreakers with SSH without the victims even being aware that it has been installed. Although we haven't heard of anything like this happening yet, if we thought of it then you can bet that the hackers out there have thought of it too.
Changing the Root Password
The best protection is to simply change your iPhone root password. That will keep you safe from the current iPhone malware...as least for now. Here's how:
Install the MobileTerminal application from Cydia.
Reboot your iPhone.
Launch MobileTerminal and type in the command: passwd
At the prompt which asks for the "Old Password," type in: alpine
At the new password prompt, type in a new password of your choosing, making sure to pick something strong.
Re-enter the password to confirm.
You'll then be returned to the Mobile$ prompt which means the change was successful.
Now you'll need to change the password for the secondary admin. Type in the command login root.
Again, you're prompted for the old password. Type in alpine.
Now type in the command passwd
You'll then go through the change password routine a second time, entering in alpine as the old password, creating a new password and then re-entering it to confirm.
When you are finished, close the application.
Note: these instructions assume you are running iPhone OS 3.0 or higher.