How to do it...

  1. To interact with the target machine's registry, we will use the reg command, but before we start using it, let's see the available options:
meterpreter > regUsage: reg [command] [options]

Interact with the target machine's registry. The following are the options:

    • -d <opt>: The data to store in the registry value
    • -h: Help menu
    • -k <opt>: The registry key path (for example, HKLM\Software\Foo)
    • -r <opt>: The remote machine name to connect to (with current process credentials)
    • -t <opt>: The registry value type (for example, REG_SZ)
    • -v <opt>: The registry value name (for example, Stuff)
    • -w: Sets the KEY_WOW64 flag and valid values (32/64)

The following are the commands:

    • enumkey: Enumerates the supplied registry key (

Get Metasploit Penetration Testing Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.