• Stars
    star
    156
  • Rank 239,589 (Top 5 %)
  • Language
    C
  • License
    Other
  • Created about 8 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A command line tool for creating malicious outlook rules

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.

More Repositories

1

SharpGPOAbuse

SharpGPOAbuse is a .NET application written in C# that can be used to take advantage of a user's edit rights on a Group Policy Object (GPO) in order to compromise the objects that are controlled by that GPO.
C#
1,017
star
2

dref

DNS Rebinding Exploitation Framework
JavaScript
482
star
3

KernelFuzzer

Cross Platform Kernel Fuzzer Framework
C
440
star
4

win_driver_plugin

A tool to help when dealing with Windows IOCTL codes or reversing Windows drivers.
Python
417
star
5

wePWNise

WePWNise generates architecture independent VBA code to be used in Office documents or templates and automates bypassing application control and exploit mitigation software.
Python
350
star
6

OSXFuzz

macOS Kernel Fuzzer
C
249
star
7

Azurite

Enumeration and reconnaissance activities in the Microsoft Azure Cloud.
PowerShell
247
star
8

Ninjasploit

A meterpreter extension for applying hooks to avoid windows defender memory scans
C
230
star
9

z3_and_angr_binary_analysis_workshop

Code and exercises for a workshop on z3 and angr
Python
209
star
10

SharpClipHistory

SharpClipHistory is a .NET application written in C# that can be used to read the contents of a user's clipboard history in Windows 10 starting from the 1809 Build.
C#
188
star
11

drozer-modules

Python
139
star
12

ViridianFuzzer

Kernel driver to fuzz Hyper-V hypercalls
C++
132
star
13

incognito

One Token To Rule Them All https://labs.mwrinfosecurity.com/blog/incognito-v2-0-released/
C
129
star
14

CVE-2018-4121

macOS 10.13.3 (17D47) Safari Wasm Exploit
JavaScript
120
star
15

GWTMap

Python
90
star
16

CVE-2016-7255

An exploit for CVE-2016-7255 on Windows 7/8/8.1/10(pre-anniversary) 64 bit
C++
84
star
17

N1QLMap

The tool exfiltrates data from Couchbase database by exploiting N1QL injection vulnerabilities.
Python
72
star
18

SharpGPO-RemoteAccessPolicies

A C# tool for enumerating remote access policies through group policy.
C#
71
star
19

defcon25_uac_workshop

UAC 0Day all day!
58
star
20

3d-accelerated-exploitation

3D Accelerated Exploitation
C
55
star
21

Athena

GUI Tool to generate threat intelligence information in various formats
C#
44
star
22

honeypot_recipes

A chef cookbook which can be used to quickly deploy a high interaction honeypot, using the sysdig and falco tools
Ruby
43
star
23

needle-agent

The iOS Agent for the Needle Security Assessment Framework
Objective-C
41
star
24

CalendarPersist

JXA script to allow programmatic persistence via macOS Calendar.app alerts.
JavaScript
41
star
25

coralsun

macOS Cython IOKit Utility Library
Python
40
star
26

avrop

ROP based Movfuscator VM
Assembly
29
star
27

mercury-modules

Extra modules for the Mercury Android Security Assessment Framework.
Python
25
star
28

jASMin

Python
24
star
29

fdpasser

Example of passing file descriptors into a container to perform a privilege escalation on the host
C
23
star
30

tapjacking-poc

Java
23
star
31

fingertec-tool

A tool for communicating with FingerTec access control devices, as well as other ZKTeco based devices
Python
21
star
32

gists

Short handy snippets from the @mwrlabs team
PowerShell
20
star
33

timeinator

Timeinator is an extension for Burp Suite that can be used to perform timing attacks over an unreliable network such as the internet.
Python
20
star
34

weasel

C
19
star
35

veripy

a network-centric compliance testing framework for verifying the operation of network equipment against the RFCs specified in ripe-554
Python
12
star
36

Ellume-COVID-Test_Research-Files

Java
11
star
37

jar-agent

Java
9
star
38

mercury-common

This repository contains Mercury components that are shared between the Agent and the Server/Console.
9
star
39

mwr-tls

A collection of utilities for interacting with SSL and X509 Certificates on Android.
Java
8
star
40

bsides18_breakfree

Example tools and output from BSides 2018 "I Want to Break Free"
Python
7
star
41

Cisco-UCM-SQLi-Scripts

Scripts that can be used to exploit CVE-2019-15972 which was an Authenticated SQLi issue in Cisco Unified Call Manager (UCM).
Python
7
star
42

rogue-agent

Java
5
star
43

ByteConverter

C++
1
star
44

Re-Desk-v2.3-Vulnerabilities

Python
1
star