home *** CD-ROM | disk | FTP | other *** search
/ Cuteskunk BBS / cuteskunk.zip / cuteskunk / Virus / Virus-Magazines / NuKE / nk-info6.zi2 / NK-INFO6.008 < prev    next >
Text File  |  1993-05-05  |  14KB  |  240 lines

  1. ================================================================================
  2. Volume 1, Issue 6, May 1993
  3. NuKE Info-Journal #6
  4.  
  5.             NuKE-NuKE-NuKE-NuKE-NuKE-NuKE-NuKE-NuKE-NuKE-NuKE-NuKE
  6.             uK                                                  E-
  7.             KE     "The `Arms Race' on Physical Protection      -N
  8.             E-               Devices : Round Two"               Nu
  9.             -N                                                  uK
  10.             Nu                       By                         KE
  11.             uK                   Rock Steady                    E-
  12.             KE                                                  -N
  13.             E-NuKE-NuKE-NuKE-NuKE-NuKE-NuKE-NuKE-NuKE-NuKE-NuKE-Nu
  14.           
  15.  
  16. % Physical Copy-protection Devices %
  17.  
  18. A physical protection device is usually a piece of equipment to a computer
  19. or used in conjunction with a computer to protect software or data. The 
  20. majority of such devices are commonly referred to as `dongles', which are
  21. electronic devices attached to the computer.
  22.  
  23. When a dongle protection is used, no attempt is made to prevent the user or
  24. owner of the package from creating additional copies of the software. The
  25. device is designed to prevent unauthorised use and not unauthorised copying.
  26. The origins of the word `dongles' is obscure, but it originated about 1978-79
  27. and is believed to have been first used to protect the `Wordcraft' package
  28. on the Commodore Pet. 
  29.  
  30. % Dongles - A Simple Dongle Design %
  31.  
  32. The first problem in designing a dongle is finding some method of attaching
  33. the device to the hardware. It must be a method which is available on the
  34. standard minimum configuration machine for which the software is intended to
  35. run. The _most_ obvious choice is the serial interface port of which nearly
  36. every machine has at least one, especially with the increase use of mice and
  37. modems which require serial connections. Assuming further that we do not wish
  38. to use this port during the running of the program, then a very simple dongle
  39. could be constructed using the standard cabling and reverse channel so that
  40. communications are usually made in both directions simultaneously. The wires
  41. would have the following functions:
  42.  
  43.     Sending Channel
  44.     ~~~~~~~~~~~~~~~
  45.     Request to send        (Output when the computer is ready to go)
  46.     Clear to send          (Received when the terminal is ready)
  47.     Transmit data          (Line for the computer to transmit the data)
  48.    
  49.     Receiving Channel
  50.     ~~~~~~~~~~~~~~~~~
  51.     Data Terminal Ready    (Output when the computer is ready to receive data)
  52.     Data Set Ready         (Received when the terminal is ready to transmit)
  53.     Receive Data           (Line for Computer to receive the data)
  54.     Carrier Detect         (Line for modem to signal the computer that 
  55.                            (another modem signal has been found via telephone)
  56.     Ring Detect            (Line for modem to signal the computer that a)
  57.                            (ringing tone has been received)
  58.  
  59. Assume that wires are used to connect the signals as shown below:
  60.  
  61.     Standard output        Standard inputs
  62.     ~~~~~~~~~~~~~~~        ~~~~~~~~~~~~~~~
  63.     Transmit data..........Data Set Ready
  64.     Request to send........Receive Data
  65.     Data terminal ready....Ring Detect
  66.  
  67. This is a bizarre combination, which is extremely unlikely to be used by 
  68. design with any sort of equipment. To protect our dongle we further seal
  69. the plug casing with pitch or epoxy resin so that the details of the wiring
  70. cannot be seen without melting out or drilling away the resin.
  71.  
  72. The representation of a `U' character in the standard ASCII code will appear
  73. as a square wave. This is because the character itself has the binary value
  74. 0101 0101, and, taken with the character beginning pulse (start bit) and the
  75. character ending (stop bit), this makes up a square wave signal 1 0101 0101 0
  76.  
  77. +6v-+ +-+ +-+ +-+ +-+ +-+  Now, Transmit a stream of `U's, since Transmit is 
  78.     | | | | | | | | | | |  connected to Data Set Ready, this will go up and 
  79.  0  | | | | | | | | | | |  down, at intervals of one bit. By Sampling this 
  80.     | | | | | | | | | | |  line the program can test that the correct pattern
  81. -6v +-+ +-+ +-+ +-+ +-+ +- is being transmitted and received. This means the
  82.  
  83. dongle is in place. This is a perhaps a dongle suitable for the computer 
  84. hobbyist, it rather is quite a poor attempt as a dongle. This is because of
  85. several reasons; it does not allow the use of the serial port because it is
  86. needed for the dongle, therefore a mouse or modem or printer connection via
  87. the serial port can not be done if you only have one serial port. 
  88.  
  89. % Advanced Pseudo Random bit Generator Dongles %
  90.  
  91. Two new devices being marketed to software homes are Datakey (DES, 1988) and
  92. Software Key (Bristol, 1988). The overall concepts of both are similar, and
  93. they were in fact developed by the same inventor, although the two structures
  94. are quite separate and the details of the devices differ alot. 
  95.  
  96. The devices are `active' dongles. Meaning one end of the dongle plugs into the
  97. computer, and whatever is normally connected to the RS232 port is connected to
  98. the other end, and should be unaffected by this device. 
  99.  
  100. In the Datakey, which is a bit oriented device, toggling the Data Terminal 
  101. Ready line causes a single bit of data to be presented at Data Set Ready or the
  102. Data Carrier Detect Line. By this means, a string of pseudo random binary data
  103. of any length can be read out of the device. Assembly language routines are
  104. included with the device for linking into the software to be protected. 
  105.  
  106. In the Software Key, special command codes are used to trigger the device, 
  107. which responds with a byte of pseudo random data. Such sequences only repeat
  108. after an extremely large number of operation. 
  109. % Software Sentinel %
  110.  
  111. The Software Sentinel (Sentinel, 1988) plugs into the parallel printer port of
  112. an 80x86. The parallel channel was preferred to the serial channel since the
  113. parallel channel is always present on many systems, even with minimum 
  114. configuration. However Sentinel also have a serial port version of this device
  115. called the Sentinel S. 
  116.  
  117. % Dongle Cracking %
  118. ~~~~~~~~~~~~~~~~~~~
  119.  
  120. Some exports are scornful of the protection afforded by dongles. Some even
  121. boast that 30 minutes would usually be sufficient to bypass any dongle 
  122. protection in any program. As a matter of fact dongle cracking is actually
  123. straight forward, simply find the routine that accesses the dongle test. The 
  124. difficulty of this job is really based on the software used to access the 
  125. dongle. If the software accesses the parallel/serial port via interrupt 
  126. functions, a simple TSR program can be stated to `fool' the program that a 
  127. dongle is present, or simply trace through the code from that point on to
  128. see what actually happens, and what the program expects to get back. However
  129. I do not expect a program to use interrupts to access an I/O port for the
  130. sole reason of easily breaking in via the vector table. Chances are the 
  131. software is accessing the I/O port directly with the built in processor 
  132. instructions (OUT/IN). So it will be up to the user to disassemble the 
  133. program to search for IN/OUT or INS/OUTS or INSB/OUTSB or INSW/INTSW 
  134. instructions that will access the parallel/serial ports. Once you locate
  135. the routine that accesses the port, you may either reverse engineer or set
  136. a break-point and attempt your journey of debugging. 
  137.  
  138. Nevertheless, this does not nullify the credablity of dongle protection. 
  139. As a matter of fact several new software are using dongles to protect
  140. their software. But the fact remains, no software is 100% secure. Dongles,
  141. require software to `test' that the dongle is attached, therefore the 
  142. possibility of finding the `test' routine exists, and therefore modification
  143. is possible.
  144.  
  145. % Lenslok % The Latest Physical Protection Device %
  146. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  147. The Lenslok device was also designed for the low cost software end of the
  148. market. The device consists of a plastic lens device rather like a pocket
  149. magnifying glass. It contains a series of prisms which cause anything viewed
  150. through it to be seen as a confused jumble of different dots. (pixels)
  151.  
  152.       Figure #1               Figure #2
  153.   1   2   3   4   5       A   B   C   D   E
  154. ┌───┬───┬───┬───┬───┐   ┌───┬───┬───┬───┬───┐  The letter `A' normally looks
  155. │   │   │ X │   │   │   │ X │   │   │   │   │  like the pattern in figure #1.
  156. ├───┼───┼───┼───┼───┤   ├───┼───┼───┼───┼───┤  Scrambled, it could look like
  157. │   │ X │   │ X │   │   │   │ X │   │ X │   │  the pattern shown in #2. All
  158. ├───┼───┼───┼───┼───┤   ├───┼───┼───┼───┼───┤  that was done was that column
  159. │ X │   │   │   │ X │   │   │   │ X │   │ X │  1 & 3 were interchanged. So if
  160. ├───┼───┼───┼───┼───┤   ├───┼───┼───┼───┼───┤  we took column A & C and swapped
  161. │ X │   │   │   │ X │   │   │   │ X │   │ X │  them, we would get the
  162. ├───┼───┼───┼───┼───┤   ├───┼───┼───┼───┼───┤  charactor `A' once again.
  163. │ X │ X │ X │ X │ X │   │ X │ X │ X │ X │ X │  Then the Lenslok would consist
  164. ├───┼───┼───┼───┼───┤   ├───┼───┼───┼───┼───┤  of a simple optical system,
  165. │ X │   │   │   │ X │   │   │   │ X │   │ X │  which consists of two shallow
  166. ├───┼───┼───┼───┼───┤   ├───┼───┼───┼───┼───┤  angled grooves cut into the
  167. │ X │   │   │   │ X │   │   │   │ X │   │ X │  plastic which change over the
  168. └───┴───┴───┴───┴───┘   └───┴───┴───┴───┴───┘  columns.
  169.  
  170. So, the user would apply the `lens' to the screen, over the jumbled pattern
  171. of dots and presses a key until the pattern appears through the prism.
  172. Therefore, in a Lenslok protected system, you may have a word, scrambled,
  173. which the system may ask you to respond to, whereby you would take the lens,
  174. and pass it ontop of the charactor and voila.
  175.  
  176. % Cracking all together now... %
  177. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  178. Lenslok, is a great physical copy-protection, it is low-costing, it can be
  179. used inconjuction with the current `Document Protection' currently widely
  180. used in several low-cost software, expecially in home entertainment computer
  181. games. Document protection, is whereby the program, mainly in the beginning,
  182. will stop for a moment and ask you a question, whereby the answer is only
  183. to be found in the documents supplied with the original package. Nevertheless,
  184. document protection, is fairly weak, as documents can be easily photocopied.
  185. It can also be scanned as a computer image, and can be easily distributed,
  186. through computer modems, into the computer BBS scene.
  187.  
  188. So to an extent Lenslok can help document protection, as a lens is not easily
  189. copied by your average computer hobbyist. So even though a copy of the
  190. documention is made, how are we to know what exactly it (the software),
  191. is asking us for?
  192.  
  193. All together now, _ALL_ protection schemes developed now, can be broken, may it
  194. be, Lenslok, dongles, disk-based protection schemes. This is due to the reason
  195. that all protection schemes have to use some sort of software that will `test',
  196. and decide if this is an authorised copy or not. The fact of the matter is,
  197. that their is a terrible weak spot. Software protectors have developed
  198. _amazing_ protection schemes, the `front' of the protection is almost
  199. unbreakable. Emagine a castle in medival times, with a moat around the castle,
  200. the moat contains deadly man-eating animals, the front of the castle also have
  201. men waiting with boiling oil to throw over you, there is also several men with
  202. bows and arrows awaiting to kill you. Now, how effective is this, if somebody
  203. leaves the back gate unlocked? Sure, it may be nearly impossible to get through
  204. by the front, but the back gate is unguarded. The same applies for copy-
  205. protection, whereby the fact of the matter is, that nobody has done anything
  206. about low-level entry! Anyone capable of 80x86 structure assemble language,
  207. can by-pass a copy-protection. The only problem is finding the routine, this
  208. is a challenge within itself, it is rarely a just a CMP command. For some
  209. reason NPC members think that CMP is all there is to look for! Aren't they
  210. acomplished crackers?
  211.  
  212. Cracking involves alot of time, extreme knowledge on the 80x86, and a few
  213. tricks of the trade. If a document check awaits you to type an answer, you
  214. will need to set a break-point at that exact location. Ctrl-Break, will
  215. _rarely_ work, so you will have to make tools of your own, that will allow you
  216. to exit at the desired location. Protected software usually overwrite the
  217. Int 3h, and Int 1h, to avoid break-points, you will have to devise your own
  218. Break-point type program, perhaps one hooked to Int 9h, and at ALT-A it will
  219. execute a Int 3h, and at the same time you will enter your debugger entry
  220. point back to Int 3h. I would hook my TSR to Int 5h and on Print-Scrn it
  221. would load the debugger. Many times, you would have to put a special routine
  222. on Int 8h or 1Ch to make sure that your entry point is not erased at the
  223. vector table, there's an unlimited number of possible combinations, I certainly
  224. cannot name you them all. But what I can do, is give you the theory concept of
  225. the protection scheme, and you can devise your own pleasable method. Many,
  226. people enjoy reverse engneering jobs, some (like myself) take note of all
  227. systems I/Os and Interrupts being called, and work my break-point from there.
  228.  
  229. But this two-part article was to give you an understanding on how some copy-
  230. protection schemes work. The _only_ way one can attempt to defeat the
  231. protection is to understand how the protection works. Then your attempts to
  232. bypass it will be much more effective, rather than taking a non-effective
  233. guess. Be direct, go directly to the source of the conflict, don't waste
  234. your time on anything else. So I do hope this has been a learning experience
  235. for at least some. If demand is there, in the following news journal we may
  236. focus on effective cracking techniques, and some tricks and tips to avoid
  237. falling into a ditch.
  238.  
  239.                                 Rock Steady/NuKE
  240. ==============================================================================