Thông tin tài liệu:
Tài liệu tham khảo dành cho giáo viên, sinh viên chuyên ngành công nghệ thông tin - Kỹ thuật hack từ căn bản đến nâng cao.
Nội dung trích xuất từ tài liệu:
Đổi passAdmin bằng VB.ĐổipassAdminbằngVB:trangnàyđãđượcđọc lầnCácbạnthửnghiêncứuvàhoànthiệnFunctionnàynhé!PublicFunctionChangePassword(UserNameAsString,NewPasswordAsString)AsBooleanEXAMPLE:ChangePasswordAdministrator,adminpasswordDimconnAsNewADODB.ConnectionDimrsAsADODB.RecordsetDimoRootAsIADsDimoDomainAsIADsDimsBaseAsStringDimsFilterAsStringDimsDomainAsStringDimsAttribsAsStringDimsDepthAsStringDimsQueryAsStringDimuserAsIADsUserOnErrorGoToerrhandler:SetoRoot=GetObject(LDAP://rootDSE)workinthedefaultdomainsDomain=oRoot.Get(defaultNamingContext)SetoDomain=GetObject(LDAP://&sDomain)sBase=OnlygetusernamerequestedsFilter=(&(objectCategory=person)(objectClass=user)(name=_&UserName&))sAttribs=adsPathsDepth=subTreesQuery=sBase&;&sFilter&;&sAttribs&;&sDepthconn.Open_DataSource=ActiveDirectoryProvider;Provider=ADsDSOObjectSetrs=conn.Execute(sQuery)WithrsIfNot.EOFThenSetuser=GetObject(rs(adsPath))user.SetPasswordNewPasswordChangePassword=TrueEndIfEndWitherrhandler:OnErrorResumeNextIfNotrsIsNothingThenIfrs.State0Thenrs.CloseSetrs=NothingEndIfIfNotconnIsNothingThenIfconn.State0Thenconn.CloseSetconn=NothingEndIfSetoRoot=NothingSetoDomain=NothingEndFunction Error!Unknownswitchargument.