How To Jailbreak iOS 4.0.2 iPhone 3GS With PwnageTool
Apple has releasediOS 4.0.2 to fix the PDF security exploit used by JailbreakMe jailbreak for iPhone 4, iPhone 3GS, 3G on iOS 4,iOS 4.0.1 and iPad 3.2.1. Do not upgrade to iOS 4.0.2 in case of iPhone 4 or iPad, as there is no jailbreak yet available for these devices. Others might be able to jailbreak iPhone 3G with redsn0w 0.9.b5-5 or iPhone 3GS using PwnageTool (Mac OSX).
PwnageTool lets you create custom firmware (IPSW) file, with which you can later restore your iPhone via iTunes. An unofficial release is now available to jailbreak iPhone 3GS (old bootrom) on iOS 4.0.2.
Disclaimer: Since it is an unofficial release of PwnageTool, we recommend to use it with caution. We are not responsible in case of any damage to your device.
Here are the steps to jailbreak iPhone 3GS iOS 4.0.2 using PwnageTool:
1. Download iOS 4.0.2 IPSW and PwnageTool (unofficial version) (links at bottom).
2. Launch PwnageTool, choose Simple mode (use Expert mode if you are an advanced user).
3. Then select your device, iPhone 3GS or iPod Touch 2G by clicking on the device picture. Click the Next arrow.

4. In the next screen, click on ‘Browse for IPSW…’ and select the iOS 4.0.2 IPSW file that you have earlier downloaded. Click Next button to continue.
5. When asked if you have an iPhone contract that you would activate normally through iTunes, click No. What the question means is that if you are on an official carrier. Clicking No tells PwnageTool that you are on an unofficial carrier and would like to later unlock your device. It will then not update your iPhone baseband.
6. PwnageTool will start building custom IPSW to jailbreak your iPhone. Wait till you see the ihaz Success! message which is shown after the custom IPSW firmware is cooked.

7. Now go ahead and restore your iPhone 3GS to this custom iOS 4.0.2 IPSW via iTunes.
Launch iTunes, select your device in the left sidebar. Holding the SHIFT (ALT for Mac OSX) button, click on ‘Restore’. Browse and select the custom IPSW created by PwnageTool and let iTunes restore your iPhone to this firmware.
8. Once the installation is done, your iPhone will reboot.
That’s it. After your iPhone restarts, you have a fully jailbroken iPhone 3GS on iOS 4.0.2.
Now you can happily unlock iPhone 3GS with Ultrasn0w 1.1-1 on any baseband.
Download PwnageTool To Jailbreak iOS 4.0.2
Download iOS 4.0.2 IPSW for iPhone 3GS

SBSettings Alternative for iPhone 4S/iPad 2, No Jailbreak Required
How to Unlock iPhone 4S on AT&T without Jailbreaking
Save SHSH Blobs of iOS 5.0.1 for iPhone 4S with TinyUmbrella
Gmail App for iPhone, iPad, iPod Touch Available for Download
Enable FaceTime over 3G in iOS 5 [Jailbreak Tweak]
iTunes 10.5.1 for Windows, Mac OS X [Direct Download Links]
Jailbreak iOS 5.0.1 with Redsn0w 0.9.9b8