@@ -39,11 +39,11 @@ def run_host(ip)
39
39
40
40
each_user_pass do |user , pass |
41
41
next if user . blank? or pass . blank?
42
- print_status "Trying #{ user } :#{ pass } "
42
+ print_status ( "Trying #{ user } :#{ pass } " )
43
43
result = do_login ( user , pass )
44
44
case result
45
45
when :success
46
- print_good "#{ ip } :#{ rport } Login Successful #{ user } :#{ pass } "
46
+ print_good ( "#{ ip } :#{ rport } Login Successful #{ user } :#{ pass } " )
47
47
report_cred (
48
48
ip : rhost ,
49
49
port : datastore [ 'RPORT' ] ,
@@ -52,16 +52,16 @@ def run_host(ip)
52
52
password : pass ,
53
53
)
54
54
return if datastore [ 'STOP_ON_SUCCESS' ]
55
- print_status " Waiting to Re-Negotiate Connection (this may take a minute)..."
55
+ print_status ( ' Waiting to Re-Negotiate Connection (this may take a minute)...' )
56
56
select ( nil , nil , nil , 40 )
57
57
connect
58
58
hsr = pca_handshake ( ip )
59
59
return if hsr == :handshake_failed
60
60
when :fail
61
- print_status "#{ ip } :#{ rport } Login Failure #{ user } :#{ pass } "
61
+ print_status ( "#{ ip } :#{ rport } Login Failure #{ user } :#{ pass } " )
62
62
when :reset
63
- print_status "#{ ip } :#{ rport } Login Failure #{ user } :#{ pass } "
64
- print_status " Connection Reset Attempting to reconnect in 1 second"
63
+ print_status ( "#{ ip } :#{ rport } Login Failure #{ user } :#{ pass } " )
64
+ print_status ( ' Connection reset attempting to reconnect in 1 second' )
65
65
select ( nil , nil , nil , 1 )
66
66
connect
67
67
hsr = pca_handshake ( ip )
@@ -90,7 +90,7 @@ def report_cred(opts)
90
90
91
91
login_data = {
92
92
core : create_credential ( credential_data ) ,
93
- status : Metasploit ::Model ::Login ::Status ::UNTRIED ,
93
+ status : Metasploit ::Model ::Login ::Status ::SUCCESSFUL ,
94
94
} . merge ( service_data )
95
95
96
96
create_credential_login ( login_data )
@@ -110,18 +110,18 @@ def do_login(user, pass, nsock=self.sock)
110
110
end
111
111
112
112
# Check if we are now at the password prompt
113
- unless res and res . include? " Enter password"
114
- print_error "Problem Sending Login: #{ res . inspect } "
113
+ unless res and res . include? ' Enter password'
114
+ print_error ( "Problem Sending Login: #{ res . inspect } " )
115
115
return :abort
116
116
end
117
117
118
118
epass = encryption_header ( encrypt ( pass ) )
119
119
nsock . put ( epass )
120
120
res = nsock . get_once ( -1 , 20 )
121
- if res . include? " Login unsuccessful"
121
+ if res . include? ' Login unsuccessful'
122
122
disconnect ( )
123
123
return :reset
124
- elsif res . include? " Invalid login"
124
+ elsif res . include? ' Invalid login'
125
125
return :fail
126
126
else
127
127
disconnect ( )
@@ -130,38 +130,38 @@ def do_login(user, pass, nsock=self.sock)
130
130
end
131
131
132
132
def pca_handshake ( ip , nsock = self . sock )
133
- print_status " Handshaking with the pcAnywhere service"
133
+ print_status ( ' Handshaking with the pcAnywhere service' )
134
134
nsock . put ( "\x00 \x00 \x00 \x00 " )
135
135
res = nsock . get_once ( -1 , 5 )
136
- unless res and res . include? " Please press <Enter>"
137
- print_error "Handshake(1) failed on Host #{ ip } aborting. ( Error: #{ res . inspect } )"
136
+ unless res and res . include? ' Please press <Enter>'
137
+ print_error ( "Handshake(1) failed on Host #{ ip } aborting. Error: #{ res . inspect } " )
138
138
return :handshake_failed
139
139
end
140
140
141
141
nsock . put ( "\x6F \x06 \xff " )
142
142
res = nsock . get_once ( -1 , 5 )
143
143
unless res and res . include? "\x78 \x02 \x1b \x61 "
144
- print_error "Handshake(2) failed on Host #{ ip } aborting. ( Error: #{ res . inspect } )"
144
+ print_error ( "Handshake(2) failed on Host #{ ip } aborting. Error: #{ res . inspect } " )
145
145
return :handshake_failed
146
146
end
147
147
148
148
nsock . put ( "\x6f \x61 \x00 \x09 \x00 \xfe \x00 \x00 \xff \xff \x00 \x00 \x00 \x00 " )
149
149
res = nsock . get_once ( -1 , 5 )
150
150
unless res and res == "\x1b \x62 \x00 \x02 \x00 \x00 \x00 "
151
- print_error "Handshake(3) failed on Host #{ ip } aborting. ( Error: #{ res . inspect } )"
151
+ print_error ( "Handshake(3) failed on Host #{ ip } aborting. Error: #{ res . inspect } " )
152
152
return :handshake_failed
153
153
end
154
154
155
155
nsock . put ( "\x6f \x62 \x01 \x02 \x00 \x00 \x00 " )
156
156
res = nsock . get_once ( -1 , 5 )
157
157
unless res and res . include? "\x00 \x7D \x08 "
158
- print_error "Handshake(4) failed on Host #{ ip } aborting. ( Error: #{ res . inspect } )"
158
+ print_error ( "Handshake(4) failed on Host #{ ip } aborting. Error: #{ res . inspect } " )
159
159
return :handshake_failed
160
160
end
161
161
162
162
res = nsock . get_once ( -1 , 5 ) unless pca_at_login? ( res )
163
163
unless pca_at_login? ( res )
164
- print_error "Handshake(5) failed on Host #{ ip } aborting. ( Error: #{ res . inspect } )"
164
+ print_error ( "Handshake(5) failed on Host #{ ip } aborting. Error: #{ res . inspect } " )
165
165
return :handshake_failed
166
166
end
167
167
end
0 commit comments