@@ -44,14 +44,12 @@ def run_host(ip)
44
44
case result
45
45
when :success
46
46
print_good "#{ ip } :#{ rport } Login Successful #{ user } :#{ pass } "
47
- report_auth_info (
48
- :host => rhost ,
49
- :port => datastore [ 'RPORT' ] ,
50
- :sname => 'pcanywhere_data' ,
51
- :user => user ,
52
- :pass => pass ,
53
- :source_type => "user_supplied" ,
54
- :active => true
47
+ report_cred (
48
+ ip : rhost ,
49
+ port : datastore [ 'RPORT' ] ,
50
+ service_name : 'pcanywhere' ,
51
+ user : user ,
52
+ password : pass ,
55
53
)
56
54
return if datastore [ 'STOP_ON_SUCCESS' ]
57
55
print_status "Waiting to Re-Negotiate Connection (this may take a minute)..."
@@ -73,6 +71,31 @@ def run_host(ip)
73
71
74
72
end
75
73
74
+ def report_cred ( opts )
75
+ service_data = {
76
+ address : opts [ :ip ] ,
77
+ port : opts [ :port ] ,
78
+ service_name : opts [ :service_name ] ,
79
+ protocol : 'tcp' ,
80
+ workspace_id : myworkspace_id
81
+ }
82
+
83
+ credential_data = {
84
+ origin_type : :service ,
85
+ module_fullname : fullname ,
86
+ username : opts [ :user ] ,
87
+ private_data : opts [ :password ] ,
88
+ private_type : :password
89
+ } . merge ( service_data )
90
+
91
+ login_data = {
92
+ core : create_credential ( credential_data ) ,
93
+ status : Metasploit ::Model ::Login ::Status ::UNTRIED ,
94
+ } . merge ( service_data )
95
+
96
+ create_credential_login ( login_data )
97
+ end
98
+
76
99
def do_login ( user , pass , nsock = self . sock )
77
100
# Check if we are already at a logon prompt
78
101
res = nsock . get_once ( -1 , 5 )
0 commit comments