Jsteg working

This commit is contained in:
Zeecka
2026-01-14 22:34:07 +01:00
parent 1c4b245c86
commit 8f491c683f
4 changed files with 40 additions and 2 deletions
+28
View File
@@ -0,0 +1,28 @@
# flake8: noqa: E203,E501,W503
# pylint: disable=C0413,W0718,R0903,R0801
# mypy: disable-error-code=unused-awaitable
"""Jsteg Analyzer for Image Submissions."""
from pathlib import Path
from .base_analyzer import SubprocessAnalyzer
class JstegAnalyzer(SubprocessAnalyzer):
"""Analyzer for jsteg."""
def __init__(self, input_img: Path, output_dir: Path) -> None:
super().__init__("jsteg", input_img, output_dir)
self.cmd = ["jsteg", "reveal", self.img]
def process_output(self, stdout: str, stderr: str) -> str | list[str]:
"""Process the stdout into lines."""
if stdout.strip():
return [line for line in stdout.split("\n") if line.strip()]
return []
def analyze_jsteg(input_img: Path, output_dir: Path) -> None:
"""Analyze an image submission using jsteg."""
analyzer = JstegAnalyzer(input_img, output_dir)
analyzer.analyze()
+1
View File
@@ -11,6 +11,7 @@ const TOOL_ORDER = [
"identify",
"steghide",
"jpseek",
"jsteg",
"openstego",
"zsteg",
"strings"
+2
View File
@@ -21,6 +21,7 @@ from .analyzers.file import analyze_file
from .analyzers.foremost import analyze_foremost
from .analyzers.identify import analyze_identify
from .analyzers.jpseek import analyze_jpseek
from .analyzers.jsteg import analyze_jsteg
from .analyzers.openstego import analyze_openstego
from .analyzers.outguess import analyze_outguess
from .analyzers.pcrt import analyze_pcrt
@@ -112,6 +113,7 @@ def analyze_image(submission_hash: str) -> None:
(analyze_foremost, img_path, result_path),
(analyze_identify, img_path, result_path),
(analyze_jpseek, img_path, result_path, submission.password),
(analyze_jsteg, img_path, result_path),
(analyze_openstego, img_path, result_path, submission.password),
(analyze_pngcheck, img_path, result_path),
(analyze_pcrt, img_path, result_path),