pub struct MsfRpcClient { /* private fields */ }Implementations§
Source§impl MsfRpcClient
impl MsfRpcClient
pub fn new( host: &str, port: u16, username: &str, password: &str, ssl: bool, ) -> Self
pub fn login(&mut self) -> Result<MSFLoginResult>
pub fn logout(&mut self)
pub fn is_authenticated(&self) -> bool
pub fn get_workspaces(&self) -> Result<MSFWorkspacesResult>
pub fn get_hosts(&self, workspace: Option<&str>) -> Result<MSFHostsResult>
pub fn check_host_exists( &self, address: &str, workspace: Option<&str>, ) -> Result<MSFHostCheckResult>
Sourcepub fn rpc_call(
&self,
method: &str,
params: &[MsgValue],
timeout_secs: u64,
) -> Result<MsgValue>
pub fn rpc_call( &self, method: &str, params: &[MsgValue], timeout_secs: u64, ) -> Result<MsgValue>
Generic authenticated RPC call: [method, token, ...params].
Used by the exploitation layer for module discovery, execution and job monitoring. Returns the raw msgpack response so the caller can map it to strongly typed models.
Sourcepub fn module_exists(&self, module_type: &str, name: &str) -> Result<bool>
pub fn module_exists(&self, module_type: &str, name: &str) -> Result<bool>
Verify that a module exists on the connected Metasploit instance.
module_type is exploit or auxiliary (the types the planner emits).
Sourcepub fn module_info(&self, module_type: &str, name: &str) -> Result<MsgValue>
pub fn module_info(&self, module_type: &str, name: &str) -> Result<MsgValue>
Fetch full module metadata (options, targets, rank, description, …).
Sourcepub fn module_execute(
&self,
module_type: &str,
name: &str,
options: &BTreeMap<String, String>,
payload: Option<&str>,
) -> Result<MsgValue>
pub fn module_execute( &self, module_type: &str, name: &str, options: &BTreeMap<String, String>, payload: Option<&str>, ) -> Result<MsgValue>
Execute a module. Returns a map containing job_id on success or an
error payload on failure.
Sourcepub fn job_list(&self) -> Result<MsgValue>
pub fn job_list(&self) -> Result<MsgValue>
List all running jobs. Response map: { "jobs": { "0": {...}, ... } }.
Sourcepub fn session_list(&self) -> Result<MsgValue>
pub fn session_list(&self) -> Result<MsgValue>
List current sessions. Response map: { "sessions": { "1": {...}, ... } }.
Trait Implementations§
Source§impl Clone for MsfRpcClient
impl Clone for MsfRpcClient
Source§fn clone(&self) -> MsfRpcClient
fn clone(&self) -> MsfRpcClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MsfRpcClient
impl RefUnwindSafe for MsfRpcClient
impl Send for MsfRpcClient
impl Sync for MsfRpcClient
impl Unpin for MsfRpcClient
impl UnsafeUnpin for MsfRpcClient
impl UnwindSafe for MsfRpcClient
Blanket Implementations§
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
Mutably borrows from an owned value. Read more