home *** CD-ROM | disk | FTP | other *** search
/ Hacks & Cracks / Hacks_and_Cracks.iso / hackersclub / km / library / hack / gtmhh1-2.txt < prev    next >
Text File  |  1998-03-25  |  21KB  |  540 lines

  1. _____________________________________________________________
  2.  
  3. GUIDE TO (mostly) HARMLESS HACKING
  4.  
  5. Vol. 1 Number 2
  6.  
  7. In this issue we learn how to forge email -- and how to spot forgeries. I
  8. promise, this hack is spectacularly easy!
  9. ______________________________________________________________
  10.  
  11. Heroic Hacking in Half an Hour
  12.  
  13. How would you like to totally blow away your friends? OK, what is the
  14. hairiest thing you hear that super hackers do?
  15.  
  16. It's gaining unauthorized access to a computer, right?
  17.  
  18. So how would you like to be able to gain access and run a program on the
  19. almost any of the millions of computers hooked up to the Internet? How would
  20. you like to access these Internet computers in the same way as the most
  21. notorious hacker in history: Robert Morris!
  22.  
  23. It was his "Morris Worm" which took down the Internet in 1990. Of course,
  24. the flaw he exploited to fill up 10% of the computers on the Internet with
  25. his self-mailing virus has been fixed now -- on most Internet hosts. 
  26.  
  27. But that same feature of the Internet still has lots of fun and games and
  28. bugs left in it. In fact, what we are about to learn is the first step of
  29. several of the most common ways that hackers break into private areas of
  30. unsuspecting computers.
  31.  
  32. But I'm not going to teach you to break into private parts of computers. It
  33. sounds too sleazy. Besides, I am allergic to jail.
  34.  
  35. So what you are about to learn is legal, harmless, yet still lots of fun. No
  36. pulling the blinds and swearing blood oaths among your buddies who will
  37. witness you doing this hack.
  38.  
  39. But -- to do this hack, you need an on-line service which allows you to
  40. telnet to a specific port on an Internet host. Netcom, for example, will let
  41. you get away with this. 
  42.  
  43. But Compuserve, America Online and many other Internet Service Providers
  44. (ISPs) are such good nannies that they will shelter you from this temptation. 
  45.  
  46. But your best way to do this stuph is with a SHELL ACCOUNT! If you don't
  47. have one yet, get it now! 
  48.  
  49. ***********************************
  50. Newbie note #1; A shell account is an Internet account that lets you give
  51. Unix commands. Unix is a lot like DOS. You get a prompt on your screen and
  52. type out commands. Unix is the language of the Internet. If you want to be
  53. a serious hacker, you have to learn Unix.
  54. ****************************
  55.  
  56. Even if you have never telnetted before, this hack is super simple. In fact,
  57. even though what you are about to learn will look like hacking of the most
  58. heroic sort, you can master it in half an hour -- or less. And you only need
  59. to memorize *two* commands.
  60.  
  61. To find out whether your Internet service provider will let you do this
  62. stuph, try this command:
  63.  
  64.     telnet callisto.unm.edu 25
  65.  
  66. This is a computer at the University of New Mexico. My Compuserve account
  67. gets the vapors when I try this. It simply crashes out of telnet without so
  68. much as a "tsk, tsk." 
  69.  
  70. But at least today Netcom will let me do this command. And just about any
  71. cheap "shell account" offered by a fly-by-night Internet service provider
  72. will let you do this. Many college accounts will let you get away with this,
  73. too.
  74.  
  75. ******************************
  76. Newbie note #2: How to Get Shell Accounts
  77.  
  78. Try your yellow pages phone book. Look under Internet. Call and ask for a
  79. "shell account."
  80.  
  81. They'll usually say, "Sure, can do." But lots of times they are lying. They
  82. think you are too dumb to know what a real shell account is. Or the
  83. underpaid person you talk with doesn't have a clue. 
  84.  
  85. The way around this is to ask for a free temporary guest account. Any
  86. worthwhile ISP will give you a test drive. Then try out today's hack.
  87. *******************************
  88.  
  89. OK, let's assume that you have an account that lets you telnet someplace
  90. serious. So let's get back to this command:
  91.  
  92.     telnet callisto.unm.edu 25
  93.  
  94. If you have ever done telnet before, you probably just put in the name of
  95. the computer you planned to visit, but didn't add in any numbers afterward.
  96. But those numbers afterward are what makes the first distinction between the
  97. good, boring Internet citizen and someone slaloming down the slippery slope
  98. of hackerdom.
  99.  
  100. What that 25 means is that you are commanding telnet to take you to a
  101. specific port on your intended victim, er, computer.
  102.  
  103. ***********************************
  104. Newbie note #3: Ports
  105. A computer port is a place where information goes in or out of it. On your
  106. home computer, examples of ports are your monitor, which sends information
  107. out, your keyboard and mouse, which send information in, and your modem,
  108. which sends information both out and in.
  109.  
  110. But an Internet host computer such as callisto.unm.edu has many more ports
  111. than a typical home computer. These ports are identified by numbers. Now
  112. these are not all physical ports, like a keyboard or RS232 serial port (for
  113. your modem). They are virtual (software) ports.
  114. ***********************************
  115.  
  116. But there is phun in that port 25. Incredible phun. You see, whenever you
  117. telnet to a computer's port 25, you will get one of two results: once in
  118. awhile, a message saying "access denied" as you hit a firewall. But, more
  119. often than not, you get something like this:
  120.  
  121.     Trying 129.24.96.10...
  122.     Connected to callisto.unm.edu.
  123.     Escape character is '^]'.
  124.     220 callisto.unm.edu Smail3.1.28.1 #41 ready at Fri, 12 Jul     96 12:17 MDT
  125.  
  126. Hey, get a look at this! It didn't ask us to log in. It just says...ready! 
  127.  
  128. Notice it is running Smail3.1.28.1, a program used to compose and send email.
  129.  
  130. Ohmigosh, what do we do now? Well, if you really want to look sophisticated,
  131. the next thing you do is ask callisto.unm.edu to tell you what commands you
  132. can use. In general, when you get on a strange computer, at least one of
  133. three commands will get you information: "help," "?", or "man." In this case
  134. I type in:
  135.  
  136.     help
  137.  
  138.     ... and this is what I get
  139.  
  140. 250 The following SMTP commands are recognized:
  141. 250 
  142. 250    HELO hostname            startup and give your hostname
  143. 250    MAIL FROM:<sender address>  start transaction from sender
  144. 250    RCPT TO:<recipient address>    name recipient for message
  145. 250    VRFY <address>           verify deliverability of address
  146. 250    EXPN <address>                expand mailing list address
  147. 250    DATA                          start text of mail message
  148. 250    RSET                        reset state, drop transaction
  149. 250    NOOP                              do nothing
  150. 250    DEBUG [level]              set debugging level,default 1
  151. 250    HELP                           produce this help message
  152. 250    QUIT                              close SMTP connection
  153. 250 
  154. 250 The normal sequence of events in sending a message is to state the
  155. 250 sender address with a MAIL FROM command, give the recipients with
  156. 250 as many RCPT TO commands as are required (one address per command)
  157. 250 and then to specify the mail message text after the DATA command.
  158. 250 Multiple messages may be specified.  End the last one with a QUIT.
  159.  
  160. Getting this list of commands is pretty nifty. It makes you look really kewl
  161. because you know how to get the computer to tell you how to hack it. And it
  162. means that all you have to memorize is the "telnet <hostname> 25 " and
  163. "help" commands. For the rest, you can simply check up on the commands while
  164. on-line. So even if your memory is as bad as mine, you really can learn and
  165. memorize this hack in only half an hour. Heck, maybe half a minute.
  166.  
  167. OK, so what do we do with these commands? Yup, you figured it out, this is a
  168. very, very primitive email program. And guess why you can get on it without
  169. logging in? Guess why it was the point of vulnerability that allowed Robert
  170. Morris to crash the Internet?
  171.  
  172. Port 25 moves email from one node to the next across the Internet. It
  173. automatically takes incoming email and if the email doesn't belong to
  174. someone with an email address on that computer, it sends it on to the next
  175. computer on the net, eventually to wend its way to the person to who this
  176. email belongs.
  177.  
  178. Oftentimes email will go directly from sender to recipient, but if you email
  179. to someone far away, or if the Internet is clogged with traffic, email may
  180. go through several computers. 
  181.  
  182. There are millions of computers on the Internet that forward email. And you
  183. can get access to almost any one of these computers without a password!
  184. Furthermore, as you will soon learn, it is easy to get the Internet
  185. addresses of these millions of computers. 
  186.  
  187. Some of these computers have very good security, making it hard to have
  188. serious fun with them. But others have very little security. One of the joys
  189. of hacking is exploring these computers to find ones that suit ones fancy.
  190.  
  191. OK, so now that we are in Morris Worm country, what can we do with it? Well,
  192. here's what I did. (My commands have no number in front of them, whereas the
  193. computer's responses are prefixed by numbers.)
  194.  
  195.     helo santa@north.pole.org
  196.     250 callisto.unm.edu Hello santa@north.pole.org
  197.     mail from:santa@north.pole.org
  198.     250 <santa@north.pole.org> ... Sender Okay
  199.     rcpt to:cmeinel@nmia.com
  200.     250 <cmeinel@nmia.com> ... Recipient Okay
  201.     data
  202.     354 Enter mail, end with "." on a line by itself
  203.     It works!!!
  204.     .
  205.     250 Mail accepted
  206.  
  207. What happened here is that I sent some fake email to myself. Now let's take
  208. a look at what I got in my mailbox, showing the complete header:
  209.  
  210. Here's what I saw using the free version of Eudora:
  211.  
  212.     X POP3 Rcpt: cmeinel@socrates
  213.  
  214. This line tells us that X-POP3 is the program of my ISP that received my
  215. email, and that my incoming email is handled by the computer Socrates. 
  216.  
  217. *****************************
  218. Evil Genius Tip: incoming email is handled by port 110. Try telnetting there
  219. someday. But usually POP, the program running on 110, won't give you help
  220. with its commands and boots you off the minute you make a misstep.
  221. *****************************
  222.  
  223.     Return Path: <santa@north.pole.org>
  224.  
  225. This line above is my fake email address.
  226.  
  227.     Apparently From: santa@north.pole.org
  228.     Date: Fri, 12 Jul 96 12:18 MDT
  229.     
  230. But note that the header lines above say "Apparently-From" This is important
  231. because it alerts me to the fact that this is fake mail.
  232.  
  233.     Apparently To: cmeinel@nmia.com
  234.     X Status: 
  235.  
  236.     It works!!!
  237.  
  238. Now here is an interesting fact. Different email reading programs show
  239. different headers. So how good your fake email is depends on part on what
  240. email program is used to read it. Here's what Pine, an email program that
  241. runs on Unix systems, shows with this same email:
  242.  
  243.     Return Path: <santa@north.pole.org>
  244.     Received:
  245.         from callisto.unm.edu by nmia.com
  246.                  with smtp
  247.                 (Linux Smail3.1.28.1 #4)
  248.         id m0uemp4 000LFGC; Fri, 12 Jul 96 12:20 MDT
  249.  
  250. This identifies the computer on which I ran the smail program. It also tells
  251. what version of the smail program was running. 
  252.  
  253.     Apparently From: santa@north.pole.org
  254.  
  255. And here is the "apparently-from" message again. So both Pine and Eudora
  256. show this is fake mail.
  257.  
  258.     Received: from santa@north.pole.org by callisto.unm.edu with smtp
  259.      (Smail3.1.28.1 #41) id m0uemnL 0000HFC; Fri, 12 Jul 96 12:18 MDT
  260.     Message Id: <m0uemnL 0000HFC@callisto.unm.edu>
  261.  
  262. Oh, oh! Not only does it show that it may be fake mail -- it has a message
  263. ID! This means that somewhere on Callisto there will be a log of message IDs
  264. telling who has used port 25 and the smail program. You see, every time
  265. someone logs on to port 25 on that computer, their email address is left
  266. behind on the log along with that message ID.
  267.  
  268.     Date: Fri, 12 Jul 96 12:18 MDT
  269.     Apparently From: santa@north.pole.com
  270.     Apparently To: cmeinel@nmia.com
  271.  
  272.     It works!!!
  273.  
  274. If someone were to use this email program to do a dastardly deed, that
  275. message ID is what will put the narcs on his or her tail. So if you want to
  276. fake email, it is harder to get away with it if you send it to someone using
  277. Pine than if they use the free version of Eudora. (You can tell what email
  278. program a person uses by looking at the header of their email.)
  279.  
  280. But -- the email programs on port 25 of many Internet hosts are not as well
  281. defended as callisto.unm.edu. Some are better defended, and some are not
  282. defended at all. In fact, it is possible that some may not even keep a log
  283. of users of port 25, making them perfect for criminal email forgery. 
  284.  
  285. So just because you get email with perfect-looking headers doesn't mean it
  286. is genuine. You need some sort of encrypted verification scheme to be almost
  287. certain email is genuine.
  288.  
  289. ******************************************
  290. You can go to jail note: If you are contemplating using fake email to commit
  291. a crime, think again. If you are reading this you don't know enough to forge
  292. email well enough to elude arrest.
  293. *******************************************
  294.  
  295. Here is an example of a different email program, sendmail. This will give
  296. you an idea of the small variations you'll run into with this hack.
  297.  
  298. Here's my command:
  299.  
  300.     telnet ns.Interlink.Net 25
  301.  
  302. The computer answers:
  303.  
  304.     Trying 198.168.73.8...
  305.     Connected to NS.INTERLINK.NET.
  306.     Escape character is '^]'.
  307.     220 InterLink.NET Sendmail AIX 3.2/UCB 5.64/4.03 ready at Fri, 12     Jul 1996
  308. 15:45
  309.  
  310. Then I tell it:
  311.  
  312.     helo santa@north.pole.org
  313.  
  314. And it responds:
  315.  
  316.     250 InterLink.NET Hello santa@north.pole.org     (plato.nmia.com)
  317.  
  318. Oh, oh! This sendmail version isn't fooled at all! See how it puts
  319. "(plato.nmia.com)" -- the computer I was using for this hack -- in there
  320. just to let me know it knows from what computer I've telnetted? But what the
  321. heck, all Internet hosts know that kind of info. I'll just bull ahead and
  322. send fake mail anyhow. Again, my input has no numbers in front, while the
  323. responses of the computer are prefaced by the number 250:
  324.  
  325.     mail from:santa@north.pole.com
  326.     250 santa@north.pole.com... Sender is valid.
  327.     rcpt to:cmeinel@nmia.com
  328.     250 cmeinel@nmia.com... Recipient is valid.
  329.     data
  330.     354 Enter mail. End with the . character on a line by     itself.
  331.     It works!
  332.     .
  333.     250 Ok
  334.     quit
  335.     221 InterLink.NET: closing the connection.
  336.  
  337. OK, what kind of email did that computer generate? Here's what I saw using Pine:
  338.  
  339.     Return Path: <santa@north.pole.org>
  340.     Received:
  341.         from InterLink.NET by nmia.com
  342.                  with smtp
  343.                 (Linux Smail3.1.28.1 #4)
  344.         id m0ueo7t 000LEKC; Fri, 12 Jul 96 13:43 MDT
  345.     Received: from plato.nmia.com by InterLink.NET (AIX 3.2/UCB     5.64/4.03)
  346.           id AA23900; Fri, 12 Jul 1996 15:43:20  0400
  347.  
  348. Oops. Here the InterLink.NET computer has revealed the computer I was on
  349. when I telnetted to its port 25. However, many people use that Internet host
  350. computer. 
  351.  
  352.     Date: Fri, 12 Jul 1996 15:43:20  0400
  353.     From: santa@north.pole.org
  354.     Message Id: <9607121943.AA23900@InterLink.NET>
  355.     Apparently To: cmeinel@nmia.com
  356.  
  357.     It worked!
  358.  
  359. OK, here it doesn't say "Apparently-From," so now I know the computer
  360. ns.Interlink.Net is a pretty good one to send fake mail from. An experienced
  361. email aficionado would know from the Received: line that this is fake mail.
  362. But its phoniness doesn't just jump out at you.
  363.  
  364. I'm going to try another computer. Hmmm, the University of California at
  365. Berkeley is renowned for its computer sciences research. I wonder what their
  366. hosts are like? Having first looked up the numerical Internet address of one
  367. of their machines, I give the command:
  368.  
  369.     telnet 128.32.152.164 25
  370.  
  371. It responds with:
  372.  
  373.     Trying 128.32.152.164...
  374.     Connected to 128.32.152.164.
  375.     Escape character is '^]'.
  376.     220 remarque.berkeley.edu ESMTP Sendmail 8.7.3/1.31 ready at Thu, 11 Jul
  377. 1996 12
  378.     help
  379.     214 This is Sendmail version 8.7.3
  380.     214 Commands:
  381.     214     HELO    EHLO    MAIL    RCPT    DATA
  382.     214     RSET    NOOP    QUIT    HELP    VRFY
  383.     214     EXPN    VERB
  384.     214 For more info use "HELP <topic>".
  385.     214 To report bugs in the implementation send email to
  386.     214     sendmail@CS.Berkeley.EDU.
  387.     214 For local information send email to Postmaster at your     site.
  388.     214 End of HELP info
  389.  
  390. Oh, boy, a slightly different sendmail program! I wonder what more it will
  391. tell me about these commands?
  392.  
  393.     HELP mail
  394.     214 MAIL FROM: <sender>
  395.     214     Specifies the sender.
  396.     214 End of HELP info
  397.  
  398. Big f***ing deal! Oh, well, let's see what this computer (which we now know
  399. is named remarque) will do to fake mail.
  400.  
  401.     MAIL FROM:santa@north.pole.org
  402.     250 santa@north.pole.org... Sender ok
  403.  
  404. Heyyy... this is interesting ... I didn't say "helo" and this sendmail
  405. program didn't slap me on the wrist! Wonder what that means...
  406.  
  407.     RCPT TO:cmeinel@techbroker.com
  408.     250 Recipient ok
  409.     DATA
  410.     354 Enter mail, end with "." on a line by itself
  411.     This is fake mail on a Berkeley computer for which I do not     have a password.
  412.     .
  413.     250 MAA23472 Message accepted for delivery
  414.     quit
  415.     221 remarque.berkeley.edu closing connection
  416.  
  417. Now we go to Pine and see what the header looks like:
  418.  
  419.     Return Path: <santa@north.pole.org>
  420.     Received:
  421.         from nmia.com by nmia.com
  422.                  with smtp
  423.                 (Linux Smail3.1.28.1 #4)
  424.         id m0ueRnW 000LGiC; Thu, 11 Jul 96 13:53 MDT
  425.     Received:
  426.         from remarque.berkeley.edu by nmia.com
  427.                  with smtp
  428.                 (Linux Smail3.1.28.1 #4)
  429.         id m0ueRnV 000LGhC; Thu, 11 Jul 96 13:53 MDT
  430.     Apparently To: <cmeinel@techbroker.com>
  431.     Received: from merde.dis.org by remarque.berkeley.edu     (8.7.3/1.31)
  432.         id MAA23472; Thu, 11 Jul 1996 12:49:56  0700 (PDT)
  433.  
  434. Look at the three "received" messages. My ISP's computer received this email
  435. not directly from Remarque.berkeley.edu. but from merde.dis.com, which in
  436. turn got the email from Remarque. 
  437.  
  438. Hey, I know who owns merde.dis.org! So the Berkeley computer forwarded this
  439. fake mail through famed computer security expert Pete Shipley's Internet
  440. host computer! Hint: the name "merde" is a joke. So is "dis.org."
  441.  
  442. Now let's see what email from remarque looks like. Let's use Pine again:
  443.  
  444.     Date: Thu, 11 Jul 1996 12:49:56  0700 (PDT)
  445.     From: santa@north.pole.org
  446.     Message Id: <199607111949.MAA23472@remarque.berkeley.edu>
  447.  
  448.     This is fake mail on a Berkeley computer for which I do not     have a password.
  449.                              
  450. Hey, this is pretty kewl. It doesn't warn that the Santa address is phony!
  451. Even better, it keeps secret the name of the originating computer:
  452. plato.nmia.com. Thus remarque.berkeley.edu was a really good computer from
  453. which to send fake mail. (Note: last time I checked, they had fixed
  454. remarque, so don't bother telnetting there.)
  455.  
  456. But not all sendmail programs are so friendly to fake mail. Check out the
  457. email I created from atropos.c2.org!
  458.  
  459.     telnet atropos.c2.org 25
  460.     Trying 140.174.185.14...
  461.     Connected to atropos.c2.org.
  462.     Escape character is '^]'.
  463.     220 atropos.c2.org ESMTP Sendmail 8.7.4/CSUA ready at Fri, 12 Jul 1996 15:41:33
  464.     help
  465.     502 Sendmail 8.7.4    HELP not implemented
  466.  
  467. Gee, you're pretty snippy today, aren't you... What the heck, let's plow
  468. ahead anyhow...
  469.  
  470.     helo santa@north.pole.org
  471.     501 Invalid domain name
  472.  
  473. Hey, what's it to you, buddy? Other sendmail programs don't give a darn what
  474. name I use with "helo." OK, OK, I'll give you a valid domain name.  But not
  475. a valid user name!
  476.  
  477.     helo satan@unm.edu
  478.     250 atropos.c2.org Hello cmeinel@plato.nmia.com     [198.59.166.165], pleased
  479. to meet you
  480.  
  481. Verrrry funny, pal. I'll just bet you're pleased to meet me. Why the #%&@
  482. did you demand a valid domain name when you knew who I was all along?
  483.  
  484.     mail from:santa@north.pole.com
  485.     250 santa@north.pole.com... Sender ok
  486.     rcpt to: cmeinel@nmia.com
  487.     250 Recipient ok
  488.     data
  489.     354 Enter mail, end with "." on a line by itself
  490.     Oh, crap!
  491.     .
  492.     250 PAA13437 Message accepted for delivery
  493.     quit
  494.     221 atropos.c2.org closing connection
  495.  
  496. OK, what kind of email did that obnoxious little sendmail program generate?
  497. I rush over to Pine and take a look:
  498.  
  499.     Return Path: <santa@north.pole.com>
  500.  
  501. Well, how  very nice to allow me to use my fake address.
  502.  
  503.     Received:
  504.         from atropos.c2.org by nmia.com
  505.                  with smtp
  506.                 (Linux Smail3.1.28.1 #4)
  507.         id m0ueqxh 000LD9C; Fri, 12 Jul 96 16:45 MDT
  508.     Apparently To: <cmeinel@nmia.com>
  509.     Received: from satan.unm.edu (cmeinel@plato.nmia.com     [198.59.166.165])
  510.  
  511. Oh, how truly special! Not only did the computer atropos.c2.org blab out my
  512. true identity, it also revealed that satan.unm.edu thing. Grump...
  513. that will teach me.
  514.  
  515.     by atropos.c2.org (8.7.4/CSUA) with SMTP id PAA13437     for
  516. cmeinel@nmia.com; Fri, 12
  517.     Jul 1996 15:44:37  0700 (PDT)
  518.     Date: Fri, 12 Jul 1996 15:44:37  0700 (PDT)
  519.     From: santa@north.pole.com
  520.     Message Id: <199607122244.PAA13437@atropos.c2.org>
  521.  
  522.     Oh, crap!
  523.  
  524. So, the moral of that little hack is that there are lots of different email
  525. programs floating around on port 25 of Internet hosts. So if you want to
  526. have fun with them, it's a good idea to check them out first before you use
  527. them to show off with.  
  528. _________________________________________________________
  529. Want to share some kewl stuph? Tell me I'm terrific? Flame me? For the first
  530. two, I'm at cmeinel@techbroker.com. Please direct flames to
  531. dev/null@techbroker.com. Happy hacking!
  532. Copyright 1996 Carolyn P. Meinel. You may forward the GUIDE TO (mostly)
  533. HARMLESS HACKING as long as you leave this notice at the end. To subscribe,
  534. email cmeinel@techbroker.com with message "subscribe hacker
  535. <joe.blow@boring.ISP.net>" substituting your real email address for Joe Blow's.
  536. ________________________________________________________
  537.  
  538.  
  539.  
  540.