%%%###%%%%%%%%%%%%%%%%%%%%%%%%%%%.
% %
# %
.: #% *
* .===% . ::
% :*%%=====%********##%%%%%*: #
% %%%*= =====%============*#%%%-%
= % *= =====-================# % 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
% %*++**********%==+++%=+%*#%%*%%*****%**%:
% %*++**********%=+++#%%*%%+#%#%%%****%:
::#**++**********%=++++%%%#*%%%*++***%
* +%#************#%=***%*%%#*%*+++%
% . .:.:.:.:.:..:%=**#**%*%+%*##***%
% :: :.:.:.:.:.:%=****%**%++******%
.%%%%#+::::::=*%%%=****#.%+++**%:
该工具支持对 SAP 数据库进行快速分析,以识别配置了危险权限或危险权限组合的用户或角色。它类似于用于 Active Directory 的 Bloodhound。
你可以使用 pipx:
$ pipx install git+https://github.com/synacktiv/bissap.git
或者使用 pip:
$ git clone https://github.com/synacktiv/bissap
$ python3 -m venv .venv && . .venv/bin/activate # Optional: Install in a venv
$ pip install .
或者,如果你更倾向于使用 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 通过 3 个步骤工作:
$ 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)
(由于用户 DEVELOPER 只有一个角色,而该角色也是唯一易受攻击的角色,因此输出相同是正常的。)
$ 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