Closed danilo-dellorco closed 1 month ago
Thank you for posting this in the correct place, and giving lots of good details to help diagnose/debug. I've included it into the larger overhaul issue, please see: https://github.com/rapid7/metasploit-framework/issues/19154
The
webcam_snap
andwebcam_stream
commands within theandroid/meterpreter/reverse_tcp
payload are not functioning on Android devices running version 11 and higher. This issue appears to stem from the changes in Android’s window management and permission model introduced in recent Android releases, which restrict the ability to add views to the WindowManager without a valid activity or token.Reproduction Steps
This likely results from a
WindowManager$BadTokenException
, indicating that the SurfaceView is being added without a valid token or activity context, which is no longer permitted in Android 11 and above.Impact
Affects any attempt to capture images or stream video using the Android Meterpreter webcam_snap or webcam_stream commands on devices running Android 11 and higher. This affects post-exploitation capabilities on the Android platform, particularly for devices running newer Android versions. Platform:
Possible Cause
The issue likely arises due to changes in how Android 11+ manages windows and tokens. The
WindowManager.addView()
method cannot be called with null tokens or without a valid running activity context. Updating the implementation to handle the stricter security model (e.g., using the Camera2 API, or ensuring a valid activity token is used) may resolve the issue.