home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / XHU_P1.ZIP / Xhu1.txt < prev   
Text File  |  1995-10-29  |  17KB  |  377 lines

  1.                              .- XHU Pack #1 -.
  2.  
  3.   . Introduction 
  4.   . Description of Programs  
  5.   . Closing
  6.  
  7.                              .- Introduction -. 
  8.  
  9.   XHU  stands for Xenocide's Hacking  Utilities written by me, Xenocide.
  10.   They mainly deal with hacking, security, and cryptography. You may use
  11.   the  programs anyway you like, but I would like to hear your comments.
  12.   You  can  reach  me on Static  Line  (806.747.0802)  or by Internet at
  13.   dan.keisling@windmill.com or at xenocide@big12.metrobbs.com
  14.  
  15.                                             - Xenocide
  16.  
  17.                        .- Description of Programs -. 
  18.  
  19.     The archive has these files packaged in them:
  20.  
  21.   . brute  
  22.   . dzip  
  23.   . fakelog  
  24.   . isprime   
  25.   . netware  
  26.   . passwd  
  27.   . permute  
  28.   . primes  
  29.   . winsscrk
  30.  
  31.   If you are missing any of these files, please contact me so that I can
  32.   send you them.
  33.  
  34. brute:
  35.  
  36.   Brute  is a program to show the user why a brute-force attack is a bad
  37.   idea  in  gaining a key. If you  do  not understand what a brute-force
  38.   attack is, read the below explanation:
  39.  
  40.   For  this  explanation,  I  will be  using  the  example  of the PKZIP
  41.   password,  since  everyone  is familiar  with  the program. Generally,
  42.   there are three types of attacks used to gain a password (key) :
  43.  
  44.   .  Cryptanalysis  -  mathematical attack  used  to  calculate the key.
  45.   Usually  the  fastest  and  best  option;  although  usually  the most
  46.   difficult.
  47.  
  48.   . Dictionary Attack (see dzip) - using a set of words to guess the key
  49.   (usually a password). Usually very slow, but easy to create.
  50.  
  51.   .  Brute-force  Attack  - trying every  possible  combination of a key
  52.   until the key fits. Usually the slowest, but the only way to solve the
  53.   equation.
  54.  
  55.   In simple terms, suppose K=key and our equation we have to solve is
  56.  
  57.   K=2*10                   (two times five = ?) 
  58.  
  59.   Note that this is an extremely bad example. This is just to give you a
  60.   basic  example of finding a key. Encryption is much more stronger than
  61.   this.
  62.  
  63.   We  could probably rule out the attack of a dictionary since we aren't
  64.   dealing  with letters (see dzip). From a cryptanalysis stand point, we
  65.   would  compute  2*5 to find the  key.  Although encryption usually has
  66.   another  variable  stopping us from simple  computing  the left of the
  67.   equal  sign,  this  example will suffice.  If  you use brute-force, we
  68.   would  try every possible combination  of K. Since brute-force usually
  69.   starts  at  the lowest possible value and  goes  up, we would start at
  70.   K=0.  Since 0=2*5 isn't true, we would try  1. Then 2, 3, 4, etc until
  71.   we  ended up at 10. Since 10 equal  2 times 5, the program would halt,
  72.   giving us the solution to K.
  73.  
  74.   So  far, we have only been working  with numbers. Now we will be using
  75.   letters,  in  order to conform to a  PKZIP  password. So, if our PKZIP
  76.   password  is  "XHU",  how would be  go  about finding that using brute
  77.   force?  Since brute force usually begins  at the lowest possible value
  78.   and  works  its way up, we would begin  at the letter 'a.' For now, we
  79.   will  say  that P is the PKZIP password  (in this case, XHU) and P' is
  80.   the password being tried. So when we find that
  81.  
  82.   P'=P
  83.  
  84.   we  have  solved  the password. Our  first  try comes out false, since
  85.   a=xhu  is false. We would then try the letter 'b' and then 'c' and all
  86.   the  way to 'z'. Since none of these work, what now? We have to "loop"
  87.   around  to  the characters "aa". Since  aa=xhu is false, we would then
  88.   try  "ab" then "ac" all the way to "az". Once this is reached, we have
  89.   to "loop" around to "ba." We will go all the way to "bz" then "ca" and
  90.   to  "cz". All in all, we will finish the 2 character length with "zz".
  91.   We  will  then loop around to "aaa" and  try  that. Then we will go to
  92.   "aab"  and  so forth. Once "aaz" is  reached, we loop to "aba" and try
  93.   "abb"  then  "abc" until we get to  "abz" which loops around to "aca".
  94.   After  we reach "azz" we loop around to "baa". We only get to a fourth
  95.   character  string  right  after "zzz" is  reached.  (seems like a long
  96.   time).
  97.  
  98.   In  dealing  with  the  three  character  string,  we  will  reach the
  99.   combination "xhu" sometime in the middle giving us:
  100.  
  101.   xhu=xhu
  102.  
  103.   in  which  case is true, halting the  program and returning P'. If you
  104.   understand C, then we can think of:
  105.  
  106.   for  (p'=a;  p'<zzzz;  p'++)  
  107.   {  
  108.   if  (p'=p)  
  109.   {  printf("We  found  the password"); 
  110.   abort(); 
  111.   } 
  112.   else {} 
  113.   }
  114.  
  115.   Remember,  though,  that  a  PC  is  extremely  fast  at  finding this
  116.   password.  It  would generally take a matter  of a few seconds to find
  117.   the  password  "xhu."  If  you think  you  now  can crack any PKZIPPED
  118.   password, think about these points:
  119.  
  120.   . Passwords are generally more than 5 characters in length 
  121.   . Passwords in  PKZIP  are  case-sensitive  ('a'  and  'A'  are 
  122.     totally different passwords)  So far we have been only using lower
  123.     case letters  
  124.   . Secure passwords  contain  numbers, punctuation keys,  high ASCII,
  125.     and spaces within them.
  126.  
  127.   All  of  these factors contribute into  increasing the time in finding
  128.   the  password  immensely.  First, run brute  with  5 characters as the
  129.   password.  If  you  think it didn't take  that  long to show them all,
  130.   remember that it is just displaying them to the screen. When trying to
  131.   find the password, it uses this sequence:
  132.  
  133.   a) Compute password 
  134.   b) Try computed password with equation 
  135.   c) Return results of try 
  136.   d) If false, goto a; if true, goto e  
  137.   e) Exit with success 
  138.    
  139.   More  or  less.  This can more than  triple  the  time to find it all.
  140.   Granted,  finding the password "xhu" isn't  long at all, but take into
  141.   the factors listed above. For passwords with uppercase, we now have to
  142.   try  "aaA"  and  "gHA."  Basically,  every  combination  of  upper and
  143.   lowercase  letters  in  the string. Since  we  are  introducing 26 new
  144.   characters  (A  through Z) we also  have  to introduce all punctuation
  145.   keys   (keys:  ~`!@#$%^&*()_+|\=-}]{[:;"'?/>.<,),   spaces  (just  one
  146.   character - but it severely increases the time), numbers (0 through 9)
  147.   and  all  high ASCII characters  (161 characters) all greatly increase
  148.   the  time. Most security programs heavily encourage passwords that are
  149.   more  than  10 characters in length  with spaces and alternative case.
  150.   So,  you can say that in a length  of 10 characters, you will have the
  151.   try of:
  152.  
  153.   kFi&; :l~±
  154.  
  155.   This  won't usually be a password, but  brute force has to check every
  156.   possible solution to the key.
  157.  
  158.   If you are using a program that uses brute-force, it is always wise to
  159.   have the option of specifying what characters to use. Suppose you know
  160.   that  the  password is only in lower  case letters. Why would we waste
  161.   all  the other time to factor in upper case, spaces, numbers, and high
  162.   ASCII?  A  brute-force program should have  the option to specify only
  163.   using lower case letters, or by only specifying numbers and upper case
  164.   letters.
  165.  
  166.   If  you  STILL  don't really know  what  a  brute-force attack is, you
  167.   should follow up to the newsgroup sci.crypt or by contacting me.
  168.  
  169. dzip:
  170.  
  171.   Dzip  stands  for  Dictionary Zip  which  cracks PKZIPPED passwords. A
  172.   dictionary  file  (also called a wordlist)  is simply a text file that
  173.   has  one  word  per  line. The  program  checks  that word against the
  174.   password,  and  if it is false, it  tries the next one. The dictionary
  175.   file  that  dzip  looks  for is  called  ZIP_DICT.TXT  in  the current
  176.   directory. Here is an example of the program:
  177.  
  178.   Suppose our ZIP_DICT.TXT file looked like this:
  179.   
  180.   oranges
  181.   bananas
  182.   apples
  183.   zowie
  184.  
  185.   And  the  ZIP  file with the  password  is called CRACKME.ZIP. We will
  186.   assign  the  password "zowie" to CRACKME.ZIP.  Now,  dzip will more or
  187.   less try the word "oranges" to the CRACKME.ZIP file. If PKZIP tells us
  188.   that  "that  is not the right  password" dzip will then try "bananas".
  189.   Since  "bananas" does not work, we will  try "apples." It is not until
  190.   we  try  "zowie" that PKZIP says  the password is correct. The program
  191.   now halts, giving us the password to CRACKME.ZIP.
  192.  
  193.   So  how do you make a ZIP_DICT.TXT  file? You certainly do not make up
  194.   words yourself. Static Line has some available for download or you can
  195.   ftp  them  from sable.ox.ac.uk in  the pub/wordlists directory. All of
  196.   these  wordlists are setup with one  word per line and usually English
  197.   only  (although  there  are different  languages  there). As you might
  198.   notice,  using  a dictionary attack has  it's limitations. What if the
  199.   password  was "sdf(unSdf"? Since most wordlists are usually only whole
  200.   words, this limits us to only a brute-force attack (see brute). If you
  201.   do not plan on making your own dictionary files, only use a dictionary
  202.   attack  if  the password is a  whole word. Also remember that "Apples"
  203.   and  "apples" are two separate passwords. Most dictionary files are in
  204.   lower case.
  205.  
  206.   One  thing about dzip is that it is  very fast. I ran it through a one
  207.   meg  dictionary file (that's a lot of words; it took over five minutes
  208.   just  to  type  it to the screen)  and  it returned the password in 47
  209.   seconds.  As with a brute-force attack, there is no way of knowing how
  210.   long  it  will take to find the  key.  In brute-force, it happens only
  211.   when the correct key is found. Since a dictionary attack starts at the
  212.   top  and  goes down to the bottom of  the file, the time limit is only
  213.   how  long it takes to get to the word in the file. If the password was
  214.   somewhere  in the middle, it will be quicker than finding the password
  215.   if it was located at the bottom of the file.
  216.  
  217.   The  password  I used for the ZIP file  was  at the end of the one meg
  218.   ZIP_DICT.TXT  file.  This  theoretically means  that  it takes about 1
  219.   minute  to try a meg of words. However, with the abundance of words in
  220.   the  English language, a one meg  dictionary is pretty small. A common
  221.   size is around 10 megs or more.
  222.  
  223.   If  you do not know how to  solve a password using cryptanalysis, it's
  224.   always   better  to  at  least  try   a  dictionary  attack  before  a
  225.   brute-force.  Since it only (theoretically) takes  10 minutes for a 10
  226.   meg  dictionary, you might get lucky  and find the password - although
  227.   very  unlikely.  I could simple make  my password 10 times more secure
  228.   against a dictionary attack by using these passwords:
  229.  
  230.   "apples1"
  231.   "Apples"
  232.   "applesoranges"
  233.   "apples "
  234.   
  235.   Remember  that  the  space in the last  example  does  mean that it is
  236.   different from just "apples" with no space. A great more detail can be
  237.   covered  using  a  dictionary attack, but  they  are  pretty simple to
  238.   reason  out.  Using dzip against different  passwords  you made up and
  239.   from the dictionary files you downloaded. One good example is to think
  240.   of  an English whole word and use that for the ZIP password (using all
  241.   lower case letters). Then run dzip against a 10 meg dictionary and see
  242.   what happens.
  243.  
  244.   The only specifications for dzip is:
  245.   
  246.   ZIP_DICT.TXT must be in the current directory 
  247.   The ZIP to be cracked must be in the current directory
  248.   The  ZIP  file  must  have at least  3  files  encrypted with the same
  249.   password
  250.  
  251.   Although  there has not been a real cryptanalysis attack on PKZIP (the
  252.   only  one being is that you must know the plain-text of the file to be
  253.   cracked),  there will be a day when a program will return the password
  254.   in a matter of seconds. Until now, we are stuck with using brute-force
  255.   and a dictionary attack.
  256.  
  257. fakelog:
  258.  
  259.   Fakelog  is a login trojan that is  designed to capture user names and
  260.   passwords  on machines that use a "login" program. This is a demo copy
  261.   simply because all logins are different on every machine. Fakelog will
  262.   simulate  the real login on your machine and ask for the user name and
  263.   password. Once a user has entered these items, they will be written to
  264.   a  file and an error message will follow, then transferring control to
  265.   real login for the user to enter his info again.
  266.  
  267.   The  file that the passwords are written  to is called PASSWD (you can
  268.   change  it  if  you wish to something  less  obvious)  for you to view
  269.   later.  If  I was to enter "Xenocide" as  my user name and "xhu" as my
  270.   password, the PASSWD file would look like:
  271.  
  272.   . Xenocide/xhu
  273.   
  274.   Each  time a user logs in, it will be added to the end of the file. If
  275.   it  cannot  find PASSWD in the  current directory, Fakelog will create
  276.   it.
  277.  
  278.   Here is an example of Fakelog's run time:
  279.  
  280.   . Novell NetWare Login
  281.   
  282.   . Login: Xenocide
  283.   . Password: XHU
  284.   
  285.   . Wrong password entered.
  286.   
  287.   The PASSWD file would then look like:
  288.   
  289.   . Xenocide/XHU
  290.   
  291.   The  only problems with Fakelog is that  if a user logs in many times,
  292.   he will notice that he somehow mistypes his password the first time.
  293.  
  294.   In  order  for Fakelog to correctly work  and  fool a user, it must be
  295.   made  to  look exactly like the real  logon. Because I don't know what
  296.   your  logon looks like, you must contact  me so I can customize it for
  297.   you. You must give me these details:
  298.  
  299.   . Welcome Screens (Any text shown before the login prompt)
  300.   . The login prompt (ie: Login: or login: or username: etc)
  301.   . The password prompt (ie: password: or Password: or pass> etc)
  302.   . The error message (That you may get if you mistype your password)
  303.     
  304. isprime:
  305.  
  306.   Isprime  will  tell you if a number  you  specified is prime. If it is
  307.   false,  it will return the reason why.  For example, if you entered 10
  308.   as  the number, it would return false with the reason that 2*5=10. Due
  309.   to  the  limits of a personal  computer,  large numbers aren't handled
  310.   very well.
  311.  
  312. netware:
  313.  
  314.   Netware  will  encrypt  a  password  using  Novell  NetWare's Password
  315.   Encryption.  It  uses a simple hashing of  the password into a 32 byte
  316.   string and does some mixing and compression to it. Passwords can be up
  317.   to  128  bytes and the hashing can be  up to 128 bits. For example, if
  318.   you enter XHU for the password, it will return
  319.  
  320.   0E B2 B6 ED F3 8E A4 D9 B2 FF F8 23 07 8E B9 FD
  321.  
  322. passwd:
  323.  
  324.   Passwd  will  let you make a  UNIX-like passwd entry commonly found in
  325.   /etc/passwd. It contains the same info (username, home directory, user
  326.   number,  etc)  and prints it to the  file called PASSWD in the current
  327.   directory.  This  can be used for  security  programs that can check a
  328.   users  password  in a specific file. One  note is that passwd does not
  329.   modify  the strings in any way,  such that at the Encryption Password:
  330.   prompt,  you must enter the encrypted password. No encryption has been
  331.   implemented  yet,  although I hope for  it to actually encrypt it with
  332.   crypt(3) someday.
  333.  
  334. permute:
  335.  
  336.   Permute  will display all the permutations  of a string. If the string
  337.   is 'ab' it will return:
  338.  
  339.   ab ba
  340.  
  341. primes:
  342.  
  343.   Primes  will  calculate  all the primes from  2  to 3067. It ends here
  344.   because of the limitations of a personal computer.
  345.  
  346. winsscrk:
  347.  
  348.   Winsscrk will decrypt the Windows v3.11 Screen Saver Password normally
  349.   stored in control.ini. It does not specifically look for control.ini -
  350.   I have given you the choice of the file name. The only requirements is
  351.   that  the encryption password must be  after a Password= prompt. (This
  352.   is  what  control.ini looks like anyway).  It has around a 99% success
  353.   rate,  because certain punctuation keys confuse the encryption. I have
  354.   not tested Win '95's encryption (if it is different), but expect a Win
  355.   '95 edition in the next pack.
  356.  
  357.                                 .- Closing -. 
  358.                                 
  359.   Please  note  that  these programs are just  simple  ones to give me a
  360.   "test" for my knowledge. Although they may seem "useless" to you, they
  361.   greatly  helped  me  in learning how  to  program,  and in some cases,
  362.   information on basic (very basic) cryptography. Since these 9 programs
  363.   took  me a while to make and get all the bugs out of, I cannot say how
  364.   long,  if ever, an XHU Pack #2 will  come out. I might also extend the
  365.   releases from other people who would like to distribute these kinds of
  366.   programs.  If you would, contact me and we can arrange for it to be in
  367.   a  pack. My only thoughts on new programs are duplicated past programs
  368.   (such  as  dzip), which is still quite  a challenge, and to improve on
  369.   them  as  much  as possible. If you  also  would like to see a program
  370.   made, please contact me so we can figure out how and we can release it
  371.   into a pack some day.
  372.  
  373.   My only thanks are to Breed_X, who helped me with the Fakelog program.
  374.  
  375.                                         - Xenocide
  376.                                            
  377.