@mojolabs-id/prober v0.1.5
Prober
Prober simple TypeScript library for network scanning work with Fqdn,Url, IPv4, IPv6 and ASN
Prober can be used with both TypeScript and JavaScript.
Prober's source can be found on GitHub
Installation
Node.js
If you want to use Prober from within a Node.js environment, you can install it via npm.
npm install @mojolabs-id/prober
Linux
If you want to use Prober from linux command line without install Node.js , you can install it with command
curl -sk https://api.github.com/repos/mojolabs-id/prober/releases | grep browser_download_url | \
cut -d\" -f4 | egrep 'prober' -m1 | wget -i - -O /tmp/prober && chmod +x /tmp/prober && sudo mv /tmp/prober /usr/local/bin/proberUsage
How you get access to the above, depends on the module loading mechanism being used.
The examples below will show how
to access Prober using ES module mechanism with TypeScript in Node.js, using CommonJs module mechanism with
JavaScript in Node.Js.
ES module with TypeScript
Import what you need from @mojolabs-id/prober and use away
import { Prober ,Options } from '@mojolabs-id/prober';CommonJs with JavaScript
All external modules in @mojolabs-id/prober are exported. So you can require
('@mojolabs-id/prober') and then access the module you want to use in your application, or access the module in one go, while
requiring; as shown below:
const {Prober ,Options } = require('@mojolabs-id/prober');You can then make use of the imported module in your code
(async () => {
const prober = new Prober();
const options: Options = {
path: '/',
timeout: 5000,
host: 'www.sonymusic.com',
// host: '197.134.250.157',
// port: '22,80,3000-3010,5555'
port: '443'
};
prober.on('done', async (ctx, result) => {
console.log(result)
});
prober.on('error', (err,target) => {
//console.error(err)
});
prober.on('finish', (arg) => {
console.log('finish !',arg)
});
await prober.parse(options);
})();Command line
Usage: prober options
Example:
echo AS55688 | prober --stdin -p 80,443,3000Documentation
Examples
Overview
mojolabs@ubuntu:~# prober -h 127.0.0.1 --status --title -hh Content-Type --techs --nmap -e HTTP --port=21-23,80,3000,5432,3306,6379,4000
127.0.0.1:4000 | ERROR | Unable connect 127.0.0.1:4000 connect ECONNREFUSED 127.0.0.1:4000
127.0.0.1:6379 | ERROR | Unable connect 127.0.0.1:6379 connect ECONNREFUSED 127.0.0.1:6379
127.0.0.1:3000 | ERROR | Unable connect 127.0.0.1:3000 connect ECONNREFUSED 127.0.0.1:3000
127.0.0.1:23 | ERROR | Unable connect 127.0.0.1:23 connect ECONNREFUSED 127.0.0.1:23
127.0.0.1:22 | ERROR | Unable connect 127.0.0.1:22 connect ECONNREFUSED 127.0.0.1:22
127.0.0.1:21 | ERROR | Unable connect 127.0.0.1:21 connect ECONNREFUSED 127.0.0.1:21
127.0.0.1:3306 | SUCCESS | m
127.0.0.1:5432 | SUCCESS
127.0.0.1:80 | SUCCESS | 200 | Default Site | Bootstrap | text/html | HTTP/1.1 200 OK | {"service":"http","p":"OpenResty web app server","cpe":"a:openresty:ngx_openresty"}
127.0.0.1:80 | MATCH | 200 | Default Site | Bootstrap | text/html | HTTP/1.1 200 OK | {"service":"http","p":"OpenResty web app server","cpe":"a:openresty:ngx_openresty"} | HTTPLicense
Prober is under the Apache 2.0 License
Contributing
To discuss a new feature or ask a question, open an issue. Find the issue tracker here
Found a bug, and you want to provide a fix for it? Then feel free to submit a pull request. It will be appreciated if the changes made are backed with tests.
Change log
View latest releases here
v0.1.5
- fix log output
v0.1.4
- fix SSL routines:ssl3_get_record:wrong version number
v0.1.3
- refactor
v0.1.2
- fix option
v0.1.1
- fix asn validation
v0.1.0
- Initial release