0day in {REA_TEAM}

Basic of Reversing by c0lo!! December 23, 2009

Filed under: Basic of Reversing by c0lo!!, Other Tutorials — kienmanowar @ 6:35 am

Overview


I posted this at GzN since a lot of people had no idea about reversing so hopefully this well help them start out and maybe it’ll help some of you guys too. This article will cover most of what you need to know to get started in reverse engineering. I will assume you know pretty much nothing so if you see a bit you already know heaps about, just go onto the next bit. I have posted my crap over here as well because this is 1 more forum that I recognise as a place where people want to learn. Somewhere where the attitude isn’t just leech to get the hack working but find out how to make your own hack and why the hack works. As I always say Hack to learn, don’t learn to hack.

Download here:

http://www.mediafire.com/download.php?mkmnymntjkz

Best Regards
m4n0w4r

 

REVERSING GENERALS – PART III April 29, 2009

Filed under: Other Tutorials, REVERSING GENERALS – PART III — kienmanowar @ 8:03 am

REVERSING GENERALS – PART 3
Dịch : Benina

TỔNG QUAN VỀ ĐẢO MÃ – PHẦN 3

Case

Đây cũng là đọan code trong Opera 3.62. Nó chọn lựa những trang help nào hiển thị trong browser. Tôi lướt qua đọan code này một cách ngẫu nhiên, nhưng nó là một ví dụ hữu ích cho lệnh switch/case. Trước khi bạn tìm hiểu về nó, tôi muốn bạn chú ý rằng , có
2 cách khác nhau trong phát biểu switch. Một là viết ra 1 chuổi các lệnh nhảy jump. Điều này tương đương với “if then sldif elseif ….end” và Một nữa là lọai mà Opera 3.62 sử dụng ở đây. Nó nhanh hơn lọai đã đề cập trước đó (lọai “if then sldif elseif ….end”). Ở
đây, chương trình tính tóan một một “điểm nhảy”(jumpmark) [4*eax+004932A3] đến code tương đương, thay vì đi qua mọi dòng line để check lệnh jump như lọai đầu tiên. Đây đơn giản chỉ là cách làm việc của code, bởi code có chiều dài giống nhau cho mọi
nhánh – 4 byte. Thông thường đây ko phải là case, vì bạn phải đề cập một chuổi các phát biểu “cmp jne” mà chúng tham chiếu đến lọai “if then elsif elsif elsif…end”. Bây giờ hảy xem đọan code sau:

:00493070 mov eax, dword ptr [ebp+10]; eax = Par1
:00493073 add eax, FFFFB1DD
; Par1 = Par1 – 20003d “look at stringrefs”
:00493078 cmp eax, 0000008A
; if eax smaller than 138d jump toindex.html
:0049307D ja 0049305E
:0049307F movzx eax, byte ptr [eax+00493357]
:00493086 jmp dword ptr [4*eax+004932A3]
; switch statement, calculate jumpmark

* Data Obj ->”keys.htm”
|
:0049308D push 0051DD58 ; a jumpmark
:00493092 jmp 00493063

* Data Obj ->”prefmenu.htm#print”
|
:00493094 push 005256B0 ; another jumpmark
:00493099 jmp 00493063

* Data Obj ->”dialogs.htm#direct”
|
:0049309B push 0052569C ; …
:004930A0 jmp 00493063

* Data Obj ->”prefmenu.htm#sethome”
|
:004930A2 push 00525684
:004930A7 jmp 00493063

* Data Obj ->”dialogs.htm#fileuplf”
|
:004930A9 push 0052566C
:004930AE jmp 00493063

* Data Obj ->”dialogs.htm#hotlist”
|
:004930B0 push 00525658
:004930B5 jmp 00493063

* Data Obj ->”dialogs.htm#locked”
|
:004930B7 push 00525644
:004930BC jmp 00493063
; and so on …


Các biến Global :

Trong phần lớn các chương trình có nhiều biến và hằng số mà chúng có khả năng truy xuất mọi lúc, mọi nơi. Đây ko phải là biến local, bởi chúng bị lọai bỏ sau khi hàm kết thúc. Vì vậy chúng (biến loacal) chỉ có thể truy xuất bới chính hàm của chúng. Các biến
có thể được truy xuất đến mọi lúc, mọi nơi được gọi là các biến global (biến tòan cục) (trái với local). Vì vậy một reverser sẽ phải chú ý “theo dõi” chúng, bởi chúng chứa các cờ flags giống như registrationflags (cờ cho biết soft đăng ký chưa), demoflags (cờ xác
định soft có phải là lọai demo hay FULL), trialdate (cờ xác định cho dùng thử, giới hạn tgian ) , …và các dữ liệu khác như tên chương trình, các tham số, …..Xác định các biến global có thể là một công việc khó. Tôi đã tìm hiểu có 2 cách Opera truy xuất các biến của nó. Một là dùng addr trực tiếp. Điều này có ý nghĩa là , nếu biến là 00543380 chương trình truy xuất đến nó bởi chính là số này (00543380)

direct mode: mov eax, dword prt [00543380]

Một cách khác nữa, nó có thể dùng mode addr liên quan. Bạn có thể thấy một ví dụ cho trường hợp này trong phần kế tiếp. Với mode này, chương trình truy xuất biến liên quan đến một “địa chỉ nền” (baseaddress). Base này được chứa trong một thanh ghi. Nếu bạn thấy vài thứ giống như vậy, thì nó là 1 lọai khó để xác định biến global. Nhưng vẫn có thể, bạn chỉ phải search giá trị của offset. Đừng rối với những thứ lọai này, nó sẽ “sáng sủa” hơn trong lần thứ 2 chương trình “chạm” đến nó. Nhìn vào ví dụ sau:

mov eax, [esi + 4EC]
|         |
base offset

Download toàn bộ bài viết:
reversing-generals_phan3

 

REVERSING-GENERALS (Phần II) April 29, 2009

Filed under: Other Tutorials, REVERSING-GENERALS (Phần II) — kienmanowar @ 7:56 am

REVERSING-GENERALS (Phần II)
Dịch: Benina

Phần 2
TỔNG QUAN VỀ ĐẢO MÃ

RETURN VALUE (giá trị trả về của hàm)

Nếu hàm trả về một giá trị, nó luôn trả về trên thanh ghi eax hay trong một tham số input nào đó. (nhập vào trước hàm) .Bạn sẽ thấy rằng thường thì nếu nó là tham số input, bằng cách kiểm tra nó ta thấy nó là addr hay một giá trị được cung cấp cho hàm call. Nếu nó là một giá trị, nó ko được chỉ định như một tham số , bạn cần chú ý nó sau này. Nếu nó là một addr, nó sẽ trỏ đến một string như ví dụ sau. Sau dĩ bạn sẽ thấy dòng kế của code miêu tả nó được sử dụng lại hay là ko. Trong phần lớn các case , bạn sẽ thấy nó được sử dụng lại một lần nữa (điều đó thật hiệu quả khi nhớ addr thật của nó). Bây giờ tui sẽ chỉ cho bạn một lập trình viên pascal với cách nhìn của anh ta khi create một hàm. Điều này sẽ làm khái niệm rỏ ràng trong sáng hơn. Ở đây là khai báo của một hàm:

function MyAdd(x, y :integer) : integer; // declaration
var erg: integer; // local var
begin
erg := x + y; // do the things
add := erg; // return value
end;

Đây là một hàm thông thường, nó chỉ cộng 2 số int, có 2 tham số, và một biến cục bộ được sử dụng tạm thời để gán cho giá trị trả về của hàm. ASM phải cần đến là di chuyển 2 tham số này ra khỏi stack khi hàm thực thi xong và nó phải nghịch đảo đầy đủ vùng nhớ cho biến cục bộ của hàm…Giống như đoạn mã này:

; *Pascal*
push ebx ; par1
push ecx ; par2
call MyAdd ; call the function
; in this example, the function restores the
stack (pascal)
mov …, eax ; returnvalue in eax

; *C*
push ecx ; par2
push ebx ; par1
call MyAdd ; call the function
add esp, 8 ; restore the stack
mov …, eax ; returnvalue in eax

;——————————-
; *MyAdd*
;——————————-
push ebp ; save baspointer
mov ebp, esp ; get a grip on the parameters
sub esp, 4 ; make room for the local var

; adding
mov ebx, [ebp+0C] ; get first parameter
mov ecx, [ebp+8] ; get second parameter
add ebx, ecx ; add
mov [ebp-4], ebx ; move result to local var
mov eax, [ebp-4] ; return local var
; returnvalue is eax
leave ; this instruction does the folowing:
; mov esp, ebp
; pop ebp
add esp, 8 ; ONLY for pascal!
ret

Download toàn bộ bài viết:
reversing-generals_phan2

 

REVERSING-GENERALS (Phần I) April 29, 2009

Filed under: Other Tutorials, REVERSING-GENERALS (Phần I) — kienmanowar @ 7:39 am

REVERSING-GENERALS (Phần I)
Dịch: Benina

TỔNG QUÁT VỀ “ĐẢO MÔ

Bài này tui tham khảo bài viết của Ignatz/stoicForce . Ở đây , tui ko thể dịch sát nghĩa như các lão ấy viết. Vì dịch sát nghĩa ra tiếng Việt thì chắc cũng ko có ý nghĩa gì hết. Vì mấy Lão này ko phải là Người Anh, nên tiếng Anh họ viết khó dịch quá. Đồng thời trình độ tiếng Anh của Benina cũng thuộc dạng amatơ, nên có gì sơ xuất mong các bạn thông cảm. Ở đây ,tui hiểu như thế nào khi đọc tut này thì tui viết lại như cách mình nghĩ mà thôi. Chỉ là phỏng dịch. Nếu có gì sai các bạn góp ý cho. Vì TUT này rất hay, nên tui chọn tut dành để “biếu” các bạn newbie còn khó khăn khi đọc TUT về Reversing. Đầu tiên , tui xin dịch “Reverse” là “Đảo mã” (Chứ ko phải “đào mả” nhe) cho nó gọn. Nếu có ai dịch từ này hay hơn , xin cho ý kiến để sao này “ko tái phạm”. Hìhì Nói thêm một chút, một anh Reverser khác với một anh Cracker. Hay nói nôn na một anh chuyên đảo mã khác với một anh chàng bẻ khóa. Anh đảo mã có thể trở thành một anh bẻ khóa .Còn anh bẻ khóa thì chưa chắc trở thành anh đảo mã. Vì nếu bạn đảo mã tốt thì bạn dễ dàng trở thành cracker một cách dễ dàng. Vì lý do đó , nên tui mới dịch TUT này , rồi các bạn sẽ hiểu những gì tui nói

ĐIỂM SÁNG TRONG QUÁ TRÌNH ĐẢO MÃ CODE

(CONVENTION) TẬP QUÁN:

Khi bắt đầu đảo mã,bạn sẽ sớm thấy rằng bản chất của vấn đề là thường chúng ta dựa vào một số thói quen khi đọc code, giống như cách mà bạn đặt tên cho biến và chú thích cho vòng lặp . Khi đảo mã cũng giống vậy. Chưa bao giờ tui lượt giảm thông tin trong code, mà luôn luôn thêm thông tin vào.Ví dụ, chưa bao giờ viết đè lên 1 address mà thêm một cái tên sau nó:

mov [00534160], eax
mov [00534160_SerialFlag], eax ; like this you won´t lose vital information

(COMMENT) CHÚ THÍCH CHO CODE

Đó là điều rất quan trọng ,bạn nên dùng những định nghĩa trong sáng cho code và đừng quan tâm khi bạn phải viết nhiều từ để mô tả code.Bạn sẽ yêu chính bạn về việc làm này khi sau này bạn quay lại đọc những ghi chú mà mình đã viết và bạn sẽ ghét bỏ chính bản thân mình khi ko ghi chú đầy đủ để sau này ko lần ra được những bước mình đã đi qua. Nó cũng sẽ làm một vài phần của code trong sáng hơn cho chính bạn . Từ đó bạn cùng sẽ dễ tìm ra mẫu code làm gì nếu bạn chú thích nó một cách đúng đắn. Rule tổng quát cho việc ghi chú thích là: ghi chú thích code làm sao mà một người chưa đảo mã đọan code đó có thể hiểu được mà ko phải “sorry, understand “. Đơn giản thế thôi, nhưng thật sự việc này ko dễ đâu các bạn ạ. Vì ghi chú thích cho mình nhớ thì dễ , nhưng khi ghi chú thích vắn tắt cho một người khác hiểu thì rất khó. Bạn phải có một quá trình đọc code và đồng thời học tập các cao thủ khi họ comment code.

Download toàn bộ bài viết
reversing-generals_phan1

 

ARTeam: ezine number 4th, new issue March 26, 2009

Filed under: Other Tutorials — kienmanowar @ 4:42 am
Tags:

Hi everybody, it’s a great pleasure to announce the release of the new issue of our eZine. It was a real hard work to assemble all these contributions, but the final result in my opinion is really good.

A 160 pages issue with releases, hopefully all of quality. Coming to this issue, it is focused on non-windows reversing, or better on non-win32 reversing. There are insights into the Linux world (Externalist, Gunther) and the Palm (wast3d_bytes has released independently another Palm issue, which has been extended exclusively for this eZine, I also added an interesting video tutorial from Suntzu). There are also two interesting contributions into .NET advanced concepts and one about classical reversing from Gyver75, which I added for the passion for reversing it clearly shows, besides quality of the work.

This walkthrough is completed by a series of video tutorials prepared by argv about live debugging Symbian systems, not only using IDA. The non-win32 tutorials are just a completion of the activity we had already started a long time ago, investigating new reversing worlds like the already known Symbian, iPhone, .NET and Mac.

Very soon our new web site will finally open, meanwhile you can find this issue on our mirror: http://xchg.info/ARTeam/Tutorials/index.php?dir=ARTeam_eZine/&file=ARTeam_eZine_Number4.rar (it’s a 44Mb pack. sorry, but the supplements are several)

Have phun.

BR,

Shub

 

Yahoo Archive Decode March 14, 2009

Filed under: Other Tutorials, Yahoo Archive Decode — kienmanowar @ 1:57 am
Tags:

Author: RCA (The member of REA-cRaCkErTeAm :) )
Today he show off his research, hope all of you find some interesting information!!

Yahoo Messenger is a popular chat client around the world with many interesting features. One of these features is achieving our chat and the chat log can be viewed in future. The chat log can be viewed after logging into Yahoo Messenger. But there are some programs which can view the archive without logging. Therefore there must be a way to decrypt this log without password. So I write a small documentation to describe how we can reverse the encrypted message to clear one.

Download his paper :
http://rongchaua.net/Web/Tut/Reverse/Crypto/Yahoo Archive Decode.zip

Best Regards
m4n0w4r

 

ARTeam: Reversing Xilisoft, by Nieylana March 5, 2009

Filed under: Other Tutorials — kienmanowar @ 1:09 am
Tags:

ARTeam: Reversing Xilisoft, by Nieylana

Hi everyone,

Nyelana have recently been doing some work with Xilisoft Products, below is a link to my newest tutorial, this tutorial does not mention any specific target, nor does it show you how to crack/patch/keygen any of their software but explains how the crypto things works.

When you register a Xilisoft Product you enter a name/serial, the serials validation itself is not dependant on the name, so i started wondering what the name was for, so i looked for it in the registry, and i noticed the serial wasn’t stored there, but rather an ‘encrypted’ form of it, this tutorial will take you on my adventure to find this encryption routine, and fully understand it and be able to replicate it.

Sources have been provided in VB6 by nyelana (complete application for encrypting/decrypting data), source code is also provided in C by Ghandi, this is provided for those who prefer C/C++ to make a reasonable implementation of their encryption routine.

Also included in the package is a Flowchart (from IDA) in .xps format of the main encryption/decryption routine to further help you understand it, (this flowchart is also included at the end of the tutorial, on the last page).

NOTE: If you haven’t a reg key, there’s plenty around, and even tutorials around on it, search. Also, Xilisoft uses this same routine for storing all the trial information, this isn’t discussed in the paper, but once you understand the routine you can easily find these ‘keys’ with Olly

Download here:
http://xchg.info/ARTeam/Tutorials/index.php?dir=ARTeam_Tutorials/&file=XiliCrypt_Reversing_Xilisoft_Encryption_Routine_by_Nieylana.rar

 

ARTeam: A Tales of Reversing & Keygenning Two MD5 Registration Schemas February 27, 2009

Filed under: Other Tutorials — kienmanowar @ 7:21 am
Tags:

ARTeam: A Tales of Reversing & Keygenning Two MD5 Registration Schemas

Hi all,
this is a nice release, a twofold tutorial about reversing and keygenning an MD5 based registration schema. The tutorial as I said is twofold because it’s the union of two tutorials made by 2KAD and Nieylana.

The result is quite interesting because tutorials describing the complete process of reversing and keygenning an MD5 based registration schema are not so common, of are rather old.

Least but not last the sources (delphi and ASM) of the keygens are added to the distribution so as you’ll be able to look at them also. What do you want more?

Another fine release from ARTeam!

Get it here:

http://xchg.info/ARTeam/Tutorials/index.php?dir=ARTeam_Tutorials/&file=Reversing_Keygenning_Two_MD5_Schemas_by_2kAD_Nieylana.rar

 

ExeCryptor Internals : Tutorials + Tools February 27, 2009

Filed under: Other Tutorials — kienmanowar @ 7:19 am
Tags:

ExeCryptor Internals : Tutorials + Tools
Author : Zool@nder of AT4RE
This package is intended to fill the vacuousness that turns around
the great ExeCryptor.
It’s was born as an essay to understand EC internals and how it
greatly do its job.
This whole project was initiated by a dummy-extremely important
article about the PRN generating and tools coding. (I’ll not go out
of any one’s way by my chitchat so just forget this).

Ok, now the turn of interesting things, The whole stuff will a
series, and will be divided to 3 or 4 parts due to time impediments.
And I’ll publish in each part what I accomplish and comment.

You will find in this package the following files:
+ EC LDE : EC length disasm internal engine.
+ EC_LIB_API_PROCS : Various procedures used by EC to protect API
and LIBS use. It contains:
- EC_GETKERNEL32HANDLE -> The way it grabs kernel32 lib image
base.
- EC_GETPROCADDRESS -> The way it gets API addresses.
- EC_REDIR_BP_CHECKER -> The technique it uses to check API BP
and redir.
+ EC_VIRTUAL_MACHINE : The MUST, it’s EC Virtual Machine Engine and
some tools to reverse it.
+ STRINGS DECRYP-RECRYPTER : EC method to not leave string traces
in code.

With every project you will find tutorial, source code, and tools
so you can study what you want.

Download here:

http://rapidshare.com/files/201952892/EC_MEGA_PROJECT.rar

 

Rebuilding the Import Address Table Using Hooked DLL Calls February 22, 2009

Filed under: Other Tutorials — kienmanowar @ 1:08 am
Tags:

Author : Jason Raber + Brian Krumheuer
Author website : http://www.rri-usa.org/

For a Reverse Engineer, rebuilding a large Import Address Table (IAT) can be a very time-consuming and tedious process. When the IAT has been sufficiently hashed or munged and current IAT rebuilders fail to resolve any of the calls, there is little other choice than to rebuild it by hand. Depending on the size, it can take days or even weeks. Also, doing anything by hand is prone to mistakes. QuietRIATT is an IDA Pro plug-in which automates the process of rebuilding the IAT when it can’t be done by current IAT tools. Not only can it greatly reduce the amount of time spent rebuilding by hand, it also removes the element of human error.

Download here:
http://www.tuts4you.com/download.php?view.2631