Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DMG Scanner #269

Merged
merged 8 commits into from
Dec 30, 2022
Merged

Add DMG Scanner #269

merged 8 commits into from
Dec 30, 2022

Conversation

ryanohoro
Copy link
Collaborator

Describe the change

Adds a scanner that can extract DMG files and metadata using the 7zip OS dependency, with three tests.

Adds taste yara to identify several mac disk image types.

Updates 7zip to 22.01 using package pinning to the kinetic (22.10) release, required to parse dmg metadata.

Updates the test for ScanVhd, affected by the 7zip upgrade.

Describe testing procedures

...
============================= test session starts ==============================
platform linux -- Python 3.10.6, pytest-7.2.0, pluggy-1.0.0
rootdir: /strelka
plugins: mock-3.10.0, unordered-0.5.2
collected 67 items

tests/test_required_for_scanner.py .
tests/test_scan_base64.py .
tests/test_scan_base64_pe.py .
tests/test_scan_batch.py .
tests/test_scan_bmp_eof.py .
tests/test_scan_bzip2.py .
tests/test_scan_dmg.py ...
tests/test_scan_docx.py .
tests/test_scan_elf.py .
tests/test_scan_email.py .
tests/test_scan_encrypted_doc.py ....
tests/test_scan_encrypted_zip.py ..
tests/test_scan_entropy.py .
tests/test_scan_exiftool.py ..
tests/test_scan_footer.py .
tests/test_scan_gif.py .
tests/test_scan_gzip.py .
tests/test_scan_hash.py .
tests/test_scan_header.py .
tests/test_scan_html.py .
tests/test_scan_ini.py .
tests/test_scan_iso.py .
tests/test_scan_javascript.py .
tests/test_scan_jpeg.py ..
tests/test_scan_json.py .
tests/test_scan_libarchive.py ......
tests/test_scan_lnk.py .
tests/test_scan_lzma.py .
tests/test_scan_macho.py .
tests/test_scan_manifest.py .
tests/test_scan_msi.py .
tests/test_scan_ocr.py .
tests/test_scan_pdf.py .
tests/test_scan_pe.py .
tests/test_scan_png_eof.py ...
tests/test_scan_qr.py .
tests/test_scan_rar.py .
tests/test_scan_strings.py .
tests/test_scan_tar.py .
tests/test_scan_upx.py .
tests/test_scan_url.py .....
tests/test_scan_vhd.py ..
tests/test_scan_x509.py ..
tests/test_scan_yara.py .
tests/test_scan_zip.py ..
...
======================= 67 passed, 27 warnings in 8.60s ========================
...

Sample output

{
    "elapsed": 0.118618,
    "flags": [],
    "total": {"files": 5, "extracted": 5},
    "files": [
        {
            "filename": "Install/Install Flash Player/.background.png",
            "size": "70758",
            "datetime": "2022-12-28 16:28:45",
        },
        {
            "filename": "Install/Install Flash Player/.DS_Store",
            "size": "16388",
            "datetime": "2022-12-28 16:28:49",
        },
        {
            "filename": "Install/Install Flash Player/.VolumeIcon.icns",
            "size": "312349",
            "datetime": "2022-12-28 16:28:45",
        },
        {
            "filename": "Install/Install Flash Player/Install Flash Player",
            "size": "33016",
            "datetime": "2022-12-28 20:31:11",
        },
        {
            "filename": "Install/Install Flash Player/Install Flash Player_rsrc",
            "size": "51737",
            "datetime": "2022-12-28 16:28:45",
        },
    ],
    "meta": {
        "7zip_version": "22.01",
        "partitions": [
            {
                "path": "/tmp/tmprz_rjjxg",
                "type": "HFS",
                "created": "2022-12-28 20:18:31",
            }
        ],
    },
}

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of and tested my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@phutelmyer phutelmyer merged commit fbeeb66 into target:master Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants