Skip to main content

SAP security analysis tool using SAP GUI scripting

Project description

SAP security analysis tool using sap gui scripting

The SAPSEC tool does not need to know and store your login and password to SAP server (log in to SAP yourself). The SAPSEC is open source to ensure that unwanted actions are not performed in the code. Of cource we don't recommend to scan with SAP_ALL user rights.

Table of contents

Python installation

  1. Download last version of Python 3.x installer
  2. Run the installer
  3. While installation choose folowing option:
    • Add python 3.x to PATH

Install

Pip installation (recomended)

Installation is easy. Run in windows console (command line interpreter - cmd):

pip install sapsec

If your computer is behind a proxy set additional option --proxy in following format:

pip install sapsec --proxy http://user:password@proxyserver:port

Installation from github

If for some reason the installation was not successful (with pip) there is an opportunity to install sapsec from github source files.

  1. Download zip archive with project source codes. Or use git clone:
git clone https://github.com/gutskodv/sap-security.git
  1. Unpack files from dowloaded zip archive. And go to project directory with setup.py file.
  2. Ugrade pip, Install Wheel package, Collect sapsec package:
python -m pip install --upgrade pip
pip install wheel
python setup.py bdist_wheel
  1. Install sapsec package from generaed python wheel in dist subdirectory:
python setup.py dist\sapsec*.whl

Requirements

You can manually intall requirements if they were not installed in automatic mode.

  1. PyWin32 (Python extensions for Microsoft Windows Provides access to much of the Win32 API, the ability to create and use COM objects, and the Pythonwin environment).
pip install pywin32
  1. XlsxWriter (Python module for writing files in the Excel 2007+ XLSX file format).
pip install xlsxwriter
  1. PyYaml (a YAML parser and emitter for Python).
pip install xlsxwriter

Before running

  1. РЎheck that gui scripting is enabled on the SAP server. The parameter sapgui/user_scripting should be set to TRUE. If the parameter value is currently set to FALSE, change it before start. For more information about GUI scripting read the article.
  2. If the paramaeter sapgui/user_scripting_per_user is also set to TRUE, make sure the SAP user is assigned S_SCR:ACTVT=16 (Authorization for SAP GUI Scripting).

Usage

  1. Run SAP Logon application.
  2. Log in to the SAP server (enter your user name and password).
  3. Go to windows console (command line interpreter - cmd). Change directory
  4. Run sapsec:
sapsec

or

python -m sapsec

or you'd like use your own config:

sapsec --rules rules_config.yaml
  1. Inspect generated excel report (in directory you choosen).

Predefined SAP security packs

  1. Weak(redundant) password hashes (BCODE, PASSCODE) in SAP tables. Privelege to scan:
    • S_TABU_NAME:ACTVT=03, TABLE=USR02, USH02, USRPWDHISTORY, USH02_ARC_TMP, VUSER001, VUSR02_PWD, TDDAT
    • S_PROGRAM:P_ACTION=SUBMIT
    • S_GUI:ACTVT=61
    • S_SCR:ACTVT=16
    • S_TCODE:TCD=SE16, SA38
    • S_USER_AGR:ACTVT=03, ACT_GROUP=*
    • S_USER_AUT:ACTVT=03, OBJECT=* , AUTH=*
    • S_USER_GRP:ACTVT=03, CLASS=*
    • S_USER_PRO:ACTVT=03

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

sapsec-1.0.2.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

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

sapsec-1.0.2-py3-none-any.whl (39.6 kB view details)

Uploaded Python 3

File details

Details for the file sapsec-1.0.2.tar.gz.

File metadata

  • Download URL: sapsec-1.0.2.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for sapsec-1.0.2.tar.gz
Algorithm Hash digest
SHA256 10d25def6ca50fbfcffaba8105f89efb2c55d66212dae9a9b1649355ad48256d
MD5 e18a6aece7162bcc8ab97b871c2553f8
BLAKE2b-256 e37deb122a6de7d65b3c1e51fa77bc51071957cba6a163dddc9d235b897b329c

See more details on using hashes here.

File details

Details for the file sapsec-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: sapsec-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 39.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for sapsec-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e8c7f1a28638854f0075f200886a261eecfa1d8c37dc775414382d3c26d10453
MD5 c3f0592a8f8d753c0ca13cb20ac57d07
BLAKE2b-256 8e9dcb1c40ea80b84156a9ae0659da31a2f8742adb860a511e039937de64e67c

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