Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attributes to client #117

Merged

Conversation

n00tmeg
Copy link
Contributor

@n00tmeg n00tmeg commented Nov 30, 2017

This PR add the following attributes to the Client:

  • peer_native_lm
  • primary_domain
  • default_name
  • default_domain
  • dns_host_name
  • dns_domain_name
  • dns_tree_name
  • os_version
  • dialect

Some negotiation and authentication methods/classes needed to be update in order to sets these attributes.

This fixes #112 .

Verification Steps

  • bundle install
  • Verify you can authenticate to a remote server with ruby examples/authenticate.rb <ip-address> <username> <password>
  • Verify you can authenticate anonymously to a remote server with ruby examples/anonymous_auth.rb <ip-address>

rake spec

  • rake spec
  • VERIFY no failures

Also, customize the NTLM client flags to make sure the peer/server will
return as much information as possible.
Also, add helper methods to the SMB1 NegotiateResponse and
NegotiateResponseExtended classes.
@@ -123,11 +171,17 @@ def initialize(dispatcher, smb1: true, smb2: true, username:, password:, domain:
@username = username.encode('utf-8') || ''.encode('utf-8')
@max_buffer_size = MAX_BUFFER_SIZE

negotiate_version_flag = 0x02000000
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NEGOTIATE_VERSION flag is missing in rubyntlm library. I had to manually add it. I also submitted a PR to add it: WinRb/rubyntlm#38

@coveralls
Copy link

coveralls commented Nov 30, 2017

Coverage Status

Coverage increased (+0.8%) to 97.608% when pulling 1f4acc6 on chrisdlf:feature/112/add_attributes_to_client into e7eecf1 on rapid7:master.

@coveralls
Copy link

coveralls commented Nov 30, 2017

Coverage Status

Coverage increased (+0.8%) to 97.608% when pulling 3acb1ef on chrisdlf:feature/112/add_attributes_to_client into e7eecf1 on rapid7:master.

@coveralls
Copy link

coveralls commented Nov 30, 2017

Coverage Status

Coverage increased (+0.8%) to 97.608% when pulling 9cd9e43 on chrisdlf:feature/112/add_attributes_to_client into e7eecf1 on rapid7:master.

@dmohanty-r7 dmohanty-r7 merged commit 0983838 into rapid7:master Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add additional attributes to client
4 participants