Giter VIP home page Giter VIP logo

notionterm's Introduction

notionterm

Embed reverse shell in Notion pages.
Hack while taking notes


demo


FOR βž•:

  • Hiding attacker IP in reverse shell (No direct interaction between attacker and target machine. Notion is used as a proxy hosting the reverse shell)
  • Demo/Quick proof insertion within report
  • High available and shareable reverse shell (desktop, browser, mobile)
  • Encrypted and authenticated remote shell

NOT FOR βž–:

  • Long and interactive shell session (see tacos for that)

Why? πŸ€”

The focus was on making something fun while still being usable, but that's not meant to be THE solution for reverse shell in the pentester's arsenal

How? πŸ€·β€β™‚οΈ

Just use notion as usual and launch notionterm on target.

Requirements πŸ–ŠοΈ

  • Notion software and API key
  • Allowed HTTP communication from the target to the notion domain
  • Prior RCE on target

roughly inspired by the great idea of OffensiveNotion and notionion!

TL;DR

Learn command and flags is too boring: Use wrap-notionterm.sh

Quickstart

πŸ—οΈ Set-up

  1. Create a page and give to the integration API key the permissions to have page write access
  2. Build notionterm and transfer it on target machine (see Build)

πŸ‘Ÿ Run

There are 3 main ways to run notionterm:

"normal" mode
Get terminal, stop/unstop it, etc...
notionterm [flags]
Start the shell with the button widget: turn ON, do you reverse shell stuff, turn OFF to pause, turn ON to resume etc...
"server" mode
Ease notionterm embedding in any page
notionterm --server [flags]
Start a shell session in any page by creating an embed block with URL containing the page id (CTRL+Lto get it): https://[TARGET_URL]/notionterm?url=[NOTION_PAGE_ID].
light mode
Only perform HTTP traffic from target β†’ notion
notionterm light [flags]

Build

As notionterm is aimed to be run on target machine it must be built to fit with it.

Thus set env var to fit with the target requirement:

GOOS=[windows/linux/darwin]

Simple build

git clone https://github.com/ariary/notionterm.git && cd notionterm
GOOS=$GOOS go build notionterm.go

You will need to set API key and notion page URL using either env var (NOTION_TOKEN & NOTION_PAGE_URL) or flags (--token & --page-url)

"All-inclusive" build

Embed directly the notion integration API token and notion page url in the binary. ⚠️ everybody with access to the binary can retrieved the token. For security reason don't share it and remove it after use.

Set according env var:

export NOTION_PAGE_URL=[NOTION_PAGE_URL]
export NOTION_TOKEN=[INTEGRATION_NOTION_TOKEN]

And build it:

git clone https://github.com/ariary/notionterm.git && cd notionterm
./static-build.sh $NOTION_PAGE_URL $NOTION_TOKEN $GOOS

notionterm's People

Contributors

ariary 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

notionterm's Issues

Change initialization

Create button & terminal block instead of trying to retrieve it at initialization

Fast & simple inclusion in page

To ease the inclusion of terminal in a page:

  • giving a page link notionterm would create the button & the code block directly
  • To go further and make it dynamicπŸ’‘one page with link configuration. notionterm will repeatedly ask the page to grab Notion page link. Once Notion page link is retrieved => make the steps above

In that way, to get a Shell in a page all I need is:

  1. Get the link of my page
  2. Paste it the Notion configuration page
  3. Wait notionterm block creation

Add template page

Share a link of the notionterm page:
-> public notion page without editing right

I meet a problem when i run "./notionterm"

os : ubuntu:20.04
this is specific info

root@docker-desktop:/home/notionterm# ./notionterm
./notionterm: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./notionterm)

Optimize request occurence

Limit the number of « request » prefixed function as possible.

for exemple in the Init function, perform only 1 request to search for the Notion page configuration

Ease terminal management

Add a richtext instead of writing following.
Like this we can check if it is a command by only checking the last rich text

Handle long time command

Print partial result of long time running command:

  • each X Time flush the buffer result in terminal block code

Handle directory changement

  • Init page and write current directory (? in buttion caption?)
  • Handle when user type cd => change directory on page + change path for command execution

RichText limit size

When the command output is big:

body failed validation: body.code.rich_text[2].text.content.length should be ≀ `2000`, instead was `13647`

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.