1.0.0 • Published 5 years ago

@tiaanduplessis/scanports v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@tiaanduplessis/scanports

package version package downloads standard-readme compliant package license make a pull request

Modest port scanner

Table of Contents

Install

This project uses node and npm.

$ npm install @tiaanduplessis/scanports
$ # OR
$ yarn add @tiaanduplessis/scanports

Usage

const scanPorts = require('@tiaanduplessis/scanports')

scanPorts({ host: 'github.com', timeout: 5000 })
  .then(data => {
    const openPorts = data.filter(current => current.open)
    console.log('Open Ports', openPorts)
    // Open Ports [ { port: 22,
    //     open: true,
    //     data:
    //      <Buffer 53 53 48 2d 32 2e 30 2d 62 61 62 65 6c 64 2d 37 39 32 63 33 66 34 31 0d 0a> },
    //   { port: 80, open: true, data: null },
    //   { port: 443, open: true, data: null } ]
  })
  .catch(console.error)

Using the CLI:

$ scanports --host=localhost --start=1 --end=1000 --timeout=5000

Contribute

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am "Add some feature"
  3. Push to the branch: git push origin my-new-feature
  4. Submit a pull request

License

MIT

1.0.0

5 years ago