Procedure to jailbreak iPhone 2G, 3G, 3GS and iPod Touch with 3.1.2 firmware using redsn0w
* Download the latest version of iTunes and update your iPhone to the latest 3.1.2 Firmware if you haven’t already done it.
* Download redsn0w 0.9 for Windows or Mac based on your OS and also download iPhone OS 3.1.2 IPSW file.
* Now run redsn0w and browse to the original iPhone OS 3.1.2 .ipsw file. Redsn0w will check if the firmware is valid and will then patch it.
# If you are a iPhone 2G user you need to select “Install Cydia” and “Unlock” to unlock your iPhone 2G. If you have a iPhone 3G or iPhone 3GS you just need to select “Install Cydia“.
# If you are interested in customizing your iPhone you can choose any/all of the “Verbose boot”, “Custom boot logo” and “Custom recovery logo”, else you can skip this step.
# Now redsn0w will show you some instructions to enter into DFU mode.
* Hold down the “Power” button and immediately without releasing the power button, also hold down the “Home” button. Without releasing the “Home” button, release the “Power” button but keep holding the “Home” button for 30 seconds.
# Your iPhone will reboot once it is jailbroken