home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / zines / n_z / tic1.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  134.3 KB  |  3,387 lines

  1.  
  2.           T H E  I N F I N I T Y   C O N C E P T
  3.                ```   ```
  4.               `   ``    `
  5.                ```   ```
  6.  
  7.  
  8.  
  9.               .oO____Oo.
  10.  
  11.  
  12. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~The Infinity Concept~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  13.              . Issue #1 .
  14.               . Summer  1995 .
  15.  
  16. -=-=-=-=-=-=-=-=-=Brought to you by the members and associates of-=-=-=-=-=-=
  17.  
  18. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-the Guild=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  19.  
  20.        .Route [daemon9/Infinity].
  21.        .......Nihil..............
  22.        .......Carbonboy..........
  23.        .......Squidge............
  24.        .......jfp................
  25.        .......E-fx...............
  26.        .......Mythrandir.........
  27.        .......Delirium...........
  28.        .......Alhambra...........
  29.        .......MrZippy............
  30.  
  31.                  url's
  32.                 -------
  33.        ftp://ftp.netcom.com/pub/da/daemon9/*the Guild/
  34.        http://server.cs.jhu.edu/~jed/TheGuild/
  35.  
  36.  
  37.  
  38.  
  39. ------------------------------------------------------------------------------
  40. Summer 1995 [DefConIII] |  The Infinity Concept  |  issue 1
  41.  
  42. ------------------------------------------------------------------------------
  43.  
  44.  
  45.  
  46.  
  47.     [Introduction]
  48.  
  49.  
  50.     Welcome to the first issue of the Infinity Concept.  This compendium
  51. of information has been compiled and brought to you by members of the Guild.
  52. Our aim in this and future issues is the dissemination of useful and
  53. accurate information.  The Infinity Concept is here to provide you with the
  54. best in today's technologies.  The articles themselves will usually have a
  55. hacking tint to them, as much of our diverse backgrounds tend to converge
  56. there, but don't be suprised to find an occasional wild-card...
  57.     It is our goal to disseminate legitimate information in a
  58. discretionary, factual manner.   However, should you spot an obvious (or not-
  59. so-obvious) error please feel free to make a note of it and let the author of
  60. the article know about it.  We are ALL here to learn.
  61.  
  62.  
  63.  
  64.  
  65.        Table of contents
  66.  
  67.        1).Electronic Privacy............................Route
  68.        2).Windows NT Security...........................Nihil
  69.        3).Computer Security Threat Response.............Zippy
  70.        4).Semi-Conductor Refrence books...................JFP
  71.        5).How to help keep your privacy..............Deliryum
  72.        6).Obtaining information on other people....Mythrandir
  73.        7).Linux Packet Sniffing....................Mythrandir
  74.        8).Phone Explorations.......................Mythrandir
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.               .oO____Oo.
  82.  
  83.  
  84.     This, the first issue of The Infinity Concept, is set forth into
  85. tumultous times.
  86.     The Guild is still relatively new and we have not set any standard
  87. practices as yet.  This just makes for a somewhat hecktic schedule and slight
  88. disorganization.  This will change, however, and we will become a cohesive
  89. and solid unit as time goes on (esp. after DefConIII).
  90.     Despite the rantings of a few misguided individuals, there is *NO*
  91. dissention in our ranks and the Guild is not an information leeching group.
  92. This electronic magazine is proof enough of that.  The anti-Guild propaganda
  93. that was recently spread throughout .2600 is also a crock of shit.
  94.     To further make things frantic, DefConIII is right around the corner.
  95. Several Guild members (including myself) will be there.  In an effort to get
  96. ready to for the confrence, I have had to step up the schedule for this issue.
  97. Some members didn't have time to submit their articles, but pledge to next
  98. issue (Fall 1995?).
  99.     The fact that the two founding members (Nihil and myself) have
  100. recently moved has not made things run any smoother, either...
  101.     Despite all the forementioned hoops, it is my opinion that we have put
  102. together a solid compendium of useful knowledge.  The areas of expertise of
  103. Guild members differ widely, and we have shown that here.  I think the
  104. information hungry reader will find this an enjoyable, smart compilation.
  105. Feel free to drop me a note and let me know what you think.
  106.  
  107.  
  108.       -Route, Guildmaster
  109.  
  110.  
  111.  
  112.     ______________________________________________________________
  113.     |Electronic Privacy - The Glory of Cryptography               |
  114.     |______________________________________________(the dark art)_|
  115.  
  116.  
  117.             by Infinity
  118.  
  119.  
  120.  
  121.  
  122.     --[Abstract]--
  123.  
  124.  
  125.     It seems you just can't trust *anybody* these days.  The advent of the
  126. digital age has brought us wonderful advances in computing and communicating.
  127. However, it has also brought with it the need for increased awareness of *who*
  128. is out there, and just *who* may be watching you.
  129.     E-mail is not safe.  Anyone worth their weight in silicon can forge
  130. mail, and clever individuals can read *anyone's* mail...  Your files are not
  131. safe.  It's not much of a hack to browse through the directory structure of
  132. a computer, and forget about hidden files...  Your off-line storage is not
  133. safe.  Disks, tapes, CD-WORMS, Magno-optical disks, floptical, whatever the
  134. technology, there is no considerable effort involved in stealing off-line
  135. media and subsequently reading it.
  136.     Enter cryptography.
  137.     E-mail is now safe.  No one reads your mail, except for the intended
  138. recipient.  Your files are now safe.  No one can touch them without your
  139. passphrase.  Your disks are now safe.  No one can read a file without your
  140. passphrase.
  141.     You may wonder why people would want to get into your files... You
  142. are somebody important, you know something important, you have something
  143. important; you are nobody important, you know nothing important, you have
  144. nothing important.  It doesn't matter: Some malicious crackers are nothing
  145. more than vandals, breaking into accounts and computers to cause damage and
  146. fuck around.  If they happen upon some interesting mail or files, great.  Some
  147. are more methodic; evil crackers that may target you or your organization,
  148. in hopes of monetary gain, social notoriety among peers, or a personal
  149. vendetta. (I won't even discuss the Federal Government.  God knows they don't
  150. read people's mail.)  For whatever reason, it happens.  Better safe than
  151. sorry.
  152.     This paper is intended to introduce you (in a relatively technical
  153. way) to cryptography.  It is not for the feint at heart.  If large numbers
  154. scare you, read no further.  I assume a basic familiarity with the subject
  155. (and familiarity with the complexity classes of the running time of
  156. algorithms won't hurt).  I tend to jump around from topic to topic, as it is
  157. the way I think, from one tangent to the next, but looking back, I believe
  158. there is enough cohesiveness to tie this whole thing together nicely.
  159.  
  160.  
  161.  
  162.     --[Symmetric key  vs.  Asymmetric key]--
  163.  
  164.  
  165.     There are two major types of cryptography (I won't even deal with
  166. ciphers that don't utilize keys) symmetric (secret-key) and asymmetric
  167. (public-key).
  168.     In a symmetric system, one key is used for encryption and decryption
  169. (or the decryption key can be calculated from the encryption key).  The
  170. message is encrypted with the secret-key and the process is reversed with the
  171. same key.  Getting the sender and receiver to agree on a key without any
  172. potential attacker finding out is the major problem of the system.  If the
  173. channels in which the messages are traveling are insecure (untrusted), how can
  174. the key be securely transmitted?  If the key was snooped, all future messages
  175. could be decrypted by the attacker.  This issue of key management is the major
  176. problem in secret-key systems.
  177.     In 1976 a better method for key management was developed.  Whitfield
  178. Diffie and Martin Hellman came up with a system involving two keys, both
  179. related mathematically.  One key is kept private and the other is published
  180. publicly.  A message encrypted by one is only decryptable by the other.
  181. This solves the age old problem of secure key management.  Anyone can encrypt
  182. a message with the public-key, but only the intended recipient (with the
  183. corresponding private-key) can decrypt the message.  Furthermore,
  184. authentication can be done in such a system.  If the owner of a given private
  185. key encrypts (or cryptographically signs) a message with his key, only his
  186. corresponding public-key will decrypt (or verify the signature) of the message.
  187. If they do not match, either the message has been altered, or the key used is
  188. not the corresponding private-key.  In either case, the message is discarded.
  189.     The advantages of public-key over secret-key are obvious and great.
  190. The need for secure channels in which to transmit a private key is not
  191. necessary.  In a secret-key system there is always a risk that an attacker
  192. could discover the secret-key through these insecure channels.
  193.     The other great advantage of public-key systems is the authentication
  194. mechanism built into them.  Authentication via secret-key systems is clumsy
  195. and can require a trusted third party (an arbitrator).
  196.     One disadvantage (the only one?) of a public-key system is speed.
  197. Some secret-key systems are orders of magnitude faster than some public-key
  198. systems.  This may not be too noticeable for small messages, but on large files,
  199.  
  200. it quickly becomes undesirable.  The solution to this?  The hybrid-
  201. cryptosystem.
  202.     Using both public-key and secret-key cryptography, the best of both
  203. worlds is achieved.  The public-key system is used to encrypt a psudeorandomly
  204. generated secret key that was used to conventionally encrypt the message.
  205. This whole package can then be confidently sent across insecure channels.
  206.  
  207.  
  208.     [Some words on PGP]
  209.  
  210.  
  211.     This article will not focus on PGP, but as it is the premier hybrid
  212. system, I feel the need to mention it.  PGP is one of those 'best of both
  213. worlds' cryptosystems.  It uses a symmetric cipher for bulk encryption and
  214. an asymmetic cipher for key exchange.  For digital signatures (authentication),
  215. a one-way hashing function is used (a one-way hash is simply a function that
  216. takes input and produces a unique fixed-size output that is not feasible to
  217. duplicate, except with the same input).
  218.     PGP uses IDEA for bulk encryption (focused on, in depth below), RSA for
  219. key exchange (mentioned below), and MD5 for message digests.  The keysizes
  220. currently used by PGP are 128-bits for the IDEA key, and 512-2048 for the RSA
  221. keys.
  222.  
  223.  
  224.     [Some words on RANDOMNESS (as it pertains to cryptography)]
  225.  
  226.  
  227.     Cryptography is big on randomness.  Some systems (such as an engine
  228. for a one-time pad) need an n-length string of random bits, for an n-length
  229. message.  True randomness is not something easily achieved.  Computers are
  230. INCAPABLE of generating a random sequence of bits.  The best a computer can do
  231. is a pseudo-random string.
  232.     A pseudo-random bit generator is fine if it is cryptographically
  233. secure.  To achieve this, the generator first of all needs to have a large
  234. enough period (the period of a function is defined as the point in which it
  235. begins to repeat.  Sin is periodic at 2PI.) to be suitable for the
  236. cryptosystem's needs.  Again using the one-time pad reference, if you have a
  237. message of length n, and the generator is periodic at some point m<n, you have
  238. a problem.  If the sequence of numbers repeats at some point, you have
  239. completely sacrificed the strength of your cipher.  To be thought of as
  240. cryptographically secure, a generator must not only pass statistical tests for
  241. randomness, but it also must be unpredictable.  It must be totally infeasible
  242. to predict the next bit given all the previous bits, and the way in which they
  243. were generated.
  244.  
  245.  
  246.  
  247.     --[Why it works (why it's safe)]--
  248.  
  249.     It's not presently possible to mathematically prove that any cipher
  250. is unbreakable (except a one-time pad--see below).  But, we can be reasonably
  251. sure that provably strong ciphers are safe from penetration, given a large
  252. enough keysize, and secure enough algorithm.
  253.  
  254.  
  255.     [Strength of Secret-key systems]
  256.  
  257.     The strength of any secret-key system (assuming an ideal cipher with
  258. an impenetrably strong algorithm) resides in the key length.  That is, the
  259. number of different possible keys that the cipher could use to encrypt a
  260. message.  This is usually a large number.  A very large number. (To get an idea,
  261.  
  262. see the chart below..)
  263.  
  264.  
  265.     CIPHER  KEY-LENGTH      IN BASE 10...
  266.  
  267.     DES     56-bits         7.2E16
  268.     LOKI    64-bits         1.8E19
  269.     NEWDES  120-bits        1.3E36
  270.     IDEA    128-bits  340,282,366,920,938,463,463,374,607,431,768,211,456
  271.  
  272.     In order to retrieve the key, on average, half the key-space will need
  273. to be searched.  In the case of DES, if a computer could try 1,000,000 keys
  274. per second (generating the key, decrypting the message and testing to see if
  275. you were successful), it would likely take 2,000 years to recover the correct
  276. key.  LOKI keyspace would take almost 600,000 years to find a hit, and an
  277. IDEA key would take 10E25 years (the universe is only 10E10 years old) to
  278. search for a match (if the same computer could try 1,000,000,000 keys, and
  279. you had 1,000,000,000 of them, it would only take 10E13 years).  For more
  280. info on the security of IDEA, see below.
  281.     So why not create a cipher with a 16,384-bit key? (My calculator can't
  282. even compute the size of it's keyspace.)  The caveat is this:  Remember that
  283. the algorithm must be perfectly secure so that there is no alternative to
  284. brute force.  Cryptography is subtle art (thank you Bruce Schneier for that
  285. wonderful quote).  It is not a simple task to create an algorithm that is
  286. perfectly secure, and in many cases, increasing the key size will detract from
  287. the overall security.  A keyspace of 128-bits is not likely to be searched in
  288. polynomial time without some RADICALLY new technology.
  289.  
  290.  
  291.  
  292.     [Strength of Public-key systems]
  293.  
  294.     The security of public-key systems resides in so-called 'trap door'
  295. functions: Mathematical problems that are relatively easy to calculate in one
  296. direction, but infeasible to calculate the inverse of.  Such problems as:
  297. discrete logarithms in a finite field (it's complexity is not known, but is
  298. thought to lie between P and NP-hard), knapsack problems (an NP-complete
  299. problem), and, the most famous, RSA which gets it's security from the
  300. difficulty in factoring large numbers (a super-polynomial time problem).
  301.  
  302.  
  303.     [MH]
  304.  
  305.  
  306.     The Merkle-Hellman public-key system gets it's security from the
  307. knapsack problem (actually, this algorithm has been broken, but it is still a
  308. good example of a trap-door function).  In a nutshell:
  309.  
  310.     The knapsack problem is best described with the thief analogy: A thief
  311. robbing a safe finds it filled with N types of items of varying size (and
  312. value), but only has a knapsack of capacity M<N to carry the items.  The
  313. problem is to find a combination of items to maximize the total value of what
  314. he chooses.  The problem is solvable for relatively small input values, but
  315. seems to grow exponentially with the number of items in the safe.
  316.     The MH system encodes a message as a solution to a series of knapsack
  317. problems.  A block of plaintext equal in length to the number of items would
  318. select the items, and ciphertext would be sum (a binary 1 in the plaintext
  319. indicates inclusion, while a 0 is indicates exclusion of the item in question):
  320.  
  321.       PLAINTEXT
  322.       BLOCK (in
  323.       binary)   1 0 0 1 1 1 0     0 0 0 0 0 0 0 0    1 1 1 1 1 1 1
  324.       KNAPSACK:
  325.       BLOCK    1 7 9 20 30 43 60 1 7 9 20 30 43 60 1 7 9 20 30 43 60
  326.  
  327.  
  328.       RESULTING
  329.       CIPHERTEXT
  330.       BLOCK:     (1+20+30+43)   (0)               (1+7+9+20+30+43+60)
  331.             94              0               170
  332.  
  333.  
  334.     The security comes from the non-superincreasing knapsack (which is the
  335. public key).  A superincreasing knapsack is one where every term in the series
  336. is greater then the sum of the all previous terms.  A superincreasing knapsack
  337. is relatively trivial to solve.  With non-superincreasing knapsacks, the only
  338. way to figure which items were included in the knapsack, is to test ALL
  339. possible solutions, until the correct one is found.  This is NOT an easy
  340. problem.  The fastest solution's complexity grows exponentially, scaling with
  341. the number of items in the knapsack.  With a knapsack of sufficient size (200
  342. or more items) and sufficient item complexity, solving it on a computer that
  343. can try 1,000,000 possible solutions a second, it would likely take 10E46
  344. years.  The universe is only 10E11 years old...
  345.     In MH, the private-key is the series of weighted items for a
  346. superincreasing knapsack problem.  The public-key is a series of weighted
  347. items for a non-superincreasing knapsack problem with the same solution.
  348.     In any event, the MH public-key system was broken by Adi Shamir
  349. (of RSA fame) and (?) Zippel by finding a way to construct the superincreasing
  350. knapsack from the non-superincreasing one.
  351.  
  352.  
  353.  
  354.     [RSA]
  355.  
  356.     The RSA Public-key system is the most popular and well known
  357. public-key system.  It is widely believed that RSA gets it's security from the
  358. difficulty in factoring large numbers (it's possible that another method for
  359. breaking RSA may be discovered, but it hasn't surfaced yet).
  360.  
  361.       The math of RSA is simple:
  362.  
  363.       Take two large primes, p and q.
  364.  
  365.       Find the product n of pq (which is the public modulus).
  366.  
  367.       Randomly choose a number e, such that: e<n and e is relatively
  368.       prime to (p-1)(q-1).
  369.  
  370.       Use Euclid's algorithm to compute d [which is the inverse
  371.       mod(p-1)(q-1) or ed = 1 mod (p-1)(q-1)].
  372.  
  373.       e is the public exponent, and d is the private one.
  374.  
  375.       The public-key is (n,e) and private key is d.
  376.  
  377.       p and q must be destroyed.
  378.  
  379.  
  380.  
  381.     The security comes from the difficulty in factoring the public modulus
  382. n.  Prime factorization of large numbers is not an easy problem (it has not
  383. been proven that factoring *must* be as difficult as it is, but no one has
  384. discovered an easier way to go about it).  The fastest algorithms are of the
  385. super-polynomial complexity class.  While not easy, factoring technology has
  386. jumped LEAPS and BOUNDS in the past few years.  In 1977 Ron Rivest (of RSA
  387. fame) said that factoring a 125-digit number would take 40 quadrillion years.
  388. In 1994 a 129-digit number was factored.  In June of 1995 the 116-digit
  389. Blacknet key was factored.  The table below shows time estimates for factoring
  390. several keysizes using the general number field sieve (GNFS) (a MIPS-year is
  391. a 1,000,000 instruction per second computer running for one year, or 3E13
  392. instructions).
  393.  
  394.  
  395.  
  396.       Key size in bits        MIPS-years required to factor
  397.  
  398.       512                     3E5
  399.       768                     2E8
  400.       1024                    3E11
  401.       1280                    1E14
  402.       1536                    3E16
  403.       2048                    3E20
  404.  
  405.  
  406.     A related algorithm, the special number field sieve (SNFS) is faster
  407. still then the GNFS.  The SNFS is actually more efficient on special number
  408. types that are not too often used in cryptography, but the SNFS is relevant
  409. to a factoring discussion.  The SNFS has faster times accordingly.
  410.  
  411.        Key size in bits        MIPS-years required to factor
  412.  
  413.       512                     <200
  414.       768                     1E5
  415.       1024                    3E7
  416.       1280                    3E99
  417.       1536                    2E11
  418.       2048                    4E14
  419.  
  420.  
  421.     If you are thinking that a 1024-bit key is unconditionally safe, here
  422. are some assumptions from the mathematicians who factored RSA-129:
  423.  
  424.  
  425.       We believe that we could acquire 100 thousand machines without
  426.       superhuman or unethical efforts.  That is, we would not set
  427.       free an Internet worm or virus to find resources for us.  Many
  428.       organizations have several thousand machines each on the net.
  429.       Making use of their facilities would require skillful
  430.       diplomacy, but should not be impossible.  Assuming the 5 mips
  431.       average power, and one year elapsed time, it is not too
  432.       unreasonable to embark on a project which would require half
  433.       a million mips years.
  434.  
  435.     Frightening indeed.
  436.  
  437.  
  438.     [What key size should I choose?]
  439.  
  440.  
  441.     To determine a desirable keysize, you need to assertain the security
  442. you need vs. the lifetime of the key.  I am assuming (as most people using
  443. cryptography would) that you want maximum security.  Since no realistic
  444. predictions of factoring speed can be realistically made beyond a few years,
  445. the keysize chosen should be a factor (no pun intended) of this.  Today you
  446. need a 1024-bit number to get the level of security you got from a 512-bit
  447. number in the early 1980s.  If you want your key (and data) to remain secure
  448. for 20 years, and you do not plan to (or cannot) change it, 1024 bits is likely
  449. too short.  Choose an implementation that allows for a larger keysize.
  450. Something about 2048-bits just makes me feel good...
  451.  
  452.  
  453.     Below is the announcement posted by Paul Leyland about the successful
  454. PGP public-key modulus prime factorization. (If you try to check the
  455. signature integrity, you may notice it doesn't check.  I went a little hay
  456. -wire with the spell checker...)
  457.  
  458. ---------------------------------BEGIN INCLUDED TEXT---------------------------
  459.  
  460.  
  461. -----BEGIN PGP SIGNED MESSAGE-----
  462.  
  463.  
  464. We announce the first known hostile attack on a PGP public key.
  465.  
  466. In 1993, Tim May created BlackNet as a proof-of-concept implementation
  467. of an information trading business with cryptographically protected
  468. anonymity of the traders.  He created a 1024-bit key, and invited
  469. potential traders to encrypt their sales pitch and a public key for a
  470. reply with the BlackNet key, posting the result in one or more Usenet
  471. newsgroups.  BlackNet would then reply in the same manner.  The original
  472. proposal went only to a few people and May acknowledged his authorship
  473. shortly afterwards, when his pedagogical point had been made. It was
  474. soon posted to the Cypherpunks list, and from there to Usenet.  Six
  475. months afterwards in February 1994, a 384-bit key was created in the
  476. BlackNet name, and the BlackNet message was spammed to hundreds of
  477. newsgroups by the new key owner, L. Detweiler.
  478.  
  479. At least one message was posted encrypted in the 384-bit key.  The
  480. encryptor, either by design or by unwitting use of PGP's encrypttoself
  481. option, also encrypted the message to his own key, exposing his identity
  482. to anyone who cared to look him up on the key servers and use finger.
  483.  
  484. Factoring 384-bit integers is not too difficult these days.  We wanted
  485. to see whether it could be done surreptitiously.  Jim Gillogly picked
  486. the 384-bit BlackNet key as a suitable target, partly because of its
  487. apparent interest and partly because he had saved a copy of the reply.
  488. Paul Leyland took the key to pieces.  The public exponent was found to
  489. be 17 and the public modulus:
  490.  
  491. 3193508200533105601431099148202479609827976414818808019973596061739243\
  492. 9454375249389462927646908605384634672078311787
  493.  
  494. To factor this 116-digit integer, we used the same technology as the
  495. RSA-129 project which completed last year.  That computation was so
  496. large that it was necessary for it to be done in a blaze of publicity in
  497. order to attract enough resources.  Ours, we estimated, would take about
  498. 400 mips-years, less than a tenth of the earlier one.  Arjen Lenstra and
  499. Paul Leyland have been factoring integers for years, Lenstra with a
  500. MasPar at Bellcore and Leyland with a dozen or so workstations at Oxford
  501. University.  Alec Muffett has been contributing to factorizations for
  502. almost a year, using forty or so machines outside working hours at Sun
  503. Microsystems UK.  Jim Gillogly threw a couple of machines into the pot,
  504. for a total peak power of around 1300 mips, plus the MasPar.  The
  505. computation began on March 21st on the workstations and continued until
  506. June 23rd.  Lenstra slipped in three weeks runtime on the MasPar between
  507. other factorizations; he also performed the matrix elimination and
  508. emailed the factors (PGP-encrypted) to Leyland. About 50% of the
  509. computation was done by the MasPar.
  510.  
  511. The factors, as can easily be checked, are:
  512. 5339087830436043471661182603767776462059952694953696338283
  513. and
  514. 5981374163444491764200506406323036446616491946408786956289
  515.  
  516. Over in Oxford, a doctored PGP was created.  It could generate only
  517. one secret key, that from two primes hard-coded into it.  The key was
  518. generated and tested on the following message:
  519.  
  520. > -----BEGIN PGP MESSAGE-----
  521. > Version: 2.6
  522. >
  523. > hDwDqeLyyFpa0WsBAYCumTBz0ZUBL7wC8pMXS4mBS0m3Cf6PrPer+2A0EQXJZM46
  524. > OvPnqNWz5QK3Lwyg9DeEqAPF5jH/anmgXQEE3RNhybQUcqnOSVGMO2f5hjltI73L
  525. > 8CRXhFzMCgjdCwTRf0Oq61j4RAptUviqhDq/r7J2FpY7GwpL5DxuJ+YrWNep69LK
  526. > Q/CkKxtwvv2f0taly4HCLCcqw59GQ5m++WnOwDQWKG7yUaXJuUG/mJdr/o+ia3y+
  527. > QKyqOesHdSjWoXDpK7F2Cvxf2KpV3+vzbv+TriRyDV+zR/8womdJl6YAAAKtmWO2
  528. > fy0sp/cqr/1ZGQKmfZWz5L0bh1e/sJXJq9PjvPc05ePxZ35XEoRTCqxbq2GPynkH
  529. > YSynfXZY//814TKmdQxPBvkc8Nbi0rc/GYyoAmItDui4mQISYskGkmLieoWDDlpP
  530. > E9tZlb/7Xa22QS53Or6DwU/y226WXQvrWq5OJ+8OhQyEnLWsEdfgFoe1l9aeweX5
  531. > 0ao5lcp098Q4JFfQWoaU9D7kmKvg+AVT44Pv16/nPvihAoC2O14xg7t1U8032ybs
  532. > 4FLpvxyqoF7+oDV/QNw4Evk1ZnxE5+PH2sOf1qCJdljVSd3wGSfUQaDPRx5RH0XC
  533. > SAgYMsIRaytpdoq521tHUZt2BIg7Ii89TfUBrnkenBFAqdZAf+JR1PSB4yaV3YtG
  534. > PCS4lNQkmWx+ItjP0zsHVcAR0TiBcpV0gMY+tx0h40CTkDi2vHiVyswSJr4halsW
  535. > SIixrdi6B0i3f7v7xlOpFI2khza1c/dH8nrF1uPLECeAZ8TQq53ZlyN472KYuTVZ
  536. > 8y5NqyXd672dYEtzsOlUa9YwFKKyGisyDhZmE5wSOg2Pjopvl0WkuZSR/kdxrX/N
  537. > hFdfXRy1Kgkr+vz9abumhcWS5lYCCfVLk/CIgRqHO09nlEJCTb1T/U788Gptr3/d
  538. > 3dj8C/LECdY7fIdkmTgYhXmfv7fQxLWln29Yux0cEpRq2ud8rjYVSuEaTUO9dF4n
  539. > 9oFRsPdbb0TOxaMVFm2hnELzeKAk/poInfEZkN2ZnusxJ4aM1HkBRva+CAMhQHdT
  540. > XMisoNawWEDPwiwu91owIrBevPJNvX155jUTwKNj0UPBwS6TfS5gXl9g+LoBnMWQ
  541. > nbMMMYVXbJVsAeVOlzTSBftpbglx1k7ocDaAJTZ3OCjf0FcKJsa+4Hybc713611c
  542. > WSHV5esfY9k/yw==
  543. > =nLfz
  544. > -----END PGP MESSAGE-----
  545.  
  546. A successful decryption resulted in:
  547.  
  548. >   Although I realize blacknet was a hoax of some sort, I'm curious as
  549. > to the reasons behind it and I would like to know the motives of the
  550. > person who did it, malicious to make fun of cypher punks or simply
  551. > poking fun at cyberspace in general.
  552. >    I'm interested in forming a similar net, not for the buying and
  553. > selling of information, but for the fun of doing it, who knows what might
  554. > come about in a network somewhat limited and away from the internet, but
  555. > based on pgp without people flaming, and without the netloons like
  556. > dwetler and sternlight, (I have my doubts about dwetler's actual motives
  557. > in spamming the mailers)
  558. >   SO, hopefully they key I encrypt it to is the actual one, and if not
  559. > hopefully whoever is intercepting this is as interested in creating
  560. > what I am, why else be eaves dropping??
  561. >   Looking forward to hearing from whoever out there, and
  562. > I hope you're competent enough with unix to extract my pgp key
  563. > from my .plan
  564. >
  565. >
  566. > --
  567. > Finger yusuf921@raven.csrv.uidaho.edu for PGP public key 2.6ui
  568. > GJ/GP -d+ H+ g? au0 a- w+++ v+(?)(*) C++++ U++1/2 N++++ M-- -po+ Y+++
  569. > -         t++ 5-- j++ R b+++ D+ B--- e+(*) u** h* r+++ y?
  570. >
  571. >
  572. >
  573.  
  574. The next step was to create a revocation certificate and send that off
  575. to the PGP key servers.  After all, the key has undoubtedly been
  576. compromised.
  577.  
  578. The moral of this story is that 384-bit keys can be broken by a small
  579. team of people working in secret and with modest resources.  Lest anyone
  580. object that a MasPar is not a modest resource, we'd re-iterate that it
  581. did only 50% of the work; that we took only three months and that we
  582. used only 50 or so quite ordinary workstations.  We believe that we
  583. could have used at least twice as many machines for at least twice as
  584. long without anyone noticing. The currently minimum recommended key
  585. size, 512 bits, is safe from the likes of us for the time being, but we
  586. should be able to break them within five years or so.  Organizations
  587. with more than "modest resources" can almost certainly break 512-bit
  588. keys in secret right now.
  589.  
  590. Alec Muffett    alec.muffett@uk.sun.com
  591. Paul Leyland    pcl@oucs.ox.ac.uk
  592. Arjen Lenstra   lenstra@bellcore.com
  593. Jim Gillogly    jim@acm.org
  594.  
  595. and, of course, BlackNet<nowhere@cyberspace.nil>     8-)
  596.  
  597. P.S.   The 384-bit BlackNet secret key is:
  598.  
  599. > -----BEGIN PGP MESSAGE-----
  600. > Version: 2.6.2i
  601. >
  602. > lQDAAy/ty1QAAAEBgM98haqmu+pqkoqkr95iMmBTNgb+iL54kUJCoBSOrT0Rqsmz
  603. > KHcVaQ+p4vLIWlrRawAFEQABfAw0gFVVGhzZF63Nc8HJin4jAy2WgIOsvST5ne1Y
  604. > CbfyDIZ6siTHUAos8wMBQZ6Q8QDA2b6tiYqrGu6E1+F0DGPSk9MGif5/LKFrAMDz
  605. > 8HXIK1zrEFEDq9/5dUXO2rk1tH+mkAEAv0EE9e5EJn+quL3/YvAg6bKOlM7HgVKq
  606. > JEDDtCBCbGFja05ldDxub3doZXJlQGN5YmVyc3BhY2UubmlsPg==
  607. > =/BEI
  608. > -----END PGP MESSAGE-----
  609.  
  610.  
  611. -----BEGIN PGP SIGNATURE-----
  612. Version: 2.6
  613.  
  614. iQCVAwUBL+6HEzt/x7zOdmsfAQGRpQP9FZluArrT5+zsG/R6y/MF7O3d7ArEkVe2
  615. rUQgP7W2NxudAFHTNaL9mqLBDVNW/3PqWIhvHMtrSgG+ZAFBH5bP03tizfOFr+SL
  616. eO1JQgYFey7Wh5J/YCuE0VTlYMZ7bhnoiGIvTYZgxIzVWAYyGmlWKRDjfKz/Pks8
  617. qavbPg6qbPo=
  618. =s12J
  619. -----END PGP SIGNATURE-----
  620. --
  621. Paul Leyland <pcl@sable.ox.ac.uk>        | Hanging on in quiet desperation is
  622. Oxford University Computing Services     |     the English way.
  623. 13 Banbury Road, Oxford, OX2 6NN, UK     | The time is gone, the song is over.
  624. Tel: +44-1865-273200  Fax: 273275        | Thought I'd something more to say.
  625. Finger pcl@sable.ox.ac.uk for PGP key    |
  626.  
  627.  
  628. -------------------------------------END INCLUDED TEXT-------------------------
  629.  
  630.  
  631.  
  632.     [Why a (proper) ONE-TIME PAD is unbreakable]
  633.  
  634.     A one-time pad is the only provably perfect cryptosystem.  A one-time
  635. pad is a simple symmetric cryptosystem.  If a message of length n needs to be
  636. encrypted, a pseudo-random sequence of bits of length n is generated.  The
  637. message is then XORed with the pad.  The pad must be generated by a
  638. cryptographically secure PRNG (pseudo-random number generator) and can only be
  639. used once per communication, and must be transmitted securely.  If this
  640. protocol is followed, you have perfect secrecy.
  641.     Since the ciphertext yields *no* possible information about the
  642. plaintext, with the possible exception of it's length, no cryptanalysis can be
  643. performed on the ciphertext.  A given ciphertext is equally likely to be any
  644. possible plaintext of equal size, and there is no way of knowing which of the
  645. decryptions is valid.  You could spend an eternity trying all the possible
  646. solutions, and never be sure which is the proper meaning of the original
  647. message.
  648.  
  649.  
  650.  
  651.  
  652.     --[The IDEA algorithm]--
  653.  
  654.  
  655.     The International Data Encryption Algorithm, designed by Xuejia Lai
  656. and James Massey, was originally called PES (Proposed Encryption Standard).
  657. It was demonstrated to be vulnerable to a differential cryptanalysis attack
  658. in 1990 and had to be strengthened.  The result of the strengthening was
  659. called IPES (Improved Proposed Encryption Standard), and, in 1992 the name
  660. was changed to IDEA.
  661.     IDEA is a symmetric cipher with a 128-bit key, that operates on
  662. 64-bit blocks of data, divided into 4 16-bit sub-blocks, for eight rounds.
  663. IDEA mangles data by mixing operations from three algebraic groups: XOR,
  664. addition modulo 2E16, and multiplication modulo 2E16+1.  These operations
  665. are encased within the algorithm itself, and involve no external permutations
  666. (unlike DES's E-box). The operations operate on the 16-bit sub-blocks of
  667. data, so IDEA is efficient on slower 16-bit processors.  Like most symmetric
  668. ciphers, IDEA uses confusion and diffusion to obscure the redundancies that
  669. naturally occur in a plaintext message (esp. if that message is English text):
  670.     Confusion is where relations between the plaintext and ciphertext
  671. is obscured.  This makes cryptanalysis of the ciphertext more difficult, as
  672. there are fewer redundancies to exploit.  Substitution is one method of
  673. confusion (remember the Caesar Cipher?).
  674.     Diffusion is where the redundancy of a plaintext message is spread
  675. out through the ciphertext.  This dissipation of the plaintext message
  676. further frustrates attempts to locate redundancies.  Transposition is one
  677. method of diffusion.
  678.  
  679.  
  680.     [IDEA in 14 easy steps]
  681.  
  682.  
  683.     Below is a basic overview of one round of IDEA (This information
  684. originally appeared in Bruce Schneier's book, Applied Cryptography).  A 64-bit
  685. data block is divided into 4 16-bit sub-blocks (X1-X4).  These four blocks
  686. become the input to the first round of the algorithm.  In each round, the
  687. four sub-blocks are XORed, added, and multiplied with one another and with 6
  688. 16-bit sub-blocks of key material.  Between each round, the second and third
  689. sub-blocks are swapped.
  690.     In each round, this is what happens:
  691.  
  692.  
  693.       1. Multiply X1 and the first key sub-block.
  694.       2. Add X2 and the second key sub-block.
  695.       3. Add X3 and the third key sub-block.
  696.       4. Multiply X4 and the fourth key sub-block.
  697.       5. XOR the results of step 1 and step 3.
  698.       6. XOR the results of step 2 and step 4.
  699.       7. Multiply the results of step 5 with the fifth key sub-block.
  700.       8. Add the results of step 6 and step 7.
  701.       9. Multiply the results of step 8 with the sixth key sub-block.
  702.       10. Add the results of step 7 and step 9.
  703.       11. XOR the results of step 1 and step 9.
  704.       12. XOR the results of step 3 and step 9.
  705.       13. XOR the results of step 2 and step 10.
  706.       14. XOR the results of step 4 and step 10.
  707.  
  708.     The output of the round is the four sub-blocks that are results of
  709. steps 11, 12, 13, and 14.  The input to the next round is the two inner
  710. blocks of the previous round, reversed.  After the 8th round, the first four
  711. steps are repeated, and the four sub-blocks are re-attached to form the final
  712. ciphertext block.
  713.  
  714.  
  715.     [Key sub-block creation]
  716.  
  717.     The algorithm uses 52 key sub-blocks (6 for each of the eight rounds,
  718. and 4 more for the final output).  The 128-bit master key is divided in 8
  719. 16-bit sub-keys.  These are the first 8 sub-keys used by the algorithm (6 for
  720. the first round, 2 for the second).  The master key is then rotated (bitwise)
  721. 25-bits to the left, and divided again into eight sub-keys.  The first four
  722. are used in round two; the last four are used in the third round.  The
  723. master key is again rotated 25-bits to the left and divided into 8 sub-keys,
  724. and so on until the end of the algorithm.
  725.  
  726.  
  727.     [Decryption]
  728.  
  729.     IDEA, being a symmetric cipher, goes through the same process for
  730. decryption, as it does for encryption.  The only difference is that the key
  731. sub-blocks are reversed and slightly different.  The decryption key
  732. sub-blocks are either additive or multiplicative inverses of the encryption
  733. key sub-blocks.  The decryption keys are more computationally intensive to
  734. compute than the encryption keys, and that time is negligible. (sort of.. see
  735. below).
  736.  
  737.  
  738.     [Security of IDEA]
  739.  
  740.     IDEA is a new algorithm;  too new for any concrete proofs of security
  741. one way or the other.  It is conceivable that the NSA or some such group has
  742. come up with a better method than brute-force, but it is unlikely they have,
  743. or at least, unlikely that the public sector would know about it if they had.
  744. IDEA *looks* very secure.  So far, the best method publicly known for
  745. breaking IDEA, is by a brute-force search of it's keyspace.
  746.     As I stated before, a brute-force attack is absolutely infeasable.
  747. It gets worse.  Generating encryption sub-keys is much faster than generating
  748. decryption sub-keys.  When a brute-force attack is waged against a ciphertext
  749. block, this time adds up, as each new attempt requires a new decryption key.
  750. The time to compute all the additive and multiplicative inverses can double
  751. or triple the necessary time and/or resources needed to launch such an attack.
  752.  
  753.  
  754.     [Weak keys]
  755.  
  756.     A weak key is a key that compromises the security of a cryptosystem
  757. in one fashion or another, making some attacks easier. (DES has 4 weak keys,
  758. and 12 semi-weak keys.)  The IDEA weak keys are weak in the sense that if
  759. used, an attacker can exploit them in a chosen-plaintext attack.  (A chosen
  760. plaintext attack is where an attacker has access to the plaintext and
  761. ciphertext for several messages, and can choose the encrypted plaintext.
  762. This allows the attacker to exploit chosen parts of a message, and possibly
  763. glean more information about the key.) A weak key example:
  764.  
  765.       0000,0000,0x00,0000,0000,000x,xxxx,x000
  766.  
  767.     'x' can be any number.  The chance of accidentally generating one of
  768. these keys is 2E-96.  Not too likely.
  769.  
  770.  
  771.  
  772.     --[Source]--
  773.  
  774.     IDEA is patented, but is usable without restriction for noncommercial
  775. use.  Please note the keying function below is *not secure*.  It uses a
  776. simplified key, in that it takes up to 8 characters and casts each one into a
  777. 16-bit word, by shifting it left 8 bits, and OR'ing it with the previous
  778. character (0 for the first character), making 8 16-bit subblocks of the key,
  779. which is no where near as complex a key as possible.  I would recommend
  780. either writing a better keying function, or finding a secure 128-bit hash to
  781. use.  In any event, the code is really here to learn from.  You cannnot be
  782. sure whether or not it has been altered from the original code (I cannot be
  783. sure, as it had no signature to check the integrity).  If you want more or
  784. less guaranteed security, use PGP's conventional encryption function.
  785.  
  786.  
  787. ---------------------------------BEGIN INCLUDED TEXT---------------------------
  788.  
  789. /* idea.h */
  790.  
  791. #ifndef _IDEA_DOT_H
  792. #define _IDEA_DOT_H
  793.  
  794. #include <stdio.h>
  795. #include <time.h>
  796. #include <process.h>
  797. #include <io.h>
  798. #include <string.h>
  799. #include <conio.h>
  800.  
  801. #define IDEAKEYSIZE 16
  802. #define IDEABLOCKSIZE 8
  803. #define word16 unsigned int
  804. #define word32 unsigned long int
  805. #define ROUNDS  8
  806. #define KEYLEN  (6*ROUNDS+4)
  807. #define tempfilename "tempfile.Σnc"
  808.  
  809.  
  810. int end_of_file,noisy,overwrite;   /*global vars*/
  811.  
  812. #define low16(x) ((x) & 0xffff)
  813.  
  814. typedef unsigned int uint16;
  815. typedef word16 IDEAkey[KEYLEN];
  816.  
  817. /*IDEA Algorithm functions */
  818. void en_key_idea(word16 userkey[8],IDEAkey Z);
  819. void de_key_idea(IDEAkey Z, IDEAkey DK);
  820. void cipher_idea(word16 in[4],word16 out[4],IDEAkey Z);
  821. uint16 inv(uint16 x);
  822. uint16 mul(uint16 a,uint16 b);
  823.  
  824. /*file handling functions*/
  825. char read_char_from_file(FILE *fp);
  826. word16 read_word16_from_file(FILE *fp);
  827. void write_char_to_file(char data,FILE *fp);
  828. void write_word16_to_file(word16 data,FILE *fp);
  829. void cipher_file(FILE *in,FILE *out,word16 *key);
  830. void decipher_file(FILE *in,FILE *out,word16 *key);
  831. void swap_files_and_clean_up(char *file);
  832.  
  833. #endif
  834.  
  835.  
  836. /* End idea.h */
  837.  
  838.  
  839.  
  840.  
  841.  
  842. /*IDEA.C   v2.2
  843.     c source code for IDEA block cipher. IDEA (International Data
  844.     Encryption Algorithm), formerly known as IPES (Improved Proposed
  845.     Encryption Standard). Algorithm developed by Xuejia Lai and James L.
  846.     Massey, of ETH Zurich. This implementation modified and derived from
  847.     original C code developed by Xuejia Lai. Zero-based indexing added,
  848.     names changed from IPES to IDEA. CFB functions added. Random Number
  849.     routines added. Optimized for speed 21 Oct 92 by Colin Plumb
  850.     <colin@nsq.gts.org>  This code assumes that each pair of 8-bit bytes
  851.     comprising a 16-bit word in the key and in the cipher block are
  852.     externally represented with the Most Significant Byte (MSB) first,
  853.     regardless of internal native byte order of the target cpu.
  854.     modified for use with PC files by Colin Maroney 4/1/94*/
  855.  
  856. /*   USAGE:     pass a key made up of 8 16-bit numbers (word16) in an array
  857.       ("word16 key[8];"), an input FILE * and an output temporary
  858.       FILE * to either encode_file() or decode_file().
  859.       where the key comes from is up to you.
  860.       then call swap_files_and_clean_up() with the original file's
  861.       name as the argument, to replace the original file
  862.       with the encoded data (stored in the temporary file).
  863.  
  864.       you can remname the tempfile to be used in idea.h
  865.       noisy is an integer which tells encrypting/decrypting
  866.       functions to echo a "." every 256 writes, so the user can
  867.       see that something is happening. set it to 0 for quiet
  868.       running.
  869.  
  870.       please note that for really good security the original file
  871.       is overwritten before being erased if you use the w switch.
  872.       otherwise it outputs a file "<filename>.enc"
  873.  
  874.       the main() used here as illustration reads the filename
  875.       from the command line arguments, as well as a command
  876.       "e" or "d" to tell it whether to encrypt or
  877.       decrypt, and a key.  the older versions had an interface
  878.       for when a command line was not use.  lack of editing
  879.       features made this buggy, so i axed it. */
  880.  
  881.  
  882. #include "idea.h"
  883.  
  884. static uint16 inv(uint16 x){
  885.  
  886.     uint16 t0,t1;
  887.     uint16 q,y;
  888.     if(x<=1)return x;
  889.     t1=(uint16)(0x10001l/x);
  890.     y=(uint16)(0x10001l%x);
  891.     if (y==1)return low16(1-t1);
  892.     t0=1;
  893.     do{
  894.       q=x/y;
  895.       x=x%y;
  896.       t0+=q*t1;
  897.       if (x==1)return t0;
  898.       q=y/x;
  899.       y=y%x;
  900.       t1+=q*t0;
  901.     }while (y!=1);
  902.  
  903.     return low16(1-t1);
  904. }
  905.  
  906. static void en_key_idea(word16 *userkey, word16 *Z){
  907.  
  908.     int i,j;
  909.  
  910.     /* shifts */
  911.     for (j=0;j<8;j++)Z[j]=*userkey++;
  912.  
  913.     for (i=0;j<KEYLEN;j++){
  914.       i++;
  915.       Z[i+7]=((Z[i&7] << 9) | (Z[i+1 & 7] >> 7));
  916.       Z+=i&8;
  917.       i&=7;
  918.     }
  919. }
  920.  
  921. static void de_key_idea(IDEAkey Z,IDEAkey DK){
  922.  
  923.     int j;
  924.     uint16 t1,t2,t3;
  925.     IDEAkey T;
  926.     word16 *p=T+KEYLEN;
  927.     t1=inv(*Z++);
  928.     t2=-*Z++;
  929.     t3=-*Z++;
  930.     *--p=inv(*Z++);
  931.     *--p=t3;
  932.     *--p=t2;
  933.     *--p=t1;
  934.  
  935.     for (j=1;j<ROUNDS;j++){
  936.       t1=*Z++;
  937.       *--p=*Z++;
  938.       *--p=t1;
  939.       t1=inv(*Z++);
  940.       t2=-*Z++;
  941.       t3=-*Z++;
  942.       *--p=inv(*Z++);
  943.       *--p=t2;
  944.       *--p=t3;
  945.       *--p=t1;
  946.     }
  947.  
  948.     t1=*Z++;
  949.     *--p=*Z++;
  950.     *--p=t1;
  951.     t1=inv(*Z++);
  952.     t2=-*Z++;
  953.     t3=-*Z++;
  954.     *--p=inv(*Z++);
  955.     *--p=t3;
  956.     *--p=t2;
  957.     *--p=t1;
  958.  
  959.     /*copy and destroy temp copy*/
  960.     for(j=0,p=T;j<KEYLEN;j++){
  961.       *DK++=*p;
  962.       *p++=0;
  963.     }
  964. }
  965.  
  966.  
  967. uint16 mul(uint16 a, uint16 b){
  968.  
  969.     word32 p;
  970.  
  971.     if(a){
  972.       if(b){
  973.        p=(word32)a*b;
  974.        b=(uint16)(low16(p));
  975.        a=(uint16)(p>>16);
  976.        return b-a+(b<a);
  977.       }
  978.       else return 1-a;
  979.     }
  980.     else return 1-b;
  981. }
  982.  
  983. #define MUL(x,y) (x=mul(low16(x),y))
  984. #define CONST
  985.  
  986. static void cipher_idea(word16 in[4],word16 out[4],register CONST IDEAkey Z){
  987.  
  988.     register uint16 x1,x2,x3,x4,t1,t2;
  989.     int r=ROUNDS;
  990.  
  991.     x1=*in++; x2=*in++;
  992.     x3=*in++; x4=*in;
  993.     do{
  994.     MUL(x1,*Z++);
  995.     x2+=*Z++;
  996.     x3+=*Z++;
  997.     MUL(x4,*Z++);
  998.     t2=x1^x3;
  999.     MUL(t2,*Z++);
  1000.     t1=t2+(x2^x4);
  1001.     MUL(t1,*Z++);
  1002.     t2=t1+t2;
  1003.     x1^=t1;
  1004.     x4^=t2;
  1005.     t2^=x2;
  1006.     x2=x3^t1;
  1007.     x3=t2;
  1008.     }while(--r);
  1009.  
  1010.     MUL(x1,*Z++);
  1011.     *out++=x1;
  1012.     *out++=(x3+*Z++);
  1013.     *out++=(x2+*Z++);
  1014.     MUL(x4,*Z);
  1015.     *out=x4;
  1016. }
  1017.  
  1018. char read_char_from_file(FILE *fp){
  1019.  
  1020.     char temp=0;
  1021.  
  1022.     if((fread(&temp,sizeof(char),1,fp))!=1)end_of_file=1;
  1023.  
  1024.     return(temp);
  1025. }
  1026.  
  1027. word16 read_word16_from_file(FILE *fp){
  1028.  
  1029.     word16 temp=0;
  1030.  
  1031.     if((fread(&temp,sizeof(word16),1,fp))!=1)end_of_file=1;
  1032.  
  1033.     return(temp);
  1034. }
  1035.  
  1036. void write_char_to_file(char data,FILE *fp){
  1037.  
  1038.     if((fwrite(&data,sizeof(char),1,fp))!=1){
  1039.       printf("Fatal Error writing output file!!!\n");
  1040.       exit(-1);
  1041.     }
  1042. }
  1043.  
  1044. void write_word16_to_file(word16 data,FILE *fp){
  1045.  
  1046.     if((fwrite(&data,sizeof(word16),1,fp))!=1){
  1047.       printf("Fatal Error writing output file!!!\n");
  1048.       exit(-1);
  1049.     }
  1050. }
  1051.  
  1052.  
  1053. void cipher_file(FILE *in,FILE *out,word16 *key){
  1054.  
  1055.     word16 input[4],output[4];
  1056.     IDEAkey Z;
  1057.     int x,y;
  1058.     int count=0;
  1059.     long length;
  1060.     int temp;
  1061.  
  1062.     en_key_idea(key,Z);
  1063.     end_of_file=0;
  1064.  
  1065.     length=filelength(fileno(in));
  1066.     fwrite(&length,sizeof(long),1,out);
  1067.  
  1068.     while(!end_of_file){
  1069.       x=0;
  1070.  
  1071.       while (x<4){
  1072.        input[x]=((word16)(read_char_from_file(in)<<8));
  1073.        if (!end_of_file){
  1074.             temp=read_char_from_file(in);
  1075.             if (temp<0)temp+=256;
  1076.             input[x]=input[x]|temp;
  1077.             x++;
  1078.        }
  1079.        if(end_of_file){
  1080.             while (x<4) input[x++]=0;
  1081.             break;
  1082.        }
  1083.       }
  1084.       cipher_idea(input,output,Z);
  1085.       for (y=0;y<x;y++){
  1086.        if(noisy)if(count++%256==0) printf(".");
  1087.        write_word16_to_file(output[y],out);
  1088.       }
  1089.     }
  1090. }
  1091.  
  1092. void decipher_file(FILE *in,FILE *out,word16 *key){
  1093.     word16 input[4],output[4];
  1094.     int x,y;
  1095.     IDEAkey Z,DK;
  1096.     int count=0;
  1097.     long length=0;
  1098.  
  1099.     en_key_idea(key,Z);
  1100.     de_key_idea(Z,DK);
  1101.  
  1102.     end_of_file=0;
  1103.  
  1104.     fread(&length,sizeof(long),1,in);
  1105.  
  1106.  
  1107.     while (!end_of_file){
  1108.       x=0;
  1109.       while(x<4){
  1110.        input[x]=read_word16_from_file(in);
  1111.        if(end_of_file)break;
  1112.        x++;
  1113.       }
  1114.        cipher_idea(input,output,DK);
  1115.        for (y=0;y<x;y++){
  1116.             if(noisy)if(count++%256==0) printf(".");
  1117.             if(length-->0)write_char_to_file(((char)(output[y]>>8)),out);
  1118.             if(length-->0)write_char_to_file(((char)(output[y]&255)),out);
  1119.        }
  1120.       }
  1121. }
  1122.  
  1123. void swap_files_and_clean_up(char *file){
  1124.     long fsize,count;
  1125.     FILE *fp;
  1126.     char temp[100];
  1127.  
  1128.     if(overwrite){
  1129.       if ((fp=fopen(file,"r+b"))==NULL)printf("\nError overwriting old file,
  1130. security compromised.\n");
  1131.  
  1132.       else{
  1133.        fseek(fp,0l,SEEK_END);
  1134.        fsize=ftell(fp);
  1135.        fseek(fp,0l,SEEK_SET);
  1136.        for (count=0;count<fsize;count++)fputc('0',fp);
  1137.        fclose(fp);
  1138.       }
  1139.  
  1140.       if ((remove(file))!=0){
  1141.        printf("\nERROR removing old file <%s>\n",file);
  1142.        printf("encoded data remains in temporary file <%s>\n",tempfilename);
  1143.        exit(-1);
  1144.       }
  1145.     }
  1146.  
  1147.     else{
  1148.       strcpy(temp,file);
  1149.       file=strtok(temp,".");
  1150.       strcat(file,".enc");
  1151.     }
  1152.  
  1153.     if ((rename(tempfilename,file))!=0){
  1154.       printf("\nERROR renaming temporary file <%s>!!\n",tempfilename);
  1155.       printf("Data is safely processed and stored in that file.\n");
  1156.       exit(-1);
  1157.     }
  1158. }
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164. /*-----------------------------------------------*/
  1165.  
  1166.  
  1167. #define KBYTES 1024
  1168.  
  1169. void getuserkeyfromargv(word16 *key,char *arg){
  1170.  
  1171.     int x;
  1172.  
  1173.     for (x=0;x<strlen(arg) && x<8;x++){
  1174.       if (x==0) key[x]=arg[x]<<8;
  1175.       else key[x]=((arg[x]<<8)|(key[x-1]>>8));
  1176.     }
  1177.  
  1178.     if(strlen(arg)>8)printf("\nONLY first *8* characters of key used!!!\n");
  1179.  
  1180.     if(x<8)while(x<8)key[x++]=0;
  1181. }
  1182.  
  1183. main(int argc, char **argv){
  1184.  
  1185.     word16 userkey[8];
  1186.     char filename[100];
  1187.     FILE *fp,*temp;
  1188.     int to_or_from;
  1189.  
  1190.     noisy=1;
  1191.     overwrite=0;
  1192.  
  1193.     if (argc!=4){
  1194.       printf("\nUsage: idea filename.ext [e|d[w]] key\n");
  1195.       printf("          e=encode   d=decode   w=overwrite file\n");
  1196.       printf("       NOTE: Key must be no longer than 8 characters long!!!\n");
  1197.       exit(-1);
  1198.     }
  1199.  
  1200.     else{
  1201.       strncpy(filename,argv[1],99);
  1202.       filename[99]='\0';
  1203.       if (argv[2][0]=='e') to_or_from=1;
  1204.       else if(argv[2][0]=='d') to_or_from=0;
  1205.        else{
  1206.             printf("\nUsage: idea filename.ext [e|d[w]] key\n");
  1207.             printf("   e=encrypt d=decrypt w=overwrite file\n");
  1208.             printf("       NOTE: Key must be no longer than 8 characters
  1209. long!!!\n");
  1210.             exit(-1);
  1211.        }
  1212.       if (argv[2][1]=='w') overwrite=1;
  1213.       getuserkeyfromargv(userkey,argv[3]);
  1214.     }
  1215.  
  1216.  
  1217.     if ((fp=fopen(filename,"r+b"))==NULL){
  1218.       printf("\nError opening File %s\n",filename);
  1219.       exit (-1);
  1220.     }
  1221.  
  1222.     if((temp=fopen(tempfilename,"w+b"))==NULL){
  1223.       printf("\nError opening temporary file\n");
  1224.       exit(-1);
  1225.     }
  1226.  
  1227.     if (to_or_from==1){
  1228.       printf("\nEncoding file %s   ",filename);
  1229.       cipher_file(fp,temp,userkey);
  1230.     }
  1231.     else{
  1232.       printf("\nDecoding file %s   ",filename);
  1233.       decipher_file(fp,temp,userkey);
  1234.     }
  1235.  
  1236.     fclose (fp);
  1237.     fclose(temp);
  1238.  
  1239.     swap_files_and_clean_up(filename);
  1240.  
  1241.     return 0;
  1242. }
  1243.  
  1244. ---------------------------------END INCLUDED TEXT-----------------------------
  1245.  
  1246.  
  1247.     --[How to implement cryptography securely]--
  1248.  
  1249.  
  1250.     You can be using the most secure algorithm available, and be using it
  1251. improperly, and sacrifice all the security it has to offer. This section
  1252. includes some general things to be wary of, to have optimum success with
  1253. whatever algorithm you are using.
  1254.  
  1255.  
  1256.     [Passphrase/word picking]
  1257.  
  1258.     First things first.  Why bother using all of the worlds computers in a
  1259. parallel brute force search or prime factorization, when a poorly chosen
  1260. password is the only obstacle (if you deadbolt your door, don't leave the
  1261. hinges off).  Poor passwords are the number one way in which ALL of computer
  1262. security is compromised....
  1263.  
  1264.       THINGS YOUR PASSWORD SHOULD *NOT* BE:
  1265.  
  1266.       -In any dictionary.
  1267.       -A real word.
  1268.       -Anything that can be deduced from knowing you.
  1269.       -And for GOD'S sake NOT written down.
  1270.  
  1271.       THINGS YOUR PASSWORD *SHOULD* BE:
  1272.  
  1273.       -The full length allowable by the implementation.
  1274.       -Of mixed case, numerics and special characters.
  1275.       -Something you learn to type quickly w/o looking at the keyboard.
  1276.       -Something you DO NOT forget.
  1277.  
  1278.  
  1279.     [Dangers of a multi-user system]
  1280.  
  1281.     Using cryptography on a multi-user system can be dangerous.  There are
  1282. multitudes of attacks possible, with the feasibility and implementation
  1283. depending on the particular OS.  There are so many possible attacks: key
  1284. logging, memory space snooping, swap-file reading, trojan horses, etc...
  1285. Granted some of these attacks are sophisticated.  I supposed your level of
  1286. paranoia depends on what you are seeking to hide, but, my advice is to never
  1287. underestimate the sophistication of your enemy.  My further advice is NOT to
  1288. use cryptography on an untrusted multi-user system.
  1289.  
  1290.  
  1291.     [Van-Eck devices]
  1292.  
  1293.     All electronic equipment emits electrical and electromagnetic
  1294. radiation.  Van-Eck devices are devices that intercept this radiation from
  1295. computer equipment and are able to reassemble the data displayed therein.
  1296. Van Eck devices can be very hard to detect, as they can be installed out of
  1297. site from the target.  Van Eck devices can be built for around $300.00 from
  1298. parts available at Radio Shack.  The implications of this are obvious and
  1299. potentially severe.  Unfortunately, apart from outfitting your equipment
  1300. with TEMPEST certified products (or shielding the rooms with lead), there
  1301. isn't much you can do about this threat, except be wary of just who is
  1302. driving a van in your neighborhood with limo'd out windows and parked in
  1303. front of your house...
  1304.  
  1305.  
  1306.     [Packet-Sniffing]
  1307.  
  1308.     Packet-sniffing is another 'invisible threat'.  Packet sniffers are
  1309. very hard to detect, because most are passive, not altering or producing data,
  1310. just recording what zips on by.  Some implementations of crypto products will
  1311. send some sort of initialization value or even a key (or password) across the
  1312. wire in the clear.  I'd avoid using them. (Unfortunately, one of the most
  1313. commonly networked OS's, Unix, is vulnerable to this attack.  It sends login
  1314. names and passwords in the clear both upon logging in and in ftp and telnet
  1315. sessions.  Of course, there are alternatives, such as Kerberos or a revised
  1316. ftp or telnet client [and daemon].)
  1317.  
  1318.  
  1319.  
  1320.     --[In closing]--
  1321.  
  1322.  
  1323.     In this world of tinsel locks, privacy is a dangerous illusion.
  1324.  
  1325.     As the world inexoribly heads towards a completely computer controlled
  1326. society we will need some level of assurance that our secrets remain secret.
  1327. Cryptogrpahy can provide this assurance.  It is my humble opinion (and not
  1328. much of a revalation) that cryptography will become much more commonplace in
  1329. the years to come.
  1330.     As far as today goes, cryptography is largely a misunderstood artform.
  1331. When some people think of cryptography they think of super-spys and large
  1332. governments.  The people that DO know about modern day cryptography, often
  1333. implement it incorrectly, sacraficing it's security.  The few that do know
  1334. need to teach the masses that don't know.  It is important to show them *why*
  1335. to use it, not just how.
  1336.     It is also important to keep cryptography legal and thriving.  If the
  1337. power of unbreakable ciphers is put in the hands of the few government
  1338. officials and outlawed for the masses, it would be a tragedy.  More than a
  1339. tragedy, it would be a violation of our intrinsic right to privacy.  I don't
  1340. remember where I read it:  When cryptography is outlawed, only outlaws will
  1341. have cryptography.
  1342.  
  1343. He who controls the information will control the world.
  1344.  
  1345.     In the uneducated words of one late actor:
  1346.  
  1347.       "...You won't get in...It's encrypted..."
  1348.  
  1349.  
  1350.  
  1351.     --[Credit where credit is due]--
  1352.  
  1353.  
  1354.     This paper could not have been possible without the following:
  1355.  
  1356.     - Bruce Schneier for his GODSEND book _APPLIED_CRYPTOGRAPHY_,
  1357.       which I find myself constantly reading.
  1358.  
  1359.     - Bruce Schneier for answering my questions.
  1360.  
  1361.     - The gracious community of SCI.CRYPT for answering my questions.
  1362.  
  1363.     - Paul Fahn of RSA Laboratories for the SCI.CRYPT FAQ.
  1364.  
  1365.     - Introduction to Algorithms, a very, very large and very theory-
  1366.       oriented book.
  1367.  
  1368.     - Paul Rubin, Adam Back, and several others for their help.
  1369.  
  1370.     - Alec Muffet, Paul Leyland, Arjen Lenstra, and Jim Gillogly for
  1371.       factoring the Blacknet key and showing us just how important large
  1372.       keys are.
  1373.  
  1374.     - Some inate hunger for knowledge I developed somewhere along the
  1375.       line...
  1376.  
  1377.  
  1378.  
  1379.               .oO____Oo.
  1380.  
  1381.  
  1382.  
  1383.  
  1384.     ______________________________________________________________
  1385.     |Windows NT Security                                          |
  1386.     |_____________________________________________________________|
  1387.  
  1388.  
  1389.               by the Nihilist
  1390.  
  1391.  
  1392. 1.1  The Subject of Trust
  1393.  
  1394. Within any network security model, the subject of trust is always an area of
  1395. great complexity.  The Windows NT security model centers around the concept
  1396. of a domain, in which a single sign-on is necessary to access any resources
  1397. (file services, print services, and program execution) where permissions have
  1398. been granted. A domain model, such as the one used in Windows NT, offers ease
  1399. of use for both users and for general administration but also offers many
  1400. possible avenues of exploit for those inclined.  The model is made more
  1401. complex when the concept of a trusted domain is introduced.
  1402.  
  1403. A trusted domain is another domain with which an explicit connection is made
  1404. through a trust relationship. In Windows NT a trust relationship is one way
  1405. *and* non-transitive. In order to have two domains trust each other, there
  1406. must be two trust relationships established, one from domain A to domain B
  1407. and another trust from B to A.  Once a trust relationship is created,
  1408. permissions must be explicitly granted in the trusting domain if users from
  1409. the trusted domain are to have access to resources in it.  The idea of
  1410. non-transitive trust is that if domain A trusts domain B and domain B trusts
  1411. domain C then domain A does not trust domain C.
  1412.  
  1413. Windows NT inherently handles the mechanisms of trust and permissions securely
  1414. by using ACLs (Access Control Lists), process and user Ids, and
  1415. cryptographically signed tokens. Nowhere in authentication are clear text
  1416. passwords used, except with FTP, telnet and a few other UNIX like utilities
  1417. (the r commands and telnet are only clients on NT[1], so the security of the
  1418. serving host would be the one compromised unless the passwords are the same on
  1419.  both systems).  But these mechanisms do not, by any means, guarantee a secure
  1420. environment without careful administration and guidelines.
  1421.  
  1422. Invariably, there are nuances to the security mechanisms in all operating
  1423. systems and network operating systems, Windows NT is no different.  In the case
  1424. of trust relationships, there is a significant peculiarity to be aware of.
  1425. Once a trust relationship is established, it should be able to be broken by
  1426. either domain, the trusting or the trusted, at any time.  What really happens
  1427. (in versions 3.1 and 3.5) is that either or both sides can sever the trust
  1428. connection but it will remain in effect until the Primary Domain Controller
  1429. (PDC) in either domain is rebooted.  The ramifications of this would only come
  1430. into play if an administrator or user in the trusting domain made data or
  1431. resources available expecting that members of the formerly trusted domain did
  1432. not have access.  Another case maybe that it was expected that the data in a
  1433. share would not be updated, but a user of the trusted domain, unaware, made
  1434. changes because she/he could.  The way to prevent a situation like this from
  1435. happening is to remove the permissions from the resource, opposed to relying
  1436. on the breaking of trust.
  1437.  
  1438. A more insidious bug I uncovered is the ability to view and *possibly* change
  1439. or create user information in the trusting domain.  Normally the trusting
  1440. domain has access to user names and groups from the trusted domain in order to
  1441. grant permissions to resources, but the trusted domain does not have access to
  1442. the trusting domain's user database.  I created a trust relationship between
  1443. a Windows NT 3.1 Advanced Server domain, the trusting domain, and a Windows NT
  1444. 3.5 Server domain, the trusted domain.  Immediately after establishing the
  1445. trust, I opened the User Manager in the trusted domain and attempted to view
  1446. the user database of the trusting domain.  I was able to view *all* the
  1447. information regarding user accounts, groups, and the domain's security policy
  1448. which includes minimum password length, password aging, logon hours, tries
  1449. before lockout, and user rights.  At the time I was unable to attempt adding
  1450. or modifying a user account.  None the less, revealing this information is
  1451. enough of a breach of security by itself.  Remember, knowledge is power.  I
  1452. have not had the resources available to me to thoroughly test the extent of
  1453. this bug, but I do know that any further attempts to view the user information
  1454. were denied.  For this bug to be exploited, one must be in the Administrators
  1455. group of a domain controller or in the Domain Admin group of the trusted
  1456. domain and possibly do a little social engineering.
  1457.  
  1458. To this point, I have discussed trust in the NT sense of the word, but if one
  1459. applies a more philosophical view of trust to Windows NT they will see it
  1460. extends much deeper into the networking model.  The concept of single sign-on
  1461. in a network requires an authority, or trusted, service to validate access to
  1462. resources across multiple hosts. What this implies is that if someone can
  1463. crack or circumvent the trusted validation mechanisms then that individual
  1464. has a free reign as far as the trust extends.  The scope of a breach of
  1465. this nature would include the local domain and it would extend to any
  1466. trusting domains where permission has been granted to resources.
  1467.  
  1468. When users logon to Windows NT, a security access token, which contains the
  1469. user's security ID, group security IDs, user name, group names, and user
  1470. rights, is created by the system from information stored in the security
  1471. account manager database (similar to the UNIX /etc/passwd database, but
  1472. contains much more information and is encrypted. The default location of the
  1473. database is %SystemRoot%\system32\config\SAM).  All processes created by the
  1474. user, or run on the users behalf (impersonation), have the user's security
  1475. access token attached.  When a process tries to access a protected object,
  1476. the Security Reference Monitor (the only access validation code in the system,
  1477. which I believe is embedded in the kernel) checks the user's security token
  1478. against the object's DACL and grants or denies access based on the local
  1479. system's policies and standard validation routines.  The SAM database is
  1480. always open by a process, therefore it can not be copied or deleted regardless
  1481. of the user's security level[2].  It maybe possible for a system level program
  1482. to gain access to or delete the database, but the old UNIX problem of snatching
  1483. password files seems to be eliminated.   Therefore, the areas that seem most
  1484. likely to be exploited revolve around security access tokens and the logic in
  1485. the Security Reference Monitor.  If processes do not set or reset tokens
  1486. correctly or the Security Reference Monitor deals with obscure situations
  1487. illogically, then holes like the trust bug mentioned earlier could be opened.
  1488. The significance of these holes is magnified because they possibly affect
  1489. multiple servers.
  1490.  
  1491.  
  1492. 1.2  Do I have permission?
  1493.  
  1494. Windows NT has probably shut the door on the less technical cracker, but poor
  1495. administration could open the door back up.  By default, the directory and
  1496. file permissions leave the system software unnecessarily open to all, a
  1497. situation that begs to be exploited through trojan horses.  Also, some of the
  1498. management utilities will allow any user to view information about the system
  1499. like user names, group names, and application and system logs.  I prefer to
  1500. not give out any information about my systems other than what is necessary to
  1501. accomplish the intended work.  I suggest setting file permissions by hand in
  1502. the %SystemRoot% and system32 directories.  The entire system32 directory can
  1503. be made read only to the everyone group to prevent trojan horses and
  1504. tampering, and the management utilities can be made only accessible to the
  1505. administrators group and any other group or user responsible for accounts and
  1506. management.  Also, it should never be necessary to share the system32
  1507. directory[3].
  1508.  
  1509. If a user can delete files from the system32 directory, it is very easy to
  1510. obscure the audit logs by simply removing three files: MSAuditE.dll,
  1511. MSObjs.dll, and IOLogMsg.dll.  These three files supply the text of the audit
  1512. entries, and without them the entries become very cryptic (but with some work
  1513. one can still figure out what happened, or else just replace the files).
  1514.  
  1515. The %SystemRoot%\system32\config directory is a prime target since it
  1516. contains the system databases and audit logs.  The default permissions are
  1517. well thought out, but there is a precautionary measure that can be taken to
  1518. insure that even if there is a complete security breach the audit logs can not
  1519. be erased.  The Registry can be modified to write the logs to a WORM (Write
  1520. Once Read Many) device, if one is available.  I recommend this type of
  1521. configuration for RAS hosts and Internet gateways or any other host that needs
  1522. robust auditing.  In the following example, the Registry has been modified to
  1523. write the security log to a WORM drive mapped to drive X:
  1524.  
  1525. Key Name:          SYSTEM\CurrentControlSet\Services\EventLog\Security
  1526. Class Name:        <NO CLASS>
  1527. Last Write Time:   6/15/95 - 8:58 AM
  1528. Value 0
  1529.   Name:            File
  1530.   Type:            REG_EXPAND_SZ
  1531.   Data:                  X:\Log\SecEvent.Evt
  1532.  
  1533.  
  1534. 1.3  TCP/IP and Security
  1535.  
  1536. Running TCP/IP in a Windows NT environment does not *by it self* open any
  1537. security holes (it is my protocol of choice), but some of the services and
  1538. applications that have become standard in the UNIX environment do.
  1539.  
  1540. FTP and Telnet are two prime examples of services that will send passwords
  1541. un-encrypted on the wire.  With such services it is really the server that is
  1542. compromised, because this is where the revealed password can be used to gain
  1543. access.  At this point, up to and including build 1057 (version 3.51) of Windows
  1544.  
  1545. NT, it can only be a server for FTP, with the exceptions mentioned previously.
  1546. The recommended configuration for a FTP server under NT is to *only* allow
  1547. anonymous access, this way no passwords for the NT machine will be divulged.
  1548.  
  1549. The real danger comes in a heterogeneous environment where users synchronize
  1550. passwords on their NT accounts and on some other system, such as a UNIX box,
  1551. and use  unsecure services like Telnet and FTP.  A local attacker can sniff
  1552. packets at the ethernet or IP level to capture the passwords, and a remote
  1553. attacker can possibly spoof a local router or host and have the IP packets
  1554. sent to a remote machine to be captured and analyzed.  The best defense is to
  1555. educate users on secure password practices and create utilities to try and
  1556. test for bad habits.
  1557.  
  1558. If operating in a pure NT environment, refrain from using UNIX style services
  1559. and use the standard NT networking services.  With the NT services you are
  1560. protected from the standard and not so standard password and IP spoofing
  1561. attacks.  Even if an attacker spoofs a connection, they still have to deal
  1562. with the signed tokens servers and processes check.
  1563.  
  1564. There is one danger of information leakage with TCP/IP.  If the host is
  1565. multihomed, any application that binds to a port on one interface expecting to
  1566. only send data on that network will be in for a big surprise.  There is *no*
  1567. guarantee that packets will
  1568.  only be sent on the interface the port is bound to. If one NIC is on a private
  1569. network and the other is on a public network, there could be problems[5].  This
  1570. issue is apparently fixed in the build 1057 bits.
  1571.  
  1572.  
  1573. 1.4 Closing Comments
  1574.  
  1575. Build 1057 of Windows NT has cleaned up a lot of the internals, and since
  1576. I have only had access to it for three days[4], I have not tested it out
  1577. *yet*.  My words to live by are still: don't trust your users, don't think C2
  1578. means secure, and don't think that nobody can get in.  Have fun!
  1579.  
  1580.  
  1581. Footnotes
  1582.  
  1583. 1  There are third parties that supply telnet and r command daemons, but the
  1584. security issues involved with the current versions of the software are
  1585. tremendous (the documentation warns of this in some cases). It is possible for
  1586. an individual who is using the server locally to see what is being executed
  1587. remotely and enter commands to be executed as the remote user. This prompts
  1588. me to recommend against their use unless security is of NO concern.
  1589. Microsoft supplies an unsupported client/server remote command execution
  1590. utility (rcmdsvc.exe and rcmd.exe) with the Resource Kit that does not send
  1591. passwords in the clear, but I can not speak as to whether it is actually secure.
  1592.  
  1593. 2  It could be possible to kill the process which has the database open.
  1594. This might leave the file wide open since the group everyone has full control.
  1595.  
  1596. 3  It is possible to replace files in the system32 (or any other directory) by
  1597. doing a "copy trojan.exe \\target_machine\c$\%SYSTEMROOT%\system32\AT.EXE" if
  1598. the permissions are not set correctly.
  1599.  
  1600. 4  Ah, but now I have access to thousands of them! and source! very LARGE.
  1601.  
  1602. 5  I believe this will only manifest itself if the host thinks the destination
  1603. can be reached through the other interface.  Probably rare, but I have seen it
  1604. happen.
  1605.  
  1606.               .oO____Oo.
  1607.  
  1608.  
  1609.  
  1610.      _____________________________________________________________
  1611.     |  Computer Security Threat Response                          |
  1612.     |______________________________________(is your system safe?)_|
  1613.  
  1614.  
  1615.  
  1616.               by MrZippy
  1617.  
  1618.  
  1619.  
  1620. ---[ 1.0 ]---
  1621.       INTRODUCTION
  1622.  
  1623.     If you forgot the password on your home computer, you'd be happy to
  1624. find that all you have to do is pull a jumper and the password is cleared
  1625. out.  However, no system administrator wants access to his/her system to be
  1626. that easy.  In order to stay ahead of those desiring to break into their
  1627. systems, sysadmins need a way to stay on top of security risks to their
  1628. systems.
  1629.  
  1630.     Several computer security orginazations were formed in order to
  1631. centralize reports of security threats and fixes for them.  There have been
  1632. numerous discussions about the impact of making this type of information
  1633. available to the public, but it is my (and many other people's) opinion that
  1634. publishing security loopholes can only make systems more secure. If someone
  1635. does manage to gain entry to a system through a well-documented loophole,
  1636. then it must be considered the sysadmin's fault for not taking action to
  1637. close the hole.
  1638.  
  1639.     So, how does a sysadmin (or anyone else, for that matter) become
  1640. informed of a possible security threat?  There are many security-related
  1641. orginazitions that publish information on potential problems.  The three
  1642. major players are CERT, FIRST, and [8LGM].  This article is intended to
  1643. give you an overview about what these groups are about.  The URL of each
  1644. orginazation is provided so you may further explore them.
  1645.  
  1646.  
  1647. ---[ 1.1 ]---
  1648.       CERT [Computer Emergency Response Team]
  1649.     <http://www.sei.cmu.edu:80/SEI/programs/cert.html>
  1650.  
  1651.     CERT is probably the most well-known of all computer security
  1652. organizations. Based at the Carnegie Mellon University, they provide
  1653. 24-hour technical assistance for responding to computer security
  1654. incidents, product vulnerability assistance, technical documents,
  1655. and seminars. The most visible of CERT's activities are it's
  1656. *CERT Advisories*.  These advisories are posted to a mailing list and
  1657. Usenet news groups, and are archived at CERT's FTP site.
  1658.  
  1659.     The advisories are usually NOT highly technical, and provide only an
  1660. overview of a potential threat rather than a detailed description of
  1661. exactly how to exploit the threat.  In their words,
  1662.  
  1663.      "A CERT advisory provides information on how to obtain a patch or
  1664.       details of a work around for a known computer security problem. "
  1665.  
  1666. CERT advisories are extremely useful to sysadmins, because they outline how
  1667. to fix a problem and where to obtain the resources to do it. .  They are
  1668. less useful to someone wishing to exploit the security hole because of the
  1669. lack of technical information.
  1670.  
  1671.     In addition to publishing Advisories, CERT maintains a FTP site
  1672. containing all sorts of informative materials.  Archives of all CERT
  1673. Advisories are stored here, as well as an archive of security-related
  1674. Usenet articles.  You can find RFC 1244 (the Site Security Handbook),
  1675. RFC 1281 (the Guidelines for the Secure Operation of the Internet), and the
  1676. Department of Defense's "Orange Book."  Also kept at the site are security-
  1677. related papers, technical tips for securing a system, and a small
  1678. collection of security tools.
  1679.  
  1680.  
  1681. ---[ 1.2 ]---
  1682.       8LGM [8-Legged Groove Machine]
  1683.       <http://www.8lgm.org/>
  1684.  
  1685.     8LGM is similar to CERT in that they also publish security Advisories.
  1686. They actively report any vulnerabilities they find directly to the vendors
  1687. that are affected.  The Advisories that 8LGM publishes are made known to
  1688. the relevant organizations (such as CERT), but are generally much more
  1689. detailed than a CERT Advisory.
  1690.  
  1691.     8LGM maintains not only a list of Advisories, but also a full write-up
  1692. on how to exploit the security bug.  The exploits are only posted after a
  1693. patch or fix has been found.  Most of these exploit files contain working
  1694. shell scripts which demonstrate the exact problem and how easy it is to
  1695. utilize it.  This is provided to assist sysadmins in closing the hole and
  1696. preventing any possible future exploit of the same bug.
  1697.  
  1698.     The exploit files are only available through 8LGM's email file server.
  1699. People requesting exploit files are warned that their names may be
  1700. published if 8LGM feels it necessary.  Since the exploit files are not made
  1701. available until a patch to the bug is available, it's unlikely that
  1702. the information can be used in a harmful way unless a sysadmin is unaware
  1703. of the problem in the first place.
  1704.  
  1705.     I find the 8LGM archive interesting because it is able to answer
  1706. questions about EXACTLY how a particular loophole was utilized. You can
  1707. gain a better understanding of the extent someone will go to gain
  1708. access to a system, and also gain a greater sense of appreciation for the
  1709. security advisory organizations.  It quickly becomes apparent how easily a
  1710. system can be compromised.
  1711.  
  1712.  
  1713. ---[ 1.3 ]---
  1714.       FIRST [Forum of Incident Response and Security Teams]
  1715.       <http://www.first.org/first/>
  1716.  
  1717.     FIRST is made up of members of Computer Response Teams from around
  1718. the world, including government agencies, Universities, and commercial
  1719. organizations.  It's main purpose is to share information between it's
  1720. members.
  1721.  
  1722.     FIRST is not a public organization - the information shared between
  1723. members is generally not for release to the public.  In fact, FIRST members
  1724. must sign a non-disclosure agreement before being admitted.  Members may
  1725. write their own advisories, (like CERT does), but the text of
  1726. communications between FIRST members stays secret.
  1727.  
  1728.     Not much else is known about FIRST.  Since they do not publish their
  1729. own advisories, they do not maintain a public archive.  The information
  1730. they have made available mainly discusses it's goals, but shows no examples
  1731. of how or if they have achieved them. FIRST states that any of it's members
  1732. may be contacted with security problems, and that member will assist you
  1733. with a solution. Currently, the following organizations are members of FIRST:
  1734.  
  1735.   ------------------------------------------------------------
  1736.   Air Force (US)                        Micro Bit Virus Center (Germany)
  1737.   ANS (US)                              Motorola (US)
  1738.   Apple Computer (US)                   NASA Ames (US)
  1739.   Assist (US)                           Nasirc (US)
  1740.   Auscert (Australia)                   Navcrt (US)
  1741.   Bellcore (US)                         Navy (US)
  1742.   Boeing (US)                           Nist (US)
  1743.   BSI (Germany)                         Nordunet (Denmark)
  1744.   CCTA (UK)                             Penn State (US)
  1745.   CERT                                  Purdue University (US)
  1746.   CERT-IT (Itally)                      Rentar (France)
  1747.   CIAC-Doe (US)                         SBA (US)
  1748.   Cisco (US)                            Sun Microsystems (US)
  1749.   DDN (US)                              Surfnet (Netherlands)
  1750.   DEC (US)                              Switch (Switzerland)
  1751.   Defense Research Agency (UK)          TRW (US)
  1752.   DFN-CERT (Germany)                    UK Agencies (UK)
  1753.   Dow (US)                              Unisys (US)
  1754.   EDS (US)                              US Sprint (US)
  1755.   GE (US)                               Veteran's Health Admin (US)
  1756.   Goddard (US)                          Westinghouse (US)
  1757.   Goldman (US)
  1758.   HP (US)
  1759.   J. P. Morgan (US)
  1760.   MCI (US)
  1761.   ------------------------------------------------------------
  1762.  
  1763.     After reviewing the types of organizations involved in FIRST, it is
  1764. very possible that major breakthroughs in computer security are originated
  1765. here.  Notice, though, that the only organization which actually releases
  1766. information to the public is CERT.  This makes you wonder what FIRST
  1767. members know that they're not sharing with the rest of the world.
  1768.  
  1769. ---[ 1.4 ]---
  1770.       CONCLUSION
  1771.  
  1772.     Hopefully, this has made you more aware of a few of the resources
  1773. available to sysadmins and non-admins alike.  The reason that any of the
  1774. organizations mentioned in this article make this type of information
  1775. available to the public is to educate them.  The more who know about the
  1776. risks involved in running a computer system, the more secure they will be.
  1777. Unless the information provided is completely disregarded by those running
  1778. the systems, it is rare that the knowledge gained from these advisories
  1779. can be used in a harmful manner.
  1780.  
  1781.  
  1782.               .oO____Oo.
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788. UNTAPPED RESOURCES:  SEMICONDUCTOR REFERENCE BOOKS AND MANUFACTURERS
  1789. ====================================================================
  1790. By J. Frank Parnell
  1791.  
  1792.  
  1793. Many hackers would like to build their own electronic projects, but feel the
  1794. knowledge required to do so is beyond them.  This, in fact, is untrue.  This
  1795. article will hopefully help those people.  The information talked about in
  1796. this article is oriented to people with a basic knowledge of electronics. If
  1797. you don't know a resistor from a capacitor then you should pick up "Getting
  1798. Started In Electronics" (part # 276-5003) from Radio Shack.  It's only $2.99
  1799. and can help give you a basic understanding of electronics and electronic
  1800. circuits.
  1801.  
  1802.  
  1803.  
  1804.     Part 1 - Semiconductor Reference Books
  1805.     --------------------------------------
  1806.  
  1807. Most hackers know a computer user is only as good as the reference material
  1808. they have available (or have memorized).  Well, the same holds true for
  1809. electronics.  There is one difference though--most electronics related
  1810. reference material may be obtained free of charge.
  1811.  
  1812.  
  1813. What are they?
  1814. ==============
  1815.  
  1816. Semiconductor reference books (also known as databooks) contain a wealth of
  1817. information.  They are meant to help engineers and technicians design and
  1818. construct circuits in an easy and straightforward manner.  There are books
  1819. for resistors, books for capacitors, books for transistors, books for
  1820. integrated circuits, etc.  The most useful of these books are the integrated
  1821. circuit (IC) databooks.  These IC databooks come in many flavors (power,
  1822. digital, linear, etc.), and from many sources (National, Motorola, Texas
  1823. Instruments, etc.).  At the end of this article is a list of semiconductor
  1824. manufacturers for your reference.  First, I will explain a bit about the
  1825. different types of books.
  1826.  
  1827.     Linear                  Analog circuits (amplifiers, voltage
  1828.             regulators, radio and TV circuits).
  1829.  
  1830.     Logic (TTL)             Digital circuits (logic chips mostly.  AND
  1831.             gates, multiplexers, data bus drivers).
  1832.  
  1833.     Microprocessor          Like the name says, microprocessors.
  1834.  
  1835.     Memory                  Again, like it says, "memory."
  1836.  
  1837.     Power                   Usually things like high power transistor
  1838.             switches and high output audio drivers.
  1839.  
  1840.     Interface               Line drivers, RS-232 interface chips, etc.
  1841.  
  1842.     Data conversion/        Analog to digital converters and such.
  1843.     acquisition
  1844.  
  1845. These are the most common types of books.  There are others also, but these
  1846. books will be the ones you encounter most often.
  1847.  
  1848.  
  1849. Why would I want them?
  1850. ======================
  1851.  
  1852. So you're asking yourself, "Why in the heck would I want to find out the
  1853. technical details of chips and stuff."  Well, let me tell you.  Along with
  1854. all the technical specifications in these books there are also "typical
  1855. applications."  These are schematics, and sometimes circuit board designs,
  1856. of common electronic circuits used in everyday consumer equipment.  The
  1857. engineers at these companies, some of the brightest people around, have sat
  1858. down and designed almost every conceivable use of each chip their company
  1859. manufactures.  They have done such a good job that people with just a
  1860. rudimentary knowledge of electronics can take this info and build themselves
  1861. perfectly functioning electronics circuits.  "Engineering by databooks" is
  1862. very common in all types of industries.  It takes less time, costs less
  1863. money, etc.  Why re-invent the wheel?
  1864.  
  1865. Some examples of "typical applications" are:
  1866.  
  1867.     Radio control circuits          Controlling something remotely, or
  1868.               getting a signal from a remote place
  1869.               when something happens.
  1870.  
  1871.     DTMF generators                 Generating your own DTMF tones for
  1872.               telephone communications.
  1873.  
  1874.     Ultrasonic transceivers         Wireless communications.  You could
  1875.               make a wireless burglar alarm.
  1876.  
  1877.     Speech synthesizers             Verbal communications (e.g. you think
  1878.               somebody might recognize your voice).
  1879.  
  1880.     Audio amplifiers                Listening to faint conversations.
  1881.  
  1882. The list goes on and on.  Almost anything you can think of has already been
  1883. designed by the engineers that work at these IC companies, although they
  1884. won't be called things like "red box."  Instead they will be called something
  1885. generic (like DTMF tone generators).
  1886.  
  1887. Almost everything I have built was already designed in a databook.  There
  1888. are some exceptions, like radios.  Complex (or semi-complex) things are laid
  1889. out in functional blocks.  A radio will have an RF receiver, a tuner and an
  1890. output amplifier.  So, you just have to hook each of these separate circuits
  1891. together to end up with your final circuit.  [This is actually a poor
  1892. example, but you get the picture.]
  1893.  
  1894.  
  1895. Where can I get these books?
  1896. ============================
  1897.  
  1898. Perhaps the most reliable place to get these books is direct from the IC
  1899. manufacturers.  They have these technical reference books printed up by the
  1900. thousands just for people like you and me.  Sometimes, if you get the right
  1901. person, they will send you a complete set of all their books.
  1902.  
  1903. Another place to find them is at electronics suppliers.  They get tons of
  1904. databooks from the IC manufacturers.  In fact, they often get so many that
  1905. they have to throw some of them out.  Several years ago all of these
  1906. suppliers would hand these books out free.  A friend and I would go around
  1907. to the different suppliers in the area and load up on databooks.  In just a
  1908. few hours, we would have a truck load.  The practice of just handing them
  1909. out is getting increasingly scarce nowadays.  The suppliers feel it's
  1910. another way to make money and so they are starting to charge for them.  But
  1911. not all suppliers do this, so look around and ask.  The easiest way to find
  1912. the suppliers is to look in the yellow pages under:
  1913.  
  1914.     Electronic equipment wholesale & manufacturers
  1915.     Electronic supplies wholesale & manufacturers
  1916.  
  1917. or something similar.  You can also find them by calling the chip
  1918. manufacturers and asking them for local suppliers in your area.
  1919.  
  1920. The last easy place you can find these books is at electronic trade shows.
  1921. Most major cities have them every year or two.  They will usually be in
  1922. some big convention center or arena (the same place they would have home
  1923. shows, boat shows, lawn and garden shows, etc.)  You will probably have to
  1924. do some digging to find out when they are scheduled.  The chip manufacturers
  1925. will set up booths to show off their latest products, and often times they
  1926. will have some sort of "goody" to entice people to stop by their booths.
  1927. These goodies might be key rings, sample parts, or candy but often they are
  1928. databooks.  If they don't have databooks at the show, or if they are all
  1929. gone, you can ask the company representative at the show to send some to
  1930. you.  He will take your name and address and send them out in a few weeks.
  1931.  
  1932.  
  1933. How does one get these books?
  1934. =============================
  1935.  
  1936. It will be easiest to get these reference books if you work for a high-tech
  1937. company or you are in college (or some type of school).  Depending on which
  1938. situation you are in, you can try one of the following:
  1939.  
  1940. If you are with a company, as opposed to school, then your best route would
  1941. be going to an IC manufacturer.  When you get books from them they will
  1942. usually pay the shipping.  To get the books you need to talk with somebody
  1943. in the sales department.  A typical conversation might go like this:
  1944.  
  1945.     IC mfg.         "Hello, blahblahblah IC company."
  1946.  
  1947.     You             "Hi, could I have sales please."
  1948.  
  1949.     IC mfg.         "Just a minute."
  1950.  
  1951.     IC mfg.         "Hello, this is Joe Salesman, can I help you?"
  1952.  
  1953.     You             "Hi Joe, this is John Q. Public with Electro-cool
  1954.        company.  The databooks we have for your company are
  1955.        several years old and I was wondering if you could
  1956.        send me out a new set?"
  1957.  
  1958.     IC mfg.         "Okay.  Can I have your shipping address?"
  1959.  
  1960.     You             "Sure, it's blahblahblah, and could you mark the
  1961.        package 'attention John Q. Public'?"
  1962.  
  1963. Sometimes the salesperson will say that they have to charge for the books.
  1964. If this happens, just say you are not interested.  Then call back in a few
  1965. days and try to talk with a different person.
  1966.  
  1967. If you are in school, then your best route would probably be a local
  1968. electronics supplier.  But you can try either one regardless of your
  1969. situation.  When you get databooks from a local supplier you will probably
  1970. have to pay for shipping yourself, so your best bet is to just go to their
  1971. place and pick up the books.  Again, you want to talk with somebody in
  1972. sales.  A typical conversation might go like this:
  1973.  
  1974.     Supplier        "Hello, blahblahblah electronics supplier."
  1975.  
  1976.     You             "Hi, could I have sales please?"
  1977.  
  1978.     Supplier        "Just a minute."
  1979.  
  1980.     Supplier        "Hello, this is Joe Salesman.  Can I help you?"
  1981.  
  1982.     You             "Hi Joe, this is John Q. Public at Bigshot
  1983.        University.  I'm working with the electronics lab,
  1984.        and we would like to update our reference books.  Do
  1985.        you guys have any IC databooks?"
  1986.  
  1987.     Supplier        "Yes we do.  We have blahblahblah and so&so."
  1988.  
  1989.     You             "Would it be possible for me to come down and get
  1990.        a few databooks for our lab?"
  1991.  
  1992.     Supplier        "Certainly.  Our address is blahblahblah."
  1993.  
  1994.     You             "All right.  I will come down tomorrow.  Thanks a
  1995.        bunch."
  1996.  
  1997. Now, if these guys want to charge for the books, then you need not call back
  1998. because you will get the same response from everybody there.  Just tell them
  1999. you are not interested.
  2000.  
  2001. If you are getting the databooks from an electronics convention, then just
  2002. act professional and dress nicely, because you will be judged by your
  2003. appearance.  The sales people there are specifically picked to be the
  2004. "suckup" type that wants to please, so you should have no problem.
  2005.  
  2006.  
  2007. Why do they give them away?
  2008. ===========================
  2009.  
  2010. You might be saying to yourself, "This sounds to good to be true, there must
  2011. be a catch or something."  Well, yes and no.  Today, integrated circuits are
  2012. so complex that if you did not have these reference books to help you along
  2013. you would be lost.  There is no way in the world you could figure out how to
  2014. use an IC just by looking at it.  You need to have these technical books to
  2015. do anything.  This being the case, the manufacturers of these chips would
  2016. not be able to sell even one of their chips if an engineer (or technician)
  2017. could not figure out how to use them.  This is why these books are given
  2018. away.  It all has to do with marketing their products.
  2019.  
  2020. Now the catch, they won't just give them to Joe Blow on the street.  They
  2021. must feel there is a potential "sell" somewhere in the future.  In other
  2022. words, there is a marketing strategy behind it.  So most of the time they
  2023. will only give them to people at schools (universities, colleges, technical
  2024. schools, high schools, etc.) or people in high tech industries (software,
  2025. hardware, consumer electronics, research facilities, etc.).  The people in
  2026. these industries and institutions are much more likely to buy these products
  2027. than your average Joe on the street (who would not know how to use these
  2028. reference books let alone buy any of these products).  Since most hackers
  2029. will actually be buying these products, there should not be a problem.
  2030.  
  2031.  
  2032.  
  2033.     Part 2 - Semiconductor Manufacturers
  2034.     ------------------------------------
  2035.  
  2036. Semiconductor manufacturers can provide you with more than just databooks.
  2037. They can also provide you with technical expertise and even free parts. They
  2038. provide all of this in the name of sales.  Since these things help people
  2039. use their products, they are more than happy to do this.
  2040.  
  2041.  
  2042. Getting technical help
  2043. ======================
  2044.  
  2045. IC manufacturers usually have an entire department of engineers to help
  2046. their customers when they are having trouble using their chips.  They can
  2047. walk you through how a circuit works, fax you updated schematics, give you
  2048. ideas on other ways to use their chips, etc.  Say you are trying to make a
  2049. DTMF decoder and you got all the info from the databook, and you put it
  2050. together just right and it still doesn't work.  You can call these guys up
  2051. and ask them for help.  This time when calling, you will want to talk with
  2052. an application engineer instead of a salesperson.  A typical conversation
  2053. might go like this:
  2054.  
  2055.     IC mfg.         "Hello, blahblahblah IC company."
  2056.  
  2057.     You             "Hello.  I'd like to speak to an application
  2058.        engineer, please."
  2059.  
  2060.     IC mfg.         "Just a minute."
  2061.  
  2062.     IC mfg.         "Hi, this is Joe Engineer, can I help you?"
  2063.  
  2064.     You             "Hi Joe, this is John Q. Public with Electro-cool
  2065.        company.  I have been working with your ABC123 DTMF
  2066.        decoder chip and I am having a few problems.  Can
  2067.        you help me?"
  2068.  
  2069.     IC mfg.         "Sure, what kind of problems are you having?"
  2070.  
  2071.     You             "Well, I hooked up the circuit the way your databook
  2072.        said to and it isn't decoding..."
  2073.  
  2074.     IC mfg.         "OK.  Have you checked blahblahblah?"
  2075.  
  2076.     etc...
  2077.  
  2078. These engineers are really a godsend.  They will go out of their way to help
  2079. you.  I have actually had some engineers draw up complete schematics and fax
  2080. them to me.
  2081.  
  2082.  
  2083. Getting free parts
  2084. ==================
  2085.  
  2086. Another thing IC manufacturers will do is provide you with free parts.  OK,
  2087. say you are the entrepreneurial type, and you have designed some kind of
  2088. cool electronic gizmo that you want to sell to "2600" readers, but you are
  2089. not sure if your design will actually work or not.  You can call the IC
  2090. manufacturers and ask them to send you a sample part.  You will need to
  2091. talk with customer support to get sample parts.  A typical conversation
  2092. might go like this:
  2093.  
  2094.     IC mfg.         "Hello, blahblahblah IC company."
  2095.  
  2096.     You             "Hi.  Can I have customer support?"
  2097.  
  2098.     IC mfg.         "Just a minute."
  2099.  
  2100.     IC mfg.         "Hi, this is Joe Supportperson.  Can I help you?"
  2101.  
  2102.     You             "Hi Joe, this is John Q. Public with Electro-cool
  2103.        company.  I am doing a little research project with
  2104.        DTMF decoders and I was hoping you could send me a
  2105.        sample ABC123 chip so I can verify if the project is
  2106.        viable or not.  I just need one to verify the
  2107.        circuit design."
  2108.  
  2109.     IC mfg.         "Sure, where would you like it sent?"
  2110.  
  2111.     You             "Send it to Electro-cool company at blahblahblah.
  2112.        And could you mark it 'attention John Q. Public'?"
  2113.  
  2114.     IC mfg.         "No problem.  You should have it in a couple of
  2115.        days."
  2116.  
  2117. Some other situations in which you could get sample parts is if you need
  2118. just one chip and you can't find anybody to sell you just one, or if you
  2119. can't find the chip from any supplier, anywhere.  Just call the manufacturer
  2120. and ask them for a sample.  Most likely they will help you.  This practice
  2121. of sampling parts is very common in the electronics industry.  Again, it all
  2122. has to do with marketing, sales, and customer satisfaction.
  2123.  
  2124.  
  2125. A final note about dealing with semiconductor manufacturers
  2126. ===========================================================
  2127.  
  2128. Many times when you call and ask for specific departments the receptionist
  2129. will ask "for what product, sir"?  Just tell them "ICs."  Also, when you
  2130. ask for sample parts you may be asked a few questions about how many you
  2131. might purchase in the future.  Because I work in a research department I
  2132. tell them "I have no idea.  It depends on the project making it out of the
  2133. research stage."  Also, remember to be courteous--these people are helping
  2134. you.
  2135.  
  2136.  
  2137. Additional References
  2138. =====================
  2139.  
  2140.  
  2141. Semiconductor suppliers
  2142. -----------------------
  2143.  
  2144. The following companies will sell electronic parts to anybody (i.e. you
  2145. don't need to be working for a high-tech company or going to school).
  2146. You can call these companies and get their catalogs, free.  As well
  2147. as describing the products they sell, these catalogs have some useful
  2148. information in them.
  2149.  
  2150.     Digi-Key Corporation
  2151.     701 Brooks Ave. South, P.O. Box 677
  2152.     Thief River Falls,   MN  56701-0677  USA
  2153.     TELEPHONE: 800-344-4539
  2154.     FAX:       218-681-3380 FAX
  2155.     OTHER:     800-344-4539
  2156.  
  2157.     Mouser Electronics
  2158.     24-T Hwy. 287 N., P.O. Box 719
  2159.     Mansfield,   TX  76063  USA
  2160.     TELEPHONE: 817-483-4422
  2161.     FAX:       817-483-0931 FAX
  2162.     OTHER:     800-346-6873
  2163.     TELEX II4   510-601-0375 TWX
  2164.  
  2165.  
  2166. Semiconductor manufacturers
  2167. ---------------------------
  2168.  
  2169. Here is a list of some of the more common semiconductor manufacturers.
  2170.  
  2171.  
  2172.     Advanced Micro Devices, Inc.
  2173.     One AMD Place, P.O. Box 3453
  2174.     Sunnyvale,   CA  94088-3453  USA
  2175.     TELEPHONE: 408-732-2400
  2176.  
  2177.     Intel Corp.
  2178.     3065-T Bowers Ave.
  2179.     Santa Clara,   CA  95052-8121  USA
  2180.     TELEPHONE: 408-765-8080
  2181.     OTHER:  800-548-4725
  2182.  
  2183.     Motorola, Inc., Semiconductor Products Sector
  2184.     3102-T N. 56th St.
  2185.     Phoenix,        AZ  85018  USA
  2186.     TELEPHONE: 602-952-3248
  2187.     FAX:    602-952-6100 FAX
  2188.  
  2189.     National Semiconductor Corp.
  2190.     2900 Semiconductor Dr., P.O. Box 58090
  2191.     Santa Clara,   CA  95052-8090  USA
  2192.     TELEPHONE: 408-721-5000
  2193.     FAX:    408-739-9803
  2194.     OTHER:  800-272-9959
  2195.       910-339-9240 TWX
  2196.  
  2197.     NEC Electronics Inc.
  2198.     401-T Ellis St., P.O. Box 7241
  2199.     Mountain View,   CA  94039  USA
  2200.     TELEPHONE: 415-960-6000
  2201.     FAX:    800-729-9288 FAX
  2202.     OTHER:  800-632-3531
  2203.  
  2204.     SGS-Thomson Microelectronics Inc.
  2205.     1310-T Electronics Dr.
  2206.     Carrollton,   TX  75006  USA
  2207.     TELEPHONE: 214-466-6000
  2208.     FAX:    214-466-6572 FAX
  2209.  
  2210.     Siemens Components Inc., Integrated Circuit Div.
  2211.     10950 N. Tantan Ave.
  2212.     Cupertino,   CA  95014  USA
  2213.     TELEPHONE: 408-777-4500
  2214.     FAX:    408-777-4977 FAX
  2215.     OTHER:  800-338-2777
  2216.  
  2217.     Texas Instruments, Inc.
  2218.     P.O. Box 255012, M.S. 57
  2219.     Dallas,   TX  75265-5012  USA
  2220.     TELEPHONE: 214-995-2011
  2221.     FAX:    214-995-4360 FAX
  2222.     OTHER:  800-336-5236
  2223.  
  2224.  
  2225.  
  2226.  
  2227.        Ways how to help keep your privacy
  2228.                 by Deliryum
  2229.  
  2230.  
  2231.  Privacy. Its something that all of us should strive to obtain. Not because
  2232. we feel we have something to hide, but becuase we have something to protect.
  2233. The world in which we live today is not exactly a friendly place to be anymore.
  2234. Crime is all around us; Though no longer are the lines so very well drawn
  2235. as to who are the criminals and who are your friends as they may have been in
  2236. past times. Our neighbors, police, even our very government could possiblly
  2237. turn out to be our worse enemies. Is this just idle paranoia or something
  2238. quite sinister and *very* real? Take a long hard look at the world today
  2239. folks and that question should be easy to answer.
  2240.  
  2241.  Below are various things you can do to help maintain your privacy. Although
  2242.  there are no garrantees of *total* privacy, these procedures will certainly
  2243.  help secure your privacy to a greater degree than most.
  2244.  
  2245. Do your best to stay away from trouble with the law. They like information
  2246. about people and will do practically anything to get it. Keep your record as
  2247. clean as possible.  If you do get in trouble with them do not say anything. You
  2248. are under no obligation to talk to them. Make sure your attorney is present if
  2249. you do however. If you say nothing that will incriminate you or others then that
  2250. will make it that much harder on them to screw you over. This cannot be stressed
  2251. enough! Believe it, live it, follow it.
  2252.  
  2253. Never tell strangers where you work. Always give fake info on this. Tell
  2254. them that you are self employed, aren't employed, etc etc... If you are paid by
  2255. check, DON'T deposit the paycheck into a bank account that has any bearing
  2256. upon you. Such as one that has your name as the owner of said account.. :) The
  2257. best measure as to cashing the check would be to go to the bank whose name is
  2258. printed upon the check. Never make a regular schedule of cashing your checks as
  2259. this might allow a cashier/other bank employee the ability to recognise you as
  2260. you would be a "regular". Habits of such would be one of the first things a
  2261. person might check out to get information on you. Also, on the subject of jobs,
  2262. you should watch what info you give about yourself to other workers.
  2263.  
  2264. Also in dealing with strangers and people that you really don't know on a very
  2265. personal level in general be wary of what you say pertaining to yourself. The
  2266. less you tell of yourself, the harder you make it on potential "snoops". The
  2267. popular phrase from the X-files show of "trust no one" is the key mindset
  2268. here.
  2269.  
  2270. In your finacial dealings, try to stick to cash. Cash leaves no paper trail
  2271. and is practically impossible to trace in itself. If you can't use cash as in
  2272. the case of mail order use money orders as they are hard to trace whereas
  2273. checks are quite traceable. In the case of mail order items, always have them
  2274. sent to a "drop site". This should not be a post office box either. This
  2275. rule should apply to all mail in general for that matter. Also on that
  2276. subject, when sending US mail never put your address on the outside of the
  2277. letter.
  2278.  
  2279. When dealing with US mail use a typewriter/printer to make out the letter.
  2280. Handwriting can be traced back to you should a test be preformed upon samples.
  2281. After typing the letter out make a copy of it via a copy machine and mail the
  2282. copy. Destroy the original. This will make it next to impossible to trace the
  2283. letter back to a particular machine. When using E-mail always encrypt any
  2284. sensitive information. Please refer to Daemon9's article once again if you
  2285. have not in this issue of IC.
  2286.  
  2287. Do your best to keep secret the names of your friends/family. Also, always
  2288. tell your friends/family NEVER EVER EVER to give out information concerning
  2289. you. This being phone numbers, addresses, etc etc etc... Make sure you are
  2290. quite adamanate about this!
  2291.  
  2292. Keep your home in such a manner that it would not draw un-needed attention.
  2293. In this I mean don't throw large parties that would get the notice of your
  2294. pesky ass neighbors. Keep your music low. Keep your yard clean and well mowed.
  2295. Keep yourself in a likewise manner. By this I mean do not behave in a way that
  2296. is "unacceptable" to the community at large. This will draw attention to
  2297. yourself from others as they will think you are "strange". I know this may be
  2298. a stretch for most of you (myself included in this.. heh ). Also, do not be
  2299. "unfriendly" to people, but make sure you are not overly friendly either. To
  2300. do so either way will bring attention to yourself. To keep them from taking an
  2301. interest in you, so to speak, act like them, talk like them, be like them. Like
  2302. they say... when in Rome... do like the Romans... :)
  2303.  
  2304.  When going to a doctor or such try not to use your real name if you possibly
  2305. can. By this I mean, if you can afford it (that meaning that you can pay in
  2306. cash for the services provided) give a fake name and address on any forms you
  2307. are given. Fake id should be a definate must in these cases as they are most
  2308. likely going to request some form of id or another. This advice should go for
  2309. pharacists as well if you are needing to have medicine filled.
  2310.  
  2311. Do not affiliate your self in groups or clubs. Such being *any* politically
  2312. active group, Kiwanas club, PTA, Militias (heh), etc etc etc... Keep to
  2313. yourself on your views concerning "controversial" subjects to yourself. Siding
  2314. with such groups will most certainly draw attention to yourself by someone.
  2315.  
  2316. Avoid being fingerprinted. Many jobs ask that thier employees be fingerprinted
  2317. for id purposes... Don't allow this to be done on you. Several times a year tv
  2318. ads will come out about how a person should be finger printed with the fbi so
  2319. if they end up missing the fbi can help search for the missing person, etc
  2320. etc.. well while that might be a big help in finding a lost loved one it also
  2321. helps to kill your personal privacy as that will be entered in the NCIC. In
  2322. other words, don't let them print ya. :) In the case of legal trouble when
  2323. they are ganna print ya whether you like it or not have your lawyer file for
  2324. expungement of your records after your trial/payment of fees. Its ganna cost
  2325. ya (believe me.. it will), but expungment will order by the courts that all
  2326. records pertaining to your case be destroyed. In other words, as far as the
  2327. law is concerning.. the crime was never took place. A clean record is a good
  2328. thing too... heh
  2329.  
  2330. To start off you should stop attending church. For the most part, church ppl
  2331. are some of the nosiest people around. It seems like they want to know
  2332. everthing about you and will gossip like crazy about you. If you are that
  2333. devoutly religeous and value that over your privacy you should change the
  2334. church that you currently attend and use another name at the new church. Also,
  2335. speaking of which you should give false information about yourself concerning
  2336. everything related your attendance of that church. In other words, if you are
  2337. asked where you live give a fake address. Basically bullshit info to anything
  2338. relating to "you" at that particular church. if you give to the offering box
  2339. give in cash. Do not use a check. A paper trail is quite easy to trace. If you
  2340. are asked by someone (neighbor, whomever) of the name of the church you attend
  2341. you should give the name of another church than the faith of the one that you
  2342. attend or just tell them that you do not attend at all. Do NOT let them talk
  2343. you into going to thier church. Once again I stress you should really stop
  2344. attending church as this will enhance your privacy.
  2345.  
  2346. Avoid getting yourself into a "routine". Most of us fall victim to this. We do
  2347. things a certain way and manner. Such as driving to and from work. We normally
  2348. alway take the same route. Vary the ways in which you do things. Habits mark
  2349. us and thus can be used against us.
  2350.  
  2351. When making phone calls, NEVER dial 1-800 numbers or any other number that has
  2352. ANI capabilites from your house... ie.. 911 (well, only if you have to from your
  2353. phone), 1-900's, etc etc... They will have the number you are at if you do.
  2354. Also, concerning your phone bill ask the phone company what you can do to make
  2355. your line more private. Block out caller id, have an unlisted number, have it
  2356. where your information is flagged where it can't be given out to the LD
  2357. companies such as at&t and the like, etc etc... Also request that a passcode
  2358. be put on your bill with them and have that passcode be used for *ALL* trans-
  2359. actions concerning your account with them. Such as phone canceling, changing of
  2360. status of the line, etc etc...
  2361.  
  2362. Finally, when disposing of "sensitive" information make sure you rend it so it
  2363. cannot be recovered. In the case of electronic data, one should encrypt it with
  2364. such a program as PGP, wipe (not erase) it, and then possibly (if its VERY
  2365. sensitive) run a defrag on your harddrive as well. This should make it
  2366. impossible for a recovery. In the case of "physical" items, such as US mail,
  2367. documents, disks, etc...shreading is a good idea followed by burning the remains
  2368. and then scattering them. Remeber police agencies need no warrent to search
  2369. your trash. Keep this in mind. Paranoia is a good thing.
  2370.  
  2371.  While there is no sure fire way to completly remaining anonymous short of
  2372.  completly revamping your identity, the above measures will greatly enhance
  2373.  the level of your personal privacy. Well, this about does it for me. Take
  2374.  care folks and always watch your backs. You never know who may be back there
  2375.  waiting with the proverbial knife... :)
  2376.  
  2377.  
  2378.  
  2379.        Deliryum
  2380.  
  2381.               .oO____Oo.
  2382.  
  2383.  
  2384.  
  2385.  
  2386. _+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
  2387. +  Mythrandir's Greetings and such  +
  2388. _+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
  2389.  
  2390. A special hi and hello to all those who have touched my life:
  2391.  
  2392. Dexter - If this ever finds its way to you, GO to my family's house
  2393.      and get my phone number and use that wonderful tool called the
  2394.      phone.  As you said, We have much to talk about.
  2395.  
  2396. ReDragon - The man who made me feel special when he said things like,
  2397.        Mythrandir is the first person to come on #hack in a long
  2398.        time that was a complete and utter idiot. (perhaps the word wasn't
  2399.        idiot), and JUST THE OTHER DAY I WAS THINKING TO MYSELF WTF
  2400.        HAPPENED TO MYTHRANDR.  Now, how can you not love this guy?
  2401.  
  2402. Zem - The guy who was working right along with me, when I rediscovered computer
  2403.       hacking.  It was a fine night of delving into the network around us.
  2404.       Also, the creator of probably the most unique application the guild
  2405.       will ever receive.
  2406.  
  2407. Tim - Me TIM at DEFCON.  All I have to say is, thanks Tim! You've done
  2408.       so much good, and you don't even realize it.
  2409.  
  2410.  
  2411.  
  2412. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  2413. = Obtaining Information on Other People =
  2414. - By,                                   -
  2415. =    Mythrandir                         =
  2416. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  2417.  
  2418.  
  2419. Recently, I was given a copy of a post to alt.privacy which dealt
  2420. with the acquiring of knowledge through public records.  I found the
  2421. subject very interesting so I decided to look into it.  As luck would have
  2422. it I found two interesting books on the subject in the reference section
  2423. at a bookstore down at my college.  I read through these two books,
  2424. and found that obtaining information on another individual was
  2425. very easy.  The two books I purchased were
  2426.  
  2427. Researching Public Records by Vincent Parco and published by Citadel Press
  2428. under the Learning Annex books series.  The ISBN is 0-8065-1522-8
  2429. The book cost me $8.95.
  2430.  
  2431. Private Investigating Made Easy by Kelly E. Riddle and published by
  2432. Historical Publications.  The ISBN is 1-881825-05-1
  2433. The book cost me $12.95.
  2434.  
  2435. This article documents the general information that I gained while reading
  2436. these books.  If you wish more detail and pointers to resources, I
  2437. recommend picking these books up.
  2438.  
  2439. First off, it is entirely legal to use public records for investigation
  2440. of another individual. However, you must obtain a liscense in order
  2441. to investigate for money.
  2442.  
  2443. If you are trying to obtain information on a person, you should first detail
  2444. exactly what you know and what you are trying to find out.
  2445. The basic information that you should try to collect (and the more
  2446. you have the easier your search will be) is..
  2447.  
  2448. Name (full name) - When doing searches be sure to search on all possible
  2449.     variations of a name.  If a persons name is Timothy X. you should also
  2450.     search under Tim X.
  2451.  
  2452. Birth Date - This is needed to access some records.
  2453.  
  2454. Social Security Number - Again some records are searched by this number.
  2455.  
  2456. Address - This is mostly useful in order to find a person
  2457.  
  2458. Phone Number - Useful to have so you can call, and obtain more information
  2459.     through social engineering.  Or you can just have a nice chat with
  2460.     the person you are trying to obtain information about.
  2461.  
  2462. Description - Helpful in determining who a person is if you do not have a lot
  2463.     of the above information.
  2464.  
  2465. Occupation - Also useful in finding a person as well as determining the
  2466.     financial position of your subject.
  2467.  
  2468. Of course there are many other things that you can find out about a person,
  2469. but the above are very useful in tracking down someone and after
  2470. that you can do what you will.
  2471.  
  2472.     So how do you obtain this information? Well, it is very easy.  Two of the
  2473. best places to start are the Board of Elections and the good ole DMV.
  2474.  
  2475.     In order to do a search at the board of elections you need to have a list
  2476. of names that you are searching for.  A birth date or approximate
  2477. birthdate can also be helpful. The board of elections holds voter registration
  2478. records that you can access.  These records will allow you to verify a
  2479. persons name, when they were born, a general description, their current
  2480. address, how long they have lived there, immigration status, and politcal party.
  2481. It is also possible for you to obtain their phone number if they recorded
  2482. it in an optional field.  As you can see this one stop is very useful for
  2483. obtaining plenty of information.  There is of course one hitch, they must
  2484. have registered to vote.
  2485.  
  2486.     So the board of elections doesn't turn up anything.  Well, chances are
  2487. the subject drives.  So off to the DMV you go.  In order to do a search at
  2488. the DMV you need a full name, birthdate, and possibly a drivers liscense
  2489. number (but not always).  Also, you need to call the appropriate DMV
  2490. for which state you are searching.  The DMV holds drivers registration
  2491. information.  This will get you the persons full name, birth date,
  2492. their driving record, date liscense issued and when it expires,
  2493. and any restrictions the subject has on driving.
  2494.  
  2495.     Also, if you are searching by liscense plate you can obtain the
  2496. full name of the owner of a vehicle (not necessarily the driver), the
  2497. vehicle identification number, year and model of the vehicle, insurance
  2498. company, registration and expiration, lien holder, and the color of
  2499. the vehicle.  All useful information as well.
  2500.  
  2501. Well, at this point you have probably already ammased quite a bit of
  2502. information. But suppose you are trying to find a person, and they
  2503. are not living at the address that is listed on their drivers liscense.
  2504. At this point you should head on over to the post office and fill out
  2505. a freedom of information act form requesting the forwarding address of
  2506. an individual.  You need the persons name and last place of residence.
  2507. This will usually work if someone filled out a mail forwarding card when
  2508. they moved.  However, it is possible for the subject to request that the
  2509. information not be given out by paying a small fee. (So for future reference,
  2510. if you move, ask about this option and pay the few dollars for your privacy)
  2511.  
  2512. Other places to obtain information is the County Courthouse where
  2513. you can obtain Criminal recordes, civil records (divorces, debts..) ,
  2514. birth records, marriage liscenses, death records, and many other
  2515. pieces of information.  One useful search is to see if the subject owns
  2516. any businesses.
  2517.  
  2518. A little investigation into these areas should yield tremendous results.
  2519. If you have any questions about searching records or need any help
  2520. please feel free to contact me at jwthomp@uiuc.edu
  2521.  
  2522. Best of luck,
  2523.  
  2524. Mythrandir
  2525.  
  2526. P.S. I intentionally did not go into full detail with this, but felt
  2527.     it was better to just lay down the basics to allow people to explore
  2528.     this.  I am certain that you will find all of your endeavors fruitful
  2529.     and very interesting.
  2530.  
  2531.  
  2532.  
  2533.  
  2534.               .oO____Oo.
  2535.  
  2536.  
  2537.  
  2538. ----------------------------------------------------
  2539. +           Linux Network Sniffing                 +
  2540. ----------------------------------------------------
  2541.  
  2542. The following file that I have included is a basic
  2543. network sniffer that will run on linux boxes.  It
  2544. is very easy to port it over to other platforms as
  2545. all you have to do is rewrite the network code section.
  2546.  
  2547. inet.h - contains all of the includes for the networking
  2548.      code to work.
  2549.  
  2550. globals.h - contains one global definition.. Perhaps later
  2551.         I'll add another.
  2552.  
  2553. packet.h - contains the definitions for the packets.
  2554.        Currently only tcp/ip is supported.
  2555.  
  2556.        struct PACKET will hold one packet
  2557.        struct CONNECTION defines a unique connection pair
  2558.  
  2559. find.h & .c - contain the code for a very simple pattern matching
  2560.           algorithm.
  2561.  
  2562. sniff.c - contains the bulk of the sniffer code
  2563.  
  2564. sniff.h - contains the definitions for sniff.c.
  2565.       init - initializes the network interface.
  2566.        This will need to be modified if this is ported
  2567.        to a new platform.
  2568.  
  2569.       Get_Packet - grabs a packet from the network
  2570.              This will also have to be modified if a port is
  2571.              attempted.
  2572.  
  2573.       Convert_Packet - converts the raw char string buffer
  2574.        into a struct PACKET.  This should be modified
  2575.        in the future to check for what type of
  2576.        packet it is.. i.e. tcp/ip, tcp/udp, IPX..
  2577.  
  2578.       Set_Connection - Defines the values for a unique connection pair
  2579.           into struct CONNECTION
  2580.  
  2581.       Write_Data - Merely outputs the data portion of a PACKET onto the
  2582.              screen
  2583.  
  2584.       Display_Connections - Displays a list of unique connections from
  2585.             an array of CONNECTIONS.. Not very eligant.
  2586.  
  2587.       Data_Length - Returns the length of the data portion of a PACKET
  2588.  
  2589. main.c - Contains the main loop, that utilizes this code.  In its present
  2590.      form it captures all packets that traverse lo (loopback) and
  2591.      display them on the screen... If you would like to watch another
  2592.      interface change the name string to another interface, such as
  2593.      eth0..
  2594.  
  2595.     I have modified this program to act as a password sniffer, but have not
  2596. included it as it is still far to rough looking (yes even in comparison to
  2597. this).
  2598. I will however, release it as soon as I am happy with it.  I also plan to
  2599. release an updated version of this sniffer that will check for packet type
  2600. and print out the appropriate type.
  2601.  
  2602.     Even though this code is rough, it should be very easy for someone to
  2603. rip apart and play with.  I am interested to hear of anything anyone does
  2604. with it, and as always am more than willing to help out or to answer questions.
  2605.  
  2606. - Mythrandir
  2607.  
  2608. The following is a shell archive of the code.  Create a directory
  2609. and place this in it as sniff.shar  Then type sh sniff.shar and it
  2610. will self extract.
  2611.  
  2612. #!/bin/sh
  2613. # shar: Shell Archiver  (v1.22)
  2614. #
  2615. #       Run the following text with /bin/sh to create:
  2616. #         OUT
  2617. #         README
  2618. #         find.c
  2619. #         find.h
  2620. #         globals.h
  2621. #         inet.h
  2622. #         main.c
  2623. #         packet.h
  2624. #         sniff.c
  2625. #         sniff.h
  2626. #
  2627. sed 's/^X//' << 'SHAR_EOF' > OUT &&
  2628. SHAR_EOF
  2629. chmod 0644 OUT || echo "restore of OUT fails"
  2630. sed 's/^X//' << 'SHAR_EOF' > README &&
  2631. XTo compile on a Linux box type
  2632. Xgcc -o Sniff find.c main.c sniff.c
  2633. X
  2634. XEnjoy,
  2635. X
  2636. XMythrandir
  2637. SHAR_EOF
  2638. chmod 0644 README || echo "restore of README fails"
  2639. sed 's/^X//' << 'SHAR_EOF' > find.c &&
  2640. X#include <string.h>
  2641. X
  2642. Xint Find(char * String, char * Match, int length2)
  2643. X{
  2644. Xint length;
  2645. Xint i, k;
  2646. Xchar buf[100];
  2647. X
  2648. Xlength = strlen(Match);
  2649. X
  2650. Xif(length2 < length)
  2651. X    return 0;
  2652. X
  2653. Xfor(i = 0; i < (length2 - length); i++)
  2654. X    {
  2655. X    for(k = 0; k < length; k++)
  2656. X        buf[k] = String[k + i];
  2657. X    if(!strncmp(buf,Match,length))
  2658. X        return 1;
  2659. X    }
  2660. X
  2661. Xreturn 0;
  2662. X}
  2663. SHAR_EOF
  2664. chmod 0644 find.c || echo "restore of find.c fails"
  2665. sed 's/^X//' << 'SHAR_EOF' > find.h &&
  2666. Xint Find(char * String, char * Match, int);
  2667. SHAR_EOF
  2668. chmod 0644 find.h || echo "restore of find.h fails"
  2669. sed 's/^X//' << 'SHAR_EOF' > globals.h &&
  2670. X#define PACKET_LENGTH 500
  2671. X
  2672. X
  2673. X
  2674. SHAR_EOF
  2675. chmod 0644 globals.h || echo "restore of globals.h fails"
  2676. sed 's/^X//' << 'SHAR_EOF' > inet.h &&
  2677. X#ifndef INET
  2678. X#define INET
  2679. X
  2680. X#include <stdio.h>
  2681. X#include <string.h>
  2682. X#include <unistd.h>
  2683. X#include <stdlib.h>
  2684. X
  2685. X#include <sys/ioctl.h>
  2686. X#include <sys/types.h>
  2687. X#include <sys/socket.h>
  2688. X#include <netinet/in.h>
  2689. X#include <arpa/inet.h>
  2690. X
  2691. X#include <linux/inet.h>
  2692. X#include <linux/in.h>
  2693. X#include <linux/types.h>
  2694. X#include <linux/socket.h>
  2695. X
  2696. X
  2697. Xchar *pname;
  2698. X
  2699. X#endif
  2700. SHAR_EOF
  2701. chmod 0644 inet.h || echo "restore of inet.h fails"
  2702. sed 's/^X//' << 'SHAR_EOF' > main.c &&
  2703. X#include "sniff.h"
  2704. X#include "inet.h"
  2705. X#include "find.h"
  2706. X
  2707. X#include <string.h>
  2708. X
  2709. Xvoid main()
  2710. X{
  2711. XFILE * fd;
  2712. Xint i,j;
  2713. Xint choice;
  2714. Xchar name[2];
  2715. Xchar buf[500];
  2716. Xstruct PACKET *Out;
  2717. Xstruct CONNECTION List[256];
  2718. Xchar View[256][50];
  2719. Xchar Data[256][50];
  2720. Xstruct CONNECTION Check[1];
  2721. Xint toggle = 0;
  2722. Xint count = 0;   /* Stores the number of unique connections */
  2723. X
  2724. Xstrncpy(name, "lo\0", 3);
  2725. X
  2726. Xinit(name);
  2727. X
  2728. Xwhile(1)
  2729. X    {
  2730. X
  2731. X    /*
  2732. X     * Get the next packet to fly by the network
  2733. X     */
  2734. X    Get_Packet(buf);
  2735. X
  2736. X    /*
  2737. X     * Convert the buffer into a Packet type structure
  2738. X     */
  2739. X    Out = Convert_Packet(buf);
  2740. X
  2741. X    /*
  2742. X     * Display all of the packet information
  2743. X     */
  2744. X    Display_Packet(Out);
  2745. X
  2746. X    /*
  2747. X     * If the program detects login in the text it will then check
  2748. X     * if the connection is unique
  2749. X     */
  2750. X        if(Unique(List, Out, count) == -1)
  2751. X            {
  2752. X            printf("Found a Unique connection\n");
  2753. X            count = count + 1;
  2754. X            Display_Connections(List, count);
  2755. X            }
  2756. X
  2757. X    }
  2758. X}
  2759. SHAR_EOF
  2760. chmod 0644 main.c || echo "restore of main.c fails"
  2761. sed 's/^X//' << 'SHAR_EOF' > packet.h &&
  2762. X#include "globals.h"
  2763. X
  2764. X
  2765. X
  2766. X
  2767. Xstruct iphdr {
  2768. X    unsigned char version;
  2769. X    unsigned char tos;
  2770. X    unsigned char tot_len[2];
  2771. X    unsigned char id[2];
  2772. X    unsigned char frag_off[2];
  2773. X    unsigned char ttl;
  2774. X    unsigned char protocol;
  2775. X    unsigned char check[2];
  2776. X    unsigned char saddr[4];
  2777. X    unsigned char daddr[4];
  2778. X    };
  2779. X
  2780. Xstruct tcphdr {
  2781. X    unsigned char source[2];
  2782. X    unsigned char dest[2];
  2783. X    unsigned char seq[4];
  2784. X    unsigned char ack_seq[4];
  2785. X    unsigned char flags[2];
  2786. X    unsigned char window[2];
  2787. X    unsigned char check[2];
  2788. X    unsigned char urg_ptr[2];
  2789. X    };
  2790. X
  2791. X/*
  2792. X * A structure which contains all of the parts of a packet
  2793. X */
  2794. X
  2795. Xstruct PACKET {
  2796. X    struct iphdr IP;
  2797. X    struct tcphdr TCP;
  2798. X    char DATA[PACKET_LENGTH];
  2799. X    };
  2800. X
  2801. Xstruct CONNECTION {
  2802. X    unsigned char protocol;
  2803. X    unsigned char saddr[4];
  2804. X    unsigned char daddr[4];
  2805. X    unsigned char source[2];
  2806. X    unsigned char dest[2];
  2807. X    unsigned char seq[4];
  2808. X    unsigned char ack_seq[4];
  2809. X    };
  2810. X
  2811. X
  2812. SHAR_EOF
  2813. chmod 0644 packet.h || echo "restore of packet.h fails"
  2814. sed 's/^X//' << 'SHAR_EOF' > sniff.c &&
  2815. X#include <linux/if_ether.h>
  2816. X#include <linux/if.h>
  2817. X#include <string.h>
  2818. X
  2819. X#include "inet.h"
  2820. X#include "sniff.h"
  2821. X#include "globals.h"
  2822. X
  2823. X/* Globals */
  2824. X
  2825. X
  2826. X
  2827. Xint Sock;
  2828. Xstruct ifreq oldifr, ifr;
  2829. X
  2830. Xvoid init(char * DEV)
  2831. X{
  2832. X
  2833. XSock = socket(AF_INET, SOCK_PACKET, htons(ETH_P_ALL));
  2834. X
  2835. X/*
  2836. X * Stores device name to access in ifr and oldifr
  2837. X */
  2838. Xstrcpy(ifr.ifr_name, DEV);
  2839. Xstrcpy(oldifr.ifr_name, DEV);
  2840. X
  2841. X/*
  2842. X * Stores the cards current setting into ifr and oldifr
  2843. X */
  2844. Xif(ioctl(Sock, SIOCGIFFLAGS, &ifr) < 0)
  2845. X    {
  2846. X    printf("Unable to get %s flags.\n", DEV);
  2847. X    exit(1);
  2848. X    }
  2849. X
  2850. Xif(ioctl(Sock, SIOCGIFFLAGS, &oldifr) < 0)
  2851. X    {
  2852. X    printf("Unable to get %s flags.\n", DEV);
  2853. X    exit(1);
  2854. X    }
  2855. X
  2856. X/*
  2857. X * Sets ifr's flags to include Promiscuous Mode
  2858. X */
  2859. Xifr.ifr_flags |= IFF_PROMISC;
  2860. X
  2861. X/*
  2862. X * Sets devices flags to that of ifr's
  2863. X */
  2864. Xif(ioctl(Sock, SIOCSIFFLAGS, &ifr) < 0)
  2865. X    {
  2866. X    printf("Unable to set %s flags.\n", DEV);
  2867. X    exit(1);
  2868. X    }
  2869. Xprintf("%s device has been successfully configured.\n", DEV);
  2870. X}
  2871. X
  2872. Xvoid Get_Packet(char buf[PACKET_LENGTH])
  2873. X{
  2874. Xint length;
  2875. Xstruct sockaddr saddr;
  2876. Xint sizeaddr;
  2877. X
  2878. Xlength = recvfrom(Sock, buf, PACKET_LENGTH, 0, &saddr, &sizeaddr);
  2879. X
  2880. X
  2881. X}
  2882. X
  2883. Xstruct PACKET * Convert_Packet(char buf[PACKET_LENGTH])
  2884. X{
  2885. Xint i;
  2886. Xchar tmp[PACKET_LENGTH];
  2887. Xstruct PACKET Holder;
  2888. X
  2889. X/*
  2890. X * Copy over ip information
  2891. X */
  2892. Xfor(i = 14; i < 34; i++)
  2893. X    tmp[i - 14] = buf[i];
  2894. X/*
  2895. X * Copy tmp to iphdr structure
  2896. X */
  2897. Xbcopy(tmp, &Holder.IP, 20);
  2898. X
  2899. X/*
  2900. X * Copy over tcp information
  2901. X */
  2902. Xfor(i = 34; i < 54; i++)
  2903. X    tmp[i - 34] = buf[i];
  2904. Xbcopy(tmp, &Holder.TCP, 20);
  2905. X
  2906. Xfor(i = 54; i < PACKET_LENGTH; i++)
  2907. X    tmp[i - 54] = buf[i];
  2908. Xbcopy(tmp, &Holder.DATA, (PACKET_LENGTH - 54));
  2909. X
  2910. Xreturn &Holder;
  2911. X}
  2912. X
  2913. Xvoid Display_Packet(struct PACKET * Out)
  2914. X{
  2915. Xint i,k;      /* loop variables */
  2916. Xint dlength;
  2917. X
  2918. X
  2919. X
  2920. X/*
  2921. X * Display ip Information
  2922. X */
  2923. Xprintf("Header Length: %d   Service Type: %d",
  2924. X        Out->IP.version & 0x000f, Out->IP.tos & 0x00ff);
  2925. Xprintf("    Total Length: %d\n",
  2926. X        (Out->IP.tot_len[0] & 0x00ff) * 256 + (Out->IP.tot_len[1] & 0x00ff));
  2927. Xprintf("Id: %d    FragFlags: %d\n",
  2928. X        (Out->IP.id[0] & 0x00ff) * 256 + (Out->IP.id[1] & 0x00ff),
  2929. X        (Out->IP.frag_off[0] & 0x00ff) * 256 + (Out->IP.frag_off[1] & 0x00ff));
  2930. Xprintf("TTL: %d    Protocol: %d    HeaderChecksum: %d\n",
  2931. X        Out->IP.ttl & 0x00ff, Out->IP.protocol & 0x00ff,
  2932. X        (Out->IP.check[0] & 0x00ff) * 256 + (Out->IP.check[1] & 0x00ff));
  2933. Xprintf("Source Address: %d.%d.%d.%d    Destination Address: %d.%d.%d.%d\n",
  2934. X        Out->IP.saddr[0] & 0x00ff, Out->IP.saddr[1] & 0x00ff,
  2935. X        Out->IP.saddr[2] & 0x00ff, Out->IP.saddr[3] & 0x00ff,
  2936. X        Out->IP.daddr[0] & 0x00ff, Out->IP.daddr[1] & 0x00ff,
  2937. X        Out->IP.daddr[2] & 0x00ff, Out->IP.daddr[3] & 0x00ff);
  2938. X
  2939. X/*
  2940. X * Display tcp information
  2941. X */
  2942. X
  2943. Xprintf("Source Port: %d    Destination Port: %d\n",
  2944. X        ((Out->TCP.source[0] & 0x00ff) * 256) + (Out->TCP.source[1] & 0x00ff),
  2945. X        ((Out->TCP.dest[0] & 0x00ff) * 256) + (Out->TCP.dest[1] & 0x00ff));
  2946. Xprintf("Sequence Number: %ld    Acknowledgement Number: %ld\n",
  2947. X        (Out->TCP.seq[0] & 0x00ff) * 65536 + (Out->TCP.seq[1] & 0x00ff) * 4096
  2948. X        + (Out->TCP.seq[2] & 0x00ff) * 256 + (Out->TCP.seq[3] & 0x00ff),
  2949. X        (Out->TCP.ack_seq[0] & 0x00ff) * 65536 + (Out->TCP.ack_seq[1] & 0x00ff)
  2950. * 4096
  2951. X        + (Out->TCP.ack_seq[2] & 0x00ff) * 256 + (Out->TCP.ack_seq[3] &
  2952. 0x00ff));
  2953. Xprintf("TCP Header length: %d    Checksum: %d    Urgent Pointer: %d\n",
  2954. X        (Out->TCP.flags[0] & 0x00f0) >> 4, (Out->TCP.check[0] & 0x00ff) * 256 +
  2955. X        (Out->TCP.check[1] & 0x00ff), (Out->TCP.urg_ptr[0] & 0x0ff) * 256 +
  2956. X        (Out->TCP.urg_ptr[1] & 0x00ff));
  2957. X
  2958. X/*
  2959. X * Display data information
  2960. X */
  2961. X
  2962. X/*
  2963. X * Data length = Total length - IP header length - TCP Header length
  2964. X */
  2965. Xdlength = (Out->IP.tot_len[0] & 0x00ff) * 256 + (Out->IP.tot_len[1] & 0x00ff)
  2966. X          - (Out->IP.version & 0x000f) * 4 - ((Out->TCP.flags[0] & 0x00f0) >>
  2967. 4) * 4;
  2968. X
  2969. Xprintf("Data Length: %d\n", dlength);
  2970. Xif((Out->IP.tot_len[0] & 0x00ff) > PACKET_LENGTH)
  2971. X    dlength = PACKET_LENGTH - (Out->IP.version & 0x00ff) * 4 -
  2972. X              ((Out->TCP.flags[0] & 0x00ff) >> 4) * 4;
  2973. Xprintf("-------------------------------------------------------------\n");
  2974. Xfor(i = 0 + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4;
  2975. X        i <  (dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4);
  2976. X        i += 16)
  2977. X    {
  2978. X    if((dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4) - i >= 16)
  2979. X        for(k = 0; k < 16; k++)
  2980. X            if((Out->DATA[i + k] & 0x00ff) < 16)
  2981. X                printf("0%x", Out->DATA[i + k] & 0x00ff);
  2982. X            else
  2983. X                printf("%x", Out->DATA[i + k] & 0x00ff);
  2984. X    else
  2985. X        for(k = 0; k < (dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) *
  2986. 4) - i; k++)
  2987. X            if((Out->DATA[i + k] & 0x00ff) < 16)
  2988. X                printf("0%x", Out->DATA[i + k] & 0x00ff);
  2989. X            else
  2990. X                printf("%x", Out->DATA[i + k] & 0x00ff);
  2991. X    printf("                ");
  2992. X    if((dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4) - i >= 16)
  2993. X        for(k = 0; k < 16; k++)
  2994. X            if((Out->DATA[i + k] & 0x00ff) > 39)
  2995. X                printf("%c", Out->DATA[i + k]);
  2996. X            else
  2997. X                printf(".");
  2998. X    else
  2999. X        for(k = 0; k < (dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) *
  3000. 4) - i; k++)
  3001. X            if((Out->DATA[i + k] & 0x00ff) > 39)
  3002. X                printf("%c", Out->DATA[i + k]);
  3003. X            else
  3004. X                printf(".");
  3005. X    printf("\n");
  3006. X    }
  3007. Xprintf("-------------------------------------------------------------\n");
  3008. X}
  3009. X
  3010. Xint Unique(struct CONNECTION List[256], struct PACKET * Out, int count)
  3011. X{
  3012. Xint i,j;    /* Loop counters */
  3013. Xint flag = -1;
  3014. Xint num;    /* Number where non uniqueness occurs */
  3015. X
  3016. X/*
  3017. X * Scan through list of connections and see if Out differs.
  3018. X */
  3019. Xfor(i = 0; i < count; i++)
  3020. X    {
  3021. X    /*
  3022. X     * Checks if this is a non-unique connection
  3023. X     */
  3024. X    if((Out->IP.protocol & 0x00ff) == (List[i].protocol & 0x00ff))
  3025. X    if((Out->IP.saddr[0] & 0x00ff) == (List[i].saddr[0] & 0x00ff))
  3026. X    if((Out->IP.saddr[1] & 0x00ff) == (List[i].saddr[1] & 0x00ff))
  3027. X    if((Out->IP.saddr[2] & 0x00ff) == (List[i].saddr[2] & 0x00ff))
  3028. X    if((Out->IP.saddr[3] & 0x00ff) == (List[i].saddr[3] & 0x00ff))
  3029. X    if((Out->IP.daddr[0] & 0x00ff) == (List[i].daddr[0] & 0x00ff))
  3030. X    if((Out->IP.daddr[1] & 0x00ff) == (List[i].daddr[1] & 0x00ff))
  3031. X    if((Out->IP.daddr[2] & 0x00ff) == (List[i].daddr[2] & 0x00ff))
  3032. X    if((Out->IP.daddr[3] & 0x00ff) == (List[i].daddr[3] & 0x00ff))
  3033. X    if((Out->TCP.source[0] & 0x00ff) == (List[i].source[0] & 0x00ff))
  3034. X    if((Out->TCP.source[1] & 0x00ff) == (List[i].source[1] & 0x00ff))
  3035. X    if((Out->TCP.dest[0] & 0x00ff) == (List[i].dest[0] & 0x00ff))
  3036. X    if((Out->TCP.dest[1] & 0x00ff) == (List[i].dest[1] & 0x00ff))
  3037. X        flag = i;
  3038. X    }
  3039. X
  3040. Xif (flag == -1)
  3041. X    {
  3042. X    List[count].protocol = Out->IP.protocol;
  3043. X    List[count].saddr[0] = Out->IP.saddr[0];
  3044. X    List[count].saddr[1] = Out->IP.saddr[1];
  3045. X    List[count].saddr[2] = Out->IP.saddr[2];
  3046. X    List[count].saddr[3] = Out->IP.saddr[3];
  3047. X    List[count].daddr[0] = Out->IP.daddr[0];
  3048. X    List[count].daddr[1] = Out->IP.daddr[1];
  3049. X    List[count].daddr[2] = Out->IP.daddr[2];
  3050. X    List[count].daddr[3] = Out->IP.daddr[3];
  3051. X    List[count].source[0] = Out->TCP.source[0];
  3052. X    List[count].source[1] = Out->TCP.source[1];
  3053. X    List[count].dest[0] = Out->TCP.dest[0];
  3054. X    List[count].dest[1] = Out->TCP.dest[1];
  3055. X    List[count].seq[0] = Out->TCP.seq[0];
  3056. X    List[count].seq[1] = Out->TCP.seq[1];
  3057. X    List[count].seq[2] = Out->TCP.seq[2];
  3058. X    List[count].seq[3] = Out->TCP.seq[3];
  3059. X    List[count].ack_seq[0] = Out->TCP.ack_seq[0];
  3060. X    List[count].ack_seq[1] = Out->TCP.ack_seq[1];
  3061. X    List[count].ack_seq[2] = Out->TCP.ack_seq[2];
  3062. X    List[count].ack_seq[3] = Out->TCP.ack_seq[3];
  3063. X    }
  3064. X
  3065. Xreturn flag;
  3066. X}
  3067. X
  3068. X/*
  3069. X * Display unique connections
  3070. X */
  3071. X
  3072. Xvoid Display_Connections(struct CONNECTION List[256], int count)
  3073. X{
  3074. Xint i;
  3075. X
  3076. Xfor(i = 0; i < count; i++)
  3077. X    {
  3078. X    printf("#%d, P: %d, ", i, List[i].protocol & 0x00ff);
  3079. X    printf("SA: %d.%d.%d.%d, DA: %d.%d.%d.%d, ",
  3080. X        List[i].saddr[0] & 0x00ff, List[i].saddr[1] & 0x00ff,
  3081. X        List[i].saddr[2] & 0x00ff, List[i].saddr[3] & 0x00ff,
  3082. X        List[i].daddr[0] & 0x00ff, List[i].daddr[1] & 0x00ff,
  3083. X        List[i].daddr[2] & 0x00ff, List[i].daddr[3] & 0x00ff);
  3084. X    printf("SP: %d, DP: %d\n",
  3085. X        (List[i].source[0] & 0x00ff) * 256 + (List[i].source[1] & 0x00ff),
  3086. X        (List[i].dest[0] & 0x00ff) * 256 + (List[i].dest[1] & 0x00ff));
  3087. X    }
  3088. Xprintf("---------------------------------------------------------\n");
  3089. X}
  3090. X
  3091. Xvoid Set_Connection(struct PACKET * Out, struct CONNECTION List[256])
  3092. X    {
  3093. X    List[0].protocol = Out->IP.protocol;
  3094. X    List[0].saddr[0] = Out->IP.saddr[0];
  3095. X    List[0].saddr[1] = Out->IP.saddr[1];
  3096. X    List[0].saddr[2] = Out->IP.saddr[2];
  3097. X    List[0].saddr[3] = Out->IP.saddr[3];
  3098. X    List[0].daddr[0] = Out->IP.daddr[0];
  3099. X    List[0].daddr[1] = Out->IP.daddr[1];
  3100. X    List[0].daddr[2] = Out->IP.daddr[2];
  3101. X    List[0].daddr[3] = Out->IP.daddr[3];
  3102. X    List[0].source[0] = Out->TCP.source[0];
  3103. X    List[0].source[1] = Out->TCP.source[1];
  3104. X    List[0].dest[0] = Out->TCP.dest[0];
  3105. X    List[0].dest[1] = Out->TCP.dest[1];
  3106. X    List[0].seq[0] = Out->TCP.seq[0];
  3107. X    List[0].seq[1] = Out->TCP.seq[1];
  3108. X    List[0].seq[2] = Out->TCP.seq[2];
  3109. X    List[0].seq[3] = Out->TCP.seq[3];
  3110. X    List[0].ack_seq[0] = Out->TCP.ack_seq[0];
  3111. X    List[0].ack_seq[1] = Out->TCP.ack_seq[1];
  3112. X    List[0].ack_seq[2] = Out->TCP.ack_seq[2];
  3113. X    List[0].ack_seq[3] = Out->TCP.ack_seq[3];
  3114. X    }
  3115. X
  3116. Xint Data_Length(struct PACKET *Out)
  3117. X{
  3118. Xreturn (Out->IP.tot_len[0] & 0x00ff) * 256 + (Out->IP.tot_len[1] & 0x00ff)
  3119. X       - (Out->IP.version & 0x000f) * 4 - ((Out->TCP.flags[0] & 0x00f0) >> 4)
  3120. X       * 4;
  3121. X}
  3122. X
  3123. Xvoid Write_Data(struct PACKET * Out)
  3124. X{
  3125. Xint dlength;
  3126. Xint i, k;
  3127. X
  3128. X/*
  3129. X * Data length = Total length - IP header length - TCP Header length
  3130. X */
  3131. Xdlength = (Out->IP.tot_len[0] & 0x00ff) * 256 + (Out->IP.tot_len[1] & 0x00ff)
  3132. X          - (Out->IP.version & 0x000f) * 4 - ((Out->TCP.flags[0] & 0x00f0) >>
  3133. 4) * 4;
  3134. Xfor(i = 0 + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4;
  3135. X        i <  (dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4);
  3136. X        i += 16)
  3137. X    {
  3138. X    if((dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4) - i >= 16)
  3139. X        for(k = 0; k < 16; k++)
  3140. X            if((Out->DATA[i + k] & 0x00ff) > 39)
  3141. X                printf("%c", Out->DATA[i + k]);
  3142. X            else
  3143. X                printf(".");
  3144. X    else
  3145. X        for(k = 0; k < (dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) *
  3146. 4) - i; k++)
  3147. X            if((Out->DATA[i + k] & 0x00ff) > 39)
  3148. X                printf("%c", Out->DATA[i + k]);
  3149. X            else
  3150. X                printf(".");
  3151. X    }
  3152. X}
  3153. X
  3154. X
  3155. SHAR_EOF
  3156. chmod 0644 sniff.c || echo "restore of sniff.c fails"
  3157. sed 's/^X//' << 'SHAR_EOF' > sniff.h &&
  3158. X#include "packet.h"
  3159. X
  3160. X/*
  3161. X * Header file for sniff functions
  3162. X */
  3163. X
  3164. Xvoid init(char *);
  3165. X
  3166. Xvoid Get_Packet(char buf[PACKET_LENGTH]);
  3167. X
  3168. Xstruct PACKET * Convert_Packet(char *);
  3169. X
  3170. Xvoid Display_Packet(struct PACKET *);
  3171. X
  3172. Xint Unique(struct CONNECTION *, struct PACKET *, int);
  3173. X
  3174. Xvoid Set_Connection(struct PACKET *, struct CONNECTION *);
  3175. X
  3176. Xvoid Write_Data(struct PACKET *);
  3177. X
  3178. Xvoid Display_Connections(struct CONNECTION *, int);
  3179. X
  3180. Xint Data_Length(struct PACKET *);
  3181. X
  3182. SHAR_EOF
  3183. chmod 0644 sniff.h || echo "restore of sniff.h fails"
  3184. exit 0
  3185.  
  3186.  
  3187.  
  3188.  
  3189.               .oO____Oo.
  3190.  
  3191.  
  3192. -----------------------------------------------------
  3193. -       Mythrandir's Phone explorations             -
  3194. -----------------------------------------------------
  3195.  
  3196.     A short time ago I began to realize that I had no idea how
  3197. the phone system worked.  Now most people could care less about this.
  3198. But I can never understand people like that.  Well I went out
  3199. and printed out the old LOD/H tech journals and poured through the
  3200. information they had on the telephone system.
  3201.     I also found an excellent little book called Ready-to-Build Telephone
  3202. enhancements by
  3203. Delton T. Horn ISBN:0-8306-4359-1  The other surprising resource that I found
  3204. was from good ole AT&T herself.. http://www.att.com/TALKINGPOWER/ (I believe
  3205. it is) is a series of documents written by the people who make the giant
  3206. backup batteries for the phone system.  While there are several pages
  3207. on how they create them, there are several other excellent pages which
  3208. very clearly explain the basic operations of the phone system.  So simple in
  3209. fact, that they have inspired me to build a very small but workable
  3210. telephone system myself (switching and all) just to learn about it some more.
  3211.     So, the  following are a few interesting circuits that I have found
  3212. during my exploits that I thought I would share with you.
  3213.  
  3214.  
  3215.     ----------------
  3216.     - Basic Info   -
  3217.     ----------------
  3218.  
  3219. **WIRES**
  3220.  
  3221. The four standard wires in a phone line are as follows
  3222. (In order to see these, rip off the jacket on one of your phone cords)
  3223.  
  3224. red - This is the tip wire.
  3225. green - This is the ring wire. The tip and the ring form the loop
  3226.     between your house and the CO (central office).
  3227. yellow - This wire carries the ringer signal.  However, in most home
  3228.      phone systems this wire is shorted to the green wire.
  3229.      So if you want to disable the ringer without
  3230. black - Usually unused, but sometimes used in multiline systems.
  3231.     I don't know the specific use as I have yet to tinker with anything
  3232.     but my home line. Though I would guess that it is used in
  3233.     conferencing type systems and such.
  3234.  
  3235. **TONES**
  3236.  
  3237. The phone company uses dual tones for all of its services.  The reason
  3238. for this as it is incredibly unlikely for a dual tone to be created
  3239. naturally.  So what is a dual tone? Why simply two different tones signaled
  3240. at once.
  3241.  
  3242. Name            Frequency               Duration
  3243.  
  3244. Dial Tone       350Hz & 440Hz           Continuous
  3245. Busy Signal     480Hz & 620Hz           .5sec on, .5 sec off.. and so on
  3246. Ring Back       440Hz & 480Hz           2sec on, 4 sec off
  3247. PBX             440Hz & 480Hz           1sec on, 3 sec off
  3248. Off Hook        1400Hz & 2060Hz &       .1sec on, .1sec off (yes this is
  3249.       2450Hz & 2600Hz                                annoying)
  3250. No such number  200Hz & 400Hz           Continous sweep at 1Hz
  3251.  
  3252. **Dual Tone MultiFrequency(DTMF) TONES**
  3253.       Column1         Column2         Column3         Column4
  3254.       1209Hz          1336Hz          1336Hz          1477Hz
  3255.  
  3256. Row1 697Hz        1               2               3               A
  3257.  
  3258. Row2 770Hz        4               5               6               B
  3259.  
  3260. Row3 852Hz        7               8               9               C
  3261.  
  3262. Row4 941Hz        *               0               #               D
  3263.  
  3264. ABCD are often used by the military for priority overides.  e.g. Flash
  3265.  
  3266. ------------
  3267. - Circuits -
  3268. ------------
  3269.  
  3270.     This first one is from LOD/H Volume 1 Issue 1, in an article entitled
  3271. Outside Loop Distribution Plant.  The circuit allows you to create a test set.
  3272. It has two modes, one is normal line operation, and the other is a "listen"
  3273. mode.
  3274.  
  3275. The schematic is as follows:
  3276.  
  3277. Ring >-------------------------------------> To test phone
  3278.  
  3279. Tip >-------| SPST Switch  |---------------> To test phone
  3280.  
  3281.         |              |
  3282.         |--/\/\/\/\----|
  3283.         |    Resistor  |
  3284.         |----|(--------|
  3285.       Capacitor
  3286.  
  3287. The capacitor should roughly be a .22uF 200 WVDC Mylar capacitor.
  3288. I got away with two .10 micro farads in parallel. (cap's in || are additive)
  3289.  
  3290. The resistor should be a 10kOhm 1/2W resistor.
  3291. For me this did not work.  I had to throw two 10k's in || and drop the
  3292. resistance to 5kOhm in order to be able to listen into the line.  Otherwise
  3293. I was unable to get any audio.
  3294.  
  3295. >--- should be alligator clips that can connect to posts.  Also you make them
  3296.  
  3297.      wires leading out of a phone jack as well.  In any case, the simply
  3298.      need to be able to connect to the ring and tip of a line in whatever
  3299.      manner is needed by you.
  3300.  
  3301. The SPST Switch is used to break the tip connection to the test phone.
  3302. If the switch is closed then the current will flow straight through the
  3303. wire and bypass the resistor and capacitor.  This will cause the phone
  3304. to act like a normal phone.  If the switch is open the Capacitor will charge
  3305. and block the DC voltage on the line. This will keep the phone companies
  3306. switch from detecting an off hook from current flow.  However, since the
  3307. audio signal sent across the wire is an AC signal, you will still be
  3308. able to here it.  This is because the capacitor does not block AC signals.
  3309. (If you are not sure why, please read up on it in a basic electronics
  3310. circuitry book).
  3311.  
  3312.  
  3313. The other circuit that interested me is a DTMF dialer.  I am only using
  3314. a small portion of it for myself.  I merely added the ABCD buttons to
  3315. my phone, as well as the test set above.  I used a one piece flip phone
  3316. that is very convenient as it has no base and is easy to carry around.
  3317.  
  3318.  
  3319. The parts you will need are as follows
  3320.  
  3321. IC1     MK5085 DTMF generator
  3322. IC2     LM380  Audio amplifier
  3323. KB      a 16 Button Pad. You can use a twelve as well, but you will
  3324.     not have ABCD then..
  3325. CR      3.58MHz crystal
  3326. C1      10uF 25V electrolytic capacitor
  3327. C2      .01uF cap
  3328. C3      47uF 25V electrolytic capacitor
  3329. R1      10kOhm 1/4W 5% tolerance resistor
  3330. R2      1kOhm   1/4W 5%
  3331. R3      1kOhm   1/4W 5%
  3332. R4      100Ohm Pot
  3333. SP      8Ohm Speaker.
  3334.  
  3335.                    +9V
  3336.               |
  3337.              -------------
  3338.      |---------------------------|3 8 7 1    |
  3339.      | |-------------------------|4        10|
  3340.      | | |-----------------------|5          |
  3341.      | | | ----------------------|9  IC1     |
  3342.      | | | |                     |           |
  3343.     ---------                    |           |
  3344.     |1 2 3 A|--------------------|14         |
  3345.     |  KB   |--------------------|13         |
  3346.     |       |--------------------|12         |
  3347.     |* 0 # D|--------------------|11  6   16 |
  3348.     ---------                    -------------
  3349.                   |    |
  3350.                  gnd   |
  3351.                  R2    |   R3     C2
  3352.             --/\/\/\/\-|-/\/\/\/\-|(--
  3353.             |                        |
  3354.             |                        |
  3355.               gnd            ------------
  3356.                     |
  3357.                     |      +12V
  3358.               ------|       |
  3359.               |     |     |\|
  3360.               |---/\/\/\--|+ \    C3
  3361.               |    R4     |IC2 >--)|--|
  3362.               |-----------|- /        |< SP
  3363.                    |/|         |
  3364.                      |         |
  3365.                     gnd       gnd
  3366.  
  3367. In order to you use only one power source for both +12v and +9v
  3368. just construct a voltage divder. Send +12 to the OpAmp and +12 to the
  3369. diveder which will have a +9V output.
  3370.  
  3371.        22kOhm     68kOhm
  3372.      +12V(in)---/\/\/\/\---/\/\/\/\--gnd
  3373.         |
  3374.         |
  3375.        Out (+9V)
  3376.  
  3377.  
  3378.  
  3379.               .oO____Oo.
  3380.  
  3381. --
  3382.  ----| Infinity / Route / daemon9 |--------|------------------|--------------
  3383. --| Founding member: The 0x47 0x75 0x69 0x6C 0x64 | Finger for information |--
  3384.     [RSADSALUCGARGOYLEIDEADESLUCIFERLOKIFEALSHAMD5HAVALSNEFRU]
  3385.        not your typical american
  3386.  
  3387.