Jump to content
Kev

Can you track processes accessing the camera and microphone?

Recommended Posts

In certain investigations, it may arise that you need to find the following:

  • What process was using the camera or microphone?
  • When was the last session?
  • How long was that session?

Using the contents of the following reg keys, you can to determine when and how long a process had access to privacy protected resources. These resources include the microphone, webcam, bluetooth, location, contacts and more. For this blog, I will focus on the microphone and webcam as an example.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam\

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone\

 

Below is an example of the typical entries in the webcam directory. There are several entries including Microsoft and non-Microsoft applications

1*HBWyqsx-hDG87NmeP6x12w.png

 

Microsoft applications are stored in as child keys but non-Microsoft applications (which are of the most interest) are stored in the NonPackaged child key.

 

Within the NonPackaged directory, you can see that the name of the keys are the full path of an executable with # replacing \.

 

Each entry has two values, LastUsedTimeStart and LastUsedTimeStop, with the timestamps in FILETIME format.

 

From the example above, you are able to determine, Zoom.exe had access to my webcam for 27.2 minutes (between 2020/06/01 04:30:52 UTC and 2020/06/01 04:58:04 UTC).

 

Whether you are looking at what processes had access to a webcam or even trying to prove long a user’s conversation may have been, this is a great source of information.

 

Testing RAT-like behaviour

I needed to test if this also applied to more malicious methods of accessing the microphone. I used a meterpreter post-exploit module to record audio from Windows VM.

1*dVLoREAsPCxubdhYodKVDw.png

 

As soon as I ran the recording command, a new entry was populated from where my meterpreter shell was executed. Pretty cool!

1*vgarRfJgMjMhXe0HSUnf0w.png

Monitoring

If we wanted to track all sessions (not just the last), it is easy with Sysmon. If you are running something like the Swift on Security configuration, you will need to add an inclusion line for event id 12,13 and 14 (Registry modification):

<TargetObject condition="contains">SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\</TargetObject> <!-- When a process accesses bluetooth, location, webcam, microphone etc, the timestamps of last access are updated here. HKLM and HCKU -->

After updating your configuration, a Sysmon event will now be created when the registry keys are created or updated. Below is the LastUsedTime key being updated for Skype.exe accessing my microphone in the Sysmon event log.

 

1*1H1KUIqo5SLvbgVibx3esw.png

 

The timestamp in the log are still in hex which needs to be coverted to decimal then to a human readable timestamp, however the timestamp of the event itself is also very accurate.

 

Conclusion

What spurred this off is when I came across this page in the settings, and it got me thinking on where this data is stored.

 

1*LmKwrHOZhmVjiDOALi1fpA.png

 

It will be interesting if there are other places that track historical sessions without the use of monitoring. This would be more valuable to forensic analysts that don’t always have nice logs.

 

Further research also could be done to identify which device the process is accessing (front camera, USB camera etc). I would also like to explore if this method catches more covert RAT malware.

 

Thanks for reading,

 

Source Zach

 

  • Upvote 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...