@@ -63,8 +63,8 @@ def community_strings
63
63
if not comm_str . nil? and not comm_str . empty?
64
64
comm_str . each do |c |
65
65
66
- #comm_type is for human display, access_type is passed to the credential
67
- #code using labels consistent with the SNMP login scanner
66
+ # comm_type is for human display, access_type is passed to the credential
67
+ # code using labels consistent with the SNMP login scanner
68
68
case registry_getvaldata ( key , c )
69
69
when 4
70
70
comm_type = 'READ ONLY'
@@ -86,7 +86,7 @@ def community_strings
86
86
# Save data to table
87
87
tbl << [ c , comm_type ]
88
88
89
- register_creds ( session . sock . peerhost , 161 , '' , c , 'snmp' , access_type )
89
+ register_creds ( session . session_host , 161 , '' , c , 'snmp' , access_type )
90
90
end
91
91
print_status ( "" )
92
92
@@ -156,14 +156,14 @@ def register_creds(client_ip, client_port, user, pass, service_name, access_type
156
156
credential_data = {
157
157
access_level : access_type ,
158
158
origin_type : :session ,
159
+ session_id : session_db_id ,
159
160
post_reference_name : self . fullname ,
160
161
private_data : pass ,
161
162
private_type : :password ,
162
163
username : user ,
163
164
workspace_id : myworkspace_id
164
165
}
165
166
166
- credential_data [ :session_id ] = session . db_record . id if !session . db_record . nil?
167
167
credential_data . merge! ( service_data )
168
168
credential_core = create_credential ( credential_data )
169
169
0 commit comments