Discord finds bot token in my compiled dll on my GitHub

Viewed 86

I'm setting up a program that will run on a Linux VPS, and I'm a little confused.

Here's what I've got set up: I have a Linux VPS running.

Every time I merge my GitHub repo's dev branch to master, it will automatically deploy a publish folder in the repo to the VPS containing all the compiled components, inc the main .dll.

I have a service on the VPS that picks up the main .dll and runs it.

The bot's token is stored in a .resx file that is in the .gitignore file, and as such, isn't in the repo.

The problem I'm having is, Discord notifies me it's found my bot's token in the compiled .dll on the GitHub. I was under the impression that as the .dll was compiled that the token would be either impossible or extremely difficult to extract. I may be wrong.

Is there any way around this? The bot is written in C# DotNetCore.

Thanks, Josh

1 Answers

Download a decompiler like Telerik Just Decompile and you'll see the string. I think you can find in a text editor as well.

If you want a way around Discord finding token in your public repository, make your repository private.

If you want to store something private in an exe/dll and want it to remain private, your only option is to not distribute your exe/dll.

Related