Go Pentester

Interacting with Metasploit

Early-stage Preparation:

Setting up your environment - start the Metasploit console as well as the RPC listener through the msgrpc module in Metasploit.

load msgrpc ServerHost=10.0.0.13 ServerPort=55552 User=msf Pass='dfas1342'

 To make the code more portable and avoid hardcoding values, set the environment variables.

 First, review the Metasploit API developer documentation at the official website https://metasploit.help.rapid7.com/docs/rpc-api.

session.list API method.

auth.login API method.

 auth.logout API method

Metasploit communicates using MessagePack, a compact and efficient binary format. So let's install a standard MessagePack package.

go get gopkg.in/vmihailenco/msgpack.v2

Create your directory structure.

相信未来 - 该面对的绝不逃避,该执著的永不怨悔,该舍弃的不再留念,该珍惜的好好把握。
原文地址:https://www.cnblogs.com/keepmoving1113/p/12364179.html