From 959d95706883c1a69f9527bf90cb72c2eb33f51b Mon Sep 17 00:00:00 2001 From: Ketan Date: Thu, 1 Oct 2026 13:25:32 -0400 Subject: [PATCH] Initial commit --- README.md | 4 ++++ ha.txt | 0 libs/__init__.py | 0 libs/filesearch.py | 27 +++++++++++++++++++++++++++ libs/hashchecker.py | 11 +++++++++++ 5 files changed, 42 insertions(+) create mode 100644 README.md create mode 100644 ha.txt create mode 100644 libs/__init__.py create mode 100644 libs/filesearch.py create mode 100644 libs/hashchecker.py diff --git a/README.md b/README.md new file mode 100644 index 0000000..057d39d --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Vanti +> Anti + V(irus) backwards pronounced Van-tee + +Vanti is a simple anti-virus that checks the download folder (and others if you specify it) file's file hashes with MalwareBazaar \ No newline at end of file diff --git a/ha.txt b/ha.txt new file mode 100644 index 0000000..e69de29 diff --git a/libs/__init__.py b/libs/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/libs/filesearch.py b/libs/filesearch.py new file mode 100644 index 0000000..716e662 --- /dev/null +++ b/libs/filesearch.py @@ -0,0 +1,27 @@ +import time +from watchdog.observers import Observer +from watchdog.events import FileSystemEventHandler +from pathlib import Path +downloads_path = Path.home() / "Downloads" + +class NewFileHandler(FileSystemEventHandler): + def on_created(self, event): + if not event.is_directory: + print(f"New file detected: {event.src_path}") + +if __name__ == "__main__": + path_to_watch = downloads_path + + event_handler = NewFileHandler() + observer = Observer() + observer.schedule(event_handler, path=path_to_watch, recursive=False) + + print(f"Monitoring folder: {path_to_watch}...") + observer.start() + + try: + while True: + time.sleep(1) + except KeyboardInterrupt: + observer.stop() + observer.join() diff --git a/libs/hashchecker.py b/libs/hashchecker.py new file mode 100644 index 0000000..b04987f --- /dev/null +++ b/libs/hashchecker.py @@ -0,0 +1,11 @@ +import hashlib + +def hashcheck(fileToCheck): + with open(fileToCheck, "rb") as f: + digest = hashlib.file_digest(f, "sha256") + file_hash = digest.hexdigest() + print(file_hash) + +hashcheck("ha.txt") + +