Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'msf/core'
- class MetasploitModule < Msf::Post
- #include Msf::Post::Common
- #include Msf::Post::Android::System
- #include Msf::Session::Provider::SingleCommandShell
- def initialize(info={})
- super(update_info(info,
- 'Name' => 'android Manage get_apps',
- 'Description' => %q{
- Get all apps in android device
- },
- 'License' => MSF_LICENSE,
- 'Author' => [ 'CorrM' ],
- 'Platform' => [ 'android' ],
- 'SessionTypes' => [ 'meterpreter', 'shell' ]
- ))
- end
- def run
- #print_status(session.core.methods.join(', '))
- #return
- # Check Platform
- if !session.platform.eql?("android")
- print_error("This Script for android [ONLY].!!")
- return
- end
- # Get Apps
- get_device_apps()
- #print_line(session.platform)
- print_good("Bye, CorrM.")
- end
- def get_device_apps
- print_line(session.shell_command('pm list packages -f'))
- end
- def shell_commandx(cmd, ret_read)
- buff = ""
- session.shell_write(cmd + "\n")
- if ret_read
- 1.times do |i|
- res = session.shell_read(-1, 0.01)
- buff << res if res
- end
- end
- buff
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement