Skip to content

Commit

Permalink
New variable for output location
Browse files Browse the repository at this point in the history
  • Loading branch information
shelld3v committed Jan 23, 2025
1 parent 60a5046 commit c4bb2cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ output-formats = plain
# - {scheme}: URI scheme (http or https)
# - {port}: Port number (e.g. 443)
# - {date}: Scan date, format: DD-MM-YYYY (e.g. 07-10-2022)
# - {datetime}: Scan datetime, format: DD-MM-YYYY_HH-MM-SS (e.g. 2025-01-23_14:32:27)
#
# For output formats other than PostgreSQL and MySQL
#output-file = reports/{host}/{scheme}_{port}.{extension}
Expand Down
2 changes: 0 additions & 2 deletions lib/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@

START_TIME = time.strftime("%Y-%m-%d %H:%M:%S")

START_DATETIME = time.strftime("%Y-%m-%d")

SCRIPT_PATH = FileUtils.parent(__file__, 3)

OPTIONS_FILE = "options.ini"
Expand Down
6 changes: 3 additions & 3 deletions lib/report/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from urllib.parse import urlparse

from lib.core.data import options
from lib.core.settings import STANDARD_PORTS, START_DATETIME
from lib.core.settings import STANDARD_PORTS, START_TIME
from lib.report.csv_report import CSVReport
from lib.report.html_report import HTMLReport
from lib.report.json_report import JSONReport
Expand Down Expand Up @@ -83,8 +83,8 @@ def format(self, string, target, handler):
parsed = urlparse(target)

return string.format(
# Get date from datetime string
date=START_DATETIME.split()[0],
datetime=START_TIME.replace(" ", "_"),
date=START_TIME.split()[0],
host=parsed.hostname,
scheme=parsed.scheme,
port=parsed.port or STANDARD_PORTS[parsed.scheme],
Expand Down

0 comments on commit c4bb2cb

Please sign in to comment.