Cracker Handbook 1.0 part 175 pdf

6 217 1
Cracker Handbook 1.0 part 175 pdf

Đang tải... (xem toàn văn)

Thông tin tài liệu

003D701E B9 10270000 MOV ECX,2710 003D7023 F7F1 DIV ECX 003D7025 8985 40C1FFFF MOV DWORD PTR SS:[EBP-3EC0],EAX 003D702B 8B85 E0C6FFFF MOV EAX,DWORD PTR SS:[EBP-3920] 003D7031 8B00 MOV EAX,DWORD PTR DS:[EAX] 003D7033 8985 44C1FFFF MOV DWORD PTR SS:[EBP-3EBC],EAX 003D7039 8B85 40C1FFFF MOV EAX,DWORD PTR SS:[EBP-3EC0] 003D703F 8D0485 04000000 LEA EAX,DWORD PTR DS:[EAX*4+4] 003D7046 50 PUSH EAX 003D7047 8B85 E0C6FFFF MOV EAX,DWORD PTR SS:[EBP-3920] 003D704D 83C0 04 ADD EAX,4 003D7050 50 PUSH EAX 003D7051 FFB5 E0C6FFFF PUSH DWORD PTR SS:[EBP-3920] 003D7057 FF15 FCF23D00 CALL DWORD PTR DS:[3DF2FC] ; msvcrt.memmove 003D705D 83C4 0C ADD ESP,0C 003D7060 8B85 40C1FFFF MOV EAX,DWORD PTR SS:[EBP-3EC0] 003D7066 8B8D E0C6FFFF MOV ECX,DWORD PTR SS:[EBP-3920] 003D706C 8B95 44C1FFFF MOV EDX,DWORD PTR SS:[EBP-3EBC] 003D7072 891481 MOV DWORD PTR DS:[ECX+EAX*4],EDX 003D7075 ^E9 47FFFFFF JMP 003D6FC1 003D707A FFB5 44C8FFFF PUSH DWORD PTR SS:[EBP-37BC] 003D7080 E8 5FA2FDFF CALL 003B12E4 The first mark is where the base is taken, this direction already we must have it written down, the second mark is where on finishes the curl of the IAT we put a Breakpoint Hardware execution in that line and we give a F9 Mark đầu tiên là nơi lấy giá trị Base, chỉ thị này chúng ta cần viết lại để nhớ(003D702B), mark thứ 2 là kết thúc vòng lặp IAT, chúng ta sẽ put Breakpoint Hardware execution ở dòng đó( mark thứ 2) và nhấn F9 It stops in the direction 003D707A that is the aim of the curl, in the Dump of the Olly we go to the memory direction of which points ECX that in my case is 00F81478 and we will see Nó sẽ stop tại 003D707A, và kết thúc vòng lặp, Trong cửa sổ Dump của Olly chúng ta goto đến vùng memory trỏ trong ECX, trong case của tui là 00F81478, và chúng ta sẽ thấy 00F81478 8C B7 E5 77 D9 55 D1 77 Œ·åwÙUÑw 00F81480 24 04 E5 77 5E 19 D3 77 $ åw^Ów 00F81488 20 50 D2 77 25 74 32 77 PÒw%t2w 00F81490 2F 86 D2 77 4B 2F E5 77 /†ÒwK/åw 00F81498 BC 1B E4 77 0D 0D D4 77 ¼äw Ôw 00F814A0 EE 63 C4 77 4B 17 0F 77 îcÄwKw 00F814A8 A0 35 00 10 F3 0C D4 77 5.ó.Ôw 00F814B0 4C 6E D2 77 03 6E D2 77 LnÒw nÒw 00F814B8 25 6E D2 77 65 3F C5 77 %nÒwe?Åw Therefore 00F81478 is the beginning of our IAT, now we see where it finishes, we lower until arriving a Vì vậy 00F81478 là addr bắt đầu của IAT chúng ta, bây giờ chúng ta tìm vùng kết thúc của nó , chúng ta dò xuống cho đến : 00F82160 E5 4D E5 77 6D AE 3B 00 åMåwm®;. 00F82168 3A F1 E5 77 A9 2B C4 77 :ñåw©+Äw 00F82170 1C AE 3B 00 AB AB AB AB ®;.«««« 00F82178 AB AB AB AB EE FE EE FE ««««îþîþ The end of the table is 00F82170 of this we concluded that Cuối table là addr 00F82170 , chúng ta kết luận như sau: Final - Inicio = tamaño 00F82170 - 00F81478 = CF8 Now we open the ImpRec, we select to the process uedit32.exe and we put the data Bây giờ, open ImpRec, chúng ta chọn process uedit32.exe và put dữ liệu vào : VA - Base = RVA RVA: 00F81478 – 00400000 = 00B81478 Size: CF8 The OEP does not matter, gives Get Imports, gives Save Tree and kept the file like IAT 1.txt, without closing the ImpRec we publish the file that we finished creating and we look for the text chain ` ntdll'>, ours first occurrence will be in OEP ko cần thiết phải nhập vào, nhấn Get Imports, nhấn Save Tree và save file là IAT 1.txt , ko đóng ImpRec, chúng ta mở file text và dò tìm ‘ntdll’ , dòng tìm thấy đầu tiên trong file là : 1 00B815E4 ntdll.dll 0192 RtlAllocateHeap This entrance did not work in Win98 for obvious reasons reason why it is necessary to redirigir it, in the ImpRec we looked for the entrance we give double click him, we chose I modulate kernel32.dll and we chose the API HeapAlloc, with which it was Thành phần này ko làm việc trong môi trường win98, đó là lý do tại sao cần thiết phải redirect (định lại addr ) lại nó, trong ImpRec, chúng ta tìm thành phần này và double click vào nó, chúng ta chọn module kernel32.dll và chọn API HeapAlloc, nó sẽ là : 1 00B815E4 kernel32.dll 01FC HeapAlloc It is necessary to correct all the entrances that aim at ntdll, all these are Cần thiết phải correct (làm cho hơp lệ lại, hay đúng lại) tất cả các thành phần hướng đến module ‘ntdll’, tất cả chúng là (trong case của tác giả là như sau, còn người dịch là khác): # line 121 * 1 00B815E4 ntdll.dll 0192 RtlAllocateHeap * 1 00B815E4 kernel32.dll 01FC HeapAlloc 156 * 1 00B81670 ntdll.dll 031B RtlSizeHeap * 1 00B81670 kernel32.dll 0208 HeapSize 173 * 1 00B816B4 ntdll.dll 0343 RtlUnwind * 1 00B816B4 kernel32.dll 02BE RtlUnwind 346 * 1 00B81968 ntdll.dll 02A5 RtlLeaveCriticalSection * 1 00B81968 kernel32.dll 023A LeaveCriticalSection 362 * 1 00B819A8 ntdll.dll 02F5 RtlRestoreLastWin32Error * 1 00B819A8 kernel32.dll 030D SetLastError 477 * 1 00B81B74 ntdll.dll 02E7 RtlReAllocateHeap * 1 00B81B74 kernel32.dll 0206 HeapReAlloc 598 * 1 00B81D58 ntdll.dll 0210 RtlEnterCriticalSection * 1 00B81D58 kernel32.dll 0090 EnterCriticalSection 644 * 1 00B81E10 ntdll.dll 0256 RtlGetLastWin32Error * 1 00B81E10 kernel32.dll 0162 GetLastError 709 * 1 00B81F14 ntdll.dll 01EB RtlDeleteCriticalSection * 1 00B81F14 kernel32.dll 007B DeleteCriticalSection Once corrected these we give Save Tree and we keep the IAT like IAT Scram OK.txt, now already we can close the ImpRec and erase file IAT 1.txt Sau khi corrected chúng xong, chúng ta save Tree và lưu lại IAT với tên file là IAT Scram OK.txt. Bây giờ chúng ta đóng ImpRec và xóa file IAT1.txt Of return in the Olly we erase the Breakpoint Hardware which we put at the end of the curl of the IAT, now we put a Breakpoint Hardware on execution in the direction where the zone for the redireccionamiento is taken from the calls to the APIs of ours app, this direction already we have it written down and is 003D702B Quay trở lại Olly chúng ta xóa Breakpoint Hardware mà chúng ta put ( đặt) tại cuối vòng lặp của IAT, bây giờ put Breakpoint Hardware on execution tại direction(chỉ thị) mà ở đó là vùng redirection được lấy từ các hàm calls gọi hàm APIs của ứng dụng chúng ta, chỉ thị này đã biết mà chúng ta đã viết lưu lại ở bước trên, đó là 003D702B (direction mà take Base lần đầu tiên) We closed the Olly, we return it to open, we loaded ours app, we hide dbg, we give F9 and stops in Chúng ta close Olly, chúng ta quay trở lại mở nó , chúng ta load ứng dụng, hide dbg, chúng ta nhấn F9 và dừng lại tại đây 003D7023 F7F1 DIV ECX 003D7025 8985 40C1FFFF MOV DWORD PTR SS:[EBP-3EC0],EAX 003D702B 8B85 E0C6FFFF MOV EAX,DWORD PTR SS:[EBP-3920] 003D7031 8B00 MOV EAX,DWORD PTR DS:[EAX] 003D7033 8985 44C1FFFF MOV DWORD PTR SS:[EBP-3EBC],EAX In the Dump we go to the Ebp-3920 zone and we will see Trong Dump chúng ta goto đến EBP-3920 và sẽ thấy 00129538 40 14 F8 00 00 E0 15 00 @ø à. 00129540 75 46 00 00 E8 EF EA 00 uF èïê. That is the base of the IAT 00F81440, now is necessary to change that base so that it points at a zone within the memory of ours app, in the personnel pleases to me to use one of the sections of the Armadillo, we look for one in the Memory Map Đó là base của IAT 00F81440, Bây giờ cần thiết thay đổi base vì vậy nó trỏ đến 1 vùng trong memory của ứng dụng chúng ta, tôi thật thích thú khi sử dụng một trong các sections của Armadillo, chúng ta tìm thấy một section của nó trong Memory Map Memory map Address Size Owner Section Contains Type Access Initial 00400000 00001000 uedit32 PE header Imag R RWE 00401000 0015D000 uedit32 .text Imag R RWE 0055E000 00039000 uedit32 .rdata Imag R RWE 00597000 0004A000 uedit32 .data Imag R RWE 005E1000 00001000 uedit32 .SHARED data Imag R RWE 005E2000 00030000 uedit32 .text1 code Imag R RWE . 00 400 000 00 0 01 0 00 uedit32 PE header Imag R RWE 00 4 01 0 00 0 015 D 000 uedit32 .text Imag R RWE 00 55E 000 00 03 900 0 uedit32 .rdata Imag R RWE 00 59 700 0 00 04A 000 uedit32 .data Imag R RWE 00 5E 100 0 00 0 01 0 00 . 00 3D 701 E B9 10 2 700 00 MOV ECX,2 7 10 00 3D 702 3 F7F1 DIV ECX 00 3D 702 5 8985 40C1FFFF MOV DWORD PTR SS:[EBP-3EC0],EAX 00 3D 702 B 8B85 E0C6FFFF MOV EAX,DWORD PTR SS:[EBP-39 20] 00 3D 70 31 8B 00 MOV. 12 1 * 1 00 B 815 E4 ntdll.dll 01 9 2 RtlAllocateHeap * 1 00 B 815 E4 kernel32.dll 01 FC HeapAlloc 15 6 * 1 00 B 816 70 ntdll.dll 03 1B RtlSizeHeap * 1 00 B 816 70 kernel32.dll 02 08 HeapSize 17 3 * 1

Ngày đăng: 03/07/2014, 17:21

Tài liệu cùng người dùng

Tài liệu liên quan