mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
update Doc + test + sample for token.py
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
(cmd) python debug\debugger_on_setup.py
|
||||
== With on_setup ==
|
||||
Setup called: <WinProcess "whoami.exe" pid 29796 at 0x4ccb790>
|
||||
<whoami output>
|
||||
Process exit: <WinProcess "whoami.exe" pid 29796 (DEAD) at 0x4ccb790>
|
||||
|
||||
== Without on_setup ==
|
||||
Exception: EXCEPTION_BREAKPOINT(0x80000003L)
|
||||
<whoami output>
|
||||
Process exit: <WinProcess "whoami.exe" pid 33328 (DEAD) at 0x4ccbdb0>
|
||||
@@ -0,0 +1,21 @@
|
||||
(cmd) python token\token_demo.py
|
||||
Our process token is <Token TokenId=0x3f1f98fd Type=TokenPrimary(0x1L)>
|
||||
Retrieving some infos
|
||||
Username: <hakril>
|
||||
User: <PSID "S-1-5-21-184905214-2723199098-2761450773-1001">
|
||||
- lookup : ('WILLIE', 'hakril')
|
||||
Primary group: <PSID "S-1-5-21-184905214-2723199098-2761450773-513">
|
||||
- lookup : ('WILLIE', 'Aucun')
|
||||
|
||||
Token Groups is <TokenGroups count=15>
|
||||
First group SID is <PSID "S-1-5-21-184905214-2723199098-2761450773-513">
|
||||
Some sid and attributes:
|
||||
- S-1-5-21-184905214-2723199098-2761450773-513: 7
|
||||
- S-1-1-0: 7
|
||||
- S-1-5-114: 16
|
||||
|
||||
Duplicate token is <Token TokenId=0x3f1fac85 Type=TokenImpersonation(0x2L) ImpersonationLevel=SecurityImpersonation(0x2L)>
|
||||
Enabling <SeShutDownPrivilege>
|
||||
Current thread token is <None>
|
||||
Setting impersonation token !
|
||||
Current thread token is <Token TokenId=0x3f1fac85 Type=TokenImpersonation(0x2L) ImpersonationLevel=SecurityImpersonation(0x2L)>
|
||||
@@ -0,0 +1,61 @@
|
||||
Token
|
||||
"""""
|
||||
|
||||
.. module:: windows.winobject.token
|
||||
|
||||
This module expose the :class:`Token` object that can be primarily retrieved through:
|
||||
|
||||
* :data:`windows.winobject.process.WinProcess.token`
|
||||
* :data:`windows.winobject.process.WinThread.token`
|
||||
* :data:`windows.current_process.token <windows.winobject.process.CurrentProcess.token>`
|
||||
* :data:`windows.current_thread.token <windows.winobject.process.CurrentThread.token>`
|
||||
|
||||
.. note::
|
||||
|
||||
See sample :ref:`token_sample`
|
||||
|
||||
|
||||
Token
|
||||
'''''
|
||||
|
||||
.. autoclass:: Token
|
||||
:members:
|
||||
:inherited-members:
|
||||
|
||||
|
||||
TokenGroups
|
||||
'''''''''''
|
||||
|
||||
.. autoclass:: TokenGroups
|
||||
:show-inheritance:
|
||||
:members:
|
||||
:inherited-members:
|
||||
|
||||
|
||||
|
||||
TokenPrivileges
|
||||
'''''''''''''''
|
||||
|
||||
.. autoclass:: TokenPrivileges
|
||||
:show-inheritance:
|
||||
:special-members: __getitem__, __setitem__
|
||||
:members:
|
||||
:inherited-members:
|
||||
|
||||
|
||||
TokenSecurityAttributesInformation
|
||||
''''''''''''''''''''''''''''''''''
|
||||
|
||||
.. autoclass:: TokenSecurityAttributesInformation
|
||||
:show-inheritance:
|
||||
:members:
|
||||
:inherited-members:
|
||||
|
||||
|
||||
TokenSecurityAttributeV1
|
||||
''''''''''''''''''''''''
|
||||
|
||||
.. autoclass:: TokenSecurityAttributeV1
|
||||
:show-inheritance:
|
||||
:members:
|
||||
:inherited-members:
|
||||
Reference in New Issue
Block a user