home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / general / gtmhh3_1.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  23.5 KB  |  498 lines

  1. _____________________________________________________________
  2.  
  3. GUIDE TO (mostly) HARMLESS HACKING
  4.  
  5. Vol. 3 Number 1
  6.  
  7. How to protect yourself from email bombs!
  8. ______________________________________________________________
  9.  
  10. Email bombs! People like angry johnny [xchaotic], AKA the "Unamailer," have
  11. made the news lately by arranging for 20 MB or more of email -- tens of
  12. thousands of  messages -- to flood into his victims' email accounts.
  13.  
  14. Email bombing can be bad news for two reasons. One, the victim can't easily
  15. find any of their legitimate email in that giant garbage heap of spam. Two,
  16. the flood of messages ties up mail servers and chews up communications
  17. bandwidth.
  18.  
  19. Of course, those are the two main reasons that email bombers make their
  20. attacks: to mess up people's email and/or harm the ISPs they target. The
  21. email bomb is a common weapon of war against Internet hosts controlled by
  22. spammers and con artists.
  23.  
  24. News stories make it sound like email bombing victims are, ahem, s*** out of
  25. luck. But we aren't. We know, because johnny xchaotic (who prefers to be
  26. called "angry johnny," by the way) -- the Christmas email bomber -- told the
  27. press that he had targeted both the Happy Hacker list's Supreme
  28. Commanderess, Carolyn Meinel. (Someone simultaneously attacked the Happy
  29. Hacker list itself but no one has stepped forward to take credit for the
  30. attempt). 
  31.  
  32. But as you know from the fact that we got the Happy Hacker Digest out after
  33. the attack, and by the fact that Meinel kept answering her email, there are
  34. ways to beat the email bombers.
  35.  
  36. Now most of these are techniques for use by experts only. But if you are,
  37. like most of us on this list, a newbie, you may be able to win points with
  38. your ISP by emailing its technical help people with some of the information
  39. within this guide. Maybe then they'll forgive you if your shell log file
  40. gets to looking a little too exciting!
  41.  
  42. My first line of defense is to use several on-line services. That way,
  43. whenever one account is getting hacked, bombed, etc., I can just email all
  44. my correspondents and tell them where to reach me. Now I've never gotten
  45. bombed into submission, but I have gotten hacked badly and often enough that
  46. I once had to dump an ISP in disgust. Or, an ISP may get a little too
  47. anxious over your hacking experiments. So it's a good idea to be prepared to
  48. jump accounts.
  49.  
  50. But that's a pretty chicken way to handle email bombing. Besides, a member
  51. of the Happy Hacker list says that the reason angry johnny didn't email bomb
  52. all the accounts I most commonly use is because he persuaded johnny to just
  53. bomb one for publicity purposes. But even if johnny had bombed all my
  54. favorite accounts, I could have been back on my feet in a hurry.
  55.  
  56. There are several ways that either your ISP or you can defeat these attacks.
  57.  
  58. The simplest defense is for your ISP to block mail bombs at the router. This
  59. only works, however, if the attack is coming from one or a few hosts. It
  60. also only works if your ISP agree to help you out. Your ISP may just chicken
  61. out and close your account.
  62.  
  63. ***************************
  64. Newbie note: routers are specialized computers that direct traffic. A host
  65. is a computer on the Internet.
  66. ***************************
  67.  
  68. But what if the attack comes from many places on the Internet? That happened
  69. to me on Christmas day when angry johnny took credit for an email bombing
  70. attack that also hit a number of well-known US figures such as evangelist
  71. Billy Graham, President Bill Clinton and House Majority Leader Newt
  72. Gingrich. (I blush to find myself in such company).
  73.  
  74. The way angry johnny worked this attack was to set up a program that would
  75. go to one computer that runs a program to handle email lists and
  76. automatically subscribe his targets to all lists handled by that computer.
  77. Then his program went to another computer that handles email lists and
  78. subscribed his targets to all the lists it handled, and so on.
  79.  
  80. I was able to fix my problem within a few minutes of discovery. Xchaotic had
  81. subscribed all these lists to my address cmeinel@swcp.com. But I use my
  82. private domain, techbroker.com, to receive email. Then I pipe all this from
  83. my nameserver at Highway Technologies to whatever account I find useful at
  84. the time. So all I had to do was go to the Highway Technologies Web site and
  85. configure my mail server to pipe email to another account. 
  86.  
  87. **************************
  88. Newbie note: a mail server is a computer that handles email. It is the
  89. computer that sends you email when you hook your personal computer up to the
  90. Internet and give it a command to upload or download your email.
  91. **************************
  92.  
  93. ***********************
  94. Evil genius tip: You can do something like this by creating a file in your
  95. shell account (you do have a shell account, don't you? SHELL ACCOUNT! All
  96. good hackers should have a SHELL ACCOUNT!) named .forward. This file directs
  97. your email to another email account of your choice.
  98. ***********************
  99.  
  100. If angry johnny had email bombed cmeinel@techbroker.com, I would have piped
  101. all that crud to dev/null and requested that my correspondents email to
  102. carolyn@techbroker.com, etc. It's a pretty flexible way of handling things.
  103. And my swcp.com accounts work the same way. That ISP, Southwest Cyberport,
  104. offers each user several accounts all for the same price, which is based on
  105. total usage.  So I can create new email addresses as needed.
  106.  
  107. Warning -- this technique -- every technique we cover here -- will still
  108. cause you to lose some email. But I figure, why get obsessive over it?
  109. According to a study by a major paging company, a significant percentage of
  110. email simply disappears. No mail daemon warning that the message failed,
  111. nothing. It just goes into a black hole. So if you are counting on getting
  112. every piece of email that people send you, dream on.
  113.  
  114. But this doesn't solve my ISP's problem. They still have to deal with the
  115. bandwidth problem of all that crud flooding in. And it's a lot of crud. One
  116. of the sysadmins at Southwest Cyberport told me that almost every day some
  117. luser email bombs one of their customers. In fact, it's amazing that angry
  118. johnny got as much publicity as he did, considering how commonplace email
  119. bombing is. So essentially every ISP somehow has to handle the email bomb
  120. problem.
  121.  
  122. How was angry johnny was able to get as much publicity as he did? You can
  123. get an idea from this letter from Lewis Koch, the journalist who broke the
  124. story (printed with his permission):
  125.  
  126. *******************
  127. From: Lewis Z Koch <lzkoch@mcs.net>
  128. Subject: Question
  129.  
  130. Carolyn:
  131.  
  132. First, and perhaps most important, when I called you to check if you had
  133. indeed been email bombed, you were courteous enough to respond with
  134. information.  I think it is a tad presumptuous for you to state that "as a
  135. professional courtesy I am _letting_ Lewis Koch get the full scoop."  This
  136. was a story that was, in fact, exclusive.
  137.  
  138. (Carolyn's note: as a victim I knew technical details about the attack that
  139. Koch didn't know. But since Koch tells me he was in contact with angry
  140. johnny in the weeks leading up to the mass email bombings of Christmas 1996,
  141. he clearly knew a great deal more than I about the list of johnny's targets.
  142. I also am a journalist, but deferred to Koch by not trying to beat him to
  143. the scoop.)
  144.  
  145. Second, yes I am a subscriber and I am interested in the ideas you advance.
  146. But that interest does not extend to feeding you -- or single individual
  147. or group -- :"lots of juicy details."  The details of any story lay in the
  148. writing and commentary I offer the public.  "Juicy" is another word for
  149. sensationalism, a tabloid approach -- and something I carefully avoid. 
  150.  
  151. (Carolyn's note: If you wish to see what Koch wrote on angry johnny, you may
  152. see it in the Happy Hacker Digest of Dec. 28, 1996, posted at the Hackers
  153. forum at http://www.infowar.com/cgi-shl/login.exe.)
  154.  
  155. The fact is I am extraordinarily surprised by some of the reactions I have
  156. received from individuals, some of whom were targets, others who are
  157. bystanders.  
  158.  
  159. The whole point is that there are extraordinary vulnerabilities to and on
  160. the Net -- vulnerabilities which are being ignored...at the peril of us all.
  161.  
  162. Continuing: "However, bottom line is that the email bomber used a technique
  163. that is ridiculously lame -- so lame that even Carolyn Meinel could turn
  164. off the attack in mere minutes. Fry in dev/null, email bomber!"
  165.  
  166. johnny made the point several times that the attack was "simple."  It was
  167. deliberately designed to be simple. I imagine -- I know -- that if he, or
  168. other hackers had chosen to do damage, serious, real damage, they could
  169. easily do so. They chose not to.    
  170.  
  171. One person who was attacked and was angry with my report.  He  used
  172. language such as" his campaign of terror," "the twisted mind of 'johnny',"
  173. "psychos like 'johnny'," "some microencephalic moron,""a petty gangster" to
  174. describe johnny. 
  175.  
  176. This kind of thinking ignores history and reality.  If one wants to use a
  177. term such as "campaign of terror" they should check into the history of the
  178. Unabomber, or the group that bombed the Trade Center, or the Federal
  179. Building in Oklahoma City...or look to what has happened in Ireland or
  180. Israel.  There one finds "terrorism."
  181.  
  182. What happened was an inconvenience --equivalent, in my estimation, to the
  183. same kind of inconvenience people experienced when young people blocked the
  184. streets of major cities in protest against the war in Vietnam.  People were
  185. inconvenienced --- but the protesters were making a point about an illegal
  186. and unnecessary war that even the prosecutors of the war, like Robert
  187. McNamara knew from the beginning was a lost venture.  Hundreds of thousands
  188. of people lost their lives in that war -- and if some people found
  189. themselves inconvenienced by people protesting against it -- I say, too
  190. d*** bad.
  191.  
  192. Thank you for forwarding my remarks to your list
  193.  
  194. ***********************
  195.  
  196. Ahem. I'm flattered, I guess. Are you suggesting the Happy Hacker list --
  197. with its habit of ***ing out naughty words -- and evangelist Billy Graham --
  198. whose faith I share -- are of an Earth-shaking level of political bad
  199. newsness comparable to the Vietnam War? I'm sure you don't really think
  200. this. But let's get some perspective on this, OK?
  201.  
  202. So what are some more ways to fight email bombs?
  203.  
  204. For bombings using email lists, one approach is to run a program that sorts
  205. through the initial flood of the email bomb for those "Welcome to the Tomato
  206. Twaddler List!" messages which tell how to unsubscribe. These programs then
  207. automatically compose unsubscribe messages and send them out.
  208.  
  209. Damien Sorder (jericho@dimensional.com) has set up an ftp  site to
  210. distribute one of these programs. To get it, ftp to:
  211.  
  212. ftp.nova.dimensional.com
  213. /pub/security/security.utils/unix/unsubscribe.mailist.perl
  214.  
  215. Another way your ISP can help you is to provide a program called Procmail
  216. (which runs on the Unix operating system. For details, Zach Babayco
  217. (zachb@netcom.com) has provided the following article. Thank you, Zach!
  218.  
  219. *******************************
  220. Defending Against Email-Bombing and Unwanted Mail
  221.  
  222. Copyright (C) Zach Babayco, 1996
  223.  
  224. [Before I start this article, I would like to thank Nancy McGough for letting 
  225. me quote liberally from her Filtering Mail FAQ, available at http://www.cis.
  226. ohio-state.edu/hypertext/faq/usenet/mail/filtering-faq/faq.html.  This is 
  227. one of the best filtering-mail FAQs out there, and if you have any 
  228. problems with my directions or want to learn more about filtering mail, 
  229. this is where you should look.]
  230.  
  231. Lately, there are more and more people out there sending you email that 
  232. you just don't want, like "Make Money Fast!" garbage or lame ezines that 
  233. you never requested or wanted in the first place.  Worse, there is the 
  234. email bomb.  
  235.  
  236. There are two types of email bombs, the Massmail and the Mailing List bomb:
  237.  
  238. 1) Massmail-bombing.  This is when an attacker sends you hundreds, or 
  239. perhaps even thousands of pieces of email, usually by means of a script 
  240. and fakemail.  Of the two types, this is the easier to defend against,
  241. since the messages will be coming from just a few addresses at the most.
  242.  
  243. 2) Mailing List bombs.  In this case, the attacker will subscribe you to
  244. as many mailing lists as he or she can.  This is much worse than a massmail
  245. because you will be getting email from many different mailing lists, and
  246. will have to save some of it so that you can figure out how to unsubscribe
  247. from each list.
  248.  
  249. This is where Procmail comes in.  Procmail (pronounced prok-mail) is a
  250. email filtering program that can do some very neat things with your mail,
  251. like for example, if you subscribe to several high-volume mailing lists,
  252. it can be set up to sort the mail into different folders so that all the
  253. messages aren't all mixed up in your Inbox.  Procmail can also be
  254. configured to delete email from certain people and addresses.
  255.  
  256.  
  257. Setting up Procmail
  258. -------------------
  259.  
  260. First, you need to see if your system has Procmail installed.  From the
  261. prompt, type:
  262.  
  263. > which procmail
  264.  
  265. If your system has Procmail installed, this command will tell you where
  266. Procmail is located.  Write this down - you will need it later.
  267.  
  268. *NOTE* If your system gives you a response like "Unknown command: which" 
  269. then try substituting 'which' with 'type', 'where', or 'whereis'.
  270.  
  271. If you still cannot find Procmail, then it is probably a good bet that 
  272. your system does not have it installed.  However, you're not completely 
  273. out of luck - look at the FAQ I mentioned at the beginning of this file 
  274. and see if your system has any of the programs that it talks about.
  275.  
  276. Next, you have to set up a resource file for Procmail.  For the rest of this 
  277. document, I will use the editor Pico.  You may use whichever editor you feel 
  278. comfortable with.
  279.  
  280. Make sure that you are in your home directory, and then start up your editor.
  281.  
  282. > cd
  283. > pico .procmailrc
  284.  
  285. Enter the following in the .procmailrc file:
  286.  
  287. # This line tells Procmail what to put in its log file.  Set it to on when 
  288. # you are debugging.
  289. VERBOSE=off
  290.  
  291. # Replace 'mail' with your mail directory.
  292. MAILDIR=$HOME/mail
  293.  
  294. # This is where the logfile and rc files will be kept
  295. PMDIR=$HOME/.procmail
  296.  
  297. LOGFILE=$PMDIR/log
  298. # INCLUDERC=$PMDIR/rc.ebomb
  299. (yes, type the INCLUDERC line WITH the #)
  300.  
  301. Now that you've typed this in, save it and go back up to your home directory.
  302.  
  303. > cd
  304. > mkdir .procmail
  305.  
  306. Now go into the directory that you just made, and start your editor up with 
  307. a new file: rc.ebomb:
  308.  
  309. IMPORTANT:  Be sure that you turn off your editor's word wrapping during 
  310. this part.  You will need to have the second, third, and fourth lines of 
  311. this next example all on one line.  With Pico, use the -w flag.  Consult 
  312. your editor's manual page for instructions on turning off its word wrapping.
  313. Make sure that when you edit it, you leave NO SPACES in that line.
  314.  
  315. > cd .procmail
  316. > pico -w rc.noebomb
  317.  
  318. # noebomb - email bomb blocker
  319.  
  320. :0
  321. * ! ^((((Resent-)?(From|Sender)|X-Envelope-From):|From )(.*[^.%@a-z0-9])?
  322. (Post(ma?(st(e?r)?|n)|office)|Mail(er)?|daemon|mmdf|root|uucp|LISTSERV|owner
  323. |request|bounce|serv(ices?|er))([^.!:a-z0-9]|$)))
  324. * ! ^From:.*(postmaster|Mailer|listproc|majordomo|listserv|cmeinel|johnb)
  325. * ! ^TO(netstuff|computing|pcgames)
  326. /dev/null
  327.  
  328. Lets see what these do.  The first line tells Procmail that this is the 
  329. beginning of a "recipe" file.  A recipe it basically what it sounds like 
  330. - it tells the program what it should look for in each email message, and 
  331. if it finds what it is looking for, it performs an action on the message 
  332. - forwarding it to someone; putting it in a certain folder; or in this 
  333. case, deleting it.
  334.  
  335. The second, third, and fourth lines (the ones beginning with a *)are called 
  336. CONDITIONS.  The asterisk (*) tells Procmail that this is the beginning of a 
  337. condition.  The ! tells it to do the OPPOSITE of what it would normally do.
  338.  
  339. Condition 1:
  340.  
  341. * ! ^((((Resent-)?(From|Sender)|X-Envelope-From):|From )(.*[^.%@a-z0-9])?
  342. (Post(ma?(st(e?r)?|n)|office)|Mail(er)?|daemon|mmdf|root|uucp|LISTSERV|owner
  343. |request|bounce|serv(ices?|er))([^.!:a-z0-9]|$)))
  344.  
  345. Don't freak out over this, it is simpler than it seems at first glance.  
  346. This condition tells Procmail to look at the header of a message, and see 
  347. if it is from one of the administrative addresses like root or 
  348. postmaster, and also check to see if it is from a mailer-daemon (the 
  349. thing that sends you mail when you bounce a message).  If a message IS 
  350. from one of those addresses, the recipe will put the message into your 
  351. inbox and not delete it.
  352.  
  353. Advanced User Note:  Those of you who are familiar with Procmail are 
  354. probably wondering why I require the user to type in that whole long line 
  355. of commands, instead of using the FROM_MAILER command.  Well, it looked 
  356. like a good idea at first, but I just found out a few days ago that 
  357. FROM_MAILER also checks the Precedence: header for the words junk, bulk, 
  358. and list.  Many (if not all) mailing-list servers have either Precedence: 
  359. bulk or Precedence: list, so if someone subscribes you to several hundred 
  360. lists, FROM_MAILER would let most of the messages through, which is NOT 
  361. what we want.  
  362.  
  363. Condition 2:
  364.  
  365. * ! ^From:.*(listproc|majordomo|cmeinel|johnb)
  366.  
  367. This condition does some more checking of the From: line in the header.  
  368. In this example, it checks for the words listproc, majordomo, cmeinel, 
  369. and johnb.  If it is from any of those people, it gets passed on to your 
  370. Inbox.  If not, it's a goner.  This is where you would put the usernames 
  371. of people who normally email you, and also the usernames of mailing-list 
  372. servers, such as listproc and majordomo.  When editing this line, 
  373. remember to: only put the username in the condition, not a persons full 
  374. email address, and remember to put a | between each name.
  375.  
  376. Condition 3:
  377.  
  378. * ! ^TO(netnews|crypto-stuff|pcgames)
  379.  
  380. This final condition is where you would put the usernames of the mailing 
  381. lists that you are subscribed to (if any).  For example, I am subscribed 
  382. to the netnews, crypto-stuff, and pcgames lists.  When you get a message 
  383. from most mailing lists, most of the time the list address will be in the 
  384. To: or Cc: part of the header, rather than the From: part.  This line 
  385. will check for those usernames and pass them through to your Inbox if 
  386. they match.  Editing instructions are the same as the ones for Condition 2.
  387.  
  388. The final line, /dev/null, is essentially the trash can of your system.  
  389. If a piece of email does not match any of the conditions, (i.e. it isn't 
  390. from a mail administrator, it isn't from a listserver or someone you 
  391. write to, and it's not a message from one of your usual mailing lists) 
  392. Procmail dumps the message into /dev/null, never to be seen again.
  393.  
  394. Ok.  Now you should have created two files:  .procmailrc and rc.noebomb.  
  395. We need one more before everything will work properly.  Save rc.noebomb 
  396. and exit your editor, and go to your home directory.  Once there, start 
  397. your editor up with the no word wrapping command.
  398.  
  399. > cd
  400. > pico -w .forward
  401.  
  402. We now go to an excerpt from Nancy M.'s Mail Filtering FAQ:
  403.  
  404.     Enter a modified version of the following in your ~/.forward:
  405.  
  406.      "|IFS=' ' && exec /usr/local/bin/procmail -f- || exit 75 #nancym"
  407.  
  408.     == IMPORTANT NOTES ==
  409.     * Make sure you include all the quotes, both double (") and single (').
  410.     * The vertical bar (|) is a pipe.
  411.     * Replace /usr/local/bin with the correct path for procmail (see step 1).
  412.     * Replace `nancym' with your userid.  You need to put your userid in
  413.       your .forward so that it will be different than any other .forward
  414.       file on your system.
  415.  
  416.     * Do NOT use ~ or environment variables, like $HOME, in your .forward
  417.       file.  If procmail resides below your home directory write out the
  418.       *full* path.
  419.  
  420.     On many systems you need to make your .forward world
  421.     readable and your home directory world searchable in order for the
  422.     mail transport agent to "see" it.  To do this type:
  423.  
  424.       cd
  425.       chmod 644 .forward
  426.       chmod a+x .
  427.  
  428. If the .forward template above doesn't work the following alternatives
  429. might be helpful:
  430.  
  431. In a perfect world:
  432.         "|exec /usr/local/bin/procmail #nancym"
  433. In an almost perfect world:
  434.         "|exec /usr/local/bin/procmail USER=nancym"
  435. In another world:
  436.         "|IFS=' ';exec /usr/local/bin/procmail #nancym"
  437. In a different world:
  438.         "|IFS=' ';exec /usr/local/bin/procmail USER=nancym"
  439. In a smrsh world:
  440.         "|/usr/local/bin/procmail #nancym"
  441.  
  442.  
  443. Now that you have all the necessary files made, it's time to test this 
  444. filter.  Go into your mailreader and create a new folder called 
  445. Ebombtest.  This procedure differs from program to program, so you may 
  446. have to experiment a little.  Then open up the rc.noebomb file and change 
  447. /dev/null to Ebombtest.  (You should have already changed Conditions 2 
  448. and 3 to what you want; if not, go do it now!)  Finally, open up 
  449. .procmailrc and remove the # from the last line.
  450.  
  451. You will need to leave this on for a bit to test it.  Ask some of the 
  452. people in Condition 2 to send you some test messages.  If the messages 
  453. make it through to your Inbox, then that condition is working fine.  Send 
  454. yourself some fake email under a different name and check to see if it 
  455. ends up in the Ebombtest folder.  Also, send yourself some fakemail from 
  456. root@wherever.com to make sure that Condition 1 works.  If you're on any 
  457. mailing lists, those messages should be ending up in your Inbox as well.  
  458.  
  459. If all of these test out fine, then congratulations!  You now have a 
  460. working defense against email bombs.  For the moment, change the 
  461. Ebombtest line in the rc.noebomb file back to /dev/null, and put the # 
  462. in front of the INCLUDERC line in the .procmailrc file.  If someone ever 
  463. decides to emailbomb you, you only need to remove the #, and you will 
  464. have greatly cut down on the amount of messages coming into your Inbox, 
  465. giving you a little bit of breathing room to start unsubscribing to all 
  466. those lists, or start tracking down those idiots who did it and get their 
  467. asses kicked off their ISP's.  
  468.  
  469. If you have any comments or questions about this, email me at 
  470. zachb@netcom.com.  Emailbombs WILL go to /dev/null, so don't bother!  
  471.  
  472. Disclaimer:  When you activate this program, it is inevitable that a 
  473. small amount of wanted mail MAY get put into /dev/null, due to the fact 
  474. that it is nearly impossible to know the names of all the people that may 
  475. write to you.  Therefore, I assume no responsibility for any email which 
  476. may get lost, and any damages which may come from those lost messages.
  477. ********************
  478.  
  479. A note of thanks goes to Damien Sorder (jericho@dimensional.com) for his
  480. assistance in reviewing this guide.
  481. _________________________________________________________
  482. Want to see back issues of Guide to (mostly) Harmless Hacking? See either
  483. http://www.tacd.com/zines/gtmhh/ or 
  484. http://ra.nilenet.com/~mjl/hacks/codez.htm.
  485. Subscribe to our email list by emailing to hacker@techbroker.com with
  486. message "subscribe" or join our Hacker forum at
  487. http://www.infowar.com/cgi-shl/login.exe.
  488. Want to share some kewl stuph with the Happy Hacker list? Correct mistakes?
  489. Send your messages to hacker@techbroker.com.  To send me confidential email
  490. (please, no discussions of illegal activities) use cmeinel@techbroker.com
  491. and be sure to state in your message that you want me to keep this
  492. confidential. If you wish your message posted anonymously, please say so!
  493. Please direct flames to dev/null@techbroker.com. Happy hacking! 
  494. Copyright 1997 Carolyn P. Meinel. You may forward  or post on your Web site
  495. this GUIDE TO (mostly) HARMLESS HACKING as long as you leave this notice at
  496. the end..
  497. ________________________________________________________
  498.