-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
::: nmass.masscan | ||
options: | ||
show_source: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: nmass.model.elements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
::: nmass.nmap | ||
options: | ||
show_source: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.