Skip to content

Commit

Permalink
📝 update documents
Browse files Browse the repository at this point in the history
  • Loading branch information
zrquan committed Oct 19, 2024
1 parent f2698e6 commit 0cfc40d
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 3 deletions.
59 changes: 57 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,63 @@
# nmass
# Nmass

[![Release](https://img.shields.io/github/v/release/zrquan/nmass)](https://img.shields.io/github/v/release/zrquan/nmass)
[![Build status](https://img.shields.io/github/actions/workflow/status/zrquan/nmass/main.yml?branch=main)](https://github.com/zrquan/nmass/actions/workflows/main.yml?query=branch%3Amain)
[![Commit activity](https://img.shields.io/github/commit-activity/m/zrquan/nmass)](https://img.shields.io/github/commit-activity/m/zrquan/nmass)
[![License](https://img.shields.io/github/license/zrquan/nmass)](https://img.shields.io/github/license/zrquan/nmass)

A python3 library that makes it easier to use nmap and masscan.
Nmass is a python3 library that makes it easier for developers to use **nmap and masscan**. It translates many and complex arguments into idiomatic methods and wraps the scan results in well-defined **pydantic** models.

## Examples

### Basic nmap example

```python
# nmap_example.py
nm = (
Nmap()
.with_targets("172.18.0.2")
.with_most_common_ports(100)
.with_service_info()
.with_default_script()
.without_ping()
.without_dns_resolution()
)
if result := nm.run(with_output=False):
print(result.model_dump_json(exclude_none=True))
```

### Basic masscan example

```python
# masscan_example.py
ms = (
Masscan()
.with_targets("183.2.172.185")
.with_ports("80,443")
.with_banner()
)
if result := ms.run(with_output=False):
print(result.model_dump_json(exclude_none=True))
```

### More?

Masscan is fast, and nmap is powerful. Why not combine the two?🤩 Start by using masscan to quickly detect open ports in bulk, then use nmap to perform in-depth scans on these open ports!

```python
# This is just an example, is not recommended to run
step1 = (
Masscan()
.with_targets("10.0.0.0/8")
.with_ports(80, 443)
.with_rate(10000)
)
step2 = (
Nmap()
.with_step(step1.run())
.with_service_info()
.with_scripts("http-title")
.with_verbose()
)
retult = step2.run()
```
2 changes: 2 additions & 0 deletions docs/masscan.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
::: nmass.masscan
options:
show_source: False
1 change: 1 addition & 0 deletions docs/model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: nmass.model.elements
2 changes: 2 additions & 0 deletions docs/nmap.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
::: nmass.nmap
options:
show_source: False
7 changes: 6 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ site_description: A python3 library that makes it easier to use nmap and masscan
site_author: zrquan
edit_uri: edit/main/docs/
repo_name: zrquan/nmass
copyright: Maintained by <a href="https://zrquan.com">Florian</a>.
copyright: Maintained by <a href="https://github.com/zrquan">zrquan</a>.

nav:
- Home: index.md
- Nmap: nmap.md
- Masscan: masscan.md
- Models: model.md
plugins:
- search
- mkdocstrings:
handlers:
python:
paths: [nmass]
options:
docstring_style: sphinx
theme:
name: material
feature:
Expand Down Expand Up @@ -51,3 +54,5 @@ markdown_extensions:
permalink: true
- pymdownx.arithmatex:
generic: true
- codehilite:
css_class: highlight
Empty file added nmass/model/__init__.py
Empty file.

0 comments on commit 0cfc40d

Please sign in to comment.