diff --git a/Server/engine.py b/Server/engine.py index 3725248..53d223d 100644 --- a/Server/engine.py +++ b/Server/engine.py @@ -9,14 +9,11 @@ def __init__(self, evidence_path): self.report_data = {} def run_automated_process(self): - print("Starting Identification...") sha256 = self.generate_hash("sha256") md5 = self.generate_hash("md5") - print("Verifying Magic Numbers...") magic_verified, file_sig = self.verify_file_signature() - print("Collecting Advanced Metadata...") metadata = self.get_metadata() metadata["magic_signature"] = file_sig metadata["signature_match"] = magic_verified @@ -47,6 +44,9 @@ def verify_file_signature(self): b"%PDF": "PDF Document", b"PK\x03\x04": "ZIP/Office Archive", b"MZ": "Executable (Warning)", + b"\xd4\xc3\xb2\xa1": "PCAP Network Capture (Little Endian)", + b"\xa1\xb2\xc3\xd4": "PCAP Network Capture (Big Endian)", + b"\x0a\x0d\x0d\x0a": "PCAPNG Network Capture", } try: with open(self.evidence_path, "rb") as f: @@ -65,5 +65,6 @@ def get_metadata(self): "created": datetime.datetime.fromtimestamp(stats.st_ctime, tz=datetime.timezone.utc).isoformat(), "modified": datetime.datetime.fromtimestamp(stats.st_mtime, tz=datetime.timezone.utc).isoformat(), "accessed": datetime.datetime.fromtimestamp(stats.st_atime, tz=datetime.timezone.utc).isoformat(), - "permissions": oct(stats.st_mode)[-3:] + "permissions": oct(stats.st_mode)[-3:], + "exif": {} } diff --git a/Server/main.py b/Server/main.py index 0fd080c..18ac0f4 100644 --- a/Server/main.py +++ b/Server/main.py @@ -33,7 +33,6 @@ allow_credentials=True, allow_methods=["*"], allow_headers=["*"], - allow_credentials=True, ) diff --git a/Server/tests/test_auth.py b/Server/tests/test_auth.py index 06da4db..0815495 100644 --- a/Server/tests/test_auth.py +++ b/Server/tests/test_auth.py @@ -25,7 +25,10 @@ def test_investigator_upload_and_audit(tmp_path): client = TestClient(app) files = {"file": ("small.txt", "hello world")} - headers = {"Authorization": "Bearer testtoken123"} + headers = { + "Authorization": "Bearer testtoken123", + "X-Analyze-Key": "forensic-pro-suite-demo-analyze-key" + } r = client.post("/api/analyze", files=files, headers=headers) assert r.status_code == 200 data = r.json()