Krzysztof Szewczyk

irc bots

Why?

I decided to write an IRC bot. My main idea was creating the bot that was constrained in some way (in this case, it could only be programmed in brainfuck), and in the same time allows IRC users to create their own programs, remove existing programs and editing them. My main concern would be trolls clearing the bot memory, but I didn't worry about that much really. What I thought, is nobody will try to do this anyway, as the #esoteric channel on freenode is mostly cool guys, and even if someone would try to do that, they probably wouldn't know how to modify the bot internals, so I've been pretty much safe. I left some form of safety though, so all bot files are posted onto github whenever they are changed, so every single change can be reverted without problems. Also, the bot ran on another user's account, therefore I didn't worry about someone performing RCE using the bot (albeit it'd hurt me if unnoticed; I'd notice it anyway before exploitation though - just a security measure).

Rise and fall of the idea

I've been looking for IRC bot frameworks out there. At first I thought about C, but it seemed too unpractical to use C. Then, I thought about brainfuck and piping it via telnet, giving it some extended filesystem capabilities. And this was literally it, I made a brainfuck frankenstein that would execute brainfuck code and manage the filesystem, in the meantime communicating with the IRC server via telnet. I did overlook various amount of things, one of these being allowing the bot do DM everyone possible, via a nasty redirection bug. Happily, one of users decided to bring it down (so it wouldn't damage anyone really). I didn't get to rewriting it, but one day (I believe, it'll happen in near future) I'll rewrite the bot.

How would I write it today?

Note: I am writing this as of February 2020. Well, I'd definitely use something like C or Java. My main choice is C, because my VPS environment doesn't have much RAM to spare, and Java would definitely take some of the free RAM I can afford, therefore that's my main idea.

What about the functionality?

I like the programmable bot idea. I'd add more security measures though, and I'd program out some applications for users to use. I wouldn't use brainfuck ofcourse, rather, I'd just hardcode them to the bot, so no one removes them or accidentally modifies them. Another plus of this would be, I can write my for instance chess host in my language of choice (for instance, C), and no one else will use C for his nasty ideas.

When will I revive the bot?

No idea really. I didn't get to rewriting it yet. Possibly in the nearest future as I've said before. I've got a couple of important things to do, like applying for the discrete mathematics course in MIMUW and solving their entry tasks. As I'll have some free time, I'll definitely take on this idea.