metasploit/lib.rs
1//! This is a metasploit RPC library which makes a HTTP Connection with the Metasploit RCP Server.
2//! All the modules and functions are written on the basis of Metasploit RPC Guide.
3//! # Installation
4//!
5//! Rust-metasploit comes with two features. One is blocking and second is async.Deafult is set to be blocking
6//! Async features needs to be used when you are dealing with tokio crate too.
7//! For installation , add the follwing line in your Cargo.toml under dependencies
8//!
9//! ```
10//! [dependencies]
11//! rust-metasploit={ version="1.2.0",features=["blocking"] }
12//! ```
13//! # Rust-Metasploit
14//! As said earlier,this library is usedto connect with the msfrpcd server.
15//!
16//! ## Example
17//! ```
18//! use metasploit::client::Client;
19//! fn main() {
20//! let client=Client::new("127.0.0.1",55552,"msf","password",true);
21//! println!("{}",client.gettoken());
22//! }
23//! ```
24//!
25//! The above one is a simple example code where an connection is made with RPC Server and the token is printed
26//! There is also another example such as this one below
27//!
28//! ## Example
29//! ```
30//! use metasploit::client::Client;
31//! use metasploit::msf::auth;
32//! use serde::Deserializeas des;
33//!
34//! [#derive(des,Debug)]
35//! struct AddToken {
36//! pub result:String,
37//! }
38//! fn main() {
39//! let client=Client::new("127.0.0.1",55552,"msf","password",true);
40//! let token:AddToken=auth::add_token(client,"newtoken");
41//! println!("{}",token.result);
42//! }
43//! ```
44//!
45//! Here the data type of token variable can be a custom created struct which can phrase the response from the msfrpcd server.
46//! The data type struct should only have feilds that are defined by the server.Any other exception will lead to an error.
47//! Some of the data types are defined in the previous versions of rust-metaslpoit (They are not up-to-date with the latest release).
48//! For more information on the data types , you can refer the metasploit documentation.
49//!
50pub mod client;
51pub mod msf;
52pub mod error;
53pub mod value;