libnmap 0.4.19 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CONTRIBUTING.md DELETED
@@ -1,109 +0,0 @@
1
- # Contributing to node-libnmap
2
-
3
- ## Code Contributions
4
-
5
- This document will guide you through the contribution process.
6
-
7
- ### Step 1: Fork
8
-
9
- Fork the project [on GitHub](https://github.com/jas-/node-libnmap) and check out your
10
- copy locally.
11
-
12
- ```text
13
- $ git clone git@github.com:username/node-libnmap.git
14
- $ cd node
15
- $ git remote add upstream git://github.com/jas-/node-libnmap.git
16
- ```
17
-
18
- Keep your local fork update to date using the `upstream` branch indicated in
19
- the above commands.
20
-
21
- #### Which branch?
22
-
23
- For developing new features and bug fixes, the `master` branch should be pulled
24
- and built upon.
25
-
26
- ### Step 2: Branch
27
-
28
- Create a feature branch and start hacking:
29
-
30
- ```text
31
- $ git checkout -b my-feature-branch -t origin/master
32
- ```
33
-
34
- The branch name should be descriptive about the fixes/features it will
35
- address.
36
-
37
- ### Step 3: Commit
38
-
39
- Make sure git knows your name and email address:
40
-
41
- ```text
42
- $ git config --global user.name "J. Random User"
43
- $ git config --global user.email "j.random.user@example.com"
44
- ```
45
-
46
- Writing good commit logs is important. A commit log should describe what
47
- changed and why. Follow these guidelines when writing one:
48
-
49
- 1. The first line should be 50 characters or less and contain a short
50
- description of the change prefixed with the name of the changed
51
- subsystem (e.g. "net: add localAddress and localPort to Socket").
52
- 2. Keep the second line blank.
53
- 3. Wrap all other lines at 72 columns.
54
-
55
- A good commit log can look something like this:
56
-
57
- ```
58
- subsystem: explaining the commit in one line
59
-
60
- Body of commit message is a few lines of text, explaining things
61
- in more detail, possibly giving some background about the issue
62
- being fixed, etc. etc.
63
-
64
- The body of the commit message can be several paragraphs, and
65
- please do proper word-wrap and keep columns shorter than about
66
- 72 characters or so. That way `git log` will show things
67
- nicely even when it is indented.
68
- ```
69
-
70
- The header line should be meaningful; it is what other people see when they
71
- run `git shortlog` or `git log --oneline`.
72
-
73
- Check the output of `git log --oneline files_that_you_changed` to find out
74
- what subsystem (or subsystems) your changes touch.
75
-
76
-
77
- ### Step 4: Rebase
78
-
79
- Use `git rebase` (not `git merge`) to sync your work from time to time (as
80
- mentioned in 'Step 1').
81
-
82
- ```text
83
- $ git fetch upstream
84
- $ git rebase upstream/master
85
- ```
86
-
87
- ### Step 5: Test
88
-
89
- Bug fixes and features **should come with tests**. Add your tests in the
90
- test directory. Look at other tests to see how they should be
91
- structured.
92
-
93
- ```text
94
- $ npm test
95
- ```
96
-
97
- ### Step 6: Push
98
-
99
- ```text
100
- $ git push origin my-feature-branch
101
- ```
102
-
103
- Go to https://github.com/yourusername/node-libnmap and select your feature
104
- branch. Click the 'Pull Request' button and fill out the form.
105
-
106
- Pull requests are usually reviewed within a few days. If there are comments
107
- to address, apply your changes in a separate commit and push that to your
108
- feature branch. Post a comment in the pull request afterwards; GitHub does
109
- not send out notifications when you add commits.
package/_config.yml DELETED
@@ -1 +0,0 @@
1
- theme: jekyll-theme-minimal
@@ -1,25 +0,0 @@
1
- /*!
2
- * libnmap
3
- * Copyright(c) 2013-2019 Jason Gerfen <jason.gerfen@gmail.com>
4
- * License: MIT
5
- */
6
-
7
- 'use strict'
8
-
9
- const nmap = require('../');
10
- const opts = {
11
- // Use 4, 8, 16 or 32 for class A & B (default is 16)
12
- // The larger the scan range the smaller the blocksize
13
- // maximum is 128 which is adequate for class C networks.
14
- blocksize: 8,
15
- range: ['scanme.nmap.org', '192.168.0.0/17']
16
- };
17
-
18
-
19
- nmap.scan(opts, function(err, report) {
20
- if (err) throw new Error(err);
21
-
22
- for (let item in report) {
23
- console.log(JSON.stringify(report[item], null, 2));
24
- }
25
- });
@@ -1,22 +0,0 @@
1
- /*!
2
- * libnmap
3
- * Copyright(c) 2013-2019 Jason Gerfen <jason.gerfen@gmail.com>
4
- * License: MIT
5
- */
6
-
7
- 'use strict'
8
-
9
- const nmap = require('../');
10
- const opts = {
11
- threshold: 2048, // maximum of 2048 child processes (depending on range & blocksize)
12
- range: ['scanme.nmap.org', '192.168.0.0/26']
13
- };
14
-
15
-
16
- nmap.scan(opts, function(err, report) {
17
- if (err) throw new Error(err);
18
-
19
- for (let item in report) {
20
- console.log(JSON.stringify(report[item], null, 2));
21
- }
22
- });
package/test/discover.js DELETED
@@ -1,50 +0,0 @@
1
- /*!
2
- * libnmap
3
- * Copyright(c) 2013-2019 Jason Gerfen <jason.gerfen@gmail.com>
4
- * License: MIT
5
- */
6
-
7
- 'use strict'
8
-
9
- const nmap = require('../');
10
- const timeout = 1024 * 1024 * 3;
11
- const chai = require('chai');
12
- const should = chai.should();
13
- const expect = chai.expect;
14
- const ifaces = require('os').networkInterfaces();
15
-
16
- describe('nmap', function () {
17
- context('discovery method', function () {
18
-
19
- this.timeout(timeout);
20
-
21
- it('validate report', function (done) {
22
-
23
- nmap.discover(function (err, report) {
24
-
25
- /* If 'subnet' doesn't exist in os.networkInterfaces() expect errors */
26
- for (let adapter in ifaces) {
27
- if (!ifaces[adapter][0].internal) {
28
- if (!ifaces[adapter][0].hasOwnProperty('subnet')) {
29
- try {
30
- done();
31
- }
32
- catch (error) {
33
- done(error);
34
- }
35
- }
36
- else {
37
- try {
38
- should.not.exist(err);
39
- should.exist(report);
40
- }
41
- catch (error) {
42
- done(error);
43
- }
44
- }
45
- }
46
- }
47
- });
48
- });
49
- });
50
- });
package/test/scan.js DELETED
@@ -1,50 +0,0 @@
1
- /*!
2
- * libnmap
3
- * Copyright(c) 2013-2019 Jason Gerfen <jason.gerfen@gmail.com>
4
- * License: MIT
5
- */
6
-
7
- 'use strict'
8
-
9
- const nmap = require('../');
10
- const timeout = 1024 * 1024 * 3;
11
- const chai = require('chai');
12
- const should = chai.should();
13
- const expect = chai.expect;
14
- const opts = {
15
- range: [
16
- '127.0.0.1',
17
- 'scanme.nmap.org',
18
- '::1'
19
- ],
20
- ports: '22,135'
21
- };
22
-
23
-
24
- describe('scan method', function () {
25
-
26
- context('reporting', function () {
27
- it('json', function (done) {
28
- this.timeout(timeout);
29
-
30
- nmap.scan(opts, function (err, report) {
31
- should.not.exist(err);
32
-
33
- report.should.be.a('object');
34
- done();
35
- });
36
- });
37
-
38
- it('xml', function (done) {
39
- this.timeout(timeout);
40
- opts.json = false;
41
-
42
- nmap.scan(opts, function (err, report) {
43
- should.not.exist(err);
44
-
45
- report.should.be.a('object');
46
- done();
47
- });
48
- });
49
- });
50
- });