Skip to content

Conversation

@PratGit1606
Copy link

Hey!
This PR introduces a fully interactive Discord bot for pwn.college that lets users access and browse Linux man pages directly within Discord. It first tries the local system man command, then falls back to online sources (cheat.sh, man7.org, and manpages.org) if the page isn’t available locally.

The bot formats everything into clean Discord embeds with pagination, search, and section navigation. It also caches fetched pages to speed up later lookups and reduce network calls.
The idea is to make it easier for dojo participants to quickly reference command documentation while solving challenges, without needing to switch environments.

I’ve tested it with multiple commands and it seems stable, happy to adjust anything if needed!

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +423 to +429
@bot.command()
async def manclear(ctx, *, command: str):
try:
path = get_cache_path(command)
if os.path.exists(path):
os.remove(path)
await ctx.send(f"Cache wiped for `{command}`")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Sanitize manclear input before unlinking files

The manclear command passes the raw user input straight into get_cache_path and then deletes whatever path is returned. Because get_cache_path simply joins CACHE_DIR with the provided string, a crafted command such as !manclear ../../config escapes the cache folder and lets the bot remove arbitrary files the process can access. Other handlers rely on sanitize_command, but this path bypasses validation entirely. The command should validate or sanitize the input before constructing the filesystem path.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant