This script allows you to pull data from HackTheBox and store it in Notion with a pre-made template.
- Clone this repository:
git clone https://github.com/spllat-00/hackthebox-notion.git
- Install the required Python packages
pip install -r requirements.txt
-
Setup your Notion integration and get your API credentials.
-
Visit Notion integration
-
Add to your required workspace
-
Give the integration a name:
HackTheBox-Notion
(Can be anything as per user) -
Add logo for easy access. (Logo provided in git repo)
-
Hit Submit
-
View your Secret, by click
show
-
This is:
NOTIONTOKEN
in .env file
-
-
Setup your Hack The Box App Token
-
Visit Hack The Box Settings
-
Click
Generate Identifier
-
Give it a name:
HackTheBox2Notion
(Can be anything as per user) -
Set the expire time:
1 Year
-
Copy the App Token
-
This is:
HTBTOKEN
in .env file
-
-
Copy the template Hack The Box - Notion Template
-
Open the Hack The Box - Notion Template
-
Click
Duplicate
button on top-right -
Select the same workspace you created the Notion Integration.
-
-
Connect the newly created notion integration to the workspace
-
Find the Database ID
- On the database of gallery, hit 6-dots
- Select
Copy link
- It will be in this format: https://www.notion.so/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx?v=someOtherFormathere&pvs=4
- We need the
xxxxx
part, that should be of 32 characters - This is:
NOTIONDATABASEID
-
Create a file with name
.env
file withNOTIONTOKEN
,HTBTOKEN
andNOTIONDATABASEID
values from above
Run the script
python3 HTB2Notion.py
For checking the help, use flag: -h / --help
- Running of the script for new machines
- Template
- HTBTOKEN=HTB_JWT_Token
- NOTIONTOKEN=Notion_Token
- NOTIONDATABASEID=32-bit-ID
Contributions are welcome! Feel free to open issues or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.