home *** CD-ROM | disk | FTP | other *** search
/ Steganos Hacker Tools / SHT151.iso / programme / pw_system / john-16w / doc / EXTERNAL < prev    next >
Encoding:
Text File  |  1998-12-02  |  2.9 KB  |  69 lines

  1.  
  2.  Defining an External Mode
  3. ===========================
  4.  
  5. To define an external cracking mode you need to create a configuration file
  6. section called [List.External:MODE], where MODE is any identifier that you
  7. assign to the mode. The section should contain some functions coded in a
  8. subset of the C language. John will compile and use them if you enable this
  9. mode via the command line.
  10.  
  11.  External Functions
  12. --------------------
  13.  
  14. The following functions are currently used by John:
  15.  
  16. init()        called at startup, should initialize global variables
  17. filter()    called for each word to be tried, can filter some words out
  18. generate()    called to generate words, when no other cracking modes used
  19. restore()    called when restoring an interrupted session
  20.  
  21. All of them are of type 'void', with no arguments, and should use global
  22. variable 'word' (pre-defined as 'int word[]'), except for init() which is
  23. called before 'word' is initialized. The 'word' variable contains current
  24. word to be tried, in ASCIIZ.
  25.  
  26. The functions, if defined, should do the following with 'word':
  27.  
  28. * filter() can modify the word, or zero out 'word[0]' to skip it;
  29.  
  30. * generate() should set 'word' to the next word to be tried, or zero out
  31. 'word[0]' when cracking is complete (this will cause John to terminate);
  32.  
  33. * restore() should set global variables to continue from the 'word'.
  34.  
  35. You can use an external mode separately, or with some other cracking mode,
  36. in which case only init() and filter() will be used (and only filter()
  37. will be required). Using an external filter is compatible with all the
  38. other cracking modes and '-makechars' command line option.
  39.  
  40. It is recommended that you don't use filter(), or at least don't filter
  41. too many words out when using an external mode with your own generate().
  42. Better modify generate() not to generate words that would get filtered out.
  43.  
  44.  The Language
  45. --------------
  46.  
  47. As I already mentioned above, the compiler supports a subset of C. John is
  48. a cracker, not a compiler, so I don't think it needs anything else. (Well,
  49. I'm not even sure it needed a compiler at all, but using an external, say,
  50. perl is less convenient in some cases...)
  51.  
  52. Here's a list of supported keywords: void, int, if, else, while, continue,
  53. break, return. You can define standard functions to be called by John,
  54. define global and local variables (including single dimensional arrays),
  55. use all the integer operations supported in C, and use C comments.
  56.  
  57. The following C features are missing in John's compiler:
  58.  
  59. * only standard functions supported, you can't define your own ones;
  60. * only 'while' loops are supported;
  61. * only 'int' and 'void' data types supported;
  62. * only single dimensional arrays supported;
  63. * structs/unions are not supported;
  64. * pointers are not supported (array name refers to the first element);
  65. * probably something else...
  66.  
  67. You can find some external mode examples in the default configuration file
  68. supplied with John.
  69.