Skip to content

2. Quickstart

HuskyHacks edited this page Feb 27, 2022 · 24 revisions

TL;DR

How do I get this thing working so I can see what it can do?

  1. Make a Notion account
  2. Go to the Notion API developer page and log in. Create an Integration user (New integration). Copy that user's API key.
  3. Create a page in your Notion book (any page will do). This is your "Listener." Copy the final part of the URL or press ctl+L in the Desktop app. This is your parent page ID. Keep track of it for a moment. Deck out your page with a banner and emoji icon. Have fun with it.

image

  1. In the upper-right corner of your Notion page, click "Share" and "Invite." Add your Notion Developer API account to this page.
  2. Download the Linux agent from the Release section.
  3. Run the release agent in debug mode (-d) and input the values for each prompt.
husky@ubuntu:~/Desktop/OffensiveNotion/bin/linux_debug/debug$ ./offensive_notion -d
[*] Starting!
Getting config options!
[*] Enter agent sleep interval > 5
[*] Enter agent jitter time > 0
[*] Enter parent page id > [...your parent page ID..]
[*] Enter API Key > 
[...your API key...]
[*] Enter Config File Path > 
[leave blank]
[*] Enter Log Level (1-4) > 
2
  1. Your agent should now check into your Listener page:

image

  1. Run commands! Make a To-Do block (/todo in the Notion app), enter shell whoami 🎯, and watch the magic unfold.

image

See the Agent Interaction section for the full list of available commands.

Python Installer Script

The Python script (main.py) is included as a quick and easy agent configuration/generation utility. It must be run with root privileges and has some dependencies.

Why main.py?

The primary purpose of the Python script is to make it easy for the operator to set the agent's config parameters in the code of the agent itself so it can be run without arguments. The script automates all of the steps required to do so.

Usage

husky@ubuntu:~/Desktop/OffensiveNotion$ sudo python3 main.py -h
usage: main.py [-h] [-o {linux,windows}] [-b {debug,release}] [-c] [-w] [-m {powershell,wget-linux,wget-psh,python-linux,python-windows}] [-ip HOSTIP] [-p PORT]

OffensiveNotion Setup. Must be run as root. Generates the OffensiveNotion agent in a container.

optional arguments:
  -h, --help            show this help message and exit
  -o {linux,windows}, --os {linux,windows}
                        Target OS
  -b {debug,release}, --build {debug,release}
                        Binary build
  -c, --c2lint          C2 linter. Checks your C2 config by creating a test page on your Listener.
  -w, --webdelivery     Start a web delivery server to host and deliver your agent. Provides convenient one liners to run on the target.
  -m {powershell,wget-linux,wget-psh,python-linux,python-windows}, --method {powershell,wget-linux,wget-psh,python-linux,python-windows}
                        Method of web delivery
  -ip HOSTIP, --hostIP HOSTIP
                        Web server host IP.
  -p PORT, --port PORT  Web server host port.

How To

The main.py script handles all setup and agent compilation. You need docker in order to use it. If you don't have docker already:

$ sudo apt-get install docker.io

Next, install the Python dependencies:

$ pip3 install poetry
$ poetry shell
$ poetry install

Then run the main script:

$ sudo python3 main.py [-h] [-o {linux,windows}] [-b {debug,release}] [-c] [-w] [-m {powershell,wget-linux,wget-psh,python-linux,python-windows}] [-ip HOSTIP] [-p PORT]

The only two arguments that are required are -o, for the OS, and -b, for the build (debug or release). The additional arguments are covered in the Misc section.

Once the script is running, follow the prompts to perform the installation. It creates a Docker container and creates the agent inside, then copies it to your physical host and deletes the container.

Clone this wiki locally