Skip to content

Commit 7e7ca42

Browse files
committed
updated doc
1 parent 6be7a97 commit 7e7ca42

8 files changed

Lines changed: 125 additions & 19 deletions

File tree

docs/cpe.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.cpe module
5+
--------------------------------
6+
7+
TODO
8+
9+
CPE methods
10+
-----------
11+
12+
.. automodule:: libnmap.objects.cpe
13+
.. autoclass:: CPE
14+
:members:

docs/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/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/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.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/os.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
.. automodule:: libnmap.objects.os
20+
.. autoclass:: NmapOSMatch
21+
:members:
22+
23+
NmapOSClass methods
24+
-------------------
25+
26+
.. automodule:: libnmap.objects.os
27+
.. autoclass:: NmapOSClass
28+
:members:
29+
30+
OSFPPortUsed methods
31+
--------------------
32+
33+
.. automodule:: libnmap.objects.os
34+
.. autoclass:: OSFPPortUsed
35+
: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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ 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+
.. automodule:: libnmap.process
23+
.. autoclass:: NmapProcess
24+
:members: __init__
25+
26+
2127
Processing of events
2228
--------------------
2329

0 commit comments

Comments
 (0)