Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

D7.WinAPI:Сериализация дескриптора безопасности

16 views
Skip to first unread message

Dmytry Ginzburg

unread,
May 22, 2009, 3:09:00 PM5/22/09
to
������������, � ���������������(��), All!
���.. H���� ��������.. � ���, ��� �� ����� �����:
�ݣ ��� ���� ������. ���� ��������. ���� ���������� ���� ������, �������
���������� � ���̣����� DCOM-�������. ��������������, ��� ����������� �����
��������� ����� �� ��������� � ���������� ������. ���ޣ� ��, ��� ����� � ������
��������, ������ ����� ��������� ������, ��� ��-��, ������� ����� ���������
���� �������� � ����������. ����������, ��� ����������� ������ ���� ���������
�� ���������� ������ ����� ����� DCOM:
1)�����������: LocalSystem - ��������� ��������� ��������� � ��������� ������
������ - ��������� ��������� ���������, ��������� ������, ���̣���� ������,
���̣���� ���������.
2)������:LocalSystem � Self - ��������� ��������� ������, ������ - ���������
��������� � ���̣���� ������.
������ ���������. H������� ��� ����� �� ���� ������, ��������, ��� �ӣ
��������, � ����� �������� ��������� � ��������� ��� �� ������ LaunchPermission
� AccessPermission ����� AppID � ������� � ������� �������
ConvertSecurityDescriptorToStringSecurityDescriptor. ������� ���������
���������:
_!--==> � ���� Windows Clipboard ����������... <==--!_
const
AccessPermission='O:BAG:BAD:(A;;CCDCLC;;;PS)(A;;CCDC;;;SY)(A;;CCDCLC;;;SU)';
LaunchPermission='O:BAG:BAD:(A;;CCDCSW;;;SY)(A;;CCDCLCSWRP;;;SU)';
_!--==> � ���� Windows Clipboard �������������... <==--!_
��� ������. ������ � ������ BeforeInstall ����� ������� ��������� ������� �
������ c ������� ������� ConvertStringSecurityDescriptorToSecurityDescriptor,
������� ��������� ���
_!--==> � ���� Windows Clipboard ����������... <==--!_
function
ConvertStringSecurityDescriptorToSecurityDescriptor(StringSecurityDescr
iptor:PChar;StrringSDRevision:DWORD;out SecurityDescriptor:Pointer;out
SecurityDescriptorSize:DWORD):BOOL;stdcall;external 'advapi32.dll' name
'ConvertStringSecurityDescriptorToSecurityDescriptorA';
_!--==> � ���� Windows Clipboard �������������... <==--!_
��� ��� ������ �������� �������:
_!--==> � ���� Windows Clipboard ����������... <==--!_
for i:=0to appids.Count-1 do
if reg.OpenKey('\'+key+'\'+appids.Strings[i],false)then
begin
s:=reg.ReadString('');
if s='uniopc'then//H����� ������ ��� AppID
begin
if
ConvertStringSecurityDescriptorToSecurityDescriptor(PChar(AccessPermission),1
,AccessDescriptor,l)then
reg.WriteBinaryData('AccessPermission',AccessDescriptor,l);
ifConvertStringSecurityDescriptorToSecurityDescriptor(PChar(LaunchPermission),1
,LaunchDescriptor,l)then
reg.WriteBinaryData('LaunchPermission',LaunchDescriptor,l);
reg.CloseKey;
end;
end;
_!--==> � ���� Windows Clipboard �������������... <==--!_
H� ������-�� � ������ ������ ����, ��� ��� �����, ������������ �����, �.�. ���
������� ����������� �������� ����� ����� �������� ������ �����������, mmc
������������ ������� � AV, ������� ��������� �������� ����������� ������������
�� �������. ������� MSDN, � ���� �������, ��� ���� � ���, ��� ���������� ������
��������� � ���������� �������, � ������� ���������� self-relative. H� ��������
������ ��������� ����������� � ������� ����������� c �������
GetSecirityDescriptorControl, � ������� ��� $8004, �.�. �� ��� � �������� �
���� self-relative. ��� �� ��� ��������� �������� � ������ ��� ������ ��
���������� ���� � ��������?
����� ��� ����� ����������, All.�������.

0 new messages