Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@
"label": "Start sphinx-autobuild",
"type": "shell",
"options": {
"env": {
"PROJECT_PORT": "8061"
}
"env": {
"PROJECT_PORT": "8061"
}
},
"command": "source ${config:virtualenvPath}/activate; sphinx-autobuild ${workspaceFolder}/docs ${workspaceFolder}/docs/_build/html -a --port $PROJECT_PORT --open-browser"
}
},
{
"label": "Upgrade pip",
"type": "shell",
"command": "${config:virtualenvPath}/pip install --upgrade pip"
},
]
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ Visit [LimberDuck.org][2] to find out more!
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.7.0] - 2025-09-01

### Added

#### CLI

- New option:
- `nfr --update-check` / `nfr -u` - will return confirmation if you are using the latest version of NFR.

- Requirements update
- new:
- requests>=2.32.5

## [0.6.0] - 2025-06-28

### Added
Expand Down Expand Up @@ -125,6 +138,7 @@ Plugins number used during the scan.

- Initial release

[0.7.0]: https://github.com/LimberDuck/nessus-file-reader/compare/v0.6.0...v0.7.0
[0.6.0]: https://github.com/LimberDuck/nessus-file-reader/compare/v0.5.0...v0.6.0
[0.5.0]: https://github.com/LimberDuck/nessus-file-reader/compare/v0.4.3...v0.5.0
[0.4.3]: https://github.com/LimberDuck/nessus-file-reader/compare/v0.4.2...v0.4.3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nessus file reader (NFR)

**nessus file reader** (`NFR`) by LimberDuck (pronounced *ˈlɪm.bɚ dʌk*) is a CLI tool
**nessus file reader (NFR) by LimberDuck** (pronounced *ˈlɪm.bɚ dʌk*) is a CLI tool
and python module created to quickly parse nessus files containing the results
of scans performed using Nessus and Tenable.sc by (C) Tenable, Inc. This module will let
you get data through functions grouped into categories like `file`, `scan`, `host`
Expand Down
4 changes: 2 additions & 2 deletions nessus_file_reader/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"performed by using Nessus by (C) Tenable, Inc."
)
__uri__ = "https://github.com/LimberDuck"
__version__ = "0.6.0"
__release_date__ = "2025.06.28"
__version__ = "0.7.0"
__release_date__ = "2025.09.01"
__author__ = "Damian Krawczyk"
__email__ = "[email protected]"
__license_name__ = "GNU GPLv3"
Expand Down
36 changes: 31 additions & 5 deletions nessus_file_reader/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from nessus_file_reader._version import __version__
import click
import nessus_file_reader as nfr
from nessus_file_reader import utilities
from nessus_file_reader import utilities, __about__
import os
import glob
import tabulate
Expand Down Expand Up @@ -42,12 +42,38 @@ def _add_arguments(func):
return _add_arguments


@click.group()
PACKAGE_NAME = __about__.__package_name__


@click.group(
invoke_without_command=True,
help="NFR - CLI tool and python module to pars nessus files",
epilog=f"Additional information:\n\n"
f"https://limberduck.org/en/latest/tools/{PACKAGE_NAME}\n"
f"https://github.com/LimberDuck/{PACKAGE_NAME}\n"
f"https://github.com/LimberDuck/{PACKAGE_NAME}/releases\n",
)
@click.option(
"--version", is_flag=True, callback=print_version, expose_value=False, is_eager=True
"--version",
"-v",
is_flag=True,
callback=print_version,
expose_value=False,
is_eager=True,
)
@click.option(
"--update-check",
"-u",
is_flag=True,
help="Check if a new version is available and exit.",
)
def cli():
pass
@click.pass_context
def cli(ctx, update_check):
if ctx.invoked_subcommand is None and not update_check:
click.echo(ctx.get_help())
ctx.exit(0)
if ctx.invoked_subcommand is None and update_check:
utilities.check_for_update()


@cli.command()
Expand Down
2 changes: 1 addition & 1 deletion nessus_file_reader/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.6.0"
__version__ = "0.7.0"
45 changes: 45 additions & 0 deletions nessus_file_reader/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
import ipaddress
from xml.etree.ElementTree import parse
import os
import requests
from packaging import version
from nessus_file_reader._version import __version__ as current_version
from nessus_file_reader import __about__


def ip_range_split(ip_range):
Expand Down Expand Up @@ -430,3 +434,44 @@ def nessus_scan_file_split(input_file_path: str, batch_size: int) -> None:
print(output_file)
with open(output_file, "w", encoding="utf-8") as out_file:
out_file.write(new_xml)


def check_for_update():

PACKAGE_NAME = __about__.__package_name__

try:
response = requests.get(
f"https://pypi.org/pypi/{PACKAGE_NAME}/json", timeout=1.5
)
response.raise_for_status()
latest = response.json()["info"]["version"]
read_more = (
f"> Read more:\n"
f"> https://limberduck.org/en/latest/tools/{PACKAGE_NAME}\n"
f"> https://github.com/LimberDuck/{PACKAGE_NAME}\n"
f"> https://github.com/LimberDuck/{PACKAGE_NAME}/releases"
)
if version.parse(latest) > version.parse(current_version):
print(
f"\n> A new version of {PACKAGE_NAME} is available: {latest} (you have {current_version})"
)
print(f"> Update with: pip install -U {PACKAGE_NAME}\n")
print(read_more)
elif version.parse(latest) == version.parse(current_version):
print(
f"\n> You are using the latest version of {PACKAGE_NAME}: {current_version}\n"
)
print(read_more)
else:
print(
f"\n> You are using a pre-release version of {PACKAGE_NAME}: {current_version}"
)
print(f"> Latest released version of {PACKAGE_NAME}: {latest}\n")
print(read_more)
except requests.exceptions.ConnectionError as e:
print("> Could not check for updates: Connection error.\n")
print(e)
except Exception as e:
print("> Could not check for updates:\n")
print(e)
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
click>=8.2.1
tabulate>=0.9.0
jmespath>=1.0.1
jmespath>=1.0.1
requests>=2.32.5
Loading