
Ein neues Open-Source-Tool zur schnellen Prüfung von SAP-Berechtigungen.
%%%###%%%%%%%%%%%%%%%%%%%%%%%%%%%.
% %
# %
.: #% *
* .===% . ::
% :*%%=====%********##%%%%%*: #
% %%%*= =====%============*#%%%-%
= % *= =====-================# % BBBBBBBBBBBBBBBBB IIIIIIIIII SSSSSSSSSSSSSSS SSSSSSSSSSSSSSS AAA PPPPPPPPPPPPPPPPP
=# *: =====================% + B::::::::::::::::B I::::::::I SS:::::::::::::::S SS:::::::::::::::S A:::A P::::::::::::::::P
%:#%#%%=-===*=======%%#%====+%-. B::::::BBBBBB:::::B I::::::::IS:::::SSSSSS::::::SS:::::SSSSSS::::::S A:::::A P::::::PPPPPP:::::P
% %#+++==%#========%#%%######=% BB:::::B B:::::BII::::::IIS:::::S SSSSSSSS:::::S SSSSSSS A:::::::A PP:::::P P:::::P
* %#*++#####################% % B::::B B:::::B I::::I S:::::S S:::::S A:::::::::A P::::P P:::::P
::%##++#####%=#%######%%####% % B::::B B:::::B I::::I S:::::S S:::::S A:::::A:::::A P::::P P:::::P
#-##++#####%#%%####%*###%##%.= B::::BBBBBB:::::B I::::I S::::SSSS S::::SSSS A:::::A A:::::A P::::PPPPPP:::::P
% %#++%%%##%#####%#########== B:::::::::::::BB I::::I SS::::::SSSSS SS::::::SSSSS A:::::A A:::::A P:::::::::::::PP
% %#*+%##%#####%+#%#######%:% B::::BBBBBB:::::B I::::I SSS::::::::SS SSS::::::::SS A:::::A A:::::A P::::PPPPPPPPP
- %##++#%%%####*%%########%.% B::::B B:::::B I::::I SSSSSS::::S SSSSSS::::S A:::::AAAAAAAAA:::::A P::::P
*=**++****###############%:% =% B::::B B:::::B I::::I S:::::S S:::::S A:::::::::::::::::::::A P::::P
% #*++********###########+:#%= %#% B::::B B:::::B I::::I S:::::S S:::::S A:::::AAAAAAAAAAAAA:::::A P::::P
% %*++**********########%%+==++%#:%*= ... BB:::::BBBBBB::::::BII::::::IISSSSSSS S:::::SSSSSSSS S:::::S A:::::A A:::::A PP::::::PP
+ %**++***********#####%==++++++*%*%=-*%% B:::::::::::::::::B I::::::::IS::::::SSSSSS:::::SS::::::SSSSSS:::::SA:::::A A:::::A P::::::::P
.-***++***********##%%%%=*++%+=*#%*%%#*% B::::::::::::::::B I::::::::IS:::::::::::::::SS S:::::::::::::::SSA:::::A A:::::A P::::::::P
%.#*++***********%=+++++%*+%+%#******%#%: BBBBBBBBBBBBBBBBB IIIIIIIIII SSSSSSSSSSSSSSS SSSSSSSSSSSSSSS AAAAAAA AAAAAAAPPPPPPPPPP
% %*++**********%==+++%=+%*#%%*%%*****%**%:
% %*++**********%=+++#%%*%%+#%#%%%****%:
::#**++**********%=++++%%%#*%%%*++***%
* +%#************#%=***%*%%#*%*+++%
% . .:.:.:.:.:..:%=**#**%*%+%*##***%
% :: :.:.:.:.:.:%=****%**%++******%
.%%%%#+::::::=*%%%=****#.%+++**%:
Dieses Tool ermöglicht eine schnelle Analyse einer SAP-Datenbank, um Benutzer oder Rollen zu identifizieren, die mit gefährlichen Berechtigungen oder Berechtigungskombinationen konfiguriert sind. Es ähnelt Bloodhound für Active Directory.
Sie können pipx verwenden:
$ pipx install git+https://github.com/synacktiv/bissap.git
Oder mit pip:
$ git clone https://github.com/synacktiv/bissap
$ python3 -m venv .venv && . .venv/bin/activate # Optional: Install in a venv
$ pip install .
Oder, falls Sie Debian-Pakete bevorzugen:
# apt install python3-click python3-colorlog python3-sqlalchemy python3-frozendict python3-rich python3-openpyxl python3-typing-extensions
$ PYTHONPATH=src/ python3 src/bissap/commands/__init__.py
bissap arbeitet in 3 Schritten:
$ bissap collect -t sybase
Copy this command, set the appropriate variables and execute the command. Copy the file `/tmp/dump_bissap.csv` to your host.
Call bissap -d DATABASE.sqlite import -i dump_bissap.csv to continue.
isql -X -w9999999999 -s'|' -U$USER -P$PASSWORD -H$HOST -S$SYSTEM -o /tmp/dump_bissap.csv << EOF
...
GO
EOF
$ ... # Manually execute the script
$ scp host:/tmp/dump_bissap.csv npl.csv
$ LOG_LEVEL=debug bissap -d npl.sqlite import -i npl.csv
INFO:src.file_import:Importing the database. Be patient, it may take 5 minutes or more.
...
DEBUG:src.file_import:Denormalizing the database.
$ bissap -d npl.sqlite -m 001 audit
BWDEVELOPER is vulnerable to 9 RCE(s).
BWDEVELOPER can read 17 sensitive tables.
BWDEVELOPER can execute 20 "juicy" transactions. (SE16, RSUDO, SM49, SE38, SE11, SM69, SU10, SU01, PFCG, SA38, SU01D, SM59, SU03, SU20, AL11, ST04, SUIM, SM01, DB02, SM04)
...
TEST2 can execute 1 "juicy" transactions. (SE11)
$ bissap -d npl.sqlite -m 1 audit -u 'SAP*'
SAP* is vulnerable to 9 RCE(s).
# CG3Z+SM36
> Go to CG3Z (File upload)
> Then create a new external command or edit an existing one
> Then set and save the OS command that you want to run
> Finally execute it using SM36 (Simple job selection/scheduler)
...
$ bissap -d npl.sqlite -m 1 audit --roles
ZDEVELOPER is vulnerable to 1 RCE(s).
ZDEVELOPER can execute 3 "juicy" transactions. (SU01, PFCG, SE38)
$ bissap -d npl.sqlite -m 1 audit --roles -u DEVELOPER
ZDEVELOPER is vulnerable to 1 RCE(s).
ZDEVELOPER can execute 3 "juicy" transactions. (SU01, PFCG, SE38)
(Da der Benutzer DEVELOPER nur eine Rolle hat, die zugleich die einzige angreifbare Rolle ist, ist es normal, dass die Ausgabe identisch ist.)
$ bissap -d npl.sqlite -m 1 audit -r ZDEVELOPER
ZDEVELOPER is vulnerable to 1 RCE(s).
# SE38
Go to SE38 (ABAP editor - create/edit/run ABAP program)
> Create a new ABAP program (but you will need a developer key if you don't have a "developer" account)
> Then execute it using SE38.
...
SM16 berechtigt sind$ bissap -d npl.sqlite -m 1 users by-auth -t SM16
TEST
SAP*
BWDEVELOPER
DDIC
DEVELOPER
DDIC zugewiesen sind$ bissap -d npl.sqlite -m 1 profiles of-user DDIC
SAP_ALL
S_A.SYSTEM
SAP_ALL auflisten$ bissap -d npl.sqlite -m 1 users by-profile -p SAP_ALL
BWDEVELOPER
DDIC
DEVELOPER
SAP*
TEST