Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
Changelog
=========

v0.2.0.dev0 - unreleased
------------------------
v0.2.0 - 2026-07-28
-------------------

- Full remaining Python3 migration contributed by Red Rays. Thanks [@vah13]
- Source code review and change aligment by [@codehorse87]
- Full remaining Python 3 migration contributed by [Red Rays](https://redrays.io/). ([\#84](https://github.com/OWASP/pysap/pull/84)) Thanks [@vah13](https://github.com/vah13)!
- Source code review and change alignment. Thanks [@codehorse87](https://github.com/codehorse87)!
- Functional testing by various OWASP CBAS community members
- `README.md` and documentation: Clarified that pysap now runs on Python 3 and requires Python 3.10 or newer.
- Documentation: Updated the Sphinx build to Python 3.10, Sphinx 7.4, and MyST Parser.
- `pysapcompress` model has been migrated from C code to a pure Python implementation. This makes the project more portable and packages easy to manage. Implementation is based on the TypeScript [sapcomp library by Max Jäger](https://git.sr.ht/~xje4/sapcomp). ([\#86](https://github.com/OWASP/pysap/pull/86)) Thanks [@randomstr1ng](https://github.com/randomstr1ng) and [@codehorse87](https://github.com/codehorse87)!
- Example scripts: Migrated the example scripts to Python 3 and fixed bytes/text handling, output formatting and routing edge cases across the migrated tools ([\#90](https://github.com/OWASP/pysap/pull/90)). Thanks [@randomstr1ng](https://github.com/randomstr1ng)!
- Testing and documentation: Improved the test harness, coverage, notebook generation workflow and packet/file-format notebooks; added packet fixture coverage and `pysapcompress` failure tests ([\#91](https://github.com/OWASP/pysap/pull/91)).
- `pysap/utils/fields.py`: Fixed string/byte handling in Scapy field helpers and added regression tests ([\#92](https://github.com/OWASP/pysap/pull/92)). Thanks [Tyrox](https://github.com/DominikHolzapfel)!
- Honeysap compatibility: Added NWRFC support, RFC crypto helpers, NI/RFC compatibility fixes, keepalive handling and UTF-16LE field round-trip tests ([\#93](https://github.com/OWASP/pysap/pull/93)). Thanks [@randomstr1ng](https://github.com/randomstr1ng) and Hackbarth!
- GitHub Actions: Updated the build matrix to cover Python 3.10 through 3.14 and added a documentation build job.
- Read the Docs: Updated the build configuration for the new Python 3.10 documentation toolchain.

- `pysap/SAPHDB.py`: Fixed Python 3 bytes/string handling in HDB packet fields and added test coverage for the affected packet paths ([\#95](https://github.com/OWASP/pysap/pull/95)).
- Bin scripts: Fixed Python 3 binary-file handling and exception reporting in `pysapcar`, `pysapgenpse` and `pysaphdbuserstore`; added command-line tool docs, subprocess coverage and a separate `bin_script` test/tox layer ([\#96](https://github.com/OWASP/pysap/pull/96)).
- `pysap/utils/crypto/rsec.py`: Fixed RSEC SSFS key decryption ([\#71](https://github.com/OWASP/pysap/pull/71)).
- `examples/default_sap_credentials`: Updated default SAP credentials.
- Project was contributed by SecureAuth to the OWASP CBAS Project in October 2022.
- Added the security policy file and clarified the project disclaimer.
- Documentation: Added references to SAP Secure Storage and SSFS research.
- `pysap/SAPCredv2.py`: Added subject fields instead of commonName for LPS-enabled credentials ([\#35](https://github.com/OWASP/pysap/issues/35)). Thanks [@rstenet](https://github.com/rstenet)!
- `pysap/SAPCredv2.py`: Add support for cipher format version 1 with 3DES ([\#35](https://github.com/OWASP/pysap/issues/35) and [\#37](https://github.com/OWASP/pysap/pull/37)). Thanks [@rstenet](https://github.com/rstenet)!
- `pysap/SAPHDB.py`: Added missing `StatementContextOption` values (see [\#22](https://github.com/SecureAuthCorp/SAP-Dissection-plug-in-for-Wireshark/pull/22)).
- Documentation:
- Updated the Sphinx build to Python 3.10, Sphinx 7.4, and MyST Parser.
- Clarified that pysap now runs on Python 3 and requires Python 3.10 or newer.
- Updated the build configuration in Read the Docs for the new Python 3.10 documentation toolchain.
- Updated the example-script documentation for the migrated Python 3 scripts and fixed broken documentation links ([\#94](https://github.com/OWASP/pysap/pull/94)).
- Added references to SAP Secure Storage and SSFS research.
- Added the security policy file and clarified the project disclaimer.
- Project was contributed by SecureAuth to the OWASP CBAS Project in October 2022.


v0.1.19 - 2021-04-29
Expand Down
7 changes: 4 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ include requirements.txt
include requirements-docs.txt
include requirements-examples.txt

# Include header files
include pysapcompress/*.h

# Include the docs
recursive-include docs *
prune docs/_build
Expand All @@ -20,3 +17,7 @@ recursive-include extra *.py

# Include the example scripts
recursive-include examples *

# Exclude generated Python bytecode
global-exclude *.py[cod]
global-exclude __pycache__
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pysap - Python library for crafting SAP's network protocols packets
[![Latest Version](https://img.shields.io/pypi/v/pysap.svg)](https://pypi.python.org/pypi/pysap/)
[![Documentation Status](http://readthedocs.org/projects/pysap/badge/?version=latest)](http://pysap.readthedocs.io/en/latest/?badge=latest)

Version 0.2.0.dev0 (in development)
Version 0.2.0 (July 2026)

The master branch runs on Python 3.

Expand All @@ -19,13 +19,12 @@ uses different network protocols and some services and tools make use of custom
formats as well. While some of them are standard and well-known protocols, others
are proprietaries and public information is generally not available.

[pysap](https://www.secureauth.com/labs/open-source-tools/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` and `HDB`
protocols. In addition, support for creating and parsing different proprietary file
formats is included. The modules are built on top of [Scapy](https://scapy.net/) and are
based on information acquired at researching the different protocols, file formats
and services.
[pysap](https://github.com/OWASP/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](https://scapy.net/) and are based on information acquired at researching the
different protocols, file formats and services.


Features
Expand All @@ -41,6 +40,7 @@ Features
* 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:
Expand Down Expand Up @@ -77,16 +77,21 @@ Roadmap

### Python 3 project

As time passed, and Python 2 lost relevance, we decided to start a new effort to complete the project and move it to Python 3 only. The main reason is to avoid the introduction of backwards compatibility libraries that add complexity to the code and are not relevant in the current state of the Python 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.

This project is actively being worked on by the OWASP CBAS project as part of the [master branch](https://github.com/OWASP/pysap/tree/master). The project now runs on Python 3. 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

* Update documentation and PyPi release
* [Replace pysapcompress old C-code](https://github.com/OWASP/pysap/issues/73)
* [Port SAP Credv2 file format](https://github.com/OWASP/pysap/issues/64)
* Update depending OWASP projects such as honeysap & SAP attack surface monitoring
* 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



Expand Down Expand Up @@ -140,7 +145,10 @@ Contributions made by:
* Jennifer Hornig ([@gloomicious](https://github.com/gloomicious))
* RedRays Security Team
* Vincent Berg
* WaseemAjrab ([@default-eshu](https://github.com/default-eshu))
* Waseem Ajrab ([@default-eshu](https://github.com/default-eshu))
* [@randomstr1ng](https://github.com/randomstr1ng)
* Tyrox ([@DominikHolzapfel](https://github.com/DominikHolzapfel))
* Hackbarth

Disclaimer
----------
Expand Down
2 changes: 2 additions & 0 deletions docs/dev/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../../ChangeLog.md
```
1 change: 0 additions & 1 deletion docs/dev/changelog.rst

This file was deleted.

168 changes: 84 additions & 84 deletions docs/fileformats/SAPCAR.ipynb

Large diffs are not rendered by default.

114 changes: 57 additions & 57 deletions docs/fileformats/SAPCredv2.ipynb

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions docs/fileformats/SAPPSE.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"metadata": {
"collapsed": true,
"execution": {
"iopub.execute_input": "2026-05-21T22:53:03.946141Z",
"iopub.status.busy": "2026-05-21T22:53:03.945319Z",
"iopub.status.idle": "2026-05-21T22:53:04.536456Z",
"shell.execute_reply": "2026-05-21T22:53:04.531951Z"
"iopub.execute_input": "2026-07-28T17:03:06.260749Z",
"iopub.status.busy": "2026-07-28T17:03:06.260534Z",
"iopub.status.idle": "2026-07-28T17:03:06.530807Z",
"shell.execute_reply": "2026-07-28T17:03:06.528281Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -54,10 +54,10 @@
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-21T22:53:04.545780Z",
"iopub.status.busy": "2026-05-21T22:53:04.543910Z",
"iopub.status.idle": "2026-05-21T22:53:04.569278Z",
"shell.execute_reply": "2026-05-21T22:53:04.564680Z"
"iopub.execute_input": "2026-07-28T17:03:06.540040Z",
"iopub.status.busy": "2026-07-28T17:03:06.539524Z",
"iopub.status.idle": "2026-07-28T17:03:06.564986Z",
"shell.execute_reply": "2026-07-28T17:03:06.562490Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -93,10 +93,10 @@
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-21T22:53:04.586685Z",
"iopub.status.busy": "2026-05-21T22:53:04.586000Z",
"iopub.status.idle": "2026-05-21T22:53:04.600941Z",
"shell.execute_reply": "2026-05-21T22:53:04.595911Z"
"iopub.execute_input": "2026-07-28T17:03:06.570781Z",
"iopub.status.busy": "2026-07-28T17:03:06.570208Z",
"iopub.status.idle": "2026-07-28T17:03:06.581297Z",
"shell.execute_reply": "2026-07-28T17:03:06.577977Z"
}
},
"outputs": [
Expand Down Expand Up @@ -138,10 +138,10 @@
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-21T22:53:04.608974Z",
"iopub.status.busy": "2026-05-21T22:53:04.606964Z",
"iopub.status.idle": "2026-05-21T22:53:04.618084Z",
"shell.execute_reply": "2026-05-21T22:53:04.616214Z"
"iopub.execute_input": "2026-07-28T17:03:06.585399Z",
"iopub.status.busy": "2026-07-28T17:03:06.584937Z",
"iopub.status.idle": "2026-07-28T17:03:06.595507Z",
"shell.execute_reply": "2026-07-28T17:03:06.592482Z"
}
},
"outputs": [
Expand Down Expand Up @@ -186,10 +186,10 @@
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-21T22:53:04.622430Z",
"iopub.status.busy": "2026-05-21T22:53:04.621952Z",
"iopub.status.idle": "2026-05-21T22:53:04.868262Z",
"shell.execute_reply": "2026-05-21T22:53:04.864210Z"
"iopub.execute_input": "2026-07-28T17:03:06.598380Z",
"iopub.status.busy": "2026-07-28T17:03:06.598065Z",
"iopub.status.idle": "2026-07-28T17:03:06.679427Z",
"shell.execute_reply": "2026-07-28T17:03:06.678021Z"
}
},
"outputs": [
Expand Down Expand Up @@ -225,7 +225,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
122 changes: 61 additions & 61 deletions docs/fileformats/SAPSSFS.ipynb

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ are proprietaries and public information is generally not available.

`pysap <https://owasp.org/www-project-core-business-application-security/>`_
is an open source Python 3 library that provides modules for crafting and sending packets
using SAP's ``NI``, ``Diag``, ``Enqueue``, ``Router``, ``MS``, ``SNC``, ``IGS``, ``RFC``
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 <https://scapy.net/>`_ and
are based on information acquired at researching the different protocols, file formats
Expand All @@ -36,13 +36,15 @@ Features
* 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.

Expand Down
230 changes: 115 additions & 115 deletions docs/protocols/SAPDiag.ipynb

Large diffs are not rendered by default.

204 changes: 102 additions & 102 deletions docs/protocols/SAPEnqueue.ipynb

Large diffs are not rendered by default.

Loading
Loading