You could use this script or, much easier, install the Password Exporter, a dedicated Firefox extension. It allows you to export your saved passwords to an XML file. You'll need to convert that to a CSV file, then follow the instructions to import into Passpack.
IE Password View to extract all the passwords stored in your browser, and can export into several formats, including tab-delimited text files (TSV) and XML files. Then follow the instructions to import into Passpack..