RPC, DCOM ActiveX RPC - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

RPC, DCOM ActiveX RPC

Description:

??????? ?? ??????? ?? cookies , ?????????? ?? ? ??????? ? ?? ???????? ?????? ? ... ?? ????? unsafe, ?????? ? ?????? ? ????????????? ?? untrusted script or Web page. ... – PowerPoint PPT presentation

Number of Views:157
Avg rating:3.0/5.0
Slides: 19
Provided by: nak2
Category:
Tags: activex | dcom | rpc | untrusted

less

Transcript and Presenter's Notes

Title: RPC, DCOM ActiveX RPC


1
?????? ? RPC, DCOM ? ActiveXRPC
  • ? RPC ?? ????????? 2 ???? handles binding ?
    context. ??????? ?? ??????? ?? cookies ,
    ?????????? ?? ? ??????? ? ?? ???????? ?????? ?
    ????? ?????? ??? ???????.
  • ????????? ? RPC ????? ??
  • ????? ??????? malformed ????? ??? RPC
    end-point, ?? ?? ?? ??????????
  • ????????, ????? ???? ?? ??????? ????
  • 2. ?????????? ????? ?? ?????? ??/??? ?????? ?
    ????? ?????? ?? ???????? ????? ? ?? ????????
  • 3. ????? ???????? ?????????? ????? ? ??
    ??????????.

2
?????? ????????? /robust MIDL ???? ??
??????????? ? Windows 2000 ? ??????. ??????
run-time checking ??? ???????????? ? ??????
?????? Any malformed packet is rejected by the
RPC marchaling engine ????????? ???????
range ? IDL ???? ?? ?????????? ???????????? ??
??????? ????????? ??? ??????.void Message(in,
range(0,1023) long lo, in, range(0,1023)
long hi, size_is(lo, hi) char ppData)
???????? ?? ????????? ? /robust ??????????
???????????? ??? ?????????. ??? ???? ??? ?????? ?
????? ?????. ???? ??????? ??????? ??? ? ? ??. ? ?
???????????????? ? ??????? status
RpcBindingSetAuthInfo( phone_Handle, , RPC_
C_AUTHN_LEVEL_PKT_PRIVACY, RPC_C_AUTHN_GSS_NEGO
TIATE,.)
3
???????? AuthnLevel (RPC Security Setting
Levels) RPC_C_AUTHN_LEVEL_DEFAULT ??
???????????? ? ????????? ?? ???????RPC_C_AU
THN_LEVEL_NONE RPC_C_AUTHN_LEVEL_CONNECT ????????
????? ??? ????? ????????? ???
??????RPC_C_AUTHN_LEVEL_CALL ??? ?????? ??
????? RPC call.RPC_C_AUTHN_LEVEL_PKT ?????????
???? ?????? ????? ?? ?? expected
senderRPC_C_AUTHN_LEVEL_PKT_INTEGRITY ?????
??-????, ???????? ???? ??????? ??
????????????RPC_C_AUTHN_LEVEL_PKT_PRIVACY
????? ??-???? ?????????? ?? ????????????
??????? ? ???????? ???????????? ??????????
??????(???. ?? ?????????? ?? ?????? ??? binding
handle, ????? ?? ??????? I ????????? ??? ?????
RPC ?????????. )
4
????????? ? ????????? ?? ?????? ?? ???????????
client connectionsecurity settings, ?????? ?? ??
????????? authentication handler ? ?
???????status RpcServerRegisterAuthInfo( ..,
RPC_C_AUTHN_GSS_NEGOTIATE,.)???????????
???????? ??? ?? ??????????? ???????.????????
??????? ??????????? ???. ?? ?????????????, ??????
? ?.?. ?? cli?nt binding handle ?
RpcBindingInqAuthClient() ??????????? ?
???????????? ?????????// RPC ???????? ?-?? ?
????????void Message( handle_t hPhone, unsigned
char szMsg) DWORD dwAuthn RPC_AUTHN_HANDLE
hPrivs RPC_STATUS status RpcBindingInqAuthCl
ient( hPhone, hPrivs, dwAuthn,) if(sta
tus ! RPC_S_OK) printf( )
RpcRaiseException(ERROR_ACCESS_DENIED)
5
// ???????? ?? ???? if( dwAuthn lt
RPC_C_AUTHN_LEVEL_PKT) .. // ?? ?? ??
????????? ??????? ?? ????????????? ?? //
????????? ??????, ?? ?????? ??????, ?????????????
?? // ?? ????????? ?? ??????? ?
????????? // RPC_STATUS RPC_ENTRY
RpcImpersonateClient( // RPC_BINDING_HANDLE
BindingHandle ) if(RpcImpersonateClient(.. )
! RPC_S_OK) .. GetUserName( szName) //
RpcRevertToSelf() end impersonation and
reestablish process // security
identity. RpcRevertToSelf()
6
??????????? strict_context_handle??????? ? ACF
?????? ???????? ?????? 1 context handle ??
?????? ? gt 1 ??????????. ??? ?? ??????? ???
??????? ????????? ?? ??????????? ????? ? ?? ?
????????? ?? ?? ?????? ??? ?????????? ?? ??????
?? ???? ?????????. ??? ?????? ?? ?????? ????
IDL ????? interface PrinterOperations typedef
context_handle void PRINTER_CONTEXT void
OpenPrinter(in, out PRINTER_CONTEXT
ctx) void UsePrinter( in PRINTER_CONTEXT
ctx) . interface FileOperations typede
f context_handle void FILE_CONTEXT void
OpenFile(in, out FILE_CONTEXT ctx) void
UseFile( in FILE_CONTEXT ctx) .
7
??? ????? ???????? printer context ??? ??????
??????????? ?????, ??? ???????? ?? ????? RPC
??????? ?????? ?????? ? ???????????????void
UseFile(FILE_CONTEXT ctx) CFileManipulator
cFile (CFileManipulator) ctx . ????
??????? ?? ???????? ????void ctxAttackerOpenP
rinter(ctxAttacker)UseFile(ctxAttacker) //
???????? ?? ??????? PRINTER_CONTEXT?? ?? ??
??????? ????, ? ACF ????? explicit_handle,
strict_context_handleinterface
PrinterOperationsinterface FileOperations??
???? RPC runtime ?? ????????? ???? ????? context
handle ??????? ?? PrinterOperations ? ???????? ??
PrinterOperations ? ?????? ?? FileOperations
8
?? ?????????? ?? ???????????? ?? context handles,
????? ???? ?? ??????? ????? ?? ? ????????? ? ????
?? ? ????????? (?.?. ??????????? ?? ??????) ?? ??
???????? ?? ?????? ????????. ????? ????????
??????? ??????? ??? ???? ?????? ? context handle
? ???????, ?? ?????? ???????? ?????????? ?? ?????
handle ???? ?????? ???????????. ????????? ???????
?????????????? ????? ????? ????? ???????? ? ?? ??
???????? ???? , ???????? ????? (????? context
handle info). RPC ?? ?????? ?? ?????????
context handle ? ??????? ?? 1 ??????? ????? (
???? ?????? ??????? ???????? ????????? ???? ??
????????? ?????????? ? ??????? ?? ?????), ?? RPC
?? ????????? context handle ???? ?? 1 security
session. ??? ? ??????????? ?? ?????.
9
??????????? security callback RPC
???????RpcServerRegisterIf2() ???
RpcServerRegisterIfEx() ?????? RpcServerRegisterIf
() ?? ?????????? ???????? ??? RPC ??????????. ?
??? ???????????? ?-?? ? RPC ???????, ????
???????? ??? ?? ?-?? ?????? ?? RPC runtime,
????? ????????? ???? ???????? ??? ????? ?? ??????
RPC ?-???? ?? ???? ?????????.????? ?????????
?????? ?? ?? ?????? ???? ??? RPC_C_AUTHN_LEVEL_PK
T ??? ??-?????. ?????? ?? ???, ??????????
????????? ?? ??????, ???? ? ?????????? ???? ??
?????????..// security callback ?-???? ??
???? ?????? RPC ?-?? ? ????????RPC_STATUS
SecurityCallBack( RPC_IF_HANDLE idIF, void ctx)
RPC_AUTHZ_HANDLE hPrevs DWORD dwAuthn
RPC_STATUS status RpcBindingInqAuthClient(
ctx, hPrivs, dwAuthn,) if(status !
RPC_S_OK) / error / // ?????????
?????? ?? ?????? if( dwAuthn lt
RPC_C_AUTHN_LEVEL_PKT) / error /
. return RPC_S_OK .void main()
.status RpcServerRegisterIfEx(,
SecurityCallBack)
10
??????? ?? ????????? RPC Servers ? ???
??????RPC ? ???????? (? ?????????????) ??
???????? ???????? ???? ????? ?? ????. ???? ???
????????? ???????? RPC ?????? ? ? ??? ?????? ?
????? RPC ???????, ?????? ?? ?????? ?? ???????
?????????????????? ????????my.exe my
.exe RPC1 RPC2 RPC3 RPC1 RPC2 RPC3pipe
LRPC Sockets LRPC pipesLRPCsockets
.. ??? ??? ???????? ??? LRPC, ???? ?? ????? ??
??? ???????? ? ??? ?????? ??? sockets.???????????
? ????????? ? ? ????? ??????.???????????? ?? ???
???????? ? ????? ???????? RpcBindingToStringBin
ding() ? ???? ???? RpcStringBindingParse(),
????? ?????? ??????? ?? binding ???? ? ?? ???
?????? ?? ???????? ????? ?? ?????????
11
????????? ? DCOM??? ? ??????? ?? RPC, ????? ????
?? ??????? COM ?????????? ?? ?? ?????????? ?
?????. ???????????? ?????? ?? RPC ? ??????? ?
???.1. ????????? ?? COM ? DCOM ?? ????????
????(Distributed COM Configuration Properties)
?????? ???Microsoft Management
Console.?????????? ????????? ?? ??????? ?? COM ?
DCOM ??????
12
on/off ?? ?????? ??????????- ?????????? ?? COM
Internet Service ?? ???? ???????? (?????????? RPC
?/?? HTTP)- Authentication level ????? ??????
???? RPC security level- Provide additional
security for reference tracking ????? ???????
??????? ? ??????? ???? ?????? (?????) ?? ????
IUnknownRelease() ?? COM ??????.- ?????????
?? access permissions ?? ??????? ???????????
??? ????? ?? ????? ??????? COM ?????, ??? ?????
?? ????????? ????? (launch permissions), ???
????? ?? ?????????? configuration ??????????
(configuration permission)- ??? ????????? ??
?????????? ?? DCOM ?? ?? ???????? (????? ? ???
???????).?????????? ?? ??????? ?????????
??????????? ?? firewall (??? COM ?? ?????????
???? ??????? ?????) administrator. ???????? ? ?
????????? ???? firewall ? ????? connection ????
?? ?? ??????? ? 1 ??????, ?? ?? ? ? ?????????.
13
2.????????? ?? ??????????? ?? ???? ???????????
??????? ????????? ?? Windows ? Application Tab ?
????????? ?????????? ?? ????????? ?? ????
??????????.?????? ?????? ? ???? ?????????? (???
???? DLL) ?????? ?? ???? ??????? ??????????. ?
???????? ?????? ????????? ? ??????? dll ?
?????? DCOM ???????????? ?? ?? ????????? ???
???????? user contexts.3. DCOM Security
????????? (? ?????? ? ? ??????) ?
????CoInitializesecurity() // ? ?? ? ? ??????.
????????? ?? - ??? ??? ?????? ?? ????? ?
???????. (?????? ????????, ?? ???? ?? ??
???????)- ???? ?? ?????? (RPC security settings
levels)IClientSecuritySetBlanket() // ?
??????. (????????? ????????? ?? ????? ??
security ? ?? ?? ??????? ?????????.)
14
????????? ??? ActiveX ??????????????? ??
???????? ?????? ????? ??? ???? ?? ???????? ? HTML
? ????????? ?? ????????? ?????. ??? ???? e-mail
??????? ?????????? ???????????? ?? HTML
?????????? ?????, ?? ActiveX ????? ?? ?? ????????
? ? ??? (??? ?????????? ????????? ?? ?? mail
application). Outlook 2002 ?? ??????? ??
???????????? ActiveX ???? ???? ??
mail.??????????????? ?? ???????? ?? ????????
???? - safe for initialization (SFI) ???
?????????????, ????????? ??????? ????? (???????
??? ??????????). ?????? IPersist ???????
??????????.??????????? ?? ????? ????? ?? ??
?????????. ??? ? ??????????? , ?? ?? ???? ??
??? ???????? ? ???????????? ????? , ??????? ??
SFI ???????- safe for Scripting(SFS)
??????????? ? ?? ????????? ? script ??? ?? ????
?? ???????? ????????, ??????? ?? ?? ????????.
15
?????? ?? ??????? ????? ?? ? SFS ??????? ??
?????????? ???????? ? ???????????? ?? download ??
????????????? ?? ?????. ????????? ??? ?????
Print() ?? ??????????? ?? ?????????? ???? ??
?????????? ???????. ???????????? ??? ??? ??????
?? ??????? ?? ?????????? ? ? ???? ????? ?? ??
????????? ( ?? ???? ????????) ? ????????? ???????
?? user, ??? ?????? ?????????????, ????? ? safe
(?????? ?????? ?? ???????? ?? user), ???? ??
????? unsafe, ?????? ? ?????? ? ????????????? ??
untrusted script or Web page. (????. Excel ?
trusted tool, ?? ???? ???????? ??????, ????? ??
?? ????????? ?????? automation ?-?? ?? ?????????
?? ????, ????????)??? ?? ????????? ???????? ??
???? SFI ??? SFS msdn.microsoft.com --gt safe
for scripting
16
???? ??????? ? SFS ??? SFI???????? ??????
events, methods, properties ?? ????????. ???
????? ?? ??? ??- ????? ?????? ?? ?????????? ??
???????? ???????? ??? ????? (??????? ?
?????????)- ??????? ? ?? ?????? ? ?????
?????????? ???? keys, passwords, documents-
?????????? ??? ???? ?????????? ?? ????????
???????? ??? ?????- ???? ?? ????? ?????????? ?
??????????- ????????? ?????????? ?????, ??????,
?????, ??????? ????????????- ?????????
??????????? ?????? ???????? ??????????,
??????????? ?????????? ?? ???????????????? ????
?? ?? ??????? ???? SAFE.????? ? ? ???????? ??
??????????? IObjectSafety. ??? ?????????
??????????? (????. IE) ?? ??????? ????? ????? ??
safety
17
????? ? ?? ?????????? ???????????? ????? ???????
?? ???? ?? ?? ??????? ? script ???? ?? ?????????
(??????? ) ??????.( ????. ?? ?? ?????? ???? ??
web ???????? ?? myshopping.com ??????.)????
???? ?? ?? ???????- ? ?????????? ??
IObjectWithSite , ????? ??? ????? SetSite(),
????? ?? ?????????? (????. IE ?? ????) ? ?????
???????? ??? IUnknown ?? ??????????. - ????
???? ?????? ?? ????????? ??????
??????. pUnk--gtQueryInterface(IID_IServiceProvide
r, pSP) pSP--gtQueryService(IID_IWebBrouser2,
pWB) pWB--gtgetLocationURL(bstrURL)-
?????????? ? ???? ?? ???? bstrURL ? ????? ??
????????? URL. ??? ??? ???????? ??????? ???????
???? ?? ? ???????? ????? ?? ??????? ??
www.myshopping.com.foo.com!!! ? Wininet.dll ???
???????????? ??????? InternetCrackUrl(), ?????
????? ????????? host name ?? URL.
18
???????? ? ?????????? SiteLock http//msdn.micro
soft.com/downloads/samples/internet/components/sit
elock/default.asp ??????????? ???? 2003, ?????
????????? ????????? ?? ??????? ActiveX ????????
?? Web sites. ??? ??? ??????? ?? ????????????
??????? ?? ???????? ???? ?? ?????? ?? ???????,
????? ?????????? ?????? ?? ??????? ???????? ??
?????? ????. ??? ???????, ??????????? ?????????
?? ???????? ? ?? ????? ?? ???????? ????? ?
???????? ??????? ? ??.
Write a Comment
User Comments (0)
About PowerShow.com