Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Server/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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": {}
}
1 change: 0 additions & 1 deletion Server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
allow_credentials=True,
)


Expand Down
5 changes: 4 additions & 1 deletion Server/tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading