Here’s a collection of hacked-together scripts to integrate some HTB goodness into your Discord server. These scripts were pieced together to run either on-demand or as services on a server. They use SQLite to keep track of state, so you don't spam duplicate posts every time you run them.
Heads Up: These scripts make heavy use of Discord’s community server features (forum threads). If you don’t want Discord sniffing through your messages (like more than anyways), temporarily enable the community server mode, create a few forums, and then disable it afterward.
- Fetches unreleased HTB machines and creates forum threads and announcements.
- Automatically schedules Discord events for machine releases.
- Fetches unreleased HTB challenges and posts them on Discord.
- Creates forum threads with appropriate tags (category and difficulty).
- Posts announcements in a designated channel.
- Grabs platform warnings and notices from HTB, recently some box related credentials were pushed over that endpoint.
- Use
!osint [machine_name]
to fetch machine profiles, creator details, and more.
- Set up a
.env
file in the project directory with the following values:DISCORD_TOKEN=<Your Discord Bot Token> HTB_BEARER_TOKEN=<Your HTB API Token> GENERAL_CHANNEL_ID=<Channel ID for Announcements> FORUM_CHANNEL_ID=<Forum Channel ID for Threads> MACHINES_CHANNEL_ID=<Channel ID for Machines Announcements> CHALL_VOICE_CHANNEL_ID=<Voice Channel ID for Event Scheduling>
Make sure your Discord bot has these permissions:
- Send Messages
- Manage Threads
- Manage Events
- View Channels
Each script uses SQLite to keep track of already posted challenges, machines, or notices. Databases like machines.db
and challenges.db
will be created automatically when you run the scripts.
These scripts are far from perfect and were thrown together to solve a specific set of problems. If you use them and they work, great! If not, feel free to tweak them for your needs.
If something breaks, it’s probably on you (but maybe on me).