Metasploit rpc api wrapper (nodejs)
JavaScript Makefile
Switch branches/tags
Nothing to show
Latest commit ee4009b Mar 13, 2016 @franck34 franck34 fix licence expression
Permalink
Failed to load latest commit information.
tests
.gitignore
Makefile
README.md fix and update readme Sep 9, 2015
apiMemo.txt
metasploitJSClient.js
package.json

README.md

msfnode

msfnode is a metasploit RPC client for nodejs

It make RPC calls using http/https webservices of msfrpcd daemon.

Metasploit API is really well done, it's not necessary to develop a wrapper for each API functions. Just RTMF : Metasploit Remote API Documentation

How to install

as usual ...

npm install msfnode

How to use

Note: do not forget to launch msfrpcd with this syntax if you want to run tests :

./msfrpcd -U myLogin -P myPassword -f
var metasploitClient = require('msfnode');


var onConnect = function(err,token) {
    if (err) {
        console.log(err.error_message);
        process.exit(0);
    }
    metasploitVersion();
}

var metasploitVersion = function() {

    // Do not care about token, it will automaticaly
    // be added as the second arguments
    //
    // The first value of the array is the function
    // you want to call. Full list is available
    // in metasploit remote api documentation

    var args = ['core.version'];

    client.exec(args,function(err,r) {

        if (err) return console.log('Error: '+err);

        console.log('-> Version: '+r.version);
        console.log('-> Api: '+r.api);
        console.log('-> Ruby: '+r.ruby);
    });
}


var client = new metasploitClient({
    login:'myLogin',
    password:'myPassword',
    host:'localhost',   // optional
    port:55553,         // optional
    protocol:'https',   // optional
    apiVersion:'1.0',   // optional
    apiPath:'/api/'     // optional
});

client.on('connected',onConnect);

Have good hacks !

The tests directory contains more examples.

Just by curiosity, if you are using this module, please star it !

Thank you

Special thanks to authors of theses nodejs modules :

and dailyjs ;)