We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44f79f5 commit 2bc1767Copy full SHA for 2bc1767
lib/msf/base/sessions/ldap.rb
@@ -42,7 +42,17 @@ def bootstrap(datastore = {}, handler = nil)
42
session = self
43
session.init_ui(user_input, user_output)
44
45
- @info = "LDAP #{datastore['USERNAME']} @ #{@peer_info}"
+ username = datastore['USERNAME']
46
+ if username.blank?
47
+ begin
48
+ whoami = client.ldapwhoami
49
+ rescue Net::LDAP::Error => e
50
+ ilog('ldap session opened with no username and the target does not support the LDAP whoami extension')
51
+ else
52
+ username = whoami.delete_prefix('u:').split('\\').last
53
+ end
54
55
+ @info = "LDAP #{username} @ #{@peer_info}"
56
end
57
58
def execute_file(full_path, args)
0 commit comments