4 stable releases

1.2.0 May 18, 2023
1.1.0 Mar 29, 2022
1.0.1 Sep 12, 2021
1.0.0 Sep 8, 2021

#135 in HTTP client

35 downloads per month

Custom license

115KB
3K SLoC

rs-metasploit

Metasploit Rust License: GPL v3 crates.io

Overview

Rust Metasploit is a rust library used to make communication with Metasploit RPC Server.This module uses reqwest and rmp dependencies for communication.

Example

Let's have a glance at a simple code

use metasploit::client::Client;
let client=Client::new("127.0.0.1",55552,"user","password",true);
print(client.gettoken());

Installation

In your Cargo.toml add the following

[dependencies]
rust-metasploit="1.2.0"

How To Use

How to setup metasploit RPC Server

Metasploit RPC can be setup two ways

With msfrpcd

msfrpcd -U <username> -P <password> -p <port> -a <IP Address>

For example

msfrpcd -U user -P password -p 55552 -a 127.0.0.1

With msfconsole

msf6 > load msgrpc Pass=<password> Username=<username>

For example

msf6 > load msgrpc Pass=password Username=user

When you start metasploit RPC Server from console,the ssl value should be false.Like,

let client=Client::new("127.0.0.1",55552,"user","password",false);

How to use the library

All details about the library have been written in docs.rs

P.S: The latest update of the library do not have any fixed data types for the functions.So it is recommended to read the documentation before using the library.For more information regarding the datatypes read the metasploit documentation

v1.0.1

  • Removed unwanted parameters of modules
  • Changed String parameters to str

v1.1.0

  • Added async functions.

v1.2.0

  • Added both async and blocking feature
  • Changed data types from fixed to custom type.

Thanks To

Dependencies

~5–19MB
~277K SLoC