After jailbreaking you iPhone with Sn0wbreeze for 3.1.3 firmware, you can unlock your iPhone 3G and 3GS with Ultrasn0w (04.26.08 baseband). Here is an easy guide on how to unlock your iPhone 3G and 3GS using ultrasn0w
Download iOS/iPhone firmware for iPhone (2G, 3G, 3Gs and 4), iPod Touch (2G and 3G) and iPad
Important
Now you can do untethered Jailbreak of your iPhone 3G/3Gs running latest firmware 3.1.3 with "Spirit".
Step by Step iPhone and iPod Touch (All models) Firmware 3.1.3 Jailbreak Guide Using Spirit
Step 1:
First you need to jaibreak. Here is the guide to jailbreak iPhone 3.1.3 firmware with Sn0wbreeze
Step 2:
Go to Cydia in your Jailbroken iPhone and tap on “Manage” tab. If you are using T-Mobile then you should first disable 3G and then install ultrasn0w.
Step 3
Touch on “Sources” and then click Edit
Step 4:
Tap on “Add” and a you will be asked to “Enter Cydia/APT URL”.
Type https://repo666.ultrasn0w.com and tap “Add Source”
Step 5:
It will download packages required add the repository for installing ultrasn0w.
Step 6:
Once it’s done, search for ultrasn0w in Cydia
The latest version is 0.92, installing this will unlock your iPhone 3G and 3GS with 3.1.3 firmware.
Step 7
Restart your iPhone and you are done!