https://github.com/eviltik/msfnode
Metasploit rpc api wrapper (nodejs)
https://github.com/eviltik/msfnode
Last synced: 10 months ago
JSON representation
Metasploit rpc api wrapper (nodejs)
- Host: GitHub
- URL: https://github.com/eviltik/msfnode
- Owner: eviltik
- Created: 2013-05-27T16:30:54.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2016-03-13T08:17:48.000Z (over 10 years ago)
- Last Synced: 2025-04-11T05:18:12.809Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 46
- Watchers: 6
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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](https://community.rapid7.com/search.jspa?view=content&resultTypes=document&dateRange=all&q=Remote+API&rankBy=relevance&contentType=document&containerType=&container=&containerName=&userID=&numResults=15 "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 :
* [msgpack5](https://github.com/mcollina/msgpack5 "msgpack")
* [qjobs](https://github.com/franck34/qjobs "qjobs")
and [dailyjs](http://dailyjs.com/) ;)