So I was asked how to jailbreak your iPhone if you installed 3.1.3 since the only jailbreak I know of is for 3.1.2 and a whole bunch of older versions. Basically you downgrade to 3.1.2.
Here are the steps:
1. Download a 3.1.2 ISPW from here: http://www.poorlad.com/iCommunity/ I see it as the v3.1.2 – Modem FW 05.11.07.
2. Connect your iPhone (it will remain connected)
3. Open itunes
4. Hold shift and click restore. You should be prompted to find an IPSW. Choose the one you downloaded in step #1.

Restore. You just lost everything about your phone that made it yours. Let iTunes do it’s thing and rename your phone to it’s old name.

Now to jailbreak:
1. Download blackra1n from here: http://www.blackra1n.com/
2. Double click on the app you just downloaded. Your iPhone is still connected and iTunes is probably open. Ignore anything from either. Only pay attention to BlackRa1n
3. Once your iPhone starts back up you should see a black teardrop on the screen as an app somewhere. Click it.
4. Install cydia and click go or whatever (do not uninstall backra1n at this point – I never do).

Then open cydia and install these apps at least:
http://huberblog.com/2009/12/28/jailbroken-again-at-3-1-2/

Also if you install openssh — or any app you use does — then you need to change your ssh password. It is alpine right now and we all know it.

http://www.cultofmac.com/how-to-change-your-iphones-default-ssh-password/20871