pub struct SamrAliasClient<'a> { /* private fields */ }Expand description
SAMR bound over an open \samr pipe, with both the upstream calls and the alias ones.
Implementations§
Source§impl<'a> SamrAliasClient<'a>
impl<'a> SamrAliasClient<'a>
Sourcepub async fn bind(client: &'a mut SmbClient, file_id: [u8; 16]) -> Result<Self>
pub async fn bind(client: &'a mut SmbClient, file_id: [u8; 16]) -> Result<Self>
Bind SAMR. Like dcerpc’s SamrClient::bind, but keeps the pipe reachable so we can call arbitrary opnums.
Sourcepub async fn connect(&mut self, server: &str) -> Result<SamrHandle>
pub async fn connect(&mut self, server: &str) -> Result<SamrHandle>
SamrConnect2 -> server handle.
Sourcepub async fn open_domain(
&mut self,
server: &SamrHandle,
sid: &Sid,
) -> Result<SamrHandle>
pub async fn open_domain( &mut self, server: &SamrHandle, sid: &Sid, ) -> Result<SamrHandle>
SamrOpenDomain on an arbitrary domain SID -> domain handle.
Sourcepub async fn open_builtin(&mut self, server: &SamrHandle) -> Result<SamrHandle>
pub async fn open_builtin(&mut self, server: &SamrHandle) -> Result<SamrHandle>
SamrOpenDomain on S-1-5-32, the BUILTIN domain that holds the aliases.
Sourcepub async fn machine_sid(
&mut self,
server: &SamrHandle,
) -> Result<Option<(String, Sid)>>
pub async fn machine_sid( &mut self, server: &SamrHandle, ) -> Result<Option<(String, Sid)>>
The host’s own domain SID, used as the local-member filter prefix.
SAMR exposes two domains: Builtin, plus one named after the machine (member host) or the domain (DC). We look up the second. Mirrors SharpHound’s server.GetMachineSid(), and avoids needing LSA or LDAP.
On a DC this is the domain SID, see is_domain_controller.
Sourcepub async fn open_alias(
&mut self,
domain: &SamrHandle,
rid: u32,
) -> Result<SamrHandle>
pub async fn open_alias( &mut self, domain: &SamrHandle, rid: u32, ) -> Result<SamrHandle>
SamrOpenAlias(rid) with ALIAS_LIST_MEMBERS only -> alias handle.
Sourcepub async fn get_members_in_alias(
&mut self,
alias: &SamrHandle,
) -> Result<Vec<Sid>>
pub async fn get_members_in_alias( &mut self, alias: &SamrHandle, ) -> Result<Vec<Sid>>
SamrGetMembersInAlias -> the member SIDs.
Sourcepub async fn close_handle(&mut self, handle: &SamrHandle) -> Result<()>
pub async fn close_handle(&mut self, handle: &SamrHandle) -> Result<()>
SamrCloseHandle, best effort: a leaked handle dies with the pipe.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for SamrAliasClient<'a>
impl<'a> !Sync for SamrAliasClient<'a>
impl<'a> !UnwindSafe for SamrAliasClient<'a>
impl<'a> Freeze for SamrAliasClient<'a>
impl<'a> Send for SamrAliasClient<'a>
impl<'a> Unpin for SamrAliasClient<'a>
impl<'a> UnsafeUnpin for SamrAliasClient<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more