home *** CD-ROM | disk | FTP | other *** search
-
- The complete solution of UCF crackme2
-
- (c) 1999 Ak Kort [SOS group]
-
-
- Step 1. Decrypting.
- ~~~~~~~~~~~~~~~~~~~
-
- Decrypting procedure uses 256-byte key, which answers on
- interrupt 3F and looks like simple dongle.
-
- I spent much time on analisys decrypting procedure in a
- tries of finding holes in crypting or the way of fast
- reversing. In a real that thing is practically unneeded.
- Also there is no needs to search key recursively as
- i did once in a sober foolish head...
-
- Look in a following fragment of cipher:
-
- 000000B0: D1 00 6D D9│6D 6D 6D 6D│2E 3F B8 DA│17 B4 50 09 ╤.m┘mmmm.?╕┌.┤P.
-
- There are 4 identical bytes. Doesn't looks like coincidence.
- Look at the decrypting formula:
-
- Text[i+2]=Crypt[i+2] xor Key[Text[i]]
-
- In other words, odd and even bytes are crypted independently and
- decrypting mask for the current byte is the byte from table
- indexed by previous decoded byte.
-
- Well, what is the meaning of that 4 bytes? It means, that there
- are 6 identical bytes. First two bytes are crypted by previous
- bytes and we cannot resolve crypting mask. But we can get
- next two bytes if we gues several logical cases. 6 identical
- bytes can be zero, spaces and border symbols like '═' or so.
- Other cases seem to be mostly unreal.
-
- Lets assume that they are zeros. Then the mask of decrypting
- followed bytes is 6D 6D. Check it:
-
- 2E 3F xor 6D 6D = 43 52 = 'CR'
-
- Looks like true. it can be CRACKER, CRACKED, CRACKME and so on.
-
- But if they are spaces then mask will be 6D 6D xor 20 20 = 4D 4D,
- and crypted text will be:
-
- 2E 3F xor 4D 4D = 63 72 = 'cr'
-
- Matches too. What of that cases we can select? Lets check another
- fragment:
-
- 00000110: 55 A2 A6 8C│AB 58 6D 6D│FB 5D 4E 94│83 05 E9 33 Uóªî½Xmm√]Nöâ.Θ3
-
- There are again two identical bytes 6D 6D. Lets decrypt the followed
- bytes:
-
- FB 5D xor 6D 6D = 96 30
-
- At this time every real cracker should spring up from chair,
- clear his eyes, convulsively swallow a beer and scratch his head.
- Cose every real cracker knows, that bytes 00 00 96 30 seems to be
- in a CRC32 calculation table.
-
- Check our idea - programm STEP-1\DECODE.BAS
- First it builds 256-byte table using file CRC32.DAT as a plain text.
- Then it decodes whole file into OK.COM. Let me skip other comments,
- i think this programm whould be clean for every schoolchild, who
- finished 3 monthes of programming course.
-
- Fluently look on OK.COM and satisfy youself that we had a right idea.
-
-
- Step 2. Searching of keyfile.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- After decrypting programm needs a keyfile, wich contains
- username. Before decoding this name programm check checksum
- of file by the following way:
-
- 0000002B: B90001 mov cx,0100
- 0000002E: BE4906 mov si,0649
- 00000031: E8E004 call 00000514
- 00000034: 66A3B201 mov [01B2],eax
-
- There is crc32 calculation using that table wich help us
- to dectypt code.
-
- Next, there are 0FD iterations at the same text, wich use
- crc32 as a starting value for cipher:
-
- 00000038: B9FD00 mov cx,00FD
- 0000003B: BE4906 mov si,0649
- 0000003E: 668B1EB201 mov ebx,dword ptr [01B2]
- 00000043: 51 push cx
- 00000044: AC lodsb al,ds:[si]
- 00000045: 0FBEC8 movsx cx,al
- 00000048: AD lodsw ax,ds:[si]
- 00000049: F7E1 mul cx
- 0000004B: 8A0C mov cl,byte ptr [si]
- 0000004D: 66D3C0 rol eax,cl
- 00000050: 6633D8 xor ebx,eax
- 00000053: 51 push cx
- 00000054: 0FBEC8 movsx cx,al
- 00000057: 66D3C3 rol ebx,cl
- 0000005A: 59 pop cx
- 0000005B: 66F7D0 not eax
- 0000005E: E2ED loop 0000004D
- 00000060: 59 pop cx
- 00000061: 83EE02 sub si,0002
- 00000064: E2DD loop 00000043
- 00000066: 6681FB4EC29EA6 cmp ebx,A69EC24E
-
- Comparing ebx and A69EC24E is a chechsum of keyfile. Looking
- on programm under debugger we can see that this fragment a
- quite slow and brute force on whole 256-byte file is an extremelly
- long task.
-
- But we can see, that if we fill keyfile with zeros and geting crc32
- also as 0, then on each iteration ebx is equal to 0.
- It is very usefull for search - it is enought to change one
- dword as a counter and fix last dword to fit crc32 to 0.
- Then we will don't needed to perform all 0FD iterations
- but only last 8 for changed bytes.
-
- But that algorithm will search 256 variants in a 3 seconds or
- about 15 minutes for 65536. It is easy to calucate that it will
- take more than year to search 2^32 variants. But if we use
- several hundreds computers this time will a quite short.
- That way of attack was performed in a last days of Dec 1998.
- Unfortunatly, the way of distributing packets for search
- was'n automatical and i have to send them by hands, that quite
- hamper search.
-
- So, under unstopped critic of Mikhail Kondakov I perform
- second way to reverse the sum. As I notice sometimes, my
- drunk condition intensifies my cracking skills so I can
- crack very hard things. So one day I've returned to home
- and start the assembler...
-
-
- Step 3. How to find a keyfile rather fast.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- We can notice, that the time of sum's calculation is proportional
- to bytes in keyfile. So, to minimize this time we need to
- minimize the value of bytes in files. First we should not use
- crc32 fittingm this free us from big interval of values but
- we'll have to calculate crc32 on every step and use this
- new value from begining of iterations.
-
- But we can change only last 8 bytes of file and leave 248 bytes
- unchanged, it allow us to precaluclate crc32 for the first 248
- bytes and calculate only the rest of file on each iteration.
-
- Second, look at this optimized part of cipher:
-
- lea si, Key
- mov ebx, crc32
- mov eax, crc32
- REPT 0FDh
- movsx cl,[si]
- mov ax,[si+1]
- inc si
- mul cx
- mov cl,[si+2]
- @@1: rol eax,cl
- xor ebx,eax
- rol ebx,al <- there is no such command,
- it is just for undertanding
- not eax
- loop @@1
- ENDM
-
- Now it is more understandable. This algorithm needs only 4 bytes
- from keyfile and 2 (!) high bytes from eax. After all iterations
- this cipher may be represented as:
-
- rol ebx, X
- xor ebx, Y
-
- It is quite simple to check, that X and Y depend only on high
- word of eax and keyfile but does not depend of ebx.
- So if we use static part of key we can precalulate all 65536
- cases of eax and change this very slow algorithm by the
- table. This speed up our search more than 200 times.
- X takes 1 byte, Y takes 4 bytes, so we need 5*65536=327680 bytes,
- wich fits on DOS memory.
-
- Third improovement is that we don't search bytes in a 0-255
- interval but in 1-16 so we getting rid of corner very slow cases.
-
- Using this three point we write CRACK.ASM, wich find the key
- in a several hours.
- Also there is 32-bit DOS4GW version wich about 20% faster but
- needs several files from Watcom C for compiling.
-
-
- Step 4. Resident dongle emulator.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Having decoding table it is easy to write emulator.
- I have two version of programm wich are different only
- by the number of interrupt - 3F and FD, so our emulator
- will answer on both of them.
-
- Step 5. Writting keygenerator.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- After we find the forst 256 bytes of keyfile it is very
- easy to encrypt username by the following algorithm:
-
- 00000066: 6681FB4EC29EA6 cmp ebx,A69EC24E
- 0000006D: 752F jnz 0000009E
- 00000071: BE4906 mov si,0649
- 00000074: 81C60001 add si,0100
- 00000078: 56 push si
- 00000079: 1E push ds
- 0000007A: 07 pop es
- 0000007B: 8BFE mov di,si
- 0000007D: B90800 mov cx,0008
- 00000080: 66AD lodsd eax,ds:[si]
- 00000082: 6633C3 xor eax,ebx
- 00000085: 66D1C3 rol ebx,1
- 00000088: 66AB stosd es:[di],eax
- 0000008A: E2F4 loop 00000080
-
- Very easy and takes about 3 minutes. Source is in STEP-5 directory,
- also there is the valid keyfile.
-
-
-
-
- Thanks and greetings.
- ~~~~~~~~~~~~~~~~~~~~~
-
- Mikhail Kondakov (mikhail_kondakov@usa.net) found another fast
- way for searching keyfile. I was too lazy to resolve algorithm
- of search by the right file and cann't figure wich case is
- better, but I think you should look at his keyfile in
- a STEP-X directory.
-
- Also I wish thank the following people for help me with a
- brute force by the first variant and give me some good
- ideas and help:
-
- A.D. Smolenkov, sad@metib.ru
- ATS, 2:5049/69
- Alecs Kuznetsov (Dark1st), Dark1st@dialup.ptt.ru
- Alek Akhmatov, 2:5005/28.3
- Aleksey A Pestunovich, 2:5015/111
- Aleksey Larioncev, 2:5020/1531.5
- Aleksey Timofeyev, 2:4600/96.2
- Alex Devyatykh, 2:5004/530.3
- Alex Johnson, 2:5030/181.141
- Alex Kreshchuk, 2:5063/10.58
- Alex Kuriatnikov, 2:5020/617.3
- Alex Ostapenko, 2:5020/685.21
- Alex Rozov, 2:5011/60
- Alex Shupikov, 2:5040/61.13
- Alex Stepanov, 2:5025/2.122
- Alex V.Gribov, 2:5011/45.13
- Alexander A.Kuznetsov, 2:5054/28.12
- Alexander Hokhlov, 2:5025/38.201
- Alexander Kobrin, 2:5020/620.13, awk666@mail.ru
- Alexander Kozlov, 2:5093/11
- Alexander Moukhortov, alem@datacom.ru
- Alexander Novikov, 2:450/9.25
- Alexander Onishchenko, 2:463/586.34
- Alexander S.Bulochnikov, jessbul@chat.ru
- Alexander Smok, 2:452/999.2
- Alexander Soutchkov, 2:5011/66.16
- Alexander Sukhochov, 2:5030/638.15
- Alexander Volok, 2:464/130.14, alexv@invest.ui.dp.ua
- Alexander Wischnewski, benwisch@rhoen.de
- Alexander Zolotnikov, 2:453/7.8
- Alexandr Demidneko aka CodeGlider, 2:5077/22.10, codeglider@chat.ru
- Alexandr Orlenko (Eagle), 2:5079/30.37, eagle@kuun.surgutneftegas.ru
- Alexandr Pikunow, 2:5022/27.40
- Alexey Andreev, 2:5030/142.65
- Alexey Barylnikov aka 1exa, 2:5000/72.42
- Alexey Chukanov, 2:5070/136.15
- Alexey Dobriaev, 2:5020/1822.75
- Alexey Kulinich, 2:5005/26.48
- Alexey Saenko, 2:5011/50.11
- Alexey Uzikov, 2:5011/66.9
- Alexx Valikov, 2:5011/34
- Alvils Pierhurovichs, 2:51/10
- Alvils, Alvils@inta.cs.llu.lv
- Anatoly Shishkoff AKA Shturman, 2:5020/390.12
- Ander Vill, 2:5080/500.333
- Andrew Lebedenko, 2:5061/4
- Andrew Petrov, 2:5020/993.139
- Andrew Shipinsky, ASh@tofmal.tambov.su
- Andrey Baramzin, 2:5056/40.12
- Andrey Bublikov, 2:5030/752.24
- Andrey Grishin, 2:5020/989.19
- Andrey Ivankov, Lotos@primorsky.ru
- Andrey Nikitin, 2:4642/19.33
- Andrey Novikoff, 2:5030/743.31
- Andrey Smolenkov, sad@metall.metib.ru
- Andriey Korzhun, 2:5020/1662
- Andy Malyshev, 2:5020/362.55, andy_m@iname.com, http://i.am/crk
- Andy Sadovnik, 2:5030/610
- Anthony Repin, 2:5020/753.6
- Anton A. Arapov, 2:5045/27.39
- Anton Fedorov, 2:5000/111.27
- Anton Mineev, 2:5011/53
- Anton Morozov, 2:5020/1355.22
- Anton Shmigel, 2:5050/15.22
- Arkadiy Kapustinskiy (kab), 2:5000/33
- Armen Stepanian, 2:5022/83
- Art Snaker
- Artem, 2:5030/525.62
- Artur Hairullin, 2:5011/45.15
- Boris A. Lozovsky, corwin@corbina.ru
- Boris Tcherkashin, 2:5080/65.13
- Bulat Kutov, 2:5011/41
- Constantine Vetlov, 2:5020/995
- DAO, dao@surnet.ru
- DK, damonk@usa.net
- DaRk dEAMon, 2:463/9797.57
- Denis Andrianov, 2:5010/120
- Denis Kozlov, 2:5012/15.26
- Denis Lebedev, 2:450/83.4
- Denis Litvinov, 2:5080/60.16
- Denis Mingulov, 2:5004/35.16
- Denis Ozerov, 2:5030/649.34
- Denis S. Kotov aka Deniska, ds_kotov@quake.ru
- Denis Zwerew, 2:5030/521
- Dmitriy Polyakov, 2:463/308.22
- Dmitry Bragin, 2:5011/79
- Dmitry Deniskin, 2:5020/1294.12
- Dmitry Dudarev, dudarev@lbp.lutsk.ua
- Dmitry Nikolaev, 2:5011/22.8
- Dmitry Novak, 2:5020/1432.445
- Dmitry Ostroushko, 2:5036/9.29
- Dmitry Sapojnikov, 2:5066/13.9
- Dmitry Shilin, 2:5020/150.23
- Dmitry Shumsky, 2:5023/11.54
- Dmitry Sokolov, 2:5077/25
- Edward Zinatullin, 2:5011/59.26
- Eliseev Victor A., 2:5020/718.3
- Eugene Konovalov, 2:5055/30.30
- Eugene Morozov, 2:5020/1437.7
- Eugene Nikolaev, ruchij@chat.ru
- Eugene Radyuk, 2:5077/24
- Eugene Shepelev, 2:5020/294.32
- Eugene Yurchik, 2:5010/126.37
- Eugeny Starikov, 2:464/500
- Evgeniy Skidan, 2:4521/2.18
- Evgeny Malyshev, 2:5011/13.14
- Expert of Nothing, http://www.chat.ru/~stking
- Gevorck Madzharyan, 2:5057/43
- Grigory Berezowsky, gri@irk.ru
- HaCkMAN AKA Vladimir Frolov, 2:5078/15.7
- Igor Derevenskyh, 2:5080/97.26
- Igor Kovalenko, 2:463/563
- Igor Latyshev, 2:5045/34.20
- Ivan Elin, 2:5011/89
- Ivan Redkin, 2:5011/78
- Jaffar, 2:4666/13
- Jura Marichev, 2:5011/62.19
- KPNC, uspenka@armavir.da.ru
- Kirill Silaev, kir@mail.lanck.net
- Konstantin Isakov, 2:5000/111.29, konstantin.isakov@usa.net, www.nsk.su/~bcompany
- Konstantin Norvatoff, 2:5030/163.44
- Kosh, 2:5020/1286.9
- Max Dukov, 2:5030/413.15
- Max Litvinenko, 2:5011/85
- Maxim Kovtun, 2:5020/1175.23
- Maxim Stafeev, 2:5080/157.7
- Maxim Zykov, max@eml.ee
- Mega G. Baitoff, 2:5011/60.16
- MegaBit, kostya@st.simbirsk.su
- Mickel Glumov, 2:5061/15.46
- Mihail Filichkin, 2:4631/14.1
- Mihail Karasev, 2:5095/34
- Mihail Voidenko, 2:5022/19.56
- Mikhail Vlasov, 2:5011/22.18
- Misha Myasnikov, 2:450/137.21
- Murad Urmancheev, 2:5085/1.101
- Nicholas Mednov, 2:5011/68
- Nick Klochkov, 2:463/253.222
- Nicky Shubeykin, 2:469/43.33
- Nikita Shvetsov, 2:5096/11
- Nikita Zolotarev, 2:5030/789.666
- Nikolai Lobezki, 2:5030/450.23
- Nikolay Mikolenko, 2:4642/1111
- OFF (Andrew Velder), 2:5010/146.111, off@fido.tu-chel.ac.ru
- OffSpEEd, offspeed@mail.primorye.ru
- Oleg Akulov, 2:5002/45.36
- Oleg Bashlykov (Olejonok), Olejonok@RussiaMail.Com
- Oleg Boshkov, 2:467/73
- Oleg Gatcenko, 2:464/207.9
- Oleg Krivoshatkin, 2:5067/3.1
- Oleg Loa, olegloa@chat.ru
- Oleg Pashko, 2:4657/9
- Oleg Sharipov, 2:5011/42.33
- Ostroushko Dmitry, RatNat@lipetsk.ru
- Pasha Soumartchenkov, 2:5057/36.7
- Pavel Chernov, 2:5057/10.30
- Pavel Dovgalenko, The CHEMIST, 2:5071/17.9, pdovgalenko@usa.net
- Pavel Piganov, 2:5057/25.18
- Pavel Shklovsky, 2:5011/18
- Peter Evdokimov, 2:5011/250, peterb@chat.ru, www.chat.ru/~peterb
- Ramil Garipov, 2:5011/27.11, 2:5011/36.106, ramil@mail.ru
- Roman Khomchenko, 2:5040/57.27
- Ruslan Sokolnikov, galateo@chat.ru
- R├\inMaN, pavel@omsk.edu, http://fido.omsk.edu/~rainman
- SWW aka Slava Rusakov, 2:5030/175.76
- Saboteur, saboteur@biocon.kiev.ua
- Sasha Mkrt, mkrt@tnet.sochi.net
- Serg Agarkoff, 2:5041/1
- Serg Sidorov, 2:4655/3.66
- Serge Kontarev, 2:5020/53.22
- Serge Lazo, lazo@postman.ru
- Sergei Seperovitch, 2:5020/1133
- Sergey E. Tikhonenko, expert@chat.ru
- Sergey Guculiak, 2:5011/51
- Sergey Isakov, 2:5080/105.7
- Sergey Korenivskiy, 2:5020/239.9
- Sergey Korowkin, 2:5033/27
- Sergey M Litvinov, 2:4600/126.33
- Sergey Potashev, 2:5003/70, potashev@komi.parma.ru
- Sergey Safarov, 2:451/2.22
- Sergey Shliakhota, sersh@bmz.gomel.by
- Serzh Shumikhin, 2:5004/18.8
- Seva Goncharov, 2:5080/31.20
- Shaman //UCL
- Shurik Mudrak, 2:5011/45.14
- Sirosh Evgeni, 2:5036/5.2
- Slava Vvedensky, 2:5004/32.24
- Sonic Mike, 2:50/520.4
- Sp0Raw //[rAN] //[dTG], 2:5030/664.409, 345:817/2, sp0raw@hoTMAIL.COM
- Sp0t //UCL
- Spetznaz, Spetznaz@chat.ru
- Stas Schekin, 2:5025/150.49
- System brain, 2:5011/87.2, sem@ufanet.ru
- Tim Komyakov, 2:5080/78.2
- Timur Kulmukhametov /Drago73, 2:5011/73
- Vadim Gromov, 2:5030/614.111
- Vadim Samoilov, 2:5003/34.15
- Valentin Varenik, 2:4642/3.31
- Valera Gavrilovets, 2:5030/389.7
- Valeri Bourak, 2:450/107
- Valery Shabaev, 2:5077/60
- Valery V. Bastrikov, 2:5011/27.18
- Victor Zamoulko, 2:4521/4
- Vilen Kamalov, 2:5085/44.7
- Vinkov Alexander, 2:5053/20.30
- Vitaly V Bochkaryov, 2:5090/28.111
- Vizit0r //UCL
- Vlad Bikkulov, 2:5011/36.105
- Vlad Mogilevsky, 2:5020/118.75
- Vladimir Eremin, 2:5020/1626.78
- Vladimir Kozlov, 2:5002/45.11
- Vladimir Sadvinsky, 2:5049/36.24
- Vladimir Timonin, 2:5023/11.44
- Vladimir Zaytcev, 2:5015/116
- Vladislav Bulochnikov, 2:5037/12.39
- Vladislav Zlobin, 2:5011/79.33
- Vsevolod Sokovikov, 2:5004/33.12
- Vyacheslav V Garonin, 2:465/167
- Wowik Mikolenko, 2:5031/1.23
- Xak, xak@ipc.ru, xak.ipc.ru
- Yaroslav Pecheritsa, 2:4635/34.19
- Yaroslav Sverdlikov, 2:450/84.54
- Yura Kropelnytskiy, 2:4623/55
- Yura Tkachenko, 2:5030/655.31, Yura.Tkachenko@iname.com
- Yura V. Zaburdaev, 2:450/134.8
- Yuriy Limakov, 2:5062/1.15
- Yuriy Macintosh, 2:5020/1469.777
- Zdanevich Alexander, 2:5020/755.35
- Zerg, 2:5080/130.11
- alex ivanov, 2:5030/773
- andrew karimov (the doctor), 2:4641/223.3
- andyst, andyst@chat.ru
- artp_s@hippo.ru
- blshkv
- geront, geront@sbtx.tmn.ru
- gleb@mednet.md
- hijaq, 2:5030/460.2
- joker, 2:4666/10.21
- kir@mail.lanck.net
- max a sazonoff, 2:5004/32.17
- pfk@forfree.at
- vlad-fish@usa.net
-
- And many others who wish to stay anonymous ;)
-
- Copyright
- ~~~~~~~~~
- (c) 25 Jan 1999 Ak Kort [SOS group]
- http://www.sos.nanko.ru
- e-mail: sos@russiamail.com
- FiDo: 2:5011/45
-