Skip to content

Commit

Permalink
Small Refactor Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rothoma2 committed Jun 6, 2024
1 parent b8bb7fa commit d8c9430
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ rich = "^13.7.1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.flake8]
max-line-length = 95
9 changes: 9 additions & 0 deletions your_daily_dose_malware/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# constants.py
MALWARE_BANNER = """
[green] ██████ █████ ██ ██ ██ ██ ███ ███ █████ ██ ██ ██ █████ ██████ ███████[/green]
[green] ██ ██ ██ ██ ██ ██ ██ ██ ████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ [/green]
[green] ██ ██ ███████ ██ ██ ████ ██ ████ ██ ███████ ██ ██ █ ██ ███████ ██████ █████ [/green]
[green] ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ ██ ██ [/green]
[green] ██████ ██ ██ ██ ███████ ██ ██ ██ ██ ██ ███████ ███ ███ ██ ██ ██ ██ ███████[/green]
"""
MALWARE_DESCRIPTION = "Downloads Fresh Malware Samples"
17 changes: 9 additions & 8 deletions your_daily_dose_malware/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from rich.console import Console
from your_daily_dose_malware.commands.utils.retrieve_malware import (all_most_recent,
hundred_most_recent)
from your_daily_dose_malware.constants import (MALWARE_BANNER,
MALWARE_DESCRIPTION)

from dotenv import load_dotenv


Expand All @@ -25,22 +28,20 @@ def main():

parser = argparse.ArgumentParser(
description="Download recent samples from multiple OSINT provider backends"
"MalwareBazaar: all the recent recent malware's uploaded within the last 48 hours sha256 hash"
"MalwareBazaar: all the recent recent malware's uploaded within"
"the last 48 hours sha256 hash"
"MalwareBazaar: By using api from 'https://mb-api.abuse.ch/api/v1/'"
)
parser.add_argument('-MwBz_48H', '--last-48H', action='store_true',
help="get the most recent sha256 hashes", default=True)
parser.add_argument('-MwBz_100', '--hundred-recent', action='store_true',
parser.add_argument('-MwBz_100', '--hundred-recent',
action='store_true',
help="get the most recent hundred recent malware's uploaded within the last 60 min")
args = parser.parse_args()

console = Console()
console.print("\n[green] ██████ █████ ██ ██ ██ ██ ███ ███ █████ ██ ██ ██ █████ ██████ ███████[/green]\n"
"[green] ██ ██ ██ ██ ██ ██ ██ ██ ████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ [/green]\n"
"[green] ██ ██ ███████ ██ ██ ████ ██ ████ ██ ███████ ██ ██ █ ██ ███████ ██████ █████ [/green]\n"
"[green] ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ ██ ██ [/green]\n"
"[green] ██████ ██ ██ ██ ███████ ██ ██ ██ ██ ██ ███████ ███ ███ ██ ██ ██ ██ ███████[/green]\n")
console.print("Downloads Fresh Malware Samples \n")
console.print(MALWARE_BANNER)
console.print(f"{MALWARE_DESCRIPTION} \n")

run_scrapper(args)

Expand Down

0 comments on commit d8c9430

Please sign in to comment.