Initial commit
This commit is contained in:
4
README.md
Normal file
4
README.md
Normal file
@@ -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
|
||||||
0
libs/__init__.py
Normal file
0
libs/__init__.py
Normal file
27
libs/filesearch.py
Normal file
27
libs/filesearch.py
Normal file
@@ -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()
|
||||||
11
libs/hashchecker.py
Normal file
11
libs/hashchecker.py
Normal file
@@ -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")
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user