Giter VIP home page Giter VIP logo

xrulez's Introduction

XRulez

"XRulez" is a Windows executable that can add malicious rules to Outlook from the command line of a compromised host.

To to learn more about the tool and the research behind this project, visit https://labs.mwrinfosecurity.com/blog/malicious-outlook-rules.

Description

Outlook rules can be used to achieve persistence on Windows hosts by creating a rule that executes a malicious payload. The rule can be setup to execute when the target receives an email with a specific keyword in the subject. An attacker can then drop shells on a target as and when they require by simply sending an email.

In the past, this technique could only be done via the Outlook GUI. However, XRulez achieves this from the command line.

XRulez is open source software, maintained by MWR InfoSecurity.

Getting Started

Prerequisites

  • The target machine has already been compromised.
  • The target has an authenticated session with the exchange server.
  • The target can access a file-share that we can write to.
  • We can send an email to the targets exchange account.

Usage

From a compromised system:

  1. Upload XRulez.exe to the target.

  2. Run XRulez.exe with '-l' to display a list of MAPI profiles installed on the system.

     XRulez.exe -l
    
  3. Run XRulez.exe with '-a' and the required parameters to add a new rule.

     XRulez.exe -a [--profile PROFILE] [--name NAME] [--trigger TRIGGER] [--payload PAYLOAD]
    
  4. Send an email to the target with the previously set keyword in the subject field.

  5. Wait for shell.

XRulez takes four required parameters when adding a new rule.

  • Profile Name: Outlook MAPI Profile, installed profiles can be found using '-l'.
  • Rule Name: A rule description, e.g SPAM Filter.
  • Rule Trigger: Keyword that will be searched for in the subject field of all incoming messages.
  • Payload Path: Path to the application that will be executed when the condition is met.

XRulez scans %APPDATA%\Microsoft\Outlook\ for .xml files that represent Outlook profiles. It also provides the last modified time and a suggestion for the profile to select based on the modification times. However, the .xml files are only updated when Outlook is closed. This could cause confusion if the user has just swapped accounts. Most users however will have only one default profile, called "Outlook".

After the rule has been created, XRulez can be removed from the target system and is no longer needed.

The payload application can be anything that is opened normally by ShellExec. This includes .exe, .bat, .vbs. It doesn't include .ps1 files, as by default they're opened in the default text editor.

Since MAPI is architecture dependent, different versions will be required for 32-bit / 64-bit systems. Ensure that you're using the correct version before you run XRulez.exe. If you fail to do so, a popup box will be displayed to the user stating that "MAPI can't find an Outlook client".

Limitations

Outlook must be open on the target machine. If not, there will be no session to share and therefore no connection to Exchange.

Outlook uses ShellExec to open the payload application which means that the payload can't be executed with arguments, requiring the payload to be an all enclosed application hosted on the disk or externally.

Compiling

In order to compile from source, you'll need to include / link the following headers and libraries.

License

XRulez is released under a 3-clause BSD License. See LICENSE for full details.

xrulez's People

Contributors

jaszmigi avatar rookuu avatar sam-b avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.