From this page, you can download the iOS firmware for iPhone, iPhone 3G, iPhone 3GS, iPhone 4, iPhone 4S and iPod Touch (first, second, third and fourth generation).
All firmwares, link directly to Apple’s servers, so they are not modified in any way, and are the same files that iTunes downloads in restorations and upgrades. To use them, once downloaded, you have to press the Shift key and the reset button (on Windows) and the alt + restasurar button (on Mac) and select the firmware file, it should have a. Ipsw extension. Your browser may download them as a. Zip or unzip it as such in a folder automatically if you have it configured. This is because the files. Ipsw are actually ZIP packages with all the files needed to install the firmware. When this happens, change the settings of your browser or use another browser(Chrome, Firefox, Opera etc).
To download the firmware, click on the link with the right mouse button and select ‘Save As …’ or ‘Download Linked File As …’ and choose where you want to save.
Firmwares for iPhone 5