▗▄▄▄▄▖▗▄▄▄▖▗▄▄▖ ▗▄▄▖▗▖ ▗▖▗▄▄▄▖▗▄▄▖ ▗▄▄▖
▗▞▘ █ ▐▌ ▐▌▐▌ ▐▛▚▖▐▌ █ ▐▌ ▐▌▐▌ ▐▌
▗▞▘ █ ▐▛▀▘ ▝▀▚▖▐▌ ▝▜▌ █ ▐▛▀▘ ▐▛▀▘
▐▙▄▄▄▖▗▄█▄▖▐▌ ▗▄▄▞▘▐▌ ▐▌▗▄█▄▖▐▌ ▐▌
ZIPsnipp is a command-line utility written in Python designed to be your comprehensive toolkit for handling various archive file formats. It aims to provide a user-friendly and powerful interface for common archive operations, including extraction, creation, listing, testing, password management, and even experimental repair and salvage capabilities.
- Extract Archives: Easily extract the contents of
.zip
,.tar
,.tar.gz
,.tgz
, and.gz
archives - Create Archives: Generate new
.zip
,.tar
,.tar.gz
, and.gz
archives from files and directories - List Archive Contents: Quickly view the files and directories within an archive
- Test Archive Integrity: Check for errors and corruption in your archive files
- Unlock Password-Protected ZIPs: Attempt to crack password-protected ZIP archives using dictionary attacks
- Lock Archives (ZIP): Create password-protected
.zip
archives and add files during the locking process - Experimental Archive Repair: Includes experimental features to attempt repair of corrupted
.zip
and.tar
archives, and basic salvage for.gzip
- ZIP Repair Modes:
remove_corrupted
(default): Attempts to remove corrupted files from ZIP archivesscan_only
: Only scans and reports corrupted files in ZIP archives without repair actions
- Salvage Extraction: Even if repair fails, ZIPsnipp attempts to extract any salvageable content from corrupted archives
- ZIP Repair Modes:
- User-Friendly CLI: Clean and intuitive command-line interface with options and help messages
- Loading Animation: Provides visual feedback during operations (can be disabled)
- Verbose Output: Option for detailed output for debugging and advanced users
- Interactive Prompts: Prompts for missing arguments such as output directory and files to add
- Configuration Management: Save and load configurations for common operations
- Environment Variables: Support for environment variables to set default values for common options
- Auto-Completion: Auto-completion for commands and options
.zip
.tar
.tar.gz
(.tgz
).gz
(gzip compressed single files)
- Prerequisites: Ensure you have Python 3.x installed on your system
- Download ZIPsnipp: Download the
ZIPsnipp.py
script from this repository - Make Executable (Linux/macOS):
chmod +x ZIPsnipp.py
- Run from anywhere (Optional - Linux/macOS): Place
ZIPsnipp.py
in a directory in your system'sPATH
(e.g.,/usr/local/bin/
) to run it directly asZIPsnipp
from any terminal location
Run ZIPsnipp from your terminal using the following command structure:
./ZIPsnipp.py <command> [archive_file] [options]
extract
: Extract archive contentscreate
: Create a new archivelist
: List contents of an archivetest
: Test archive integrityunlock
: Attempt to unlock a password-protected archivelock
: Create a password-protected archive (and add files)repair
: [Experimental] Attempt to repair a corrupted archivehelp
: Display help messageversion
: Show script version
# Extract a ZIP archive
./ZIPsnipp.py extract myarchive.zip
# Extract to specific directory
./ZIPsnipp.py extract myarchive.tar.gz -o extracted_files
# Create ZIP archive
./ZIPsnipp.py create new_archive.zip -f file1.txt,directory1,image.jpg
# Create password-protected ZIP
./ZIPsnipp.py lock secure_archive.zip -f important_documents,photos -p MySecretPassword
# Unlock password-protected ZIP
./ZIPsnipp.py unlock protected.zip -d passwords.txt
# Repair corrupted ZIP
./ZIPsnipp.py repair corrupted.zip --repair-mode remove_corrupted
# List contents
./ZIPsnipp.py list myarchive.tar
# Test integrity
./ZIPsnipp.py test archive_to_test.zip
# Show help
./ZIPsnipp.py help
# Show version
./ZIPsnipp.py version
Option | Short | Description | Commands |
---|---|---|---|
--output <path> |
-o |
Output directory for extraction | extract |
--password <password> |
-p |
Password for operations | extract , lock , unlock |
--dictionary <file> |
-d |
Dictionary file for password cracking | unlock |
--files <file1,file2,...> |
-f |
Files to add | create , lock |
--type <type> |
Force archive type | create , lock |
|
--repair-mode <mode> |
Repair mode for ZIP archives | repair |
|
--verbose |
Enable verbose output | All | |
--no-animation |
Disable loading animation | All | |
--save-config <file> |
Save current settings to a configuration file | All | |
--load-config <file> |
Load settings from a configuration file | All |
-
Extracting an Archive:
./ZIPsnipp.py extract myarchive.zip
-
Creating a New Archive:
./ZIPsnipp.py create new_archive.zip -f file1.txt,directory1,image.jpg
-
Creating a Password-Protected Archive:
./ZIPsnipp.py lock secure_archive.zip -f important_documents,photos -p MySecretPassword
-
Unlocking a Password-Protected Archive:
./ZIPsnipp.py unlock protected.zip -d passwords.txt
-
Repairing a Corrupted Archive:
./ZIPsnipp.py repair corrupted.zip --repair-mode remove_corrupted
-
Error: Archive file not found:
- Ensure the archive file path is correct and the file exists.
- Use absolute paths if relative paths are causing issues.
-
Error: Unsupported archive type:
- Check if the archive type is supported by ZIPsnipp.
- Use the
--type
option to specify the archive type if the extension is ambiguous.
-
Error: Incorrect password for ZIP archive:
- Verify the password provided is correct.
- Use a dictionary file with the
unlock
command to attempt password recovery.
-
Error: No files specified to add to the archive:
- Provide a comma-separated list of files and directories to add using the
--files
option. - Ensure the paths are correct and the files/directories exist.
- Provide a comma-separated list of files and directories to add using the
-
Error: Extraction failed:
- Check if the archive is corrupted or password-protected.
- Use the
repair
command to attempt to fix corrupted archives.
- Password dictionary required for unlock command
- Password recovery uses brute-force/dictionary attack
- Archive repair is experimental
- File paths in create/lock commands need comma separation
- Proper permissions required for operations
[MIT License]