fkie-cad / fact_extractor

Standalone Utility for FACT-like extraction
GNU General Public License v3.0
80 stars 31 forks source link

Accurately record whether a 7z-supported file did/didn't require a password to extract #134

Closed eclipsotic closed 2 months ago

eclipsotic commented 2 months ago

Fixes #133.

Best I can tell, the only reliable way to determine that an archive doesn't require a password is to attempt to extract it without a password. Unfortunately, for zip files, when you pass a -p argument, there is nothing in the output to indicate whether it was actually used or not.

To take advantage of this, I modified PW_LIST to be a list whose first element is an empty string. This causes 7z to attempt extraction with an empty password (i.e. no password) first. The success/failure of this extraction will show if this archive requires a password to extract or not.