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

  1.        ############################################################################
  2.        ############################## LEGIONS OF THE UNDERGROUND ##################
  3. *********************************__ *********************_____ **** ____************
  4. ********************************/  /*********========***|___  /****/ ___/***********
  5. *******************************/  /*********/ ___   /******/ /****/ /***************
  6. ******************************/  /*********/ /  /  /******/ /****/ /****************
  7. *****************************/  /*********/ /__/  /******/ /****/ /*****************
  8. ****************************/  <______** /       /******/ <____> /******************
  9. ***************************<__________| /_______/ *****(________/********************
  10.  
  11.                          (http://www.hackersclub.com/lou/)     
  12.                                    by: PLaZma
  13.  
  14.  
  15.  
  16.  Utilizing the NNTP port.  Forging/reading/posting.
  17.  NNTP = Network News Transfer Protocol
  18.  Port 119
  19.  
  20.  This assumes you have internet access, a telnet client, and about 2 ╜ brain
  21.  cells!
  22.  ---------------------------------------------------------------------------
  23.  Newbie Note~
  24.  
  25.     NNTP specifies a protocol for the distribution, inquiry, retrieval,
  26.     and posting of news articles using a reliable stream-based
  27.     transmission of news among the Internet community.  NNTP is
  28.     designed so that news articles are stored in a central database
  29.     allowing a subscriber to select only those items he wishes to read.
  30.  -------------------------------------------------------------------------------------------------------------------------------------------
  31.  
  32.  
  33.  Their are two forms of NNTP, one is mailing lists, and the other is Usenet.  We
  34.  will focus on USENET since forging to a mailing list can be done via port 25.
  35.  
  36.  Unlike its mailing list companion Usenet is an efficient means of distributing
  37.  information quickly and reliably.  Users view documents that have been
  38.  categorized / cross-referenced / sorted.  Thus allowing the user to quickly
  39.  find the information that they are looking for, rather than going through
  40.  hundreds of emails directly to them searching for the one that pertains to
  41.  their person.  This ends my brainless comparison since I don't really care if
  42.  it is efficient or not.
  43.  
  44.  The good stuff! ~~
  45.  
  46.  First off commands are not case sensitive, you don't have to worry about it.  
  47.  Their are two types of responses:  Text, and Status.
  48.  Text responses are preceded by a numeric status response line (We will get into
  49.  that soon).  Simply, text is sent as a series of textual lines.  The text input
  50.  will be terminated with a "." on a line by itself.  To those who don't use
  51.  their brain....Its much like the hack we did on port 25, the SMTP port.
  52.  Now the Status response:  Status response lines begin with a 3 digit numeric
  53.  code which is sufficient to distinguish all responses.  Some of these may also
  54.  respond with a textual message.  The first digit of the response broadly
  55.  indicates the success,  failure, or progress of the previous command.
  56.   
  57.        1xx - Informative message
  58.        2xx - Command ok
  59.        3xx - Command ok so far, send the rest of it.
  60.        4xx - Command was correct, but couldn't be performed for
  61.              some reason.
  62.        5xx - Command unimplemented, or incorrect, or a serious
  63.              program error occurred.
  64.  
  65.     The next digit in the code indicates the function response category.
  66.   
  67.        x0x - Connection, setup, and miscellaneous messages
  68.        x1x - Newsgroup selection
  69.        x2x - Article selection
  70.        x3x - Distribution functions
  71.        x4x - Posting
  72.        x8x - Nonstandard (private implementation) extensions
  73.        x9x - Debugging output
  74.  
  75.     In general, 1xx codes may be ignored or displayed as desired;  code
  76.     200 or 201 is sent upon initial connection to the NNTP server
  77.     depending upon posting permission; code 400 will be sent when the
  78.     NNTP server discontinues service (by operator request, for example);
  79.     and 5xx codes indicate that the command could not be performed for
  80.     some unusual reason.
  81.  
  82.  
  83.  Now, this is how you get to this.  You can use some sort of windoze or linux or
  84.  whatever that is designed to be a usenet reader and you can read articles with
  85.  a simple point & click interface. Which is nice and easy, but not a good way
  86.  for hacking or a good way to learning about NNTP.  Now, the way to really "Get
  87.  a feel" of the NNTP daemon is to use your favorite Telnet program and Telnet to
  88.  your news server ( e.g. Telnet  News.Pacbell.Net)  This will connect you to the
  89.  pacbell news server.  Basically take your email address and chop off the front
  90.  leaving the last two,  Joyschmoe@foobar.com is chopped to foobar.com .  Then
  91.  you just add the News, so we have news.foobar.com.  Now upon connect you should
  92.  have an idea of which group you would like to post to, if you don't....simply
  93.  give the LIST command and hold on to your hat for a LONG list of groups.  If
  94.  you already have a group in mind Such as alt.warez or alt.2600  ......  in
  95.  which case you would enter the command :  Group <alt.***>
  96.  The response should be something like this:
  97.     211 n f l s group selected
  98.             (n = estimated number of articles in group,
  99.             f = first article number in the group,
  100.             l = last article number in the group,
  101.             s = name of the group.)
  102.     411 no such news group
  103.  
  104.  If successful this would then switch your "current article pointer", which is
  105.  internally maintained to the first article in the designated news group.  It
  106.  will also return the article numbers of the first and last articles in the
  107.  group, as well as a estimate of the number of articles in that group.  (Note:
  108.  These estimates are not always correct, it must only be the exact number or
  109.  greater than the amount of articles in the group)
  110.  Now we can do two things, Read or write an article.  To read, if you know the
  111.  article number enter this command:  ARTICLE [xxxxxx]
  112.  Where xxxxxx is the number of the article you would like to peruse.  Or you can
  113.  use the message id in this fashion: ARTICLE <aaaaa>
  114.  Where aaaaa is the message id number.  These both will display the header, a
  115.  blank line, followed by the body of the message.  If you have any trouble with
  116.  the commands, simply do a HELP command and the news server will give you a list
  117.  of implemented commands.  When Reading, I prefer to give a NEXT command which
  118.  will set my current article pointer to the next article, and giving me a text
  119.  reply which usually contains a SIX digit message number.  Then I simply give
  120.  the command:  
  121.  Body <xxxxxx>  
  122.  Where the x's are the article number given by the NEXT command.
  123.  The LAST command will set your internally maintained "current article pointer"
  124.  to the last article in the mailing group. 
  125.  
  126.  Use this command to have the server give you all the news it has obtained since
  127.  your designated date timeà 
  128.  NEWNEWS newsgroups date time [GMT] [<distribution>]
  129.  Here are two examples of server client conversations:
  130.  
  131.  
  132.  Example 1 - relative access with NEXT
  133.   
  134.     S:      (listens at TCP port 119)
  135.     C:      (requests connection on TCP port 119)
  136.     S:      200 wombatvax news server ready - posting ok
  137.   
  138.     (client asks for a current newsgroup list)
  139.     C:      LIST
  140.     S:      215 list of newsgroups follows
  141.     S:      net.wombats 00543 00501 y
  142.     S:      net.unix-wizards 10125 10011 y
  143.             (more information here)
  144.     S:      net.idiots 00100 00001 n
  145.     S:      .
  146.   
  147.     (client selects a newsgroup)
  148.     C:      GROUP net.unix-wizards
  149.     S:      211 104 10011 10125 net.unix-wizards group selected
  150.             (there are 104 articles on file, from 10011 to 10125)
  151.   
  152.     (client selects an article to read)
  153.     C:      STAT 10110
  154.     S:      223 10110 <23445@sdcsvax.ARPA> article retrieved - statistics
  155.             only (article 10110 selected, its message-id is
  156.             <23445@sdcsvax.ARPA>)
  157.   
  158.     (client examines the header)
  159.     C:      HEAD
  160.     S:      221 10110 <23445@sdcsvax.ARPA> article retrieved - head
  161.             follows (text of the header appears here)
  162.     S:      .
  163.   
  164.     (client wants to see the text body of the article)
  165.     C:      BODY
  166.     S:      222 10110 <23445@sdcsvax.ARPA> article retrieved - body
  167.             follows (body text here)
  168.     S:      .
  169.   
  170.     (client selects next article in group)
  171.   
  172.     C:      NEXT
  173.     S:      223 10113 <21495@nudebch.uucp> article retrieved - statistics
  174.             only (article 10113 was next in group)
  175.   
  176.     (client finishes session)
  177.     C:      QUIT
  178.     S:      205 goodbye.
  179.  
  180.  
  181.  #2
  182.  
  183.  Example 2 - absolute article access with ARTICLE
  184.   
  185.     S:      (listens at TCP port 119)
  186.   
  187.     C:      (requests connection on TCP port 119)
  188.     S:      201 UCB-VAX netnews server ready -- no posting allowed
  189.   
  190.     C:      GROUP msgs
  191.     S:      211 103 402 504 msgs Your new group is msgs
  192.             (there are 103 articles, from 402 to 504)
  193.   
  194.     C:      ARTICLE 401
  195.     S:      423 No such article in this newsgroup
  196.   
  197.     C:      ARTICLE 402
  198.     S:      220 402 <4105@ucbvax.ARPA> Article retrieved, text follows
  199.     S:      (article header and body follow)
  200.     S:      .
  201.   
  202.     C:      HEAD 403
  203.     S:      221 403 <3108@mcvax.UUCP> Article retrieved, header follows
  204.     S:      (article header follows)
  205.     S:      .
  206.   
  207.     C:      QUIT
  208.     S:      205 UCB-VAX news server closing connection.  Goodbye.
  209.  
  210.  
  211.  
  212.  Now the POST command.   The POST command is subject to some scrutiny in my
  213.  opinion.   The RFC says that their are  headers that are essential and headers
  214.  that are voluntary.  However, upon experimentation I have found that some of
  215.  the ones they say are ESSENTIAL really aren't.  I got away with posting a
  216.  message with only a from/subject/news-group/body line!  Anyway, that's no big
  217.  deal.   I logged on to my news server and gave the POST command.  I will show
  218.  you our conversation.
  219.  
  220.  S: 200 NNTP blah blah blah ready 
  221.  C: post
  222.  
  223.  S: post
  224.       OK!
  225.  
  226.  C: From: plahzma@geocities.com
  227.       Subject: This is kewl.
  228.       NewsGroups: alt.cracks, alt.2600.warez
  229.  
  230.       This is a test to see if I can negotiate a deal with my news server
  231.  through telnet!
  232.  
  233.  .
  234.  
  235.  S:  Article Posted.
  236.  C:  Quit
  237.  S:  Connection closed by host.  Goodbye!
  238.  
  239.  
  240.  Okay, that was easy now wasn't it!?  Notice how the server responded with a 200
  241.  stat response, if this had been a 201, that would mean that I could not post!
  242.  So pay attention to the stat responses!  The "From:" line can be whatever email
  243.  address you want! That makes it a lot better for us since a lot of times when
  244.  you post to a news-group and ask a stupid question you get flamed, email
  245.  bombed,  Spammedà. And this way any direct replies are sent to that great big
  246.  trash bin in the sky!  Also Notice that on the Newsgroups: line I have put the
  247.  cracks news-group followed by the 2600 warez news-group, separated by a comma.
  248.  This tells the Daemon to post your message to cracks AND warez.  Notice that
  249.  the HEADER section has been separated from the BODY section by a blank line.
  250.  Now, also when I read the RFC it did not mention anything about a "." at the
  251.  end to send the post.  But if theirs something else were supposed to do then
  252.  o-well because the "." at the end worked.  Now I will get into more advanced
  253.  Features!
  254.  
  255.  The preceding Text was how to post with the BARE minimum!  Their are all sorts
  256.  of other headers to fool around with.  Actually anything  you put in the header
  257.  section will be transferred unchanged to the next server/client unless it
  258.  contains a KEYWORD, the keywords are immediately used by the news host.  The
  259.  following is a list of HEADER KeyWords, and the format that you should use
  260.  them.  I have omitted the boring ones, these are just extras for you.
  261.  
  262.  Relay-Version  This header line shows  the  version
  263.  of  the  program  responsible for the transmission of this
  264.  article over the immediate link.
  265.  For example, the header line might contain:
  266.     Relay-Version: version B 2.10 2/13/83; site cbosgd.UUCP
  267.  
  268.  Posting-Version    This   header   identifies   the
  269.  software  responsible  for  entering this message into the
  270.  network.  It has the same format as Relay Version.
  271.  
  272.  >From   The from line will be an internet address, with a full name (optional)
  273.  following contained in parenthesis.
  274.  For example,  the header line might contain
  275.  From: JoeBlow@Boringisp.com (JoeBlow)
  276.  
  277.  The date will be given by using this line:
  278.  Date: Weekday, DD-Mon-YY HH:MM:SS TIMEZONE  American Timezones are PST, PDT,
  279.  MST, MDT, CST, CDT, EST, EDT
  280.  (e.g. Fri, 19-Jul-97 05:36:04 PST)
  281.  
  282.  The Subject line should be some sort of suggestion of the contained text, but
  283.  if it is in reply to something, the subject line should be:
  284.  "Re: (Reference)"
  285.  Where reference is the article subject you are replying too, aduhhhh
  286.  
  287.  Path            The path command specifies where the  article has been, when
  288.  the HOST computer receives the message, it will add its name to it, and then
  289.  sends it to another host/slave and it ands its anem to the path and the next
  290.  and the next and the nextà
  291.  The names in the path are separated by punctuation marks.
  292.  For example: cbosgd!mhuxj!mhuxt"
  293.  Means the letter has gone From mhuxt then to mhuxj then to cbosgd where it now
  294.  stays.  However this is not always true, the right most could also be the NAME
  295.  of the sender.
  296.  
  297.  Reply-To     This line is in the same form as the From line.  All letters
  298.  replied to this post will be sent to this address, not to the specified FROM
  299.  address.
  300.  
  301. Publication by: PlaZma
  302.  
  303.