Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Second, let's abuse our NFS access now. On your Kali system, accomplish the following tasks. Generate a new SSH key using the ssh - keygen
Second, let's abuse our NFS access now.
On your Kali system, accomplish the following tasks.
Generate a new SSH key using the sshkeygen t rsa command. This will produce a RSAformat publicprivate keypair. Accept the default key location so that SSH can find the file in the future ~sshidrsa Leave the passphrase blank so there's no confusion about whether you have passwordless access or not.
Reference: sshkeygen
Mount the NFS disk from Metasploitable using the mount command, so that you can access the remote files inside of Kali. To accomplish this, you will first need to create an empty directory in Kali as a mount point where the network files will then appear at I suggest a location like tmpmetasploitable In order to mount a network disk, you need to be root, so use sudo as part of your command.
Reference: How to mount an NFS share in Linux
Using the mounted NFS disk, append your SSH public key the file ending in pub, as shown in your sshkeygen output to the end of the existing file rootsshauthorizedkeys file in the Metasploitable VM This will grant you passwordless SSH access to that system, as your SSH client will automatically use your key to authenticate. Note: You need to be root in Kali to edit this file as root in Metasploitable. NFS simply carries over your user ID number for root across the network.
Reference: man cat
Tip: This command is slightly tricky to accomplish with sudo if you want to use output redirection! which I would suggest A common trick is to write your command like this: sudo sh c 'COMMAND GOES HERE SOME OUTPUT FILE'
Demonstrate that you have accomplished this task by performing the following sequence, and taking a screenshot of the complete sequence :
From Kali, show your hostname: hostname could be kali or whatever hostname you chose when installing Kali
SSH from the Kali VM to the Metasploitable VM as the root user. The command should be ssh root@xxxxxxxx where xxxxxxxx is the IP address of the Metasploitable VM that you identified previously. If you correctly added your public key to the authorizedkeys file previously, when you try to SSH to the system and automatically present your private key, you should get immediate access, no password required.
At the prompt, show your hostname again: hostname should be metasploitable
Exit SSH via exit to return to Kali.
Deliverables:
Submit a screenshot demonstrating that you have successfully inserted your private key into the Metasploitable VM and now have passwordless logins to that system as the root user.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started