Katherine A. Sward

30 papers Misc 13Journal 11Unranked 6
YearRankTypeTitle / Venue / Authors
2024 J jnl
J. Am. Medical Informatics Assoc.
Zuoting Nie, Shiying Gao, Long Chen, Rumei Yang, Linda S. Edelman, Katherine A. Sward, Yun Jiang, George Demiris
2022 J jnl
J. Am. Medical Informatics Assoc.
Alan H. Morris, Christopher Horvat, Brian Stagg, David W. Grainger, Michael Lanspa, James Orme, Terry P. Clemmer, Lindell K. Weaver, Frank Thomas, Colin K. Grissom, Ellie Hirshberg, Thomas D. East, Carrie Jane Wallace, Michael P. Young, Dean F. Sittig, Mary Suchyta, James E. Pearl, Antinio Pesenti, Michela Bombino, Eduardo Beck, Katherine A. Sward, Charlene R. Weir, Shobha Phansalkar, Gordon R. Bernard, B. Taylor Thompson, Roy Brower, Jonathon D. Truwit, Jay S. Steingrub, R. Duncan Hite, Douglas F. Willson, Jerry J. Zimmerman, Vinay Nadkarni, Adrienne G. Randolph, Martha A. Q. Curley, Christopher J. L. Newth, Jacques Lacroix, Michael S. D. Agus, Kang Hoe Lee, Bennett P. deBoisblanc, Frederick Alan Moore, R. Scott Evans, Dean K. Sorenson, Anthony Wong, Michael V. Boland, Willard H. Dere, Alan S. Crandall, Julio C. Facelli, Stanley M. Huff, Peter J. Haug, Ulrike Pielmeier, Stephen Edward Rees, Dan S. Karbing, Steen Andreassen, Eddy Fan, Roberta M. Goldring, Kenneth I. Berger, Beno W. Oppenheimer, Eugene Wesley Ely, Brian W. Pickering, David A. Schoenfeld, Irena Tocino, Russell S. Gonnering, Peter J. Pronovost, Lucy A. Savitz, Didier Dreyfuss, Arthur S. Slutsky, James D. Crapo, Michael R. Pinsky, Brent James, Donald M. Berwick
2022 Misc conf
AMIA
Katherine A. Sward, Jia-Wen Guo, William Hull
2021 J jnl
J. Am. Medical Informatics Assoc.
Alan H. Morris, Brian Stagg, Michael Lanspa, James Orme, Terry P. Clemmer, Lindell K. Weaver, Frank Thomas, Colin K. Grissom, Ellie Hirshberg, Thomas D. East, Carrie Jane Wallace, Michael P. Young, Dean F. Sittig, Antonio Pesenti, Michela Bombino, Eduardo Beck, Katherine A. Sward, Charlene R. Weir, Shobha S. Phansalkar, Gordon R. Bernard, B. Taylor Thompson, Roy Brower, Jonathon D. Truwit, Jay S. Steingrub, R. Duncan Hite, Douglas F. Willson, Jerry J. Zimmerman, Vinay M. Nadkarni, Adrienne Randolph, Martha A. Q. Curley, Christopher J. L. Newth, Jacques Lacroix, Michael S. D. Agus, Kang H. Lee, Bennett P. deBoisblanc, R. Scott Evans, Dean K. Sorenson, Anthony Wong, Michael V. Boland, David W. Grainger, Willard H. Dere, Alan S. Crandall, Julio C. Facelli, Stanley M. Huff, Peter J. Haug, Ulrike Pielmeier, Stephen Edward Rees, Dan S. Karbing, Steen Andreassen, Eddy Fan, Roberta M. Goldring, Kenneth I. Berger, Beno W. Oppenheimer, Eugene Wesley Ely, Ognjen Gajic, Brian W. Pickering, David A. Schoenfeld, Irena Tocino, Russell S. Gonnering, Peter J. Pronovost, Lucy A. Savitz, Didier Dreyfuss, Arthur S. Slutsky, James D. Crapo, Derek C. Angus, Michael R. Pinsky, Brent James, Donald M. Berwick
2021 Misc conf
AMIA
Jia-Wen Guo, Katherine A. Sward, Ann M. Lyons, Susan L. Beck, Gary W. Donaldson, Wendy W. Chapman, Lewis J. Frey
2021 J jnl
Appl. Clin. Inform.
Victoria L. Tiase, Sarah E. Wawrzynski, Katherine A. Sward, Guilherme Del Fiol, Catherine J. Staes, Charlene R. Weir, Mollie R. Cummins
2020 Misc conf
AMIA
Jia-Wen Guo, Christina L. Radloff, Katherine A. Sward, Susan L. Beck, Wendy W. Chapman, Gary W. Donaldson, Lewis J. Frey
2019 conf
BHI
Ramkiran Gouripeddi, Le-Thuy T. Tran, Randy Madsen, Tanvi Gangadhar, Peter Mo, Nicole Burnett, Ryan Butcher, Katherine A. Sward, Julio C. Facelli
2019 Misc conf
AMIA
Ramkiran Gouripeddi, Le-Thuy T. Tran, Tanvi Gangadhar, Randy K. Madsen, Julio C. Facelli, Katherine A. Sward
2019 Misc conf
AMIA
George Demiris, Anne M. Turner, Sarah J. Iribarren, Katherine A. Sward
2019 Misc conf
AMIA
Christina L. Radloff, Jia-Wen Guo, Katherine A. Sward
2019 conf
MedInfo
Victoria L. Tiase, Katherine A. Sward, Mollie R. Cummins
2019 Misc conf
AMIA
Jia-Wen Guo, Christina L. Radloff, Susan L. Beck, Gary W. Donaldson, Wendy W. Chapman, Katherine A. Sward, Lewis J. Frey
2018 Misc conf
AMIA
Rumei Yang, Joseph M. Plasek, Andrew Wilson, Mollie R. Cummins, Katherine A. Sward
2018 conf
LCN Workshops
Philip Lundrigan, Kyeong T. Min, Neal Patwari, Sneha Kumar Kasera, Kerry E. Kelly, Jimmy Moore, Miriah Meyer, Scott C. Collingwood, Flory Nkoy, Bryan L. Stone, Katherine A. Sward
2018 J jnl
Proc. ACM Interact. Mob. Wearable Ubiquitous Technol.
Jimmy Moore, Pascal Goffin, Miriah Meyer, Philip Lundrigan, Neal Patwari, Katherine A. Sward, Jason Wiese
2018 Misc conf
AMIA
Katherine A. Sward, Jimmy Moore, Jason Wiese, Miriah Meyer
2017 Misc conf
AMIA
Ramkiran Gouripeddi, Nicole Burnett, Mollie R. Cummins, Julio C. Facelli, Katherine A. Sward
2017 conf
CLPsych@ACL
Jia-Wen Guo, Danielle L. Mowery, Djin Lai, Katherine A. Sward, Mike Conway
2017 J jnl
CoRR
Philip Lundrigan, Kyeong T. Min, Neal Patwari, Sneha Kumar Kasera, Kerry E. Kelly, Jimmy Moore, Miriah Meyer, Scott C. Collingwood, Flory Nkoy, Bryan L. Stone, Katherine A. Sward
2017 J jnl
J. Am. Medical Informatics Assoc.
Ann M. Lyons, Katherine A. Sward, Vikrant G. Deshmukh, Marjorie A. Pett, Gary W. Donaldson, James Turnbull
2016 Misc conf
AMIA
Katherine A. Sward, Alex A. Bui, José Luis Ambite, Michael Dellarco
2015 Misc conf
AMIA
Katherine A. Sward, Christopher J. L. Newth, Robinder G. Khemani, J. Michael Dean
2015 J jnl
J. Am. Medical Informatics Assoc.
Lewis J. Frey, Katherine A. Sward, Christopher J. L. Newth, Robinder G. Khemani, Martin E. Cryer, Julie L. Thelen, Rene Enriquez, Su Shaoyu, Murray M. Pollack, Rick E. Harrison, Kathleen L. Meert, Robert A. Berg, David L. Wessel, Thomas P. Shanley, Heidi Dalton, Joseph Carcillo, Tammara L. Jenkins, J. Michael Dean
2012 J jnl
J. Am. Medical Informatics Assoc.
Chai Young Jung, Katherine A. Sward, Peter J. Haug
2012 Misc conf
AMIA
Megha Kalsy, Bruce E. Bray, Jennifer H. Garvin, Katherine A. Sward
2008 J jnl
J. Biomed. Informatics
D. Sorenson, Colin K. Grissom, L. Carpenter, A. Austin, Katherine A. Sward, L. Napoli, Homer R. Warner, Alan H. Morris
2008 J jnl
J. Biomed. Informatics
Katherine A. Sward, James F. Orme Jr., D. Sorenson, L. Baumann, Alan H. Morris
2007 conf
MedInfo
Shobha Phansalkar, Katherine A. Sward, Charlene R. Weir, Alan H. Morris
2007 conf
MedInfo
Carole A. Gassert, Katherine A. Sward
redb/extractors/macho_extractors/macho_similarity_hashes.py
← Index redb/extractors/macho_extractors/macho_similarity_hashes.py python
import inspect
from datetime import datetime, timezone
from typing import Any

from redb.extractors.enum import Tag
from redb.extractors.macho_extractor import MachOExtractor


class MachOSimilarityHashExtractor(MachOExtractor):
    """Extract Mach-O similarity hashes using machofile API.

    Similarity hashes are MD5 fingerprints of sorted, deduplicated binary components:
    - dylib_hash: MD5 of dynamic library names
    - import_hash: MD5 of imported function names
    - export_hash: MD5 of exported symbol names
    - entitlement_hash: MD5 of entitlement names and array values
    - symhash: MD5 of external undefined symbols

    For FAT binaries:
    - Inserts one row per architecture slice with per-slice hashes
    - Inserts one row for the FAT container with combined hashes

    For single-arch binaries:
    - Inserts one row with that architecture's hashes

    Note: parent_sha256 and architecture relationships are tracked in redb_basic_properties,
    not duplicated here. Use JOIN with redb_basic_properties when needed.
    """

    def __init__(
        self,
        filepath,
        log,
        exporters=None,
        index_prefix=None,
        elastic_index=None,
        known_benign=False,
        known_malicious=False,
        macho=None,
    ):
        super().__init__(
            filepath,
            log,
            exporters,
            index_prefix,
            elastic_index,
            known_benign,
            known_malicious,
            macho,
        )
        self.elastic_index = self.index_prefix + "-macho_hashes"
        self.log.debug(inspect.currentframe().f_code.co_name)

    def tag(self):
        return Tag.MACHO_HASHES.value

    def _extract_similarity_hashes(self, arch_name=None):
        """Extract similarity hashes for a specific architecture."""
        self.log.debug(inspect.currentframe().f_code.co_name)

        if not self.macho:
            return None

        try:
            similarity_hashes = self.macho.get_similarity_hashes(arch=arch_name)
            return similarity_hashes if similarity_hashes else None
        except Exception as e:
            self.log.error(f"Error extracting similarity hashes for arch {arch_name}: {e}")
            return None

    def extract(self):
        self.log.debug(inspect.currentframe().f_code.co_name)
        try:
            if not self.macho:
                return None

            architectures = self.macho.get_architectures()
            if not architectures:
                return None

            if len(architectures) > 1:
                # FAT binary - return combined hashes + per-arch hashes
                results = []

                # First add combined hashes for the FAT container
                all_hashes = self.macho.get_similarity_hashes()
                combined_hashes = all_hashes.get('combined', {}) if all_hashes else {}
                if combined_hashes:
                    combined_hashes['arch_identifier'] = 'fat'
                    results.append(combined_hashes)

                # Then add per-arch hashes
                for arch_name in architectures:
                    hashes = self._extract_similarity_hashes(arch_name)
                    if hashes:
                        hashes['arch_identifier'] = arch_name
                        results.append(hashes)
                return results
            else:
                # Single architecture - return single result
                return self._extract_similarity_hashes(architectures[0])
        except Exception as e:
            self.log.error(f"Error extracting similarity hashes: {e}")
            return None

    def prepare_export_data(self, exporter_type: str) -> Any:
        if exporter_type == "ElasticsearchExporter":
            return self.extract()
        elif exporter_type == "ClickHouseExporter":
            if not self.macho:
                return None

            try:
                architectures = self.macho.get_architectures()
                is_fat = len(architectures) > 1
            except Exception as e:
                self.log.error(f"Could not get architectures: {e}")
                return None

            data = []
            current_time = datetime.now(timezone.utc)

            # For FAT binaries, first insert a row for the container with combined hashes
            if is_fat:
                all_hashes = self.macho.get_similarity_hashes()  # Without arch returns all including 'combined'
                combined_hashes = all_hashes.get('combined', {}) if all_hashes else {}
                if combined_hashes:
                    data.append([
                        self.sha256,                                    # sha256 (FAT container)
                        combined_hashes.get('dylib_hash'),              # dylib_hash
                        combined_hashes.get('import_hash'),             # import_hash
                        combined_hashes.get('export_hash'),             # export_hash
                        combined_hashes.get('entitlement_hash'),        # entitlement_hash
                        combined_hashes.get('symhash'),                 # symhash
                        current_time,                                   # analysis_date
                    ])

            # Insert rows for each architecture slice
            for arch_name in architectures:
                # Get architecture-specific sha256
                try:
                    arch_general_info = self.macho.get_general_info(arch=arch_name)
                    arch_sha256 = arch_general_info.get('SHA256', self.sha256)
                except Exception as e:
                    self.log.warning(f"Could not get arch-specific sha256 for {arch_name}: {e}")
                    arch_sha256 = self.sha256

                # Get similarity hashes for this architecture
                similarity_hashes = self._extract_similarity_hashes(arch_name)
                if not similarity_hashes:
                    continue

                data.append([
                    arch_sha256,                                    # sha256 (arch-specific)
                    similarity_hashes.get('dylib_hash'),            # dylib_hash
                    similarity_hashes.get('import_hash'),           # import_hash
                    similarity_hashes.get('export_hash'),           # export_hash
                    similarity_hashes.get('entitlement_hash'),      # entitlement_hash
                    similarity_hashes.get('symhash'),               # symhash
                    current_time,                                   # analysis_date
                ])

            if not data:
                return None

            column_names = [
                'sha256',
                'macho_dylib_hash', 'macho_import_hash', 'macho_export_hash',
                'macho_entitlement_hash', 'macho_symhash',
                'analysis_date'
            ]

            column_type_names = [
                'FixedString(64)',
                'Nullable(FixedString(32))', 'Nullable(FixedString(32))', 'Nullable(FixedString(32))',
                'Nullable(FixedString(32))', 'Nullable(FixedString(32))',
                'DateTime64(3, \'UTC\')'
            ]

            return (data, column_names, column_type_names)

        return None

    def get_clickhouse_table(self) -> str:
        return "redb_hashes"