1
1
2
- require 'rex/proto/http'
3
2
require 'msf/core'
4
3
5
4
class Metasploit3 < Msf ::Auxiliary
@@ -16,7 +15,7 @@ def initialize
16
15
This module attempts to validate user provided credentials against
17
16
an IP Board web application.
18
17
} ,
19
- 'Author' => 'Christopher Truncer @ChrisTruncer ' ,
18
+ 'Author' => 'Christopher Truncer [email protected] ' ,
20
19
'License' => MSF_LICENSE
21
20
)
22
21
@@ -52,7 +51,7 @@ def do_login(user, pass, ip)
52
51
'method' => 'GET' ,
53
52
} , 10 )
54
53
55
- if not res
54
+ unless res
56
55
print_error "No response when trying to connect to #{ rhost_or_vhost } "
57
56
return :connection_error
58
57
end
@@ -72,9 +71,9 @@ def do_login(user, pass, ip)
72
71
'uri' => normalize_uri ( target_uri . path , "index.php?app=core&module=global§ion=login&do=process" ) ,
73
72
'method' => 'POST' ,
74
73
'vars_post' => {
75
- 'auth_key' => " #{ server_nonce } " ,
76
- 'ips_username' => " #{ user } " ,
77
- 'ips_password' => " #{ pass } " ,
74
+ 'auth_key' => server_nonce ,
75
+ 'ips_username' => user ,
76
+ 'ips_password' => pass ,
78
77
}
79
78
} )
80
79
@@ -84,10 +83,9 @@ def do_login(user, pass, ip)
84
83
# Iterate over header response. If the server is setting the ipsconnect and coppa cookie
85
84
# then we were able to log in successfully. If they are not set, invalid credentials were
86
85
# provided.
87
- res2 . headers . each do |key , value |
88
- if key . include? "Set-Cookie" and value . include? "ipsconnect" and value . include? "coppa"
89
- valid_creds = true
90
- end
86
+
87
+ if res2 . get_cookies . include? ( 'ipsconnect' ) && res2 . get_cookies . include? ( 'coppa' )
88
+ valid_creds = true
91
89
end
92
90
93
91
# Inform the user if the user supplied credentials were valid or not
0 commit comments