Skip to content

Commit

Permalink
v04.3
Browse files Browse the repository at this point in the history
  • Loading branch information
damian-krawczyk committed Feb 19, 2025
1 parent a9b6dac commit e32d323
Show file tree
Hide file tree
Showing 22 changed files with 885 additions and 409 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tools
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ nessus_file_reader.egg-info
test_files
.vscode
_build
.DS_Store
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ This document records all notable changes to [nessus file reader by LimberDuck][
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.4.3] - 2025-02-08

### Changed

- code formatted with [black](https://black.readthedocs.io)
- requirements update
- from:
- click>=8.1.3
- tabulate>=0.8.9
- to:
- click>=8.1.8
- tabulate>=0.9.0

- tests for python
- added: 3.10, 3.11, 3.12, 3.13

## [0.4.2] - 2023-03-04

### Changed
Expand Down Expand Up @@ -66,6 +82,7 @@ Plugins number used during the scan.

- Initial release

[0.4.3]: https://github.com/LimberDuck/nessus-file-reader/compare/v0.4.2...v0.4.3
[0.4.2]: https://github.com/LimberDuck/nessus-file-reader/compare/v0.4.1...v0.4.2
[0.4.1]: https://github.com/LimberDuck/nessus-file-reader/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/LimberDuck/nessus-file-reader/compare/v0.3.0...v0.4.0
Expand Down
6 changes: 3 additions & 3 deletions examples/nfr-file-example.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import nessus_file_reader as nfr

nessus_scan_file = './your_nessus_file.nessus'
nessus_scan_file = "./your_nessus_file.nessus"
root = nfr.file.nessus_scan_file_root_element(nessus_scan_file)
file_name = nfr.file.nessus_scan_file_name_with_path(nessus_scan_file)
file_size = nfr.file.nessus_scan_file_size_human(nessus_scan_file)
print(f'File name: {file_name}')
print(f'File size: {file_size}')
print(f"File name: {file_name}")
print(f"File size: {file_size}")
39 changes: 24 additions & 15 deletions examples/nfr-host-example.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
import nessus_file_reader as nfr
nessus_scan_file = './your_nessus_file.nessus'

nessus_scan_file = "./your_nessus_file.nessus"
root = nfr.file.nessus_scan_file_root_element(nessus_scan_file)

for report_host in nfr.scan.report_hosts(root):
report_host_name = nfr.host.report_host_name(report_host)
report_host_os = nfr.host.detected_os(report_host)
report_host_scan_time_start = nfr.host.host_time_start(report_host)
report_host_scan_time_end = nfr.host.host_time_end(report_host)
report_host_scan_time_elapsed = nfr.host.host_time_elapsed(report_host)
report_host_critical = nfr.host.number_of_plugins_per_risk_factor(report_host, 'Critical')
report_host_high = nfr.host.number_of_plugins_per_risk_factor(report_host, 'High')
report_host_medium = nfr.host.number_of_plugins_per_risk_factor(report_host, 'Medium')
report_host_low = nfr.host.number_of_plugins_per_risk_factor(report_host, 'Low')
report_host_none = nfr.host.number_of_plugins_per_risk_factor(report_host, 'None')
print(f' Report host name: {report_host_name}')
print(f' Report host OS: {report_host_os}')
print(f' Host scan time START - END (ELAPSED): {report_host_scan_time_start} - {report_host_scan_time_end} ({report_host_scan_time_elapsed})')
print(f' Critical/High/Medium/Low/None findings: {report_host_critical}/{report_host_high}/{report_host_medium}/{report_host_low}/{report_host_none}')
report_host_name = nfr.host.report_host_name(report_host)
report_host_os = nfr.host.detected_os(report_host)
report_host_scan_time_start = nfr.host.host_time_start(report_host)
report_host_scan_time_end = nfr.host.host_time_end(report_host)
report_host_scan_time_elapsed = nfr.host.host_time_elapsed(report_host)
report_host_critical = nfr.host.number_of_plugins_per_risk_factor(
report_host, "Critical"
)
report_host_high = nfr.host.number_of_plugins_per_risk_factor(report_host, "High")
report_host_medium = nfr.host.number_of_plugins_per_risk_factor(
report_host, "Medium"
)
report_host_low = nfr.host.number_of_plugins_per_risk_factor(report_host, "Low")
report_host_none = nfr.host.number_of_plugins_per_risk_factor(report_host, "None")
print(f" Report host name: {report_host_name}")
print(f" Report host OS: {report_host_os}")
print(
f" Host scan time START - END (ELAPSED): {report_host_scan_time_start} - {report_host_scan_time_end} ({report_host_scan_time_elapsed})"
)
print(
f" Critical/High/Medium/Low/None findings: {report_host_critical}/{report_host_high}/{report_host_medium}/{report_host_low}/{report_host_none}"
)
7 changes: 4 additions & 3 deletions examples/nfr-plugin-example-2.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import nessus_file_reader as nfr
nessus_scan_file = './your_nessus_file.nessus'

nessus_scan_file = "./your_nessus_file.nessus"
root = nfr.file.nessus_scan_file_root_element(nessus_scan_file)

for report_host in nfr.scan.report_hosts(root):
pido_19506 = nfr.plugin.plugin_output(root, report_host, '19506')
print(f'Nessus Scan Information Plugin Output:\n{pido_19506}')
pido_19506 = nfr.plugin.plugin_output(root, report_host, "19506")
print(f"Nessus Scan Information Plugin Output:\n{pido_19506}")
7 changes: 4 additions & 3 deletions examples/nfr-plugin-example-3.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import nessus_file_reader as nfr
nessus_scan_file = './your_nessus_file.nessus'

nessus_scan_file = "./your_nessus_file.nessus"
root = nfr.file.nessus_scan_file_root_element(nessus_scan_file)

for report_host in nfr.scan.report_hosts(root):
pidos_14272 = nfr.plugin.plugin_outputs(root, report_host, '14272')
print(f'All findings for Netstat Portscanner (SSH): \n{pidos_14272}')
pidos_14272 = nfr.plugin.plugin_outputs(root, report_host, "14272")
print(f"All findings for Netstat Portscanner (SSH): \n{pidos_14272}")
23 changes: 12 additions & 11 deletions examples/nfr-plugin-example.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import nessus_file_reader as nfr
nessus_scan_file = './your_nessus_file.nessus'

nessus_scan_file = "./your_nessus_file.nessus"
root = nfr.file.nessus_scan_file_root_element(nessus_scan_file)

for report_host in nfr.scan.report_hosts(root):
report_items_per_host = nfr.host.report_items(report_host)
for report_item in report_items_per_host:
plugin_id = int(nfr.plugin.report_item_value(report_item, 'pluginID'))
risk_factor = nfr.plugin.report_item_value(report_item, 'risk_factor')
see_also = nfr.plugin.report_item_value(report_item, 'see_also')
description = nfr.plugin.report_item_value(report_item, 'description')
plugin_name = nfr.plugin.report_item_value(report_item, 'pluginName')
print('\t', plugin_id, ' \t\t\t', risk_factor, ' \t\t\t', plugin_name)
print(see_also)
print(description)
report_items_per_host = nfr.host.report_items(report_host)
for report_item in report_items_per_host:
plugin_id = int(nfr.plugin.report_item_value(report_item, "pluginID"))
risk_factor = nfr.plugin.report_item_value(report_item, "risk_factor")
see_also = nfr.plugin.report_item_value(report_item, "see_also")
description = nfr.plugin.report_item_value(report_item, "description")
plugin_name = nfr.plugin.report_item_value(report_item, "pluginName")
print("\t", plugin_id, " \t\t\t", risk_factor, " \t\t\t", plugin_name)
print(see_also)
print(description)
17 changes: 12 additions & 5 deletions examples/nfr-scan-example.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import nessus_file_reader as nfr
nessus_scan_file = './your_nessus_file.nessus'

nessus_scan_file = "./your_nessus_file.nessus"
root = nfr.file.nessus_scan_file_root_element(nessus_scan_file)

report_name = nfr.scan.report_name(root)
number_of_target_hosts = nfr.scan.number_of_target_hosts(root)
number_of_scanned_hosts = nfr.scan.number_of_scanned_hosts(root)
number_of_scanned_hosts_with_credentialed_checks_yes = nfr.scan.number_of_scanned_hosts_with_credentialed_checks_yes(root)
number_of_scanned_hosts_with_credentialed_checks_yes = (
nfr.scan.number_of_scanned_hosts_with_credentialed_checks_yes(root)
)
scan_time_start = nfr.scan.scan_time_start(root)
scan_time_end = nfr.scan.scan_time_end(root)
scan_time_elapsed = nfr.scan.scan_time_elapsed(root)
print(f' Report name: {report_name}')
print(f' Number of target/scanned/credentialed hosts: {number_of_target_hosts}/{number_of_scanned_hosts}/{number_of_scanned_hosts_with_credentialed_checks_yes}')
print(f' Scan time START - END (ELAPSED): {scan_time_start} - {scan_time_end} ({scan_time_elapsed})')
print(f" Report name: {report_name}")
print(
f" Number of target/scanned/credentialed hosts: {number_of_target_hosts}/{number_of_scanned_hosts}/{number_of_scanned_hosts_with_credentialed_checks_yes}"
)
print(
f" Scan time START - END (ELAPSED): {scan_time_start} - {scan_time_end} ({scan_time_elapsed})"
)
Loading

0 comments on commit e32d323

Please sign in to comment.