Added check for additional outgoing call event

This commit is contained in:
Nex 2022-01-28 17:21:28 +01:00
parent 5513e6e9e3
commit 90d05336da

View File

@ -9,10 +9,11 @@ from .base import AndroidExtraction
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
ACTION_NEW_OUTGOING_SMS = "android.provider.Telephony.NEW_OUTGOING_SMS" INTENT_NEW_OUTGOING_SMS = "android.provider.Telephony.NEW_OUTGOING_SMS"
ACTION_SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED" INTENT_SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED"
ACTION_DATA_SMS_RECEIVED = "android.intent.action.DATA_SMS_RECEIVED" INTENT_DATA_SMS_RECEIVED = "android.intent.action.DATA_SMS_RECEIVED"
ACTION_PHONE_STATE = "android.intent.action.PHONE_STATE" INTENT_PHONE_STATE = "android.intent.action.PHONE_STATE"
INTENT_NEW_OUTGOING_CALL = "android.intent.action.NEW_OUTGOING_CALL"
class DumpsysReceivers(AndroidExtraction): class DumpsysReceivers(AndroidExtraction):
@ -26,17 +27,20 @@ class DumpsysReceivers(AndroidExtraction):
def check_indicators(self): def check_indicators(self):
for result in self.results: for result in self.results:
if result["activity"] == ACTION_NEW_OUTGOING_SMS: if result["activity"] == INTENT_NEW_OUTGOING_SMS:
self.log.info("Found a receiver to intercept outgoing SMS messages: \"%s\"", self.log.info("Found a receiver to intercept outgoing SMS messages: \"%s\"",
result["receiver"]) result["receiver"])
elif result["activity"] == ACTION_SMS_RECEIVED: elif result["activity"] == INTENT_SMS_RECEIVED:
self.log.info("Found a receiver to intercept incoming SMS messages: \"%s\"", self.log.info("Found a receiver to intercept incoming SMS messages: \"%s\"",
result["receiver"]) result["receiver"])
elif result["activity"] == ACTION_DATA_SMS_RECEIVED: elif result["activity"] == INTENT_DATA_SMS_RECEIVED:
self.log.info("Found a receiver to intercept incoming data SMS message: \"%s\"", self.log.info("Found a receiver to intercept incoming data SMS message: \"%s\"",
result["receiver"]) result["receiver"])
elif result["activity"] == ACTION_PHONE_STATE: elif result["activity"] == INTENT_PHONE_STATE:
self.log.info("Found a receiver monitoring telephony state: \"%s\"", self.log.info("Found a receiver monitoring telephony state/incoming calls: \"%s\"",
result["receiver"])
elif result["activity"] == INTENT_NEW_OUTGOING_CALL:
self.log.info("Found a receiver monitoring outgoing calls: \"%s\"",
result["receiver"]) result["receiver"])
def run(self): def run(self):
@ -49,17 +53,20 @@ class DumpsysReceivers(AndroidExtraction):
activity = None activity = None
for line in output.split("\n"): for line in output.split("\n"):
# Find activity block markers. # Find activity block markers.
if line.strip().startswith(ACTION_NEW_OUTGOING_SMS): if line.strip().startswith(INTENT_NEW_OUTGOING_SMS):
activity = ACTION_NEW_OUTGOING_SMS activity = INTENT_NEW_OUTGOING_SMS
continue continue
elif line.strip().startswith(ACTION_SMS_RECEIVED): elif line.strip().startswith(INTENT_SMS_RECEIVED):
activity = ACTION_SMS_RECEIVED activity = INTENT_SMS_RECEIVED
continue continue
elif line.strip().startswith(ACTION_PHONE_STATE): elif line.strip().startswith(INTENT_PHONE_STATE):
activity = ACTION_PHONE_STATE activity = INTENT_PHONE_STATE
continue continue
elif line.strip().startswith(ACTION_DATA_SMS_RECEIVED): elif line.strip().startswith(INTENT_DATA_SMS_RECEIVED):
activity = ACTION_DATA_SMS_RECEIVED activity = INTENT_DATA_SMS_RECEIVED
continue
elif line.strip().startswith(INTENT_NEW_OUTGOING_CALL):
activity = INTENT_NEW_OUTGOING_CALL
continue continue
# If we are not in an activity block yet, skip. # If we are not in an activity block yet, skip.