Click and Hold the Finder icon in the dock and select Go to Folder.. from the pop-up options.

Step Two:

Type "/Users/'your username'/Library/Caches/Cleanup At Startup" in the pop-up box and click the 'Go' button. (Remove '' part from 'your username'). This will open the 'Cleanup At Startup' folder in the Finder window. Leave this window open.

Step Three:

Create a new folder, 'MOST IMPORTANT FILES IN THE WORLD' in this example.

Step Four:

Open iTunes and connect your iPhone 3GS to the computer in DFU Mode. Select it from the list of devices in the left sidebar. Hold option and click Restore button. Navigate to the iPhone firmware you downloaded before, select it and click 'Open'.

Your iPhone will now begin restoring to the 3.0 firmware. You will be warned that this will erase your phone. Click the 'Restore' button to continue.

Step Five:

When the restore is in progress check the "/Users/'your username'/Library/Caches/Cleanup At Startup" folder you opened before. A new folder will appear with a name similar to 'iPhone Temporary Files.noindex'. When the folder appears, select it, and press Command+c to copy it to the clipboard.

Open the 'MOST IMPORTANT FILES IN THE WORLD' folder you made before and paste 'iPhone Temporary Files.noindex' there. This will make a copy of your unique iBEC and iBSS.

Make sure you finish these steps before the restore is completed and you're done!

All the credit for the technique goes to DevTeam

P.S. Thanks to Melech518 for all the screenshots!

UPDATE: If you have already obtained a USB Dump from Purplera1n.com, no need to follow the guide

UPDATE 2: Seems that Purplera1n just gives iBSS so if you want iBEC as well (can't restore to totally stock 3.0 without it), follow this method as well.