Skip to main content

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:

Metadata

Release files for npkPy 2021.10.22.15.58

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for npkPy 2021.10.22.15.58
File Size Uploaded
npkPy-2021.10.22.15.58.tar.gz 21.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for npkPy 2021.10.22.15.58
File Interpreter ABI Platform
npkPy-2021.10.22.15.58-py3-none-any.whl Python 3 none any Details

Total release size: 73.2 kB

Release files / npkPy-2021.10.22.15.58.tar.gz

Download URL npkPy-2021.10.22.15.58.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
325c4968e6e1e93dcd32541f3cc86eddc939dfee81aeb26bba935d9fad9e9393
BLAKE2b-256 checksum
How to use checksums
121b2f877b24797669858d450b7333167c7be22ef0aec5c26000105c93cbfbe3
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / npkPy-2021.10.22.15.58-py3-none-any.whl

Download URL npkPy-2021.10.22.15.58-py3-none-any.whl
Size 51.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8f8ce8358f8d923c19ad33cf950cb0773045bb8ac81727536b05e2b83138471
BLAKE2b-256 checksum
How to use checksums
88403a3623015f6e1d32781cc063eae8ace46399a54f8fc3fc187926e130c616
Upload date
Uploaded using Trusted Publishing?
What is 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
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page