The method uses @sbingner's SAM (Subscriber Artificial Module), which is normally used for activations. A potential exploit was researched by the iPhone Dev Team a while ago but was not done effectively and was therefore scrapped, however MuscleNerd has confirmed his team did not perform enough tests.
To perform the unlock, you need to have inserted the SIM card you want to use into your iPhone. An important note is that you will have to repeat this for each SIM card that you plan to use with the iPhone.
To perform the unlock:
Open Cydia and add the following repository:
Open SAM, either through Settings.app or via the SAMPrefs icon on the springboard. Make sure your intended SIM card is installed in the device.
Open Utilities and tap Deactivate iPhone. If this works, the ActivationState should now be Unactivated.
Under Methods select By Country and Carrier. The find your carrier in the list. You may need the SIM ID if your network works with more than just the network ID.
Enter More Information and note down the IMSI that is listed underneath SAM Details. Then select Spoof Real SIM to SAM. Go back to the main SAM screen and change Method to Manual. Then enter the IMSI you noted down before.
Connect your iPhone to iTunes and let iTunes reactivate the iPhone. When this is complete, double click on Phone Number in iTunes and make use the ICCID shown matches the one written on the SIM card. If it doesn't, repeat the entire process again.
If the ICCID's do match, disconnect the iPhone from iTunes and disable SAM. Reconnect to iTunes, and ignore any error messages that appear. Close iTunes then reopen it.
Your iPhone will soon display signal bars, meaning the procedure has been performed correctly. If push messaging does not work correctly, enter SAM and tap Clear Push to fix, then connect to iTunes.
Thanks to .Coqui for the video!
Thanks to Mr.Kane for this video!