Skip to main content

npkPy is an unpacker tool for MikroTiks custom npk container format

Project description

Actions Status codecov

npkPy

The npkPy package module is an unpacking tool for MikroTiks custom NPK container format. The tool is capable to display the content of any NPK package and to export all container.

"NPK stands for MikroTik RouterOS upgrade package" and since there is no solid unpacking tool for the format available, I want to share my approach of it. The format, in general, is used by MikroTik to install and update the software on MikroTiks routerOs systems.

NPK packages can be found here: MikroTik Archive

The code covers the ability to modify the container payload. Yet, this ability won't be available for cli. Please be aware, that you can't create or modify valid packages since they are signed.

All recent packages are signed with EC-KCDSA signature, 
and there's no way to create a valid npk file unless you know a secret key.

Installation

pip install npkPy

Usage

$ npkPy is an unpacking tool for MikroTiks custom NPK container format

optional arguments:
  -h, --help            show this help message and exit

input:
  --files FILES         Select one or more files to process
  --srcFolder SRCFOLDER
                        Process all NPK files found recursively in given source folder.
  --glob GLOB           Simple glob. Filter files from --srcFolder which match the given string.

output:
  --dstFolder DSTFOLDER
                        Extract container into given folder

actions:
  --showContainer       List all container from selected NPK files
  --exportAll           Export all container from selected NPK files
  --exportSquashFs      Export all SquashFs container from selected NPK files
  --exportZlib          Export all Zlib compressed container from selected NPK files

Common understanding: A file represents an NPK package with multiple containers. Each container 'contains' payloads like descriptions, SquashFs images or Zlib compressed data.

Other unpacking tools

If npkPy does not work for you, check out older approaches of NPK unpacking tools:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

npkPy-2021.10.22.15.58.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

npkPy-2021.10.22.15.58-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

Details for the file npkPy-2021.10.22.15.58.tar.gz.

File metadata

  • Download URL: npkPy-2021.10.22.15.58.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for npkPy-2021.10.22.15.58.tar.gz
Algorithm Hash digest
SHA256 325c4968e6e1e93dcd32541f3cc86eddc939dfee81aeb26bba935d9fad9e9393
MD5 be8195294da7eb86e5c17d6be5e21f43
BLAKE2b-256 121b2f877b24797669858d450b7333167c7be22ef0aec5c26000105c93cbfbe3

See more details on using hashes here.

File details

Details for the file npkPy-2021.10.22.15.58-py3-none-any.whl.

File metadata

  • Download URL: npkPy-2021.10.22.15.58-py3-none-any.whl
  • Upload date:
  • Size: 51.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for npkPy-2021.10.22.15.58-py3-none-any.whl
Algorithm Hash digest
SHA256 a8f8ce8358f8d923c19ad33cf950cb0773045bb8ac81727536b05e2b83138471
MD5 924b575809bbdb2b4c0c84a43dbfbb65
BLAKE2b-256 88403a3623015f6e1d32781cc063eae8ace46399a54f8fc3fc187926e130c616

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page