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

[SMB] Allow force to disable SMBv1 #523

Merged
merged 4 commits into from
Dec 29, 2024
Merged

Conversation

XiaoliChan
Copy link
Contributor

@XiaoliChan XiaoliChan commented Dec 26, 2024

Description

Allow force to disable smbv1 in smb connection

Type of change

Please delete options that are not relevant.

  • [√] Bug fix (non-breaking change which fixes an issue)
  • [√] New feature (non-breaking change which adds functionality)

How Has This Been Tested?

nxc smb 127.0.0.1 -u a -p a --no-smbv1 --shares

Screenshots (if appropriate):

image

Checklist:

  • [√] I have ran Ruff against my changes (via poetry: poetry run python -m ruff check . --preview, use --fix to automatically fix what it can)
  • [√] I have added or updated the tests/e2e_commands.txt file if necessary
  • [√] New and existing e2e tests pass locally with my changes
  • [√] My code follows the style guidelines of this project (should be covered by Ruff above)
  • [×] If reliant on third party dependencies, such as Impacket, dploot, lsassy, etc, I have linked the relevant PRs in those projects
  • [√] I have performed a self-review of my own code
  • [√] I have commented my code, particularly in hard-to-understand areas
  • [×] I have made corresponding changes to the documentation (PR here: https://github.com/Pennyw0rth/NetExec-Wiki)

Signed-off-by: XiaoliChan <30458572+XiaoliChan@users.noreply.github.com>
@mpgn
Copy link
Collaborator

mpgn commented Dec 26, 2024

Smbv3 you mean no ?

@NeffIsBack
Copy link
Contributor

For what would you need it though?

nxc/protocols/smb.py Outdated Show resolved Hide resolved
nxc/protocols/smb.py Outdated Show resolved Hide resolved
@mpgn
Copy link
Collaborator

mpgn commented Dec 26, 2024

For what would you need it though?

could solve this kind of issue

#217

@NeffIsBack
Copy link
Contributor

For what would you need it though?

could solve this kind of issue

#217

Fair enough, sounds good

@XiaoliChan
Copy link
Contributor Author

XiaoliChan commented Dec 27, 2024

Smbv3 you mean no ?

Yes, so what should we call to the new args, or --no-smbv1?

@XiaoliChan
Copy link
Contributor Author

Test again
image

@XiaoliChan
Copy link
Contributor Author

XiaoliChan commented Dec 28, 2024

Now it won't break the smbv1 info in host info output

image

Signed-off-by: XiaoliChan <30458572+XiaoliChan@users.noreply.github.com>
Signed-off-by: XiaoliChan <30458572+XiaoliChan@users.noreply.github.com>
@mpgn
Copy link
Collaborator

mpgn commented Dec 28, 2024

Added my comments, if a user decide to use the --no-smbv1 then is normal to return None on the smbv1 info since the user don't want to check smbv1 (can be related to other thing than the shares :)
The big advantage: you don't have to change the logic from @NeffIsBack on the create_conn_obj method, just add the line no_smbv1 = self.args.no_smbv1 if self.args.no_smbv1 else no_smbv1 :)

image

@XiaoliChan
Copy link
Contributor Author

Added my comments, if a user decide to use the --no-smbv1 then is normal to return None on the smbv1 info since the user don't want to check smbv1 (can be related to other thing than the shares :)

Got you

The big advantage: you don't have to change the logic from @NeffIsBack on the create_conn_obj method, just add the line no_smbv1 = self.args.no_smbv1 if self.args.no_smbv1 else no_smbv1 :)

OK, just reverted that changed

@NeffIsBack NeffIsBack added enhancement New feature or request bug-fix This Pull Request fixes a bug labels Dec 29, 2024
@XiaoliChan XiaoliChan changed the title [SMB] Allow force to use smbv2 [SMB] Allow force to disable SMBv1 Dec 29, 2024
Signed-off-by: XiaoliChan <30458572+XiaoliChan@users.noreply.github.com>
@mpgn mpgn merged commit 2a15590 into Pennyw0rth:main Dec 29, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix This Pull Request fixes a bug enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants