The iPhone Dev-Team released the PwnageTool 3.1.3 which enables the user to jailbreak iPhone 3GS. But this tool works only on Mac OS X and not in Windows.
Jailbroken iPhone 3GS with an old firmware version (If you don’t have it better not try this guide)
How to Jailbreak iPhone 3GS with 3.1 Firmware
1. Download the following files.
2. Join all the downloaded parts using HJSplit and extract it to get one file.
3. Open iTunes.
4. Connect your iPhone to the computer.
5. Now hold Shift and click ‘ Restore ‘.
That’s it. Now wait till the installation ends.
If you want you could unlock your iPhone 3GS using Ultrasnow.
Thanks to sizlopedia.