Skip to content

Commit b237a8a

Browse files
committed
Merge branch 'docupdate'
2 parents 50d5dd9 + 34e17e9 commit b237a8a

14 files changed

Lines changed: 198 additions & 58 deletions

File tree

MANIFEST

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# file GENERATED by distutils, do NOT edit
2+
CHANGES.txt
3+
LICENSE.txt
4+
README.rst
5+
TODO
6+
setup.py
7+
docs/diff.rst
8+
docs/index.rst
9+
docs/objects.rst
10+
docs/parser.rst
11+
docs/plugins_s3.rst
12+
docs/process.rst
13+
libnmap/__init__.py
14+
libnmap/diff.py
15+
libnmap/parser.py
16+
libnmap/process.py
17+
libnmap/reportjson.py
18+
libnmap/objects/__init__.py
19+
libnmap/objects/cpe.py
20+
libnmap/objects/host.py
21+
libnmap/objects/os.py
22+
libnmap/objects/report.py
23+
libnmap/objects/service.py
24+
libnmap/plugins/__init__.py
25+
libnmap/plugins/backendplugin.py
26+
libnmap/plugins/backendpluginFactory.py
27+
libnmap/plugins/mongodb.py
28+
libnmap/plugins/s3.py
29+
libnmap/plugins/sql.py

docs/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ libnmap is a python toolkit for manipulating nmap. It currently offers the follo
1111
- report: enables you to manipulate a parsed scan result and de/serialize scan results in a json format
1212
- diff: enables you to see what changed between two scans
1313
- objects: contains basic nmap objects like NmapHost and NmapService. It is to note that each object can be "diff()ed" with another similar object.
14+
15+
- report: contains NmapReport class definition
16+
- host: contains NmapHost class definition
17+
- service: contains NmapService class definition
18+
- os: contains NmapOSFingerprint class definition and some other classes like NmapOSMatch, NmapOSClass,...
19+
- cpe: contains CPE class defdinition
20+
1421
- plugins: enables you to support datastores for your scan results directly in the "NmapReport" object from report module
1522

1623
- mongodb: only plugin implemented so far, ultra basic, for POC purpose only
@@ -35,6 +42,7 @@ The different modules are documented below:
3542
process
3643
parser
3744
objects
45+
objects/*
3846
diff
3947
plugins_s3
4048

docs/objects.rst

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ This module contains the definition and API of all "NmapObjects" which enables u
1010
2. NmapHost
1111
3. NmapService
1212

13+
The three objects above are the most common one that one would manipulate. For more advanced usage, the following objects might be useful
14+
15+
1. NmapOSFingerprint (contains: NmapOSMatch, NmapOSClass, OSFPPortUsed)
16+
2. CPE (Common platform enumeration contained in NmapService or NmapOSClass)
17+
1318
The following structure applies by default:
1419

1520
NmapReport contains:
@@ -33,20 +38,3 @@ of the same type.
3338
If you read the code you'll see the dirty trick with id() which ensures that proper objects are being compared. The logic of diff will certainly change overtime but the API (i/o) will be kept as is.
3439

3540
For more info on diff, please check the module's `documentation <diff>_`.
36-
37-
NmapReport methods
38-
------------------
39-
40-
.. automodule:: libnmap.objects
41-
.. autoclass:: NmapReport
42-
:members:
43-
44-
NmapHost methods
45-
----------------
46-
.. autoclass:: NmapHost
47-
:members:
48-
49-
NmapService methods
50-
-------------------
51-
.. autoclass:: NmapService
52-
:members:

docs/objects/cpe.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
libnmap.objects.cpe
2+
===================
3+
4+
Using libnmap.objects.cpe module
5+
--------------------------------
6+
7+
TODO
8+
9+
CPE methods
10+
-----------
11+
12+
.. automodule:: libnmap.objects.cpe
13+
.. autoclass:: CPE
14+
:members:

docs/objects/nmaphost.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
libnmap.objects.host
2+
====================
3+
4+
Using libnmap.objects.host module
5+
---------------------------------
6+
7+
TODO
8+
9+
NmapHost methods
10+
----------------
11+
12+
.. automodule:: libnmap.objects
13+
.. autoclass:: NmapHost
14+
:members:

docs/objects/nmapreport.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
libnmap.objects.report
2+
======================
3+
4+
Using libnmap.objects.report module
5+
-----------------------------------
6+
7+
TODO
8+
9+
NmapReport methods
10+
------------------
11+
12+
.. automodule:: libnmap.objects
13+
.. autoclass:: NmapReport
14+
:members:

docs/objects/nmapservice.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
libnmap.objects.service
2+
=======================
3+
4+
Using libnmap.objects.service module
5+
------------------------------------
6+
7+
TODO
8+
9+
NmapService methods
10+
-------------------
11+
12+
.. automodule:: libnmap.objects
13+
.. autoclass:: NmapService
14+
:members:

docs/objects/os.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
libnmap.objects.os
2+
==================
3+
4+
Using libnmap.objects.os module
5+
-------------------------------
6+
7+
TODO
8+
9+
NmapOSFingerprint methods
10+
-------------------------
11+
12+
.. automodule:: libnmap.objects.os
13+
.. autoclass:: NmapOSFingerprint
14+
:members:
15+
16+
NmapOSMatch methods
17+
-------------------
18+
19+
.. autoclass:: NmapOSMatch
20+
:members:
21+
22+
NmapOSClass methods
23+
-------------------
24+
25+
.. autoclass:: NmapOSClass
26+
:members:
27+
28+
OSFPPortUsed methods
29+
--------------------
30+
31+
.. autoclass:: OSFPPortUsed
32+
:members:

docs/parser.rst

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
11
libnmap.parser
22
==============
33

4-
Using libnmap.parser module
5-
---------------------------
4+
Purpose of libnmap.parser
5+
-------------------------
66

77
This modules enables you to parse nmap scans' output. For now on, only XML parsing is supported. NmapParser is a factory which will return a NmapReport, NmapHost or NmapService object.
88
All these objects' API are documented.
9+
10+
The module is capable of parsing:
11+
12+
- a complete nmap XML scan report
13+
- an incomplete/interrupted nmap XML scan report
14+
- partial nmap xml tags: <host>, <ports> and <port>
15+
16+
Input the above capabilities could be either a string or a file path.
17+
18+
Based on the provided data, NmapParse.parse() could return the following:
19+
20+
- NmapReport object: in case a full nmap xml/dict report was prodivded
21+
- NmapHost object: in case a nmap xml <host> section was provided
22+
- NmapService object: in case a nmap xml <port> section was provided
23+
- Python dict with following keys: ports and extraports; python lists.
24+
25+
Using libnmap.parser module
26+
---------------------------
27+
28+
NmapParser parse the whole data and returns nmap objects usable via their documented API.
29+
930
The NmapParser should never be instanciated and only the following methods should be called:
1031

1132
- NmapParser.parse(string)

docs/process.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Raw results of the scans will be available in the following properties:
1818
- NmapProcess.stdout: string, XML output
1919
- NmapProcess.stderr: string, text error message from nmap process
2020

21+
To instanciate a NmapProcess instance, call the constructor with appropriate parameters
22+
2123
Processing of events
2224
--------------------
2325

@@ -112,9 +114,10 @@ NmapProcess methods
112114
.. autoclass:: NmapProcess
113115
:members:
114116

117+
.. automethod:: __init__
118+
115119
NmapTask methods
116120
-------------------
117121

118-
.. automodule:: libnmap.process
119122
.. autoclass:: NmapTask
120123
:members:

0 commit comments

Comments
 (0)