NFSv4 Support - #1383
Draft
NeffIsBack wants to merge 4 commits into
Draft
Conversation
| def print_host_info(self): | ||
| root_escape_str = colored(f"root escape:{self.root_escape}", host_info_colors[1 if self.root_escape else 0], attrs=["bold"]) | ||
| self.logger.display(f"Supported NFS versions: ({', '.join(str(x) for x in self.nfs_versions)}) ({root_escape_str})") | ||
| def plaintext_login(self, domain, username, password): |
| protocol = make_protocol("4.2", share="/export") | ||
| protocol.nfs = SimpleNamespace( | ||
| root_handle=lambda share: {"status": 0, "mountinfo": {"fhandle": b"root"}}, | ||
| status_name=lambda status: str(status), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR will add all flavors of NFSv4 (4.0, 4.1, 4.2) including authentication that is specified in the respective RFCs such as Kerberos auth to NetExec. The raw NFS client will be implemented by the library itself with the following PR: Pennyw0rth/NfsClient#5
So far it works, and that's beautiful, okay?! The code is pretty bad so far, but I will improve it when the library is finished and fix the bugs that exist at the moment (no idea why it says "root escape:unknown" and then successfully lists the entire file system lol).
The RFCs that NFS 4.0, 4.1 and 4.2 are based on were implemented by codex sol on ultra with my guidance:
The implementation in NetExec was also done by AI so far, but that will change once I clean up the implementation and fix the logic.
Type of change
Insert an "x" inside the brackets for relevant items (do not delete options)
Setup guide for the review
sudo apt installnfs-kernel-server`/etc/exportspointing to an existing folder, e.g.:/var/nfs/general *()nxc nfs localhost(or the appropriate target)For a Kerberos setup you have to ask AI, because setting up a KDC etc. on Linux is quite complicated.
Don't be scare by the amount of added lines, +500 are just tests...
Screenshots (if appropriate):
Checklist:
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
poetry run ruff check ., use--fixto automatically fix what it can)tests/e2e_commands.txtfile if necessary (new modules or features are required to be added to the e2e tests)