Kamalika Datta

90 papers A 6C 16Misc 8Journal 28Unranked 32
YearRankTypeTitle / Venue / Authors
2026 J jnl
SN Comput. Sci.
Lennart Weingarten, Kamalika Datta, Rolf Drechsler
2025 C conf
DSD
Fatemeh Shirinzadeh, Abhoy Kole, Kamalika Datta, Saeideh Shirinzadeh, Rolf Drechsler
2025 conf
CCMCC
Saeideh Nabipour, Kamalika Datta, Abhoy Kole, Saeideh Shirinzadeh, Rolf Drechsler
2025 C conf
FDL
Lennart Weingarten, Kamalika Datta, Rolf Drechsler
2025 A conf
DATE
Lennart Weingarten, Kamalika Datta, Rolf Drechsler
2025 conf
ISMVL
Saeideh Nabipour, Kamalika Datta, Lennart Weingarten, Abhoy Kole, Rolf Drechsler
2025 C conf
DDECS
Anton Maidl, Abhoy Kole, Kamalika Datta, Jannis Stoppe, Rolf Drechsler
2025 conf
ISVLSI
Abhoy Kole, Mohammed E. Djeridane, Arighna Deb, Kamalika Datta, Indranil Sengupta, Rolf Drechsler
2025 J jnl
ACM J. Emerg. Technol. Comput. Syst.
Abhoy Kole, Mohammed E. Djeridane, Lennart Weingarten, Kamalika Datta, Rolf Drechsler
2024 J jnl
Frontiers Comput. Sci.
Mojtaba Noorallahzadeh, Mohammad Mosleh, Kamalika Datta
2024 A conf
DATE
Lennart Weingarten, Kamalika Datta, Abhoy Kole, Rolf Drechsler
2024 conf
ISVLSI
Abhoy Kole, Kamalika Datta, Rolf Drechsler
2024 A conf
DATE
Abhoy Kole, Arighna Deb, Kamalika Datta, Rolf Drechsler
2024 J jnl
ACM J. Emerg. Technol. Comput. Syst.
Abhoy Kole, Kamalika Datta, Indranil Sengupta, Rolf Drechsler
2024 conf
ACM Great Lakes Symposium on VLSI
Khushboo Qayyum, Abhoy Kole, Kamalika Datta, Muhammad Hassan, Rolf Drechsler
2024 conf
SOCC
Abhoy Kole, Kamalika Datta, Rolf Drechsler
2024 conf
ATS
Dev Narayan Yadav, Phrangboklang Lyngton Thangkhiew, F. Lalchhandama, Kamalika Datta, Rolf Drechsler, Indranil Sengupta
2024 Misc conf
VLSID
Fatemeh Shirinzadeh, Arighna Deb, Saeideh Shirinzadeh, Abhoy Kole, Kamalika Datta, Rolf Drechsler
2024 C conf
RC
Liam Hurwitz, Kamalika Datta, Abhoy Kole, Rolf Drechsler
2024 J jnl
ACM Trans. Embed. Comput. Syst.
Kousik Bhunia, Arighna Deb, Kamalika Datta, Muhammad Hassan, Saeideh Shirinzadeh, Rolf Drechsler
2024 conf
ATS
Fatemeh Shirinzadeh, Kamalika Datta, Saeideh Shirinzadeh, Abhoy Kole, Rolf Drechsler
2024 conf
ISED
Lennart Weingarten, Kamalika Datta, Rolf Drechsler
2024 J jnl
CoRR
Abhoy Kole, Mohammed E. Djeridane, Lennart Weingarten, Kamalika Datta, Rolf Drechsler
2023 conf
ASP-DAC
Arighna Deb, Kamalika Datta, Muhammad Hassan, Saeideh Shirinzadeh, Rolf Drechsler
2023 C conf
RC
Abhoy Kole, Kamalika Datta, Philipp Niemann, Indranil Sengupta, Rolf Drechsler
2023 A conf
DATE
Abhoy Kole, Arighna Deb, Kamalika Datta, Rolf Drechsler
2023 J jnl
it Inf. Technol.
Kamalika Datta, Arighna Deb, Abhoy Kole, Rolf Drechsler
2023 C conf
RC
Kamalika Datta, Abhoy Kole, Indranil Sengupta, Rolf Drechsler
2023 conf
iSES
Kamalika Datta, Rolf Drechsler
2023 conf
NANOARCH
Lennart Weingarten, Kamalika Datta, Rolf Drechsler
2023 conf
NEWCAS
Kamalika Datta, Arighna Deb, Fatemeh Shirinzadeh, Abhoy Kole, Saeideh Shirinzadeh, Rolf Drechsler
2022 J jnl
J. Syst. Archit.
F. Lalchhandama, Kamalika Datta, Sandip Chakraborty, Rolf Drechsler, Indranil Sengupta
2022 J jnl
J. Electron. Test.
Dev Narayan Yadav, Phrangboklang Lyngton Thangkhiew, Kamalika Datta, Sandip Chakraborty, Rolf Drechsler, Indranil Sengupta
2022 J jnl
J. Syst. Archit.
Dev Narayan Yadav, Phrangboklang Lyngton Thangkhiew, Kamalika Datta, Sandip Chakraborty, Rolf Drechsler, Indranil Sengupta
2022 J jnl
J. Circuits Syst. Comput.
F. Lalchhandama, Mukesh Sahani, Vompolu Mohan Srinivas, Indranil Sengupta, Kamalika Datta
2022 conf
GI-Jahrestagung
Kamalika Datta, Abhoy Kole, Indranil Sengupta, Rolf Drechsler
2022 conf
ISMVL
Kamalika Datta, Abhoy Kole, Indranil Sengupta, Rolf Drechsler
2022 C conf
DSD
Abhoy Kole, Kamalika Datta, Indranil Sengupta, Rolf Drechsler
2022 C conf
VLSI-SoC
Kamalika Datta, Saman Fröhlich, Saeideh Shirinzadeh, Dev Narayan Yadav, Indranil Sengupta, Rolf Drechsler
2022 C conf
DSD
Kamalika Datta, Saeideh Shirinzadeh, Phrangboklang Lyngton Thangkhiew, Indranil Sengupta, Rolf Drechsler
2020 J jnl
Integr.
Phrangboklang Lyngton Thangkhiew, Alwin Zulehner, Robert Wille, Kamalika Datta, Indranil Sengupta
2020 A conf
DATE
Kamalika Datta, Arko Dutt, Ahmed Zaky, Umesh Chand, Devendra Singh, Yida Li, Jackson Chun-Yang Huang, Aaron Thean, Mohamed M. Sabry Aly
2020 J jnl
IEEE Trans. Comput. Aided Des. Integr. Circuits Syst.
Abhoy Kole, Stefan Hillmich, Kamalika Datta, Robert Wille, Indranil Sengupta
2020 J jnl
J. Circuits Syst. Comput.
P. Mercy Nesa Rani, Kamalika Datta
2020 A conf
DATE
Abdallah M. Felfel, Kamalika Datta, Arko Dutt, Hasita Veluri, Ahmed Zaky, Aaron Voon-Yew Thean, Mohamed M. Sabry Aly
2019 conf
ASP-DAC
Alwin Zulehner, Kamalika Datta, Indranil Sengupta, Robert Wille
2019 Misc conf
VLSID
Yaswanth Krishna Yadav Danaboina, Pravanjan Samanta, Kamalika Datta, Indrajit Chakrabarti, Indranil Sengupta
2019 J jnl
J. Circuits Syst. Comput.
Leniency Marbaniang, Kamalika Datta
2019 Misc conf
VLSID
Tathagato Bose, Kamalika Datta, Indranil Sengupta
2019 J jnl
Integr.
Dev Narayan Yadav, Phrangboklang Lyngton Thangkhiew, Kamalika Datta
2019 Misc conf
VLSID
Naveen Murali G, Peddireddi Satya Vardhan, F. Lalchhandama, Kamalika Datta, Indranil Sengupta
2018 J jnl
IEEE Trans. Comput. Aided Des. Integr. Circuits Syst.
Abhoy Kole, Kamalika Datta, Indranil Sengupta
2018 J jnl
IEEE Trans. Very Large Scale Integr. Syst.
Rahul Gharpinde, Phrangboklang Lyngton Thangkhiew, Kamalika Datta, Indranil Sengupta
2018 J jnl
IEEE Trans. Circuits Syst. I Regul. Pap.
Phrangboklang Lyngton Thangkhiew, Rahul Gharpinde, Kamalika Datta
2018 conf
ISED
Phrangboklang Lyngton Thangkhiew, Kamalika Datta
2018 conf
ISMVL
Alwin Zulehner, P. Mercy Nesa Rani, Kamalika Datta, Indranil Sengupta, Robert Wille
2018 conf
ISMVL
Saeideh Shirinzadeh, Kamalika Datta, Rolf Drechsler
2018 conf
ISED
Naveen Murali G, F. Lalchhandama, Kamalika Datta, Indranil Sengupta
2018 J jnl
J. Syst. Archit.
Phrangboklang Lyngton Thangkhiew, Kamalika Datta
2017 C conf
RC
Leniency Marbaniang, Abhoy Kole, Kamalika Datta, Indranil Sengupta
2017 J jnl
CoRR
Rajarshi Ray, Arup Deka, Kamalika Datta
2017 conf
ISMVL
Abhoy Kole, P. Mercy Nesa Rani, Kamalika Datta, Indranil Sengupta, Rolf Drechsler
2017 C conf
RC
P. Mercy Nesa Rani, Abhoy Kole, Kamalika Datta, Indranil Sengupta
2017 Misc conf
VLSID
Abhoy Kole, Kamalika Datta
2017 C conf
RC
Abhoy Kole, Robert Wille, Kamalika Datta, Indranil Sengupta
2016 J jnl
IEEE J. Emerg. Sel. Topics Circuits Syst.
Abhoy Kole, Kamalika Datta, Indranil Sengupta
2016 conf
ISVLSI
F. Lalchhandama, Brojo Gopal Sapui, Kamalika Datta
2016 conf
ISED
Shuchishman Burman, Kamalika Datta, Robert Wille, Indranil Sengupta, Rolf Drechsler
2016 conf
IDT
Phrangboklang Lyngton Thangkhiew, Rahul Gharpinde, Varun Chowdhary Paturi, Kamalika Datta, Indranil Sengupta
2016 conf
ISED
Arghya P. Saikia Thengal, Naman Rastogi, Abhilash Medhi, Ritu Ranjan Shrivastwa, Kamalika Datta
2015 J jnl
IEEE Trans. Computers
Kamalika Datta, Indranil Sengupta, Hafizur Rahaman
2015 J jnl
Microelectron. J.
Kamalika Datta, Tanay Chattopadhyay, Indranil Sengupta
2015 Misc conf
VLSID
Eleonora Schönborn, Kamalika Datta, Robert Wille, Indranil Sengupta, Hafizur Rahaman, Rolf Drechsler
2015 conf
iNIS
Ritu Ranjan Shrivastwa, Kamalika Datta, Indranil Sengupta
2015 C conf
RC
Abhoy Kole, Kamalika Datta, Indranil Sengupta, Robert Wille
2014 Misc conf
VLSID
Kamalika Datta, Indranil Sengupta
2014 J jnl
Trans. Comput. Sci.
Kamalika Datta, Indranil Sengupta, Hafizur Rahaman, Rolf Drechsler
2014 conf
ACSS (2)
Kamalika Datta, Alhaad Gokhale, Indranil Sengupta, Hafizur Rahaman
2014 J jnl
ACM J. Emerg. Technol. Comput. Syst.
Kamalika Datta, Gaurav Rathi, Indranil Sengupta, Hafizur Rahaman
2014 conf
IDT
Sayak Chakraborti, Paturi Varun Chowdhary, Kamalika Datta, Indranil Sengupta
2014 C conf
DDECS
Eleonora Schönborn, Kamalika Datta, Robert Wille, Indranil Sengupta, Hafizur Rahaman, Rolf Drechsler
2014 C conf
RC
Robert Wille, Jannis Stoppe, Eleonora Schönborn, Kamalika Datta, Rolf Drechsler
2013 conf
IDT
Kamalika Datta, Indranil Sengupta, Hafizur Rahaman, Rolf Drechsler
2013 conf
ISED
Chandan Bandyopadhyay, Debashri Roy, Dipak Kumar Kole, Kamalika Datta, Hafizur Rahaman
2013 C conf
RC
Kamalika Datta, Gaurav Rathi, Robert Wille, Indranil Sengupta, Hafizur Rahaman, Rolf Drechsler
2013 J jnl
Multim. Tools Appl.
Kamalika Datta, Indranil Sengupta
2013 J jnl
J. Low Power Electron.
Kamalika Datta, Indranil Sengupta, Hafizur Rahaman
2013 conf
DTIS
Kamalika Datta, Vishal Shrivastav, Indranil Sengupta, Hafizur Rahaman
2012 conf
ISED
Kamalika Datta, Indranil Sengupta, Hafizur Rahaman
2012 Misc conf
VLSI Design
Kamalika Datta, Gaurav Rathi, Indranil Sengupta, Hafizur Rahaman
redb/extractors/apk_extractors/apk_inconsistency_tests.py
← Index redb/extractors/apk_extractors/apk_inconsistency_tests.py python
import inspect
import re
from datetime import datetime, timezone
from typing import Any

from redb.extractors.enum import Tag
from redb.extractors.apk_extractor import APKExtractor
from redb.models.dataclasses import APKInconsistencyTests

# Emulator detection indicator strings
EMULATOR_INDICATORS = {
    "generic", "sdk", "google_sdk", "Emulator",
    "goldfish", "ranchu", "Andy", "Genymotion",
    "BlueStacks", "nox", "ttVM_Hdragon",
}

# Root detection indicator strings
ROOT_INDICATORS = {
    "/system/app/Superuser.apk",
    "/system/xbin/su",
    "/system/bin/su",
    "com.noshufou.android.su",
    "com.thirdparty.superuser",
    "eu.chainfire.supersu",
    "com.koushikdutta.superuser",
    "com.topjohnwu.magisk",
}

# Standard DEX filename pattern
STANDARD_DEX_PATTERN = re.compile(r"^classes\d*\.dex$")


class APKInconsistencyTestsExtractor(APKExtractor):

    def __init__(
        self, filepath, log, exporters=None, index_prefix=None,
        known_benign=False, known_malicious=False,
        apk=None,
    ):
        super().__init__(
            filepath, log, exporters, index_prefix,
            known_benign, known_malicious, apk,
        )
        self.test_results = None
        self.log.debug(inspect.currentframe().f_code.co_name)

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

    def _test_zip_bomb(self):
        """Check if any ZIP entry has compression ratio > 100:1."""
        try:
            zf = self._get_zip_file()
            if not zf:
                return None
            with zf:
                for info in zf.infolist():
                    if info.compress_size > 0:
                        ratio = info.file_size / info.compress_size
                        if ratio > 100:
                            return True
            return False
        except Exception as e:
            self.log.warning(f"Error in zip bomb test: {e}")
            return None

    def _test_zip_duplicate_entries(self):
        """Check for duplicate filenames in ZIP directory."""
        try:
            zf = self._get_zip_file()
            if not zf:
                return None
            with zf:
                names = [info.filename for info in zf.infolist()]
                return len(names) != len(set(names))
        except Exception as e:
            self.log.warning(f"Error in duplicate entries test: {e}")
            return None

    def _test_zip_path_traversal(self):
        """Check for path traversal (../) in ZIP entry names."""
        try:
            for f in self._list_files():
                if ".." in f or f.startswith("/"):
                    return True
            return False
        except Exception as e:
            self.log.warning(f"Error in path traversal test: {e}")
            return None

    def _test_zip_suspicious_timestamps(self):
        """Check for timestamps at epoch (1980) or in the future."""
        try:
            zf = self._get_zip_file()
            if not zf:
                return None
            now = datetime.now()
            with zf:
                for info in zf.infolist():
                    try:
                        dt = datetime(*info.date_time)
                        if dt.year <= 1980 or dt > now:
                            return True
                    except (ValueError, TypeError):
                        continue
            return False
        except Exception as e:
            self.log.warning(f"Error in suspicious timestamps test: {e}")
            return None

    def _test_hidden_dex_files(self):
        """Check for DEX files not matching classes*.dex pattern."""
        try:
            for f in self._list_files():
                if f.endswith(".dex"):
                    basename = f.split("/")[-1]
                    if not STANDARD_DEX_PATTERN.match(basename):
                        return True
            return False
        except Exception as e:
            self.log.warning(f"Error in hidden DEX files test: {e}")
            return None

    def _test_manifest_component_mismatch(self):
        """Check for declared components that don't exist in DEX."""
        try:
            if not self._is_valid_apk():
                return None

            # Get all class names from DEX
            dex_classes = set()
            try:
                from androguard.core.dex import DEX
                for dex_data in (self.apk.get_all_dex() or []):
                    try:
                        d = DEX(dex_data)
                        for cls in d.get_classes():
                            name = cls.get_name()
                            if name:
                                # Convert "Lcom/example/Foo;" to "com.example.Foo"
                                dex_classes.add(
                                    name[1:-1].replace("/", ".") if name.startswith("L") else name
                                )
                    except Exception:
                        continue
            except Exception:
                return None

            if not dex_classes:
                return None

            # Check manifest components against DEX classes
            components = []
            try:
                components.extend(self.apk.get_activities() or [])
                components.extend(self.apk.get_services() or [])
                components.extend(self.apk.get_receivers() or [])
                components.extend(self.apk.get_providers() or [])
            except Exception:
                return None

            for comp in components:
                if comp and comp not in dex_classes:
                    # Component might use a shorthand; check with package prefix
                    package = self.apk.get_package() or ""
                    full_name = package + comp if comp.startswith(".") else comp
                    if full_name not in dex_classes:
                        return True

            return False
        except Exception as e:
            self.log.warning(f"Error in manifest component mismatch test: {e}")
            return None

    def _test_debuggable_release(self):
        """Check android:debuggable=true combined with a release signature."""
        try:
            if not self._is_valid_apk():
                return None

            is_debuggable = self.apk.get_attribute_value(
                "application", "debuggable"
            ) == "true"

            if not is_debuggable:
                return False

            # Check if it has a signing certificate (release builds have certs)
            try:
                certs = self.apk.get_certificates()
                if certs and len(certs) > 0:
                    return True
            except Exception:
                pass

            return False
        except Exception as e:
            self.log.warning(f"Error in debuggable release test: {e}")
            return None

    def _get_dex_strings(self):
        """Get all string constants from DEX files."""
        all_strings = set()
        try:
            from androguard.core.dex import DEX
            for dex_data in (self.apk.get_all_dex() or []):
                try:
                    d = DEX(dex_data)
                    for s in d.get_strings():
                        if s:
                            all_strings.add(s)
                except Exception:
                    continue
        except Exception:
            pass
        return all_strings

    def _test_emulator_detection_strings(self):
        """Check for emulator detection patterns in DEX strings."""
        try:
            if not self._is_valid_apk():
                return None

            dex_strings = self._get_dex_strings()
            for indicator in EMULATOR_INDICATORS:
                for s in dex_strings:
                    if indicator in s:
                        return True
            return False
        except Exception as e:
            self.log.warning(f"Error in emulator detection test: {e}")
            return None

    def _test_debugger_detection(self):
        """Check for debugger detection API calls in DEX."""
        try:
            if not self._is_valid_apk():
                return None

            dex_strings = self._get_dex_strings()
            debugger_patterns = {
                "isDebuggerConnected",
                "waitingForDebugger",
                "Debug.isDebuggerConnected",
            }
            for pattern in debugger_patterns:
                for s in dex_strings:
                    if pattern in s:
                        return True
            return False
        except Exception as e:
            self.log.warning(f"Error in debugger detection test: {e}")
            return None

    def _test_root_detection(self):
        """Check for root detection patterns in DEX."""
        try:
            if not self._is_valid_apk():
                return None

            dex_strings = self._get_dex_strings()
            for indicator in ROOT_INDICATORS:
                for s in dex_strings:
                    if indicator in s:
                        return True
            return False
        except Exception as e:
            self.log.warning(f"Error in root detection test: {e}")
            return None

    def extract(self):
        if not self._is_valid_apk():
            self.log.error(f"Invalid APK for {self.hash.sha256}")
            return None

        self.test_results = APKInconsistencyTests(
            test_zip_bomb=self._test_zip_bomb(),
            test_zip_duplicate_entries=self._test_zip_duplicate_entries(),
            test_zip_path_traversal=self._test_zip_path_traversal(),
            test_zip_suspicious_timestamps=self._test_zip_suspicious_timestamps(),
            test_hidden_dex_files=self._test_hidden_dex_files(),
            test_manifest_component_mismatch=self._test_manifest_component_mismatch(),
            test_debuggable_release=self._test_debuggable_release(),
            test_emulator_detection_strings=self._test_emulator_detection_strings(),
            test_debugger_detection=self._test_debugger_detection(),
            test_root_detection=self._test_root_detection(),
        )
        return self.test_results

    def _bool_to_nullable(self, val):
        """Convert bool/None to ClickHouse Nullable(UInt8)."""
        if val is None:
            return None
        return int(val)

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

            current_time = datetime.now(timezone.utc)
            t = self.test_results

            data = [[
                self.sha256,
                self._bool_to_nullable(t.test_zip_bomb),
                self._bool_to_nullable(t.test_zip_duplicate_entries),
                self._bool_to_nullable(t.test_zip_path_traversal),
                self._bool_to_nullable(t.test_zip_suspicious_timestamps),
                self._bool_to_nullable(t.test_hidden_dex_files),
                self._bool_to_nullable(t.test_manifest_component_mismatch),
                self._bool_to_nullable(t.test_debuggable_release),
                self._bool_to_nullable(t.test_emulator_detection_strings),
                self._bool_to_nullable(t.test_debugger_detection),
                self._bool_to_nullable(t.test_root_detection),
                current_time,
            ]]

            column_names = [
                'sha256',
                'test_zip_bomb', 'test_zip_duplicate_entries',
                'test_zip_path_traversal', 'test_zip_suspicious_timestamps',
                'test_hidden_dex_files', 'test_manifest_component_mismatch',
                'test_debuggable_release', 'test_emulator_detection_strings',
                'test_debugger_detection', 'test_root_detection',
                'analysis_date',
            ]

            column_type_names = [
                'FixedString(64)',
                'Nullable(UInt8)', 'Nullable(UInt8)',
                'Nullable(UInt8)', 'Nullable(UInt8)',
                'Nullable(UInt8)', 'Nullable(UInt8)',
                'Nullable(UInt8)', 'Nullable(UInt8)',
                'Nullable(UInt8)', 'Nullable(UInt8)',
                "DateTime64(3, 'UTC')",
            ]

            return (data, column_names, column_type_names)

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