This is what worked for me guys, pretty easy to follow:
1) Open the file C:\Windows\System32\drivers\etc\hosts (Windows) or /etc/hosts (Mac OS X) and add the following entry to the bottom of the file and save,
74.208.10.249 gs.apple.com
2) Downloaded the IPSW file for 3.1.3
3) Shift + restore in iTunes
4) Restored with backed-up data from previous sync in iTunes
5) Jailbroke with Spirit (iphone must be activated to jailbreak with Spirit)
Source:
http://*****i.com/forums/3g-s-downgrading/717723-3g-s-spirit2pwn-brick-shsh-file-3-1-3-a.html