Skip to main content

pysap - Python library for crafting SAP's network protocols packets

Build and test pysap Latest Version Documentation Status

Version 0.2.0 (July 2026)

The master branch runs on Python 3.

Overview

SAP Netweaver and SAP HANA are technology platforms for building and integrating SAP business applications. Communication between components uses different network protocols and some services and tools make use of custom file formats as well. While some of them are standard and well-known protocols, others are proprietaries and public information is generally not available.

pysap is an open source Python library that provides modules for crafting and sending packets using SAP's NI, Diag, Enqueue, Router, MS, SNC, IGS, RFC, NWRFC and HDB protocols. In addition, support for creating and parsing different proprietary file formats is included. The modules are built on top of Scapy and are based on information acquired at researching the different protocols, file formats and services.

Features

  • Dissection and crafting of the following network protocols:

    • SAP Network Interface (NI)
    • SAP Diag
    • SAP Enqueue
    • SAP Router
    • SAP Message Server (MS)
    • SAP Secure Network Connection (SNC)
    • SAP Internet Graphic Server (IGS)
    • SAP Remote Function Call (RFC)
    • SAP Netweaver RFC SDK (NWRFC)
    • SAP HANA SQL Command Network (HDB)
  • Client interfaces for handling the following file formats:

    • SAP SAR archive files
    • SAP Personal Security Environment (PSE) files
    • SAP SSO Credential (Credv2) files
    • SAP Secure Storage in File System (SSFS) files
  • Library implementing SAP's LZH and LZC compression algorithms.

  • Automatic compression/decompression of payloads with SAP's algorithms.

  • Client, proxy and server classes implemented for some of the protocols.

  • Command-line tools for offline work with SAP archive, PSE, Credv2, and SSFS files.

  • Example scripts to illustrate the use of the different modules and protocols.

Installation

To install pysap simply run:

$ python3 -m pip install pysap

pysap requires Python 3.10 or newer.

Roadmap

Python 3 project

After a long time and thanks to a great community effort, the project has been just ported to Python 3. The project now runs on Python 3, but bugs are still expected to raise as more functionality is tested and evaluated. Testing support by the community is highly appreciated.

In addition, some of the recent Python 3 capabilities are not yet fully adapted, such as static typing, native concurrency and others.

Further efforts

  • Bug fixing all over the place
  • Increment unit test coverage
  • Incorporate static typing and other Python 3.10+ features
  • Protocol completeness (e.g. NWRFC, RFC, Diag, HDB)
  • Create more stable tools mimicking SAP' native ones (e.g. genpse, dpmon, gwmon)
  • Update depending OWASP projects such as honeysap & SAP attack surface monitoring

Documentation

Documentation is available at Read the Docs.

The development documentation includes a short testing guide at docs/dev/testing.rst. It describes the unit and integration suites, the test harness, and the recommended tox and pytest commands.

License

This library is distributed under the GPLv2 license. Check the COPYING file for more details.

Authors

he tool was initially designed and developed by Martin Gallo wile working at SecureAuth's Innovation Labs team, with the help of many contributors. The code was then contributed by SecureAuth to the OWASP CBAS Project in October 2022.

Contributors

Contributions made by:

Disclaimer

The spirit of this Open Source initiative is to help security researchers, and the community, speed up research and educational activities related to the implementation of networking protocols and stacks.

The information in this repository is for research and educational purposes only and is not intended to be used in production environments and/or as part of commercial products.

If you desire to use this tool or some part of it for your own uses, we recommend applying proper security development life cycle and secure coding practices, as well as generate and track the respective indicators of compromise according to your needs.

Contact Us

Whether you want to report a bug, send a patch, or give some suggestions on this package, drop a few lines to OWASP CBAS' project leaders.

For security-related questions check our security policy.

Download files

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

Source Distribution

pysap-0.2.0.tar.gz (22.9 MB view details)

Uploaded Source

Built Distribution

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

pysap-0.2.0-py3-none-any.whl (149.0 kB view details)

Uploaded Python 3

File details

Details for the file pysap-0.2.0.tar.gz.

File metadata

  • Download URL: pysap-0.2.0.tar.gz
  • Upload date:
  • Size: 22.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for pysap-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b1756e2aae61f5a8fd5d51c1b090fc329e252729793e09aa294b18fc1489b0c9
MD5 ca873b27815b701ced14d4e2954cbe51
BLAKE2b-256 e9ab0f6290f99e5f9f246068a50d721e5c291d0d0bd06108c3d6442927c64308

See more details on using hashes here.

File details

Details for the file pysap-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pysap-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 149.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for pysap-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e39b8a3f882715cf73de3db827298881edf5f4d51216dd7210c6f8b257ef036a
MD5 83706007e7ce66ac91ee8918754a94e3
BLAKE2b-256 4c42cff225b06ce9249452afd5fcbbe9281e8e2f3917e556411a09842995e9a5

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