
Un nouvel outil open-source pour auditer rapidement les autorisations SAP.
%%%###%%%%%%%%%%%%%%%%%%%%%%%%%%%.
% %
# %
.: #% *
* .===% . ::
% :*%%=====%********##%%%%%*: #
% %%%*= =====%============*#%%%-%
= % *= =====-================# % 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
% %*++**********%==+++%=+%*#%%*%%*****%**%:
% %*++**********%=+++#%%*%%+#%#%%%****%:
::#**++**********%=++++%%%#*%%%*++***%
* +%#************#%=***%*%%#*%*+++%
% . .:.:.:.:.:..:%=**#**%*%+%*##***%
% :: :.:.:.:.:.:%=****%**%++******%
.%%%%#+::::::=*%%%=****#.%+++**%:
Cet outil permet une analyse rapide d'une base de données SAP afin d'identifier les utilisateurs ou les rôles configurés avec des permissions dangereuses ou des combinaisons de permissions. Il est similaire à Bloodhound pour Active Directory.
Vous pouvez utiliser pipx :
$ pipx install git+https://github.com/synacktiv/bissap.git
Ou, en utilisant pip :
$ git clone https://github.com/synacktiv/bissap
$ python3 -m venv .venv && . .venv/bin/activate # Optional: Install in a venv
$ pip install .
Ou, si vous préférez utiliser les paquets Debian :
# 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 fonctionne en 3 étapes :
$ 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)
(Étant donné que l'utilisateur DEVELOPER n'a qu'un seul rôle, qui est également le seul rôle vulnérable, il est normal que la sortie soit la même.)
$ 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$ bissap -d npl.sqlite -m 1 users by-auth -t SM16
TEST
SAP*
BWDEVELOPER
DDIC
DEVELOPER
DDIC$ bissap -d npl.sqlite -m 1 profiles of-user DDIC
SAP_ALL
S_A.SYSTEM
SAP_ALL$ bissap -d npl.sqlite -m 1 users by-profile -p SAP_ALL
BWDEVELOPER
DDIC
DEVELOPER
SAP*
TEST