Binding a shell to the target for remote access

In the previous recipe, we analyzed how to exploit a Windows SP2 machine and add a new user account. But the connection was terminated immediately after the execution of exploit. In this recipe, we will move a step ahead and bind a shell to the target so that we can set up a remote connectivity with the target and gain control over it. The process is similar to the one mentioned in the previous recipe. All we have to do is use a different payload that can start a shell for us on the target machine.

Getting ready

We will again start off by launching our msfconsole and our target is the same as in the Penetration testing on a Windows XP SP2 machine recipe. We will use the same dcom vulnerability and ...

Get Metasploit Penetration Testing Cookbook 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.