0day in {REA_TEAM}

HAKIN9 PDF magazine!

Posted by kienmanowar on August 28, 2009

Hakin9 is a bi-monthly publication on IT Security. The magazine is published in English and distributed in all English-spoken countries. The greatest part of hakin9’s circulation is sold in the USA, a bit less in Australia, Netherlands, Singapore and United Kingdom.

Hakin9 is a source of advanced, practical guidelines regarding the latest hacking methods as well as the ways of securing systems, networks and applications.

Hakin9 is published by Software Media LLC that is a US branch of European publishing house, Software – Wydawnictwo Sp. z o.o.

Hakin9 – Practical Protection is read and subscribed mostly by IT Security managers, officers and trainees employed in large enterprises all over the world.

New issue :
Hakin9’s (5/2009) – 21st Century Hacking Techniques
Cutting Edge Ways to Hack ASLR and Stack Canaries

hakin9
* Windows Timeline Analysis…
* Analyzing Malware Introduction to Advanced Topics…
* Hacking ASLR & Stack Canaries on Modern Linux…
* Mashup Security…
* My ERP Got Hacked – An Introduction to Computer Forensics, Part II…
* First Password Shooters…
* RSA & AES in JAVA…
* AV Scanner 101…
* The Underworld of CVV Dumping…
* It’s All About Reputation…
* Interview with Andrey Belenko…
* DefenseWall Pure Policy-Based Sandbox Application…
* Interview with Alexandre Dulaunoy & Fred Arbogast…
And more ….

Best Regards
kienmanowar

Posted in OllyDbg Tutorials | Tagged: | Leave a Comment »

Stairway to Heaven!

Posted by kienmanowar on July 2, 2009

Khi nhắc đến những ca khúc xuất sắc nhất của nhạc rock, không ai có thể không nói đến “Stairway to Heaven”, ca khúc “vua của các ca khúc”. Thật vậy, ai nghe rock mà không biết ca khúc kinh điển này thì coi như là chưa nghe rock. Từ khi ra đời cho đến nay, “Stairway to Heaven” luôn dẫn đầu các cuộc bầu chọn về ca khúc xuất sắc nhất cũng như những câu solo guitar xuất sắc nhất.

Theo thống kê của các đài phát thanh nhạc rock ở Anh và Mỹ, “Stairway to Heaven” luôn là ca khúc được yêu cầu phát sóng nhiều nhất. Đây cũng là ca khúc mà dân chơi guitar từ nghiệp dư đến chuyên nghiệp quyết tâm tập theo nhất.

Cho đến nay, “Stairway” đã trở thành cảm hứng cho vô số các ban nhạc và ca sĩ. Có đến hơn 100 bản cover lại ca khúc này theo đủ các phong cách từ hard rock (Great White), country (Dolly Parton), jazz (Pat Boone), reggae (Far Cooporation), punk (Me First and the Gimme Gimme) đến phong cách thổ dân của nhạc sĩ Rolf Harris trong đó ông đã sử dụng toàn những nhạc cụ đặc thù của thổ dân châu Úc.Bản cover này đã đạt hạng 10 ở Anh. Các phong cách khác nhau của các bản cover được sử dụng trong chương trình chat show “The Money or the Gun của Úc ở mỗi cuối chương trình. Tuy nhiên cho dù cover lại bằng phong cách nào đi nữa, phiên bản chính của Led Zeppelin vẫn là tượng đài bất hủ của nhạc rock.

- Một câu chuyện thật như đùa có liên quan đến ca khúc “Stairway to Heaven” đã diễn ra như sau. Ngày 23/1/1991, một tuần trước khi cuộc chiến vùng vịnh nổ ra ở Kuwait, một nhóm khủng bố ủng hộ Saddam Hussein đã tấn công một đài phát thanh ở New Mexico với mục đích dùng nó để phát các thông tin ủng hộ Saddam. Khi nhóm này tấn công vào đài phát thanh, DJ John Sebastian đang phát ca khúc “Stairway to Heaven”. Điều đáng buồn cười là các tay khủng bố đều là fan của Led. Và thế là thay vì chiếm dụng đài phát thanh để làm nhiệm vụ tuyên truyền, nhóm khủng bố ra lệnh cho tay DJ phát đi phát lại ca khúc này trong suốt 24 tiếng đồng hồ không ngừng nghỉ. Vụ khủng bố này chỉ được phát hiện khi một số người bực mình gọi đt yêu cầu cảnh sát làm việc với đài phát thanh lì lợm này. Khi cảnh sát đến hiện trường thì tay DJ đang trong tình trạng nguy kịch do nhồi máu cơ tim, có lẽ vì quá mệt mỏi khi phát đi phát lại một ca khúc trong suốt nhiều giờ liền.Được biết, có nhiều người đã mở đài đó suốt cả ngày để xem “chừng nào thì mới chuyển sang bài khác”

Còn đây là HD clip của “Stair way to Heaven”.. xin mời anh em thưởng thức cái mà người ta gọi là “kinh điển” :

Video:

  • Resolution — 1280×720
    Codec — H.264/MPEG-4 AVC
    Bitrate — 7378 Kbps
    Aspect Ratio — 16:9

Audio:

  • Codec — DTS 5.1
    Sampling Rate — 48 KHz
    Bitrate — 1536 Kbps

Runtime:

  • 10 min. 41 sec.

stair

stair2

Link download :


http://rapidshare.com/files/201873587/Led_Zeppelin_-_Stairway_to_Heaven.part1.rar
http://rapidshare.com/files/201885693/Led_Zeppelin_-_Stairway_to_Heaven.part2.rar
http://rapidshare.com/files/201893161/Led_Zeppelin_-_Stairway_to_Heaven.part3.rar
http://rapidshare.com/files/201897585/Led_Zeppelin_-_Stairway_to_Heaven.part4.rar

Best Regards
kienmanowar

Posted in OllyDbg Tutorials | Tagged: | Leave a Comment »

The Expendables (2010)!!

Posted by kienmanowar on May 19, 2009

Xem trên imdb thấy toàn diễn viên nổi tiếng như Arnold Schwarzenegger, Jason Statham, Sylvester Stallone, Jet Li v..v.. Xem cái poster trông hoành tráng phết!!

expendables-poster-750x1110

Posted in OllyDbg Tutorials | 1 Comment »

Cúm H5N1 :))

Posted by kienmanowar on May 4, 2009

Sáng sớm đã được trận cười vỡ bụng, càng xem càng thấy buồn cười :) ). Đang uống cốc nước mà tí thì sặc khà khà..

bkav_h5n1

Đồng chí nào làm quả ảnh này độc đáo phết :d

Posted in OllyDbg Tutorials | Tagged: | Leave a Comment »

REVERSING GENERALS – PART III

Posted by kienmanowar on April 29, 2009

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

Posted in Other Tutorials, REVERSING GENERALS – PART III | Leave a Comment »

REVERSING-GENERALS (Phần II)

Posted by kienmanowar on April 29, 2009

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

Posted in Other Tutorials, REVERSING-GENERALS (Phần II) | Leave a Comment »

REVERSING-GENERALS (Phần I)

Posted by kienmanowar on April 29, 2009

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

Posted in Other Tutorials, REVERSING-GENERALS (Phần I) | 2 Comments »

New Year Presents 2009 Edition from PediY!

Posted by kienmanowar on April 24, 2009

加密与解密工具新年大礼包2009 DVD1
New Year Presents 2009 Edition

PEDIY & China BCG荣誉出品
===============================================================================

本光盘主要收集了常用的加密与解密工具,工具来自bbs.pediy.com兄弟们的分享,我们主要是

负责整理了一下,做个列表和启动,不足之处请原谅!

由于精力实在有限,对本光盘的不足之处请大家海涵。

祝2009年顺心、快乐、健康、幸福!

This DVD-ROM mainly collects the common cracking tools shared by friends of bbs.pediy.com,
we are just responsible for arranging the contents, adding a list and startup. Excuse us
for any flaws.

We are particularly grateful to Allon for his present bag cover.

Wish you a satisfactory, happy and healthy new year!

PEDIY & BCG
2009-01-01

pediy1

pediY2

Download here :
http://book.kanxue.com/Crack_New_Year_Presents_2009.rar

Thanx kanxue and members of Pediy

Regards
m4n0w4r

Posted in OllyDbg Tutorials | Tagged: | 1 Comment »

WARNING : Unauthorized Training ^^

Posted by kienmanowar on April 18, 2009

WARNING : Unauthorized Training

Please be informed that Athena, DDC and Nhat Nghe located in Ho Chi Minh City, Vietnam, are NOT EC-Council authorized training partners and as such are NOT authorized to provide any training whatsoever for EC-Council certifications.

Candidates that take such unauthorized training shall be barred from taking the EC-Council Certification examinations and risk having their certifications revoked. Candidates are only allowed to take training from Authorized Training Partners as a precondition of taking the certification examinations.

http://eccouncil.org/Unauthorized-Training.htm

Cuối cùng thì EC-Council cũng phải lên tiếng về mấy trung tâm dạy chui tại VN :) )….. Nhục quá!!

Posted in OllyDbg Tutorials | Leave a Comment »

CodeWalker vs. Advanced MBR rootkit (Mebroot)

Posted by kienmanowar on April 15, 2009

CodeWalker vs. Advanced MBR rootkit (Mebroot)
by : Thug4lif3

Mebroot là 1 rootkit đặc biệt, lây nhiễm vào Master Boot Record và exec rootkit khi OS khởi động. Rootkit này được ví như 1 “hệ điều hành malware chạy bên trong hệ điều hành Windows”. Vì sao? Mebroot là 1 rootkit thương mại có khả năng bypass tất cả các loại personal FW như ZoneAlarm, KIS, Outpost, .. hiện có trên thế giới bằng TCP/IP stack tự tạo cùng kỹ thuật hook đặc biệt cực kỳ khó phát hiện, có khả năng update bản thân cùng các tính năng đặc biệt khác. Theo phân tích của F-Secure thì rootkit này được viết rất chuyên nghiệp và người viết có kiến thức cực sâu về Windows & NDIS. Các bạn có thể search thêm thông tin về rootkit này thông qua google.

Từ ngày 31/03 cho đến hôm nay (14/04), các tác giả của Mebroot lại triển khai 1 chiến dịch lây lan các biến thể mới của rootkit này. Các biến thể này sử dụng các kỹ thuật mới cho việc che dấu bản thân. Hiện tại, GMER/RkU/IceSword phiên bản mới nhất và các antirootkit tool khác vẫn chưa phát hiện được loại các biến thể mới của Mebroot.

CodeWalker 0.2.4.500 được phát triển để tạo các tính năng phát hiện biến thể mới nói trên. Các bạn có thể thấy các system thread ẩn từ tab “Hidden Code” và check MBR từ tab “Files”. Mời các bạn dùng thử và feedback cho mình tại thread này.

Screenshot: CodeWalker vs. Mebroot

cw

Download:

http://cmcinfosec.com/download/cmcark_cw0.2.4.500.rar

Nếu bạn bị màn hình xanh, trước tiên, config:

My Computer > Properties > Tab “Advanced” > Startup and Recovery Settings > Write Debugging Information > Kernel Memory Dump.

Sau đó, reboot và chạy lại CodeWalker. Nếu bị BSOD thì bạn vào lấy file %systemroot%\MEMORY.DMP và send vào thug4lif3 gmail \.com

Thanx Thug for Good Tools!
m4n0w4r

Posted in OllyDbg Tutorials | Tagged: | Leave a Comment »

IDA Pro Advanced changes our life

Posted by kienmanowar on September 9, 2008

Bài này được viết vào khoảng cuối tháng 3 năm 2006, tuy cũ nhưng những kiến thức của nó vẫn còn như mới :-)

IDA Pro Advanced changes our life

Author: _[kienmanowar]_

I. Intro :

Chào tất cả các anh em REA, đã lâu rồi tôi không có viết tut kể từ ngày lão nhỏ rút lui.Không hiểu lão nhỏ đang bận cái quái quỉ gì mà ngay cả YM cũng chẳng thấy thò mặt mũi lên lấy 1 lần.Mặc dù rất ngứa tay và muốn viết thật nhiều cho REA, nhưng khi đặt tay lên bàn phím tôi không biết phải bắt đầu từ đâu và viết về vấn đề gì, cộng thêm phải đi cày để gom tiền cưới vợ nên cũng chẳng có nhiều thời gian ..khà khà.Lão nhỏ ra đi để lại độc một cái tut về IDA cho anh em, mà trong khi đó chắc anh em cũng như tôi còn muốn nhiều hơn thế, nhưng thôi thì cũng phải thông cảm cho lão nhỏ chắc giờ này lão cũng đi cày để gom tiền như tôi thôi. Trong REA, hễ cứ thấy động tới IDA là y như rằng anh em lặng im phăng phắc chẳng thấy bàn tán gì nhiều, tôi cũng như anh em thôi cũng muốn voọc IDA lắm chứ nhưng …. Hôm rồi, thấy anh Be có tạo một Thread “Learning IDA online” tôi nghĩ rằng đây là một Thread rất cần thiết và bổ ích cho anh em muốn tìm hiểu về IDA như tôi, nhưng ngặt nỗi tài liệu về IDA khá khiêm tốn trong khi đó ứng dụng của nó trong Reverse lại là rất lớn.Hii anh Be đã lên tiếng thì thằng em này cũng cố theo, hôm nay mạn phép xin viết một bài rất cơ bản về IDA để anh em đọc chơi, anh em nào đã biết rồi thì xin góp ý cho bài viết để tôi còn biết đường mà sửa, còn những anh em nào chưa biết thì …. Let’s go J

Bài viết này tôi tổng hợp lại từ bài viết của tác giả BlackBird, đã viết từ năm 2000.Có thể anh em cho rằng nó quá cũ, nhưng có một câu “Cũ người mới ta”, thế giới đã đi trước chúng ta bao nhiêu năm thì giờ đây chúng ta phải chắt lọc những gì tính túy nhất để mà học hỏi.Bài viết này tôi sẽ giới thiệu cho các bạn một số chức năng của IDA, để các bạn thấy được tại sao IDA lại được đánh giá cao đến thế. Như các bạn thấy đối với những Newbies thì khi nhìn vào cửa sổ chương trình IDA, hehe điều đầu tiên họ làm là nhấn nút “X” ở góc trên phải màn hình, để làm gì thì khỏi nói các bạn cũng biết nhưng còn đối với những Elite Reverses thì IDA lại là một công cụ không thể thiếu được.Tại sao các Newbies mới ban đầu khi tiếp xúc với IDA lại có thái độ như trên, đó là bởi vì IDA có quá nhiều các hàm và các chức năng mở rộng đồng thời việc sử dụng IDA phức tạp hơn nhiều so với W32Dasm.Phần tiếp theo đây của bài viết sẽ đưa ra những lời giải thích ngắn gọn và trong sáng nhất về việc tại sao bạn nên sử dụng IDA trong khi bạn đã khá thành thạo trong việc sử dụng W32Dasm.

II. IDA: A power disassembler

Điều đầu tiên mà chúng ta nhận thấy một cách rõ ràng khi chạy IDA đó là giao diện của chương trình trông cực kì chuyên nghiệp và hơn hẳn W32Dasm. Có rất nhiều các tùy chọn cũng nhữ những tính năng cấp cao mà ở W32Dasm không có. Điều này có một thuận lợi đó là các bạn có thể Disassemble tốt hơn và chi tiêt hơn, nhưng đó cũng là điều không thuận lợi khiến IDA trở nên rất khó trong việc làm quen và sử dụng nó.

Tuy nhiên, trên thực tế IDA vẫn có đầy đủ các tính năng tương như W32Dasm như : Bạn có thể nhảy tới chính xác một đoạn code nào đó, bạn có thể quan sát vị trí nơi mà một lệnh nhảy nhảy tới một đoạn code, hay bạn có thể xem các String References v..v..

Điều khó khăn đầu tiên cho tất cả các Newbies đó chính là quá trình tìm kiếm các String References. Trong W32Dasm chúng ta có một nút bấm mà theo đó chúng ta có thể xem trực tiếp tất cả các String References rất dễ dàng. Trong IDA, tính năng này được đặt trong Menu: View à Names.

Giả sử chúng ta đã mở một file .exe trong IDA, một hộp thoại bật ra cung cấp cho chúng ta rất nhiều tùy chọn. Đừng có đụng tới bất cứ cái gì, chỉ việc nhấn ‘OK’. Sau đó IDA sẽ thực hiện công việc Analysis và sau khi thực hiện xong bạn hãy mở theo như hình trên chúng ta có được như sau :

Oki, chúng ta đang ở cửa sổ Names, vậy làm thế nào để nhận biết ra đâu là String References.Như đã nói ở phần trên W32Dasm có một nút bấm riêng phục vụ cho công việc này, nhưng còn trong IDA các string reference được gắn vào trước bởi một chữ ‘a’.Để tìm kiếm một string bạn chỉ việc nhấn ‘a’ trên bàn phím tại cửa sổ Names, tương tự như việc tìm kiếm các hàm API trong Ollydbg.Hoặc các bạn có thể cuộn chuột để tìm kiếm, cho đến khi thấy được như sau :

Đó chính là các String Reference mà IDA đã chỉ ra vị trí của chúng cho chúng ta thấy.Và đương nhiên tương tự như W32Dasm, khi tìm thấy một String đáng quan tâm chúng ta sẽ tìm đến vị trí của nó, trong IDA bạn nhấn Enter hoặc nhấp đúp vào String chúng ta sẽ đến vị trí mà String đó ở tại.

Kết quả chúng ta sẽ được như hình minh họa trên. Tai đây bạn quan sát sẽ thấy có một tham chiếu được đặt cạnh String của chúng ta, nó có dạng như sau : DATA XREF: .text:XXXXXXXX­o, chi tiết về các thành phần tôi sẽ đề cập trong bài viết sau. Ý nghĩa của cái Reference này cho chúng ta biết nơi mà String của chúng ta thực sử được sử dụng trong đoạn code của chương trình.Rê chuột vào địa chỉ XXXXXXXX, IDA sẽ cho chúng ta thấy được như sau điều mà ở W32Dasm không có được :

Để thực sử tới đoạn code sử dụng String chúng ta chỉ việc nhấn đúp chuột vào địa chỉ đó, nó sẽ đưa chúng ta đến nơi chúng ta cần đến :

Khà khà rất đơn giản phải không nào, đâu có gì là quá khó phải không các bạn. Tiếp theo chúng ta sẽ đề cập đến một số tính năng khác của W32Dasm mà cũng được IDA hỗ trợ rất tốt đó là các lệnh nhảy (Jump) và các lời gọi Call References.Tôi xin lấy 2 hình minh họa cho quá trình Disassembly một chương trình trong W32Dasm và IDA để các bạn nhận thấy được sự khác biệt.

Như các bạn thấy, IDA cung cấp các thông tin chi tiết và rõ ràng hơn nhiều.Tiếp theo ta sẽ xem một ví dụ về Reference. Trong W32Dasm các ban sẽ thấy như sau :

Còn trong IDA nó sẽ được thể hiện như sau :

Nhìn vào hình minh họa trong IDA, ta thấy rằng IDA cho chúng ta nhiều thông tin mặc dù trông nó có vẻ ngắn gọn hơn W32Dasm.Cụ thể như sau :

  1. Đây là một lệnh nhảy vì ta thấy có kí tự (j). Thêm nữa lệnh nhảy này nằm ở phía trên của địa chỉ 0×0040132D, tại sao lại biết được nó nằm phía trên đó là do ta thấy có hình mũi tên lên (­).
  2. Lệnh nhảy tới đoạn code bắt đầu tại địa chỉ 0×0040132D này nằm tại địa chỉ 0×0040131A (= DialogFunc + 29). Bạn sẽ hỏi làm sao tôi biết địa chỉ của DialogFunc, xin thưa rất đơn giản bạn chỉ cần nhấn chuột vào chữ DialogFunc và chọn Edit Function hay phím tắt là Alt+P, ta sẽ có được thông tin về địa chỉ như sau :

Vậy là 0×0040131A = 0×004012F1 + 0×29

  1. Lệnh nhảy này được nằm tại .CODE section.

Nếu như Reference là một lời gọi (CALL) thì trong IDA nó sẽ được thể hiện như sau :

Một trong những tính năng tuyệt vời khác của IDA đó chính là việc thể hiện các biến được dùng trong chương trình.Thậm chỉ bạn có thể nhấn đúp chuột vào chúng để đi tới địa chỉ nơi mà các biến được lưu trữ : Lea edi, [esp + 1B8h + var_104]

Một trong những tính năng khiến cho IDA trở thành một công cũ rất mạnh đó chính là việc sử dụng Flirt Signatures. Giải thích một cách đơn giản nhất đó là trong quá trình disassembly IDA cố gắng nhận diện chính xác các hàm thư viện có liên quan với trình biên dịch. Ví dụ :

Wow các bạn có nhận thấy sự khác biệt không? Riêng tôi thì IDA quả là tuyệt, nó nói cho ta tất cả mọi thứ, rõ ràng như ban ngày.

Một số tính năng khác tương tự với W32Dasm đó là “Goto code location” thì trong IDA là “Jump-Jump to Address”. Hay “Goto entrypoint” thì trong IDA sẽ là “Jump – Jump to entry point”.

Đó là một số tính năng quan trọng nhất khi chúng ta bắt đầu con đường chinh phục IDA. Ah tôi quên mất, trong IDA còn một tính năng khá thú vị nữa đó chính là thỉnh thoảng chúng ta thấy có rất nhiều đoạn như sau ‘db’ mà lại không thấy có các String References, nhưng đó lại chính là những đoạn code. Chỉ việc trỏ chuột vào và nhấn phím tắt C trên bàn phím, ngay lập tức IDA sẽ chuyển nó thành code. Ví dụ như sau :

Còn lý do tại sao chắc tôi sẽ viết một bài về việc làm thế nào để hiểu một đoạn code có ý nghĩa gì.Đến đây coi như là kết thúc quá trình tôi cùng các bạn tìm hiểu một số tính năng của IDA. Sau khi bạn đọc bài viết này của tôi có thể bạn sẽ đặt cho mình một câu hỏi “Liệu tôi có nên tiếp tục sử dụng W32Dasm nữa không”, câu trả lời nằm ở chính bạn.Còn riêng với cá nhân tôi, tôi sẽ vẫn giữ lại W32Dasm vì trong một số trường hợp đơn giản nó vẫn rất có ích.

III. Lời kết

Vậy là tut này đến đây là kết thúc, 7 trang giấy trong bài viết này không thể nói hết được những tính năng rất mạnh của IDA. Chỉ có thực sự bắt tay vào công việc chúng ta mới thấy được, mới tìm hiểu được những tính năng rất mạnh của nó. Không lý do gì mà IDA lại được giới Reverser cũng như giới Security yêu thích đến thế, chắc chắn nó sẽ có nhiều điều thú vị nữa khiến cho mọi người đều đam mê. Bài viết này của tôi chỉ là một phần nhỏ giới thiệu về IDA, hi vọng nó đã mang đến cho các bạn một cái nhìn khác về chương trình Disassembly rất mạnh này.Rất cảm ơn anh em đã dành thời gian đọc nó.

PS : Hi vọng anh TQN, Thug và light.phoenix có thời gian viết vài bài cho anh em mở rộng tầm mắt :)

Best Regards

_[Kienmanowar]_

–++–==[ Greatz Thanks To ]==–++–
My family, Computer_Angel, Moonbaby , Zombie_Deathman, Littleboy, Benina, QHQCrker, the_Lighthouse, Merc, Hoadongnoi, Nini … all REA‘s members, TQN, HacNho, RongChauA, Deux, tlandn, light.phoenix, dqtln, ARTEAM …. all my friend, and YOU.

–++–==[ Special Thanks To ]==–++–
- coruso_trac, pat, trm_tr. Thug4lif3, vn_blackrain, v..v.. and all brothers in VSEC

–++–==[ Thanks To ]==–++–

iamidiot, WhyNotBar, trickyboy, dzungltvn, takada, hurt_heart, haule_nth, hytkl v..v.. các bạn đã đóng góp rất nhiều cho REA. Hi vọng các bạn sẽ tiếp tục phát huy :-)


>>>> If you have any suggestions, comments or corrections email me: kienmanowar[at]reaonline.net

Posted in IDA Pro Advanced changes our lif3!, IDA Tutorials, My Tutorials | Leave a Comment »

Understanding Code!

Posted by kienmanowar on September 10, 2008

Understanding Code

Author: _[kienmanowar]_

“Cuộc sống luôn đầy cám dỗ

Ngày ngày níu kéo con người

Làm sao thắng được chính mình…Làm sao…

Ngựa non lớn lên thường háu đá

Tuổi trẻ nào suy tính gì

Nên đi tới con đường bế tắc

Chìm sâu… trong bóng tối”

I. Intro :

Chào tất cả anh em REA, chúng ta lại gặp nhau trong bài viết này của tôi viết về “Understanding Code”. Đây là bài viết của tác giả Kwazy Webbit, đề cập tới vấn đề đọc hiểu code của các chương trình được Disassembly bằng W32Dasm, IDA v..v.. Tại sao tôi lại chọn nó là chủ đề cho bài viết thứ 3 này bởi vì một lý do hết sức đơn giản, có đọc hiểu code chúng ta mới biết được chương trình đang làm gì, đoạn code mà chúng ta đang RE được dùng vào mục đích gì, đề từ đó có những thay đổi chỉnh sửa sao cho hợp lý để phục vụ mục đích của chúng ta. Hầu hết những anh em tôi quen biết đến với RE, Cracking theo những cách thức khác nhau, có người muốn chỉ trong một thời gian ngắn có thể Crack được một phần mềm mà không cần tìm hiểu xem tại sao lại làm như thế, nhiều người chỉ thực hiện theo các tut một cách dập khuôn, ăn sẵn để rồi cuối cùng vẫn luẩn quẩn với những câu hỏi “Tại sao lại làm như thế ?” , “Tại sao tôi làm thế không được ?” v…v… mà không hề có một chút đầu tư nghiên cứu tìm hiểu, nhưng ngược lại có những người đi từ những viên gạch đầu tiên, từ từ từng bước một, những viên gạch của quá trình lạo động tìm hiểu nghiêm túc, tốn nhiều mồ hôi, nước mắt để rồi bù lại họ có được những kiến thức làm tôi kinh ngạc.Có những người còn rất trẻ và những người lớn tuổi hơn tôi, có người chuyên về IT và cũng có người không. Nhưng những người đó đã để lại cho tôi lòng khâm phục bởi tinh thần làm việc nghiêm túc, lòng đam mê, sự chia sẻ kiến thức tới cộng đồng không hề vụ lợi.

Việc chúng ta tìm hiểu xem một đoạn binary biểu diễn ý nghĩa gì là một công việc quan trọng.Các đoạn mã thực thi và dữ liệu được biểu diễn ở mức thấp nhất đó là tập hợp của các bit 0 và 1.Bạn có thể cố gắng cho thực thi một đoạn dữ liệu như một đoạn mã, nhưng hầu hết trong các trường hợp việc làm này sẽ dẫn đến crash.Lấy ví dụ, việc cố gắng để sử dụng một đoạn mã thực thi như là một Picture data cũng sẽ là không hợp lệ hoặc ngược lại, nhưng đó chỉ là một sự ngẫu nhiên nào đó mà thôi. Đó là bởi vì có một cấu trúc để biểu diễn chúng khiến cho chúng không chỉ đơn thuần là binary mà còn bao hàm nhiều ý nghĩa khác. Để giúp ích cho bạn, bạn cần phải tìm hiểu về cấu trúc này và từ đó sẽ diễn dịch được nó theo đúng cách.

Để cụ thể hơn, tôi sẽ lấy một ví dụ, chẳng hạn tôi có 4 con số như sau :

112, 43, 149, 184

Như các bạn thấy chúng có thể mang rất nhiều ý nghĩa. Nếu như tôi nói với bạn rằng đây là ví dụ về một đường thẳng, và hãy tưởng tượng rằng đây là một đường thẳng 2 chiều, bắt đầu tại tọa độ thứ nhất là (112, 43) và kết thúc tại tọa độ thứ hai là (149, 184). Tuy nhiên nếu như có ai đó lại nói với bạn là đây chính là một hình vuông, liệu bạn có tin không? Tôi thì tin liền khà khà bởi vì đơn giản tôi nghĩ đây là một hình vuông với 4 các tọa độ của nó. Như các bạn thấy, 4 con số trên có rất nhiều ý nghĩa đúng không, tất cả chúng đều phụ thuộc vào sự suy diễn của bạn và tôi. Điều này sẽ dẫn đến nhiều vấn đề, làm sao chúng ta có thể phán đoán hết được ý nghĩa của chúng, và làm sao chúng ta chọn được một phương án đúng nhất trong đó? Máy tính sẽ dùng cách thức nào để có thể hiểu được? Làm thế nào chúng ta biết được điều gì đang thực sự xảy ra ? Trong bài viết này, tôi sẽ không đi vào tìm hiểu ngữ nghĩa của data, bởi vì các cấu trúc dữ liệu là quá nhiều (như các bạn đã thấy trong ví dụ ở trên). Mỗi một định dạng file sẽ có một cấu trúc dữ liệu. Chương trình sử dụng các phần mở dụng của file (.exe, .dll v..v..) như là một ám hiệu để biết cách cư xử với từng cấu trúc.

Thay vào đó, tôi và các bạn sẽ tập trung vào các đoạn code thực thi, đặc biệt là các đoạn code cho x86 processor. Chúng ta sẽ bắt đầu từ binary và kết thúc với ngôn ngữ C.

II. Binary to Hexadecimal

Như tôi đã nói ở trên, mức biểu diễn thấp nhất của thông tin (trong một môi trường máy tính) là binary. Các đoạn mã mà máy tính có thể hiểu được được biểu diễn bằng những bit 0 và 1 dài vô tận.Điều này dẫn đến con người khó có thể hiểu được những chuỗi 0 và 1 mà họ nhìn thấy thể hiện cái gì, và điều gì sẽ xảy ra. Nếu như bạn có hứng thú trong việc tìm hiểu nguyên lý hoạt động của các mạch trong CPU, tôi gợi ý bạn nên tìm đọc các quyển sách điện tử.Còn đối với tôi, tôi không biết nhiều về chúng để có thể giải thích cho bạn một cách chi tiết về nguyên lý hoạt động (Mặc dù có một thời gian tôi đã từng làm việc với những bộ vi xử lý đơn giản). Nhằm mục đích giảng giải, binary là một định dạng khó hiểu, vì nếu số lượng các số binary là quá lớn sẽ khiến cho chúng ta khó khăn trong việc quan sát. Đó chính là lý do tại sao các bạn thấy rằng thông thường chúng ta không bao giờ chỉnh sửa bất cứ gì theo định dạng binary, mà thay vào đó chúng được chuyển sang một định dạng dễ hiểu hơn mà tôi và các bạn đều biết, đó chính là Hexadecimal.Nếu như các bạn thấy trong hệ binary chỉ có 2 số 0 và 1, hệ decimal thì có 10 số (0,1,2,3,4,5,6,7,8,9) còn hệ Hexa sẽ có 16 (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F). Bạn có thể sẽ rất ngạc nhiên là tại sao định dạng Hexa lại được chọn để biểu diễn mà không phải là hệ Decimal đã quá thân thuộc ngay từ khi lọt lòng. Câu trả lời hết sức đơn giản.Đó là bởi vì tất cả các số khi được chuyển đổi vẫn nằm dưới định dang binary.Sử dụng 4bits thì tại một thời điểm bạn có thể tạo ra chính xác 16 giá trị khác nhau từ 4 bits này, bắt đầu từ 0 cho tới 15, theo hệ Hexa thì là từ 0 cho tới F. Điều này khiến cho hệ thống xử lý một cách dễ dàng hơn đơn giản chỉ bằng thay thế 4 bits bằng một số trong hệ Hexa. Dưới đây là bảng minh họa quá trình chuyển đổi giữa các hệ, giúp các bạn phần nào hiểu thêm về những gì mà tôi đã nói :

Binary

Decimal

Hexadecimal

0000

0

0

0001

1

1

0010

2

2

0011

3

3

0100

4

4

0101

5

5

0110

6

6

0111

7

7

1000

8

8

1001

9

9

1010

10

A

1011

11

B

1100

12

C

1101

13

D

1110

14

E

1111

15

F

10000

16

10

Như các bạn đã thấy trên bảng trên, tại giá trị Binary là 1000 thì giá trị ở hệ Hexa là (10), đó là vì con số 1 đầu tiên có thể được biểu diễn thành 0001, trong khi số 0 thứ 2 được biêu diễn bằng (0000). Do đó chúng ta có kết quả là 00010000, giá trị này rất phù hợp với hệ số Binary.

III. Hexadecimal to Assembly Code

Việc sử dụng kí pháp hexadecimal giúp chúng ta viết các đoạn Binary code một cách nhanh hơn, và cho phép chúng ta nhiều cái nhìn tổng quát hơn. Tuy nhiên nó vẫn không có ý nghĩa nhiều lắm cho con người bởi vì thực chất nó vẫn chỉ là những con số. Chúng ta hãy quan sát một ví dụ về đoạn code Hexa dưới đây :

83EC20535657FF158C40400033DBA39881400053

Như tôi đã nói, đây chỉ là một phương pháp biểu diễn nhanh, ngắn gọn cho các số binary.Điều đó có nghĩa là nó không cho chúng ta thấy bất kì một ý nghĩa gì cả, cũng như nhìn vào đó chúng ta chẳng hiểu nó định làm gì, nhưng cái lợi của nó là ngắn gọn hơn so với việc biểu diễn dưới dạng binary rất dài với toàn số 0 và 1. Đoạn Hexa ở trên bao gồm 40 kí tự, trong khi đó nếu chúng ta biểu diễn ở dạng binary chúng ta sẽ có được 160 (40 * 4 bits)

Đoạn mã ở trên không phải là một instruction lớn (thuật ngữ “instruction” ở đây để cập tới đoạn bytes code thực sự). Trên một vài bộ vi xử lý thì mỗi một instruction sẽ có một kích thước nhất định(ví dụ : 2 bytes) vì vậy chúng ta có thể chia code thành các phần một cách dễ dàng theo kích thước để có được các câu lệnh khác nhau (Giả sử rằng bạn sẽ có được một điểm bắt đầu hợp lệ trong đoạn code). Bộ xử lý x86 ít phức tạp hơn nhiều và có các kích thước instruction khác nhau. Bây giờ bạn có thể ngạc nhiên làm thế nào chúng ta có thể luôn luôn tách được các instructions theo cách này.Ý tưởng là như sau, chúng ta lấy byte đầu tiên, nhìn vào giá trị của nó, và byte này sẽ cho bạn biết cách tiến hành như thế nào. Một vài điều có thể xảy ra như sau :

_Nó có thể là một single byte instruction: ví dụ 90h là câu lệnh NOP (No Operation) và kích thước của nó chỉ là 1 byte.

_Có thể câu lệnh đó chưa được hoàn chỉnh: ví dụ Các lệnh (Instructions) mà được bắt đầu bằng 0Fh , chúng ta phải cần thêm các bytes vào sau để nó tạo thành một câu lệnh có nghĩa.

_Câu lệnh được định nghĩa bởi một byte độc lập, nhưng vẫn cần có tham số, ví dụ : 8Bh chuyển một thanh ghi vào trong một thanh ghi khác.Những byte mà theo sau 8Bh sẽ miêu tả nó được chuyển đến từ đâu và nó được chuyển đên đâu.

_Câu lệnh chưa hoàn chỉnh và cần thêm các tham số.

Bởi vì chúng ta sẽ cần phải biết đó là câu lệnh nào để mà tách ra, chúng ta sẽ kết hợp quá trình tách các câu lệnh khác nhau với việc chuyển chúng sang một định dạng mà con người có thể đọc hiểu được một cách tương đương. Ngôn ngữ mà con người có thể đọc hiểu được đó chính là “Assembly Language”, thường được viết tắt là ASM. Quá trình chúng ta chuyển dịch một chương trình từ Code thô (Raw code) sang ASM, được gọi là quá trình “Disassembling”. Việc làm này sẽ cho chúng ta khả năng để đọc hiểu ASM.Để có thể thực hiện được chúng ta cần phải có một số kinh nghiệm.

Vì rằng rõ ràng không có hệ thống nào để hiều một đoạn hexadecimal code thực hiện công việc gì , đó là một công việc cực kì chán ngắt. Tuy nhiên, việc hiểu được nó làm việc thế nào là rất quan trọng.Tôi sẽ chứng minh điều này thông qua ví dụ mà các bạn đã thấy ở trên.

Hãy quan sát lại đoạn Hexadecimal code :

83EC20535657FF158C40400033DBA39881400053

Chúng ta sẽ giả sử rằng byte đầu tiên chính là điểm bắt đầu hợp lệ và chúng ta sẽ bắt đầu phân tích từ đó.Đầu tiên tôi sẽ lấy byte này ra, nó là 83h , sau đó chúng ta thực hiện công việc tra cứu dựa trên một bảng và bảng này tôi để trong phần Phụ lục A1. Khi xem trong bảng này chúng ta thấy nó cần phải có thêm byte khác để mô tả nhiệm vụ của nó một cách đầy đủ nhất, và byte cần sẽ được hình thành từ một “mod R/M” byte. Để có được những gì đầy đủ về nhiệm vụ của câu lệnh chúng ta sử dụng thông tin từ byte này và tra cứu thêm bảng phụ lục thứ 2 (Phụ lục A2) để tìm kiếm thông tin thông qua “group #1”.Trong trường hợp này, byte đó chính là ECh. Một mod R/M byte bao gồm trường 3 bits sau:

Bit :

7

6

5

4

3

2

1

0

Meaning :

mod

reg

R/M

Để phân tách các trường này, chúng ta quay trở lại với binary bằng cách biểu diễn lại ECh :

EC = 1110 1100 = 11 101 100

Sử dụng bảng phụ lục A2, chúng ta sẽ thấy rằng những gì chúng ta biểu diễn ở trên phù hợp với giá trị xx101xxx, và đây chính là cậu lệnh SUB. Hai bit khác sẽ dùng để miêu tả toán hạng đầu tiên của câu lệnh SUB. Chúng ta lại xem tiếp trong một bảng phụ lục thứ 3 (Phụ lục A3), chúng ta tìm thấy 11 có nghĩa là chúng ta sẽ sử dụng trực tiếp một thanh ghi, và giá trị 100 ở trên chính là biểu diễn cho thanh ghi ESP. Quay trở lại bảng phụ lục A1 chúng ta thấy rằng cần phải có một toán hạng nữa để điền vào, đó chính là ‘Ib’ (Input byte). Rất dễ dàng để chúng ta thấy rằng byte tiếp theo đó chính là 20h.

Ghép tất cả những gì chúng ta vừa phân tích ở trên lại với nhau ,chúng ta sẽ có được một câu lệnh ASM đầu tiên :

83EC20 SUB ESP, 20

Okie như các bạn đã thấy, khá phức tạp phải không nào. Chúng ta phải tra đi tra lại mới ra được còn máy tính thì thực hiện quá nhanh J. Tiếp theo chúng ta sẽ tiếp tục quá trình phân tích với câu lệnh kế tiếp, bắt đầu tại giá trị 53h . Tra cứu trên bảng A1 nó cho chúng ta biết đây là một byte độc lập mà không có tham số :

PUSH rBX (= PUSH EBX)

Vậy cuối cùng chúng ta có được kết quả với 4 bytes đầu tiên được biểu diễn bằng ASM :

83EC20 SUB ESP, 20

53 PUSH EBX

Như các bạn đã thấy việc làm này đã tiêu tốn của chúng ta rất nhiều thời gian phải không. Tuy nhiên chúng ta thật may mắn khi có những công cụ đã thực hiện điều này cho chúng ta (ví dụ : HIEW) :

83EC20 sub esp,020

53 push ebx

56 push esi

57 push edi

FF158C404000 call d,[0040408C]

33DB xor ebx,ebx

A398814000 mov [00408198],eax

53 push ebx

Hoặc một cách khác cũng có thể giúp cho công việc của chúng ta đơn giản hơn đó là nhờ đến Ollydbg, chúng ta cũng có được đoạn code tương tự :

Tuy nhiên nhiều khi nhìn vào chúng ta không thể hiểu ngay được ý nghĩa của chúng, vi dụ như địa chỉ ở trên tham chiếu đến hàm nào, có trỏ tới một String nào không v..v.. Để giúp cho chúng ta các chương trình Disassemblers như IDA và W32DASM đã hỗ trợ rất nhiều. Sử dụng IDA, chúng ta sẽ có được nhiều thông tin hơn :

sub esp, 20h

push ebx

push esi

push edi

call ds:GetProcessHeap

xor ebx, ebx

mov hHeap, eax

push ebx ; lpModuleName

Như bạn đã thấy, IDA đã thực hiện thật tuyệt.Nó đã nhận ra được hàm call sẽ gọi tới API nào và nó cũng hiểu được giá trị trả về từ hàm đó, đó là hàm (GetProcessHeap) và do đó nó sẽ đổi tên biến thành hHeap. Đây chỉ là minh họa nhỏ cho thấy những gì IDA có thể làm được, nhưng cũng đủ để thấy rằng nó cung cấp cho chúng ta rất nhiều thông tin hơn là những gì chúng ta quan sát trong HIEW. Điều này thật là tuyệt vời và nó giúp cho chúng ta tiết kiệm được rất nhiều thời gian hơn vào việc làm bằng tay, và bên cạnh đó nó cũng giúp cho chúng ta có một điểm bắt đầu tốt cho quá trình phân tích code về sau.

Nhưng nhiệm vụ tiếp theo và rất quan trọng của chúng ta là làm cách nào để biểu đạt đoạn code dưới dạng ASM đó thành đoạn code dưới dạng cú pháp của một ngôn ngữ bậc cao (ví dụ như C).

IV. Assembly code to C

Bây giờ giả sử rằng tôi và các bạn có một đoạn code ASM, và chúng ta có thể đọc hiểu được nó để biết được chương trình đang làm gì.Tuy nhiên, vì hầu hết các câu lệnh ASM chỉ thực hiện một nhiệm vụ thông thường, do đó rất khó cho chúng ta biết được tổng quát nhiệm vụ của chương trình đang thực hiện cái gì. Hãy xem một đoạn mã ASM dưới đây :

.004122F0: 55 push ebp

.004122F1: 8BEC mov ebp,esp

.004122F3: 83EC48 sub esp,048 ;”H”

.004122F6: 53 push ebx

.004122F7: 56 push esi

.004122F8: 57 push edi

.004122F9: C745F800000000 mov d,[ebp][-08],000000000 ;”

.00412300: EB09 jmps .00041230B —–¯ (1)

.00412302: 8B45F8 mov eax,[ebp][-08]

.00412305: 83C001 add eax,001 ;”J

.00412308: 8945F8 mov [ebp][-08],eax

.0041230B: 8B4508 mov eax,[ebp][08]

.0041230E: 50 push eax

.0041230F: FF1584A34300 call lstrlenA ;KERNEL32.dll

.00412315: 3945F8 cmp [ebp][-08],eax

.00412318: 7D2E jge .000412348 —–¯ (2)

.0041231A: 8B4508 mov eax,[ebp][08]

.0041231D: 0345F8 add eax,[ebp][-08]

.00412320: 8A08 mov cl,[eax]

.00412322: 884DFF mov [ebp][-01],cl

.00412325: 0FB645FF movzx eax,b,[ebp][-01]

.00412329: 83F861 cmp eax,061 ;”a”

.0041232C: 7C18 jl .000412346 —–¯ (1)

.0041232E: 0FB645FF movzx eax,b,[ebp][-01]

.00412332: 83F87A cmp eax,07A ;”z”

.00412335: 7F0F jg .000412346 —–¯ (2)

.00412337: 0FB645FF movzx eax,b,[ebp][-01]

.0041233B: 83E820 sub eax,020 ;” ”

.0041233E: 8B4D08 mov ecx,[ebp][08]

.00412341: 034DF8 add ecx,[ebp][-08]

.00412344: 8801 mov [ecx],al

.00412346: EBBA jmps .000412302 —–­ (3)

.00412348: 5F pop edi

.00412349: 5E pop esi

.0041234A: 5B pop ebx

.0041234B: 8BE5 mov esp,ebp

.0041234D: 5D pop ebp

.0041234E: C3 retn

Bạn thấy đấy, trên đây là một đoạn mã ASM sử dụng rất nhiều các câu lệnh đơn giản kết hợp với nhau và cuối cùng là để thực hiện một nhiệm vụ nào đó mà chính chúng ta cần phải tìm hiểu. Chúng ta sẽ bắt đầu làm việc từ câu lệnh đầu tiên và cứ như thế cho đến hết, cố gắng để có một cái nhìn tổng quan nhất về những gì sẽ xảy ra bằng việc sử dụng một “Pseudo-C” notation (kí pháp Giả ngôn ngữ C), và cuối cùng là để chuyển nó về chính xác ở C code.

Okie có vẻ vẫn hơi mơ hồ, tôi sẽ cùng các bạn giải quyết. Đầu tiên chúng ta sẽ bắt đầu với những dòng lệnh sau :

.004122F0: 55 push ebp

.004122F1: 8BEC mov ebp,esp

.004122F3: 83EC48 sub esp,048 ;”H”

.004122F6: 53 push ebx

.004122F7: 56 push esi

.004122F8: 57 push edi

Hai dòng lệnh đầu tiên còn được biết đến với một cái tên là “stack frame”.Về bản chất đây là một ‘local’ stack bên trong của hàm, nơi mà chúng ta tưởng tượng như là một căn phòng đặc biệt dùng để chứa các biến cục bộ (local variables). Việc tạo ra căn phòng này có thể được thực hiện rất dễ dàng bằng cách đơn giản là giảm con trỏ stack đi một số bit nào đó, cụ thể là bao nhiêu bytes cần thiết cho việc lưu trữ các biến cục bộ.

Một trong những lợi thế chính của Stack frame chính là ở thanh ghi EBP, nó có thể được sử dụng như là một con trỏ cố định tới các biến tham chiếu (reference varibales) (Nằm ở trên thanh ghi EBP là các tham số, ở dưới nó thì là các biến cục bộ) (Đọc thêm các bài viết của anh Be)

Chú ý rằng các con trỏ Stack như (ESP và EBP) cần phải được phục hồi lại trước rời khỏi một hàm nào đó, để tránh cho việc lỗi Stack corruption.

.004122F0: 55 push ebp

.004122F1: 8BEC mov ebp,esp

.004122F3: 83EC48 sub esp,048 ;”H”

Trên đây là quá trình tạo Stack Frame và căn phòng được với không gian là 48 bytes dành cho việc lưu trữ các biến cục bộ.

Windows yêu cầu rằng một vài thanh ghi khác ngoài ESP và EBP cũng cần được bảo vệ trong suốt quá trình của một Callback function, đó là những thanh ghi EBX, ESI và EDI. Chúng được lưu trữ một cách an toàn trên Stack, và sẵn sàng để khôi phục lại đúng vị trí trước khi rời khỏi hàm.Điều này cho phép sự tự do khi sử dụng những thanh ghi này bên trong một hàm.

Đã có quá trình lưu giữ thanh ghi thì cũng phải có quá trình phục hồi chúng, điều này được thực hiện nhờ vào các câu lệnh rất đơn giản. Và nhìn vào đó ta biết ngay nó làm gì :

.00412348: 5F pop edi

.00412349: 5E pop esi

.0041234A: 5B pop ebx

.0041234B: 8BE5 mov esp,ebp

.0041234D: 5D pop ebp

.0041234E: C3 retn

Đầu tiên 3 thanh ghi được khôi phục từ stack của chúng ta. Sau đó Stack được phục hồi lại trạng thái của nó sau khi hàm đã được gọi và khi gặp câu lệnh Return. Chú ý rằng chúng ta không thể khôi phục Stack trước khi khôi phục 3 thanh ghi được, bởi vì các thanh ghi của chúng đã được lưu trên Stack.Chuyển tất cả đoạn code trên sang C là rất dễ dàng. Bây giờ chúng ta biết rằng đây có thể là một hàm, bởi vì dựa vào Stack Frame cũng như việc lưu trữ và phục hồi các thanh ghi, v..v.. :

void SomeFunction()

{

//…code…

}

Bây giờ tôi giả sử rằng đây là một void function, bởi vì không hề có bất kì một sự thay đổi nào trong thanh ghi EAX trước khi Return. Điều đó không có nghĩa là EAX đã không bị thay đổi. Nhưng cho đến bây giờ, chúng ta sẽ giả sử giá trị trong thanh ghi EAX bị lờ đi.

Tiếp theo chúng ta sẽ tiếp tục với thân của hàm này :

.004122F9: C745F800000000 mov d,[ebp][-08],000000000 ;”

.00412300: EB09 jmps .00041230B —–¯ (1)

.00412302: 8B45F8 mov eax,[ebp][-08]

.00412305: 83C001 add eax,001 ;”J

.00412308: 8945F8 mov [ebp][-08],eax

.0041230B: 8B4508 mov eax,[ebp][08]

.0041230E: 50 push eax

.0041230F: FF1584A34300 call lstrlenA ;KERNEL32.dll

.00412315: 3945F8 cmp [ebp][-08],eax

.00412318: 7D2E jge .000412348 —–¯ (2)

Chúng ta hãy để ý tới giá trị được tham chiếu đến :

d,[ebp][-08] == dword ptr[ebp-08] (in another notation)

Như tôi đã nói, bời vì nó nằm dưới thanh ghi EBP của chúng ta (thanh ghi EBP đang được lưu trên Stack), vì vậy hàm đang lưu trữ một biến cục bộ ở đó. Chúng ta biết được rằng nó có kích thước là DWORD và nó có thể là một giá trị có dấu (signed value), bởi nó được đem đi so sánh với kết quả của hàm lstrlenA, mà kết quả của hàm này là một signed int). Trên nền tảng win32, thì giá trị signed dword trong C là (signed) int. Chúng ta hãy đổi tên của nó thành int_locall để cho việc đọc hiểu trở nên dễ dàng hơn :

.004122F9: mov int_local1, 000000000

.00412300: jmps .00041230B —–¯ (1)

.00412302: mov eax, int_local1

.00412305: add eax,001

.00412308: mov int_local1, eax

.0041230B: mov eax,[ebp][08]

.0041230E: push eax

.0041230F: call lstrlenA ;KERNEL32.dll

.00412315: cmp int_local1,eax

.00412318: jge .000412348 —–¯ (2)

Okie đã thấy sáng sủa hơn một chút, tuy nhiên các bạn hãy cẩn thận ở đây, đừng nhầm lần giữa [ebp][08] với [ebp][-08] . Mặc dù là nhìn thoáng qua ta cũng thấy nó giống nhau đấy chứ, tuy nhiên đây lại là những địa chỉ hoàn toàn khác nhau. Biến tại địa chỉ [ebp][08] thì luôn luôn là một tham số đầu tiên được truyền vào hàm của chúng ta. Chính vì lí do đó chúng ta sẽ đổi tên của giá trị này thành dw_param1. Khà khà sau một hồi phân tích chúng ta đã xác định được biến cục bộ, và làm sáng tỏ được một số vấn đề , bây giờ chúng ta sẽ thử chuyển nó sang một đoạn mã giả C :

int_local1 = 0;

goto label_41230B;

eax = int_local1;

eax = eax + 1;

int_local1 = eax;

label_41230B:

eax = dw_param1;

eax = lstrlenA(eax); //lstrlenA returns its result in eax

if( int_local1 >= eax)

goto label_412348;

Vậy là phần nào chúng ta đã có một cái nhìn dễ dàng hơn với đoạn code trên, tuy nhiên đây mới chỉ là điểm khởi đầu.Việc tiếp theo chúng ta phải dùng tư duy của mình để tối ưu hóa lại đoạn code này, hãy nhìn lại 3 dòng sau :

eax = int_local1;

eax = eax + 1;

int_local1 = eax;

Chúng ta sẽ thấy rằng đoạn code trên là hơi thừa nó có thể được đơn giản hóa lại như sau :

int_local1++;

Điểm khác biệt duy nhất giữa hai cách thể hiện này là thanh ghi EAX không xuất hiện trong cách biểu diễn thứ hai. Chúng ta cần phải cẩn thận quan sát, vì rất có thể giá trị của thanh ghi EAX sẽ lại được sử dụng ở phía bên dưới thì sao J.

Tiếp theo ta đến dòng kế tiếp :

eax = dw_param1;

Điều này có nghĩa là những gì chúng ta làm ở trên là đúng bởi vì thanh ghi EAX đã được thay đổi bằng cách được gán 1 giá trị mới. Phần tiếp theo :

eax = dw_param1;

eax = lstrlenA(eax); // lstrlenA returns its result in eax

if( int_local1 >= eax)

goto label_412348;

Với đoạn code này chúng ta hoàn toàn có thể làm cho nó trở nên dễ dàng hơn, chúng ta có thể kết hợp những câu lệnh trên lại như sau :

if( int_local1 >= lstrlenA(dw_param1) )

goto label_412348;

Một lần nữa chúng ta phải quan sát xem thành ghi EAX có được sử dụng trong các đoạn code bên dưới không, để từ đó chúng ta không bỏ sót vị trí nơi mà giá trị của thanh ghi này đang được sử dụng. Trong các câu lệnh sau đó, giá trị của EAX bị thay đổi, do đó chúng ta không cần quan tâm về những thay đổi của chúng ta. Bởi vì chúng ta biết rằng hàm lstrlenA sẽ lấy đầu vào là một con trỏ trỏ tới một chuỗi, do đó chúng ta sẽ thay đổi tham số này thành pString , cuối cùng ta có được như sau :

int_local1 = 0;

goto label_41230B;

int_local1++;

label_41230B:

if( int_local1 >= lstrlenA(pString))

goto label_412348;

Quan sát toàn bộ đoạn code tiếp theo trong hàm này chúng ta thấy được dòng sau :

.00412346: EBBA jmps .000412302 —–­ (3)

Đây là một câu lệnh nhảy và nó nhảy trở về vị trí có câu lệnh int_local1++; , điều này chứng tỏ đây là một vòng lặp. Nếu như bạn đã quen thuộc với lập trình C, bạn có thể minh họa được cấu trúc này.Đây dường như là một vòng lặp for. Chúng ta sẽ cố gắng để biểu diễn lại nó, bằng cách thay đổi biến int_local1 thành i. Chúng ta sẽ viết lại dưới ngôn ngữ C như sau :

for(i = 0; i < lstrlenA(pString); i++)

{

//…rest of code…

}

Mọi việc đang dần dần được rõ ràng J. Giờ chúng ta đã biết hàm này có một vòng lặp, với số lần lặp bắt đầu từ 0 cho tới chiều dài của chuỗi có được thông qua tham số đầu tiên (lstrlenA(pString)). Tiếp theo chúng ta cần biết những gì đang diễn ra bên trong thân vòng lặp :

.0041231A: mov eax, pString

.0041231D: add eax,i

.00412320: mov cl,[eax]

.00412322: mov [ebp][-01],cl

.00412325: movzx eax,b,[ebp][-01]

.00412329: cmp eax,061 ;”a”

.0041232C: jl .000412346 —–¯ (1)

.0041232E: movzx eax,b,[ebp][-01]

.00412332: cmp eax,07A ;”z”

.00412335: jg .000412346 —–¯ (2)

.00412337: movzx eax,b,[ebp][-01]

.0041233B: sub eax,020 ;” ”

.0041233E: mov ecx, pString

.00412341: add ecx, i

.00412344: mov [ecx],al

Trong đoạn code này chúng ta lại thấy có một biến cục bộ khác được sử dụng. Nó xuất hiện dưới kiểu unsigned char , bởi vì nó có kích thước là byte ( byte ptr) và được sử dụng nhưng là unsigned (bởi câu lệnh movzx). Trong đoạn mã giả C, ta có thể viết lại như sau :

eax = pString;

eax = eax + i;

cl = *(eax);

ch_local2 = cl;

eax = (DWORD) ch_local2;

if(eax < 0×61) // “a”

goto label_412346;

eax = (DWORD) ch_local2;

if(eax > 0×7A) // “z”

goto label_412346;

eax = (DWORD) ch_local2;

eax = eax – 0×20;

ecx = pString;

ecx = ecx + i;

*(ecx) = al;

Bây giờ tiếp tục, chúng ta sẽ làm cho đoạn code của chương trình rõ ràng hơn, tôi đổi tên kí tự thành c cho nó ngắn gọn :

c = pString[i];

if((c < ‘a’) || (c > ‘z’))

goto label_412346;

pString[i] = c-0×20;

Để ý rằng địa chỉ tại 412346 chỉ đơn giản là vị trí kết thúc vòng lặp, vì vậy chúng ta có thể thay thế ‘goto label_412346’ bằng ‘continue;’, hoặc chúng ta có thể đảo conditional jumps.

Chúng ta nhận thấy rằng chương trình kết thúc vòng lặp nếu (c<‘a’)||(c>‘z’), vậy thì nó sẽ không kết thúc vòng lặp nếu ta đổi thành (c>=’a’)&&(c<=’z’), điều này cho phép chúng ta thay đổi lại cấu trúc như sau :

c = pString[i];

if((c >= ‘a’) && (c <= ‘z’))

pString[i] = c-0×20;

//…end of loop

Các bạn thấy đó , mọi thứ đã sáng tỏ và dễ hiểu hơn rất nhiều. Bây giờ chúng ta đã bắt đầu hiểu những gì đoạn code này đang làm. Chúng ta hãy sắp xếp lại chúng lại thành đoạn code cuối cùng như sau :

void SomeFunction(char* pString)

{

int i; //Local variables have to be declared

unsigned char c; //at the start of the function.

for(i = 0; i < lstrlenA(pString); i++)

{

c = pString[i];

if((c >= ‘a’) && (c <= ‘z’))

pString[i] = c-0×20;

}

}

Cuối cùng chúng ta đã có được một đoạn code ngắn gọn hơn nhiều so với những gì chúng ta đã đọc với ASM code.Nó đã được chuyển đổi hoàn toàn sang ngôn ngữ C, nhiệm vụ của nó là lấy từng kí tự từ String đầu vào, và nếu kí tự đó nằm trong khoảng ‘a’ và ‘z’ (tức là các kí tự chữ cái thường) nó sẽ được trừ đi cho 0×20h. Mà phép trừ này biểu diễn cho quá trình chúng ta chuyển đổi nó từ chữ cái thường thành chữ cái hoa. Do đó chúng ta sẽ đặt tên cho hàm này một cách gợi nhớ hơn là ToUpperCase .

V. Lời kết

Toàn bộ quá trình mà tôi và các bạn đã làm ở trên được gọi với cái tên : RE (Reverse Engineering). Chúng ta thấy rằng nó không phải là một việc làm quá khó, nhưng nó đòi hỏi một lòng kiên nhẫn và một kiến thức nền tảng vững chắc. Để chỉ khi ta chỉ nhìn lướt qua đoạn code ta có thể hiểu ngay được nó làm gì. Có một công cụ giúp chúng ta đơn giản hóa công việc đi rất nhiều, một trong số đó chính là IDA mà tôi đã giới thiệu với anh em.Hi vọng bài viết này của tôi sẽ phần nào giúp mọi người hiểu được quá trình phân tích một đoạn code như thế nào, chỉ có một lời khuyên duy nhất đó là các bạn hãy thực hành thật nhiều mới có thể đạt được những điều mình mong muốn. Qua đây tôi cũng xin cảm ơn tác giả Webbit đã cho chúng ta một bài viết rất hay và bổ ích.

Thời gian trôi đi rất nhanh

Vì sao ta cứ mãi đứng yên

Ngoài kia bóng tối đang dần buông

Lại một ngày nữa sắp qua mất rồi.

PS : Hi vọng anh TQN, Thug và light.phoenix có thời gian viết vài bài cho anh em mở rộng tầm mắt J

Best Regards

_[Kienmanowar]_

Posted in IDA Tutorials, Understanding Code | Leave a Comment »

IDA Pro Advanced_N0w 0r N3v3r

Posted by kienmanowar on September 10, 2008

IDA Pro Advanced_N0w 0r N3v3r

Author: _[kienmanowar]_

“Sóng gió cuộc đời chợt đến có ai chờ đợi.

Biết đâu một ngày phận người que diêm trước gió.

Lụi tàn trong một sớm không ngoài ai.

Nhưng với một triệu người

Hơi ấm sẻ chia từng người

Những đôi tay trần dìu nhau qua cơn khốn khó

Tầm hồn luôn rộng mở rất chân thành”

Rock mang đến cho tôi sự hứng khởi, lòng đam mê, tình yêu cháy bỏng, sự cuồng nhiệt và niềm tin vào cuộc sống. Giúp tôi vững bước trước mọi khó khăn sóng gió cuộc đời.”

I. Intro :

Chào tất cả các anh em REA, chúng ta lại gặp nhau trong phần tiếp theo tôi viết về IDA. Đây là bài viết của tác giả Medardus, có thể coi đây như là một “đơn đặt hàng” của anh Be, và tôi là người đứng ra nhận “bảo kê” cho “đơn đặt hàng” này. Thực tế tôi đã có ý định viết bài này từ rất lâu nhưng… hii lại có từ nhưng, vì thời gian bận bịu quá, sắp tới công việc lại có một số thay đổi mà chưa biết sẽ thế nào. Như đã hứa với anh em, bài viết trước tôi đã giới thiệu sơ qua một số tính năng của IDA, đủ để thuyết phục những người dù là khó tính nhất.Trong bài viết này tôi sẽ ứng dụng sử dụng IDA trong quá trình Reverse một Crackme.Hii trình độ tôi vẫn còn kém cỏi, không biết có đủ sức để hầu chuyện anh em không nữa :) . Okie, N0w L3t’s g0!!!!

II. IDA or W32Dasm…. N0w 0r N3v3r!!

Từ những ngày đầu tiên chập chững bước vào tìm hiểu thế giới Cracking & Reversing, những tut đầu tiên mà tôi đọc là của bậc đàn anh Ngô Vĩnh Hoàng hay còn được biết đến với nickname là NVH(c), nhớ lại cái thủa ban đầu ngơ ngác ấy tôi chẳng biết cái quái gì cả, chỉ biết đọc, down công cụ và làm theo một cách hoàn toàn dập khuôn , cứ 74->75, 75->74, không được nữa thì hehe Nop, nop, nop mà ít đầu tư vào suy nghĩ tại sao lại như thế.Mà hầu hết các tut thời đó đều sử dụng W32Dasm, Hiew, SoftIce v…v.. Sh1t!! nghĩ lại cái lúc hì hục cái SoftIce đến nhục, đọc và làm theo y như hướng dẫn mà lần nào Debug không treo máy thì lại bị Crash, hic cú quá tôi nghỉ chơi với SoftIce. Rồi sau này đọc các tut của lão nhỏ, tham gia vào REA ngay từ những ngày đầu tiên tôi dần dần tìm hiểu từ từ từng tí một. Các tut thời gian đó cũng hầu hết tập trung vào SoftIce, W32Dasm nhưng có sự xuất hiện của một Tool debugger mới mà hiện nay các bạn đang sử dụng đó, không nói chắc các bạn cũng biết đó chính là “em” Ollydbg. Hiii sân chơi của REA lúc đó đâu có được đông như bây giờ, chỉ có vài anh em, cầm đầu là anh Còm, anh Moon, lão Zom, bác RongchauA, bác deux, chú Little, trong đó người có nhiều bài viết nhất là anh Moon, khà khà tôi, anh Be, lão Q là một trong những member đầu tiên và cũng là những người trụ lại lâu nhất trong REA. Có thể nói REA lúc đó là một tập thể tuy chưa hiểu hết về nhau nhưng đã có cảm giác như anh em một nhà, rất gắn bó, trao đổi thẳng thắn, giúp đỡ nhau nhiệt tình và cho đến bây giờ vẫn vậy. Có thể tự hào mà nói rằng REA là một trong những 4room có “chất” nhất ở Việt Nam.

Hehe hơi lạc đề thì phải, như các bạn thấy thời đó công cụ Disassembly được ưa chuộng nhất là W32Dasm, có thể nói nó là công cụ của mọi Newbies, đơn giản, dễ học và dễ sử dụng. Nhưng sau này khi được tiếp xúc nhiều hơn với Cracking & Reversing, tôi thấy có một công cụ được nhắc đến khá nhiều đó là IDA được dùng cho cả hai giới Reversing lẫn Security.Lúc đó tôi tự hỏi “IDA là công cụ gì mà kinh thế?” nhưng rất tiếc không có câu trả lời. Sau này khi W32Dasm không còn được phát triển nữa, nó không đáp ứng được những chương trình có mức độ Protect cao cũng như những chương trình bị Packed, hic hic không còn cách nào khác tôi đành nhắm mắt đưa chân, download em IDA về “nghịch” thử xem thế nào. Phải nói rằng cảm giác đầu tiên khi mở IDA lên là một cảm giác choáng ngợp đến khỏ tả, vừa khó dùng lại vừa lắm chức năng, rối rắm và phức tạp J.

IDA là một chương trình Disassembler được phát triển bởi hãng DataRescure. Những ai đã từng sử dụng qua W32Dasm thì chắc hẳn sẽ biết Disassembler là như thế nào.Đối với những người chưa biềt gì thì có thể nói: Disassembler là một chương trình, mà theo đó nhờ vào sự giúp đỡ, hỗ trợ của chương trình này nó sẽ chuyển đổi code của một file (exe hay dll) về dạng mã assembler, được sắp xếp lại theo một khuôn dạng dễ hiểu và dễ đọc hơn. IDA hỗ trợ đầy đủ

các tính năng có trên W32Dasm, thêm vào đó nó còn hộ trợ thêm những tính năng cao cấp khác mà W32Dasm không có, ví dụ như : FLIRT (Nearly Library Identification and Recognition Technology), giúp đỡ cho việc nhận diện các hàm phù hợp từ các thư viện khác nhau và hỗ trợ các chú thích cung cấp cho việc mô tả.Sẽ rất ít người trả lời cho bạn tại sao IDA lại được sử dụng nhiều đến thế, chỉ còn mỗi một cách là tự mình tìm hiểu và chắt lọc. Vậy còn chần chừ gì nữa mà không tìm hiểu về IDA.

III. Play with Crackme

Oki, tốn bao giấy mực mới đến phần quan trọng nhất của bài viết này, đó là sử dụng IDA để thực hành với 1 Crackme.Tại sao lại là Crackme vì đơn giản nó có kích thước nhỏ và dễ dàng trong việc

Demo những kiến thức, thêm nữa là IDA sẽ disassembly rất nhanh còn nếu không bạn phải chờ dài cổ khà khà. Trong bài ngày hôm nay tôi sẽ sử dụng Crackme là CoSH Crackme #2.exe. Run thử Crackme này lên xem thế nào, đây chính là một bước quan trọng trong quá trình Reverse, tương tự như ta tiếp xúc với một người, ta phải quan sát thái độ, hành vi của người đó trước để còn liệu đường mà cử xử lại cho phải phép :) .

Download toàn bộ bài viết tại đây :

ida_now_or_never

Posted in IDA Pro Advanced_N0w 0r N3v3r, IDA Tutorials | Leave a Comment »

Phân tích RCA crackme bằng Olly và IDA+HexRays

Posted by kienmanowar on September 11, 2008

Trên REA lão RCA có code một cái crackme nhỏ và ra đề như sau :

+ Crackme level 1.1 by Rongchaua.
- Level : Very very easy.
- Aim :
. Thực tập cách set breakpoint.
. Thực tập patch.
. Mã Ascii.

Rảnh rỗi ngồi phân tích thử xem thế nào!

Dùng PeID check thử, hú hồn may quá lão Rồng nhà ta không pack, thoát khỏi bước đầu tiên. Đọc Rulz và run thử Crackme thì thấy nút Checkit bị Disable mất tiêu. Soi lại list các hàm API thường dùng cho Window thì thấy có em EnableWindow (đây mới chỉ là nghi thôi)

The EnableWindow function enables or disables mouse and keyboard input to the specified window or control. When input is disabled, the window does not receive input such as mouse clicks and key presses. When input is enabled, the window receives all input.

BOOL EnableWindow(
HWND hWnd, // handle to window
BOOL bEnable // flag for enabling or disabling input
);

Parameters
hWnd
Identifies the window to be enabled or disabled.
bEnable
Specifies whether to enable or disable the window. If this parameter is TRUE, the window is enabled. If the parameter is FALSE, the window is disabled.

Okie đã có thông tin cho sol đầu tiên “Patch to enable the button”, load crackme vào trong Olly. Tại Olly , chuột phải và chọn Search all intermodular calls, ta sẽ thấy được một list các danh sách API mà lão Rồng dùng :

Found intermodular calls
Address Disassembly Destination
00401000 Cr PUSH 0 (Initial CPU selection)
004010FE CALL user32.CreateDialogParamA
00401035 CALL user32.DialogBoxParamA
0040107D CALL user32.EnableWindow
0040108C CALL user32.EnableWindow
004011D5 CALL user32.EnableWindow
004011EF CALL user32.EnableWindow
00401113 CALL user32.EndDialog
00401125 CALL user32.EndDialog
0040123C CALL user32.EndDialog
0040103B CALL kernel32.ExitProcess
0040106C CALL user32.GetDlgItem
004011C8 CALL user32.GetDlgItem
004011E2 CALL user32.GetDlgItem
004010BA CALL user32.GetDlgItemTextA
004010D1 CALL user32.GetDlgItemTextA
00401002 CALL kernel32.GetModuleHandleA
00401017 CALL user32.LoadIconA
0040118C CALL kernel32.lstrcatA
004011A3 CALL kernel32.lstrcmpA
0040115F CALL kernel32.lstrlenA
004011BB CALL user32.MessageBoxA
00401205 CALL user32.MessageBoxA
00401140 CALL ntdll.RtlZeroMemory
0040114F CALL ntdll.RtlZeroMemory
0040105F CALL user32.SendMessageA
0040122A CALL user32.SendMessageA
0040117A CALL user32.wsprintfA

_Ái chà có tới 4 hàm EnableWindow lận, vậy là không còn nghi ngờ gì nữa rồi.Chuột phải vào 1 hàm EnableWindow bất kì và chọn Set BP on every call to EnableWindow. Kết thúc quá trình Set BP, bây h nhấn F9 để Run cracke. Bụp, Olly đã break tại 1 hàm EnableWindow và đây chính là hàm cần Patch. Lý do tại sao tôi khẳng định được là vì khi form crackme của lão Rồng được load lên thì hàm EnableWindow sẽ được load theo để Disable cái nút nhấn Checkit :

00401087 |> \6A 00 PUSH 0 ; /Enable = FALSE <== Patch here
00401089 |. FF75 FC PUSH DWORD PTR SS:[EBP-4] ; |hWnd
0040108C |. E8 D3010000 CALL ; \EnableWindow <== Break here

_Dịch lên 1 chút ta thấy PUSH 0, và thấy Olly comment bên cạnh. Do đó ta sẽ patch lại thành PUSH 1 . (0 và 1 ở đây thực chất là các cờ dùng cho việc set disable hoặc enable)

_Patch xong save lại và Run .. Done nút Checkit đã được Enable lên. Vậy là đã giải quyết được bài tập thứ nhât!

_Tiếp theo là đến bài tập tìm Real Serial. Như trong danh sách các APIs mà lão Rồng dùng ở trên, chúng ta để ý thấy có hàm GetDlgItemTextA. Check lại info về hàm này :

The GetDlgItemText function retrieves the title or text associated with a control in a dialog box.
UINT GetDlgItemText(
HWND hDlg, // handle of dialog box
int nIDDlgItem, // identifier of control
LPTSTR lpString, // address of buffer for text
int nMaxCount // maximum size of string
);

_Okie vậy là ta set 1 BP tại GetDlgItemTextA. Sau đó nhấn F9 để run Crackme và nhập thông tin về UserName và Fake Serial vào. Cuối cùng nhấn CheckIt, ta sẽ break tại đây trong Olly :

004010A8 |. 68 00010000 PUSH 100 ; /Count = 100 (256.)
004010AD |. 68 68304000 PUSH CrackMe.00403068 ; |Buffer = CrackMe.00403068
004010B2 |. 68 EC030000 PUSH 3EC ; |ControlID = 3EC (1004.)
004010B7 |. FF75 08 PUSH DWORD PTR SS:[EBP+8] ; |hWnd
004010BA |. E8 B7010000 CALL ; \GetDlgItemTextA <== Break here

Tại cửa sổ Stack :

0012FB1C 000C019E |hWnd = 000C019E ('CrackMe Level 1.1 by Rongchaua',class='#32770')
0012FB20 000003EC |ControlID = 3EC (1004.)
0012FB24 00403068 |Buffer = CrackMe.00403068
0012FB28 00000100 \Count = 100 (256.)

_UserName nhập vào của chúng ta sẽ được lưu tại Buffer trên. F8 để trace qua hàm , tại cửa sổ Dump ta có :

00403068  6B 69 65 6E 6D 61 6E 6F 77 61 72 00 00 00 00 00  kienmanowar.....

_Tương tự với hàm tiếp theo ta cũng có được kết quả FakeSerial được lưu vào một Buffer khác :

00403368  31 31 31 31 31 39 38 32 00 00 00 00 00 00 00 00  11111982........

_Sau khi Trace xong ta tới đây :


004010D6 |. FF75 08 PUSH DWORD PTR SS:[EBP+8] ; /Arg1
004010D9 |. E8 52000000 CALL CrackMe.00401130 ; \CrackMe.00401130 <== Trace Into

_ Trace Into vào hàm Call ở trên, ta sẽ tới quá trình tính toán sinh ra Real Serial.

00401130 /$ 55 PUSH EBP
00401131 |. 8BEC MOV EBP,ESP
00401133 |. 83C4 F8 ADD ESP,-8
00401136 |. 68 00010000 PUSH 100 ; /Length = 100 (256.)
0040113B |. 68 68314000 PUSH CrackMe.00403168 ; |Destination = CrackMe.00403168
00401140 |. E8 55010000 CALL ; \RtlZeroMemory
00401145 |. 68 00010000 PUSH 100 ; /Length = 100 (256.)
0040114A |. 68 68324000 PUSH CrackMe.00403268 ; |Destination = CrackMe.00403268
0040114F |. E8 46010000 CALL ; \RtlZeroMemory
00401154 |. BE 68324000 MOV ESI,CrackMe.00403268 ; ASCII "6b"
00401159 |. BF 68304000 MOV EDI,CrackMe.00403068 ; <== FU
0040115E |. 57 PUSH EDI ; /String => "kienmanowar"
0040115F |. E8 48010000 CALL ; \lstrlenA
00401164 |. 8BD8 MOV EBX,EAX ; <== Len = Length(User Name)
00401166 |. 33C0 XOR EAX,EAX ; <== i == 0
00401168 |> 50 /PUSH EAX ; <== i
00401169 |. 53 |PUSH EBX ; <== Len
0040116A |. 57 |PUSH EDI ; <== FU
0040116B |. 0FBE0C38 |MOVSX ECX,BYTE PTR DS:[EAX+EDI] ; <== Temp = FU [i]
0040116F |. 51 |PUSH ECX ; /<%x>
00401170 |. 68 59304000 |PUSH CrackMe.00403059 ; |Format = "%x"
00401175 |. 68 68314000 |PUSH CrackMe.00403168 ; |s = CrackMe.00403168
0040117A |. E8 D3000000 |CALL ; \wsprintfA
0040117F |. 83C4 0C |ADD ESP,0C
00401182 |. 68 68314000 |PUSH CrackMe.00403168 ; /StringToAdd = "69"
00401187 |. 68 68324000 |PUSH CrackMe.00403268 ; |ConcatString = "6b"
0040118C |. E8 0F010000 |CALL ; \lstrcatA
00401191 |. 5F |POP EDI
00401192 |. 5B |POP EBX
00401193 |. 58 |POP EAX
00401194 |. 40 |INC EAX ; <== i++
00401195 |. 3BC3 |CMP EAX,EBX ; <== While i < Len
00401197 |.^ 7C CF \JL SHORT CrackMe.00401168 ; <== Continue
00401199 |. 68 68334000 PUSH CrackMe.00403368 ; /String2 = "11111982"
0040119E |. 68 68324000 PUSH CrackMe.00403268 ; |String1 = "6b"
004011A3 |. E8 FE000000 CALL ; \lstrcmpA
004011A8 |. 0BC0 OR EAX,EAX
004011AA |. 75 4A JNZ SHORT CrackMe.004011F6
004011AC |. 6A 00 PUSH 0 ; /Style = MB_OK|MB_APPLMODAL
004011AE |. 68 00304000 PUSH CrackMe.00403000 ; |Title = "Reverse Engineering Association"
004011B3 |. 68 20304000 PUSH CrackMe.00403020 ; |Text = "Congratulation! You've done with it"
004011B8 |. FF75 08 PUSH DWORD PTR SS:[EBP+8] ; |hOwner
004011BB |. E8 C2000000 CALL ; \MessageBoxA
004011C0 |. 68 EC030000 PUSH 3EC ; /ControlID = 3EC (1004.)
004011C5 |. FF75 08 PUSH DWORD PTR SS:[EBP+8] ; |hWnd
004011C8 |. E8 A3000000 CALL ; \GetDlgItem
004011CD |. 8945 FC MOV DWORD PTR SS:[EBP-4],EAX
004011D0 |. 6A 00 PUSH 0 ; /Enable = FALSE
004011D2 |. FF75 FC PUSH DWORD PTR SS:[EBP-4] ; |hWnd
004011D5 |. E8 8A000000 CALL ; \EnableWindow
004011DA |. 68 ED030000 PUSH 3ED ; /ControlID = 3ED (1005.)
004011DF |. FF75 08 PUSH DWORD PTR SS:[EBP+8] ; |hWnd
004011E2 |. E8 89000000 CALL ; \GetDlgItem
004011E7 |. 8945 F8 MOV DWORD PTR SS:[EBP-8],EAX
004011EA |. 6A 00 PUSH 0 ; /Enable = FALSE
004011EC |. FF75 F8 PUSH DWORD PTR SS:[EBP-8] ; |hWnd
004011EF |. E8 70000000 CALL ; \EnableWindow
004011F4 |. EB 14 JMP SHORT CrackMe.0040120A
004011F6 |> 6A 00 PUSH 0 ; /Style = MB_OK|MB_APPLMODAL
004011F8 |. 68 00304000 PUSH CrackMe.00403000 ; |Title = "Reverse Engineering Association"
004011FD |. 68 44304000 PUSH CrackMe.00403044 ; |Text = "No,no! Try it again!"
00401202 |. FF75 08 PUSH DWORD PTR SS:[EBP+8] ; |hOwner
00401205 |. E8 78000000 CALL ; \MessageBoxA
0040120A |> C9 LEAVE
0040120B \. C2 0400 RETN 4

_ Tóm tắt đoạn code này như sau :
Đây là một vòng lặp dùng để chuyển từng kí tự trong chuỗi user name mà chúng ta nhập vào sang dạng mã Hexa của kí tự đó ( ví dụ : k — 0×6b). Sau quá trình trace khỏi vòng lặp ta được kết quả như sau :

EAX 0000000B <== length(FU)
ECX 77E74BAE kernel32.77E74BAE
EDX 00000003
EBX 0000000B
ESP 0012FB18
EBP 0012FB20
ESI 00403268 ASCII "6b69656e6d616e6f776172" <== after converted
EDI 00403068 ASCII "kienmanowar" <== String to convert

_Chuỗi sau khi tính toán sẽ được đem đi so sành với Serial mà chúng ta nhập vào. Đúng thì Ok, còn sai thì đi bụi

00401199 |. 68 68334000 PUSH CrackMe.00403368 ; /String2 = "11111982"
0040119E |. 68 68324000 PUSH CrackMe.00403268 ; |String1 = "6b69656e6d616e6f776172"
004011A3 |. E8 FE000000 CALL ; \<== Compare two Strings

Kết quả cuối cùng :

User Name : kienmanowar
Serial    : 6b69656e6d616e6f776172

Phần tiếp theo là dùng IDA+HexRays :

Cái tên HexRays sau khi xuất hiện trên site của lão Ilfak Guilfanov (http://www.hexblog.com/) đã làm cho giới RE kinh thiên động địa mặc dù lúc đó nó mới chỉ là trong ý tưởng.Đến sau này khi lão release sản phầm và public trên một site khác (http://www.hex-rays.com/) càng làm cho “giang hồ” thèm muốn. Nhưng cái giá mà lão đưa ra để có được HexRays thì quá chua chát : “A single user license of the Hex-Rays Decompiler is 2299USD (1500EUR)”. Với số tiến như thế này thì có mà thách đố, chắc đi cày đến hết đời mới mua nổi em nó về dùng. Cũng có một số team có ý định và đã bỏ tiền ra mua HexRays về sử dụng…. nhưng rồi đến một ngày, một ngày mà cả giới RE phải online để download hàng. Đó chỉnh là hôm YAG Team public hexrays cho bà con download….. Hơ hơ nhưng mà tool xịn có trong tay rồi, giờ dùng sao ta ? Không lẽ down về để đó ngó chơi…… hơn 2 ngàn $ chứ có ít đâu . Hôm nay tập dùng HexRays bèn lấy em crackme của lão Rồng ra vọc thử .. Thấy đại ca Còm dùng HexRays hay quá nên ráng đua đòi ..nhưng cũng chỉ dừng ở mức cưỡi ngựa xem hoa chứ chưa dám chạy trước . Và đây là kết quả cuối cùng sau một hồi ngồi phân tích bằng IDA + HexRays :

int __stdcall DialogFunc(HWND a1, UINT a2, WPARAM a3, LPARAM a4)
{
HWND v5; // eax@2
HWND hWnd; // [sp+0h] [bp-4h]@2

switch ( a2 )
{
case 0x110u:
SendMessageA(a1, 0x80u, 1u, lParam);
v5 = GetDlgItem(a1, 1006);
hWnd = v5;
if ( v5 )
EnableWindow(hWnd, FALSE); // disable checkit button
else
EnableWindow(hWnd, TRUE);
break;
case 0x111u:
switch ( a3 )
{
case 0x3EEu:
GetDlgItemTextA(a1, 1004, szName, 256);
GetDlgItemTextA(a1, 1005, szSerial, 256);
convert_szName_to_hex(a1);
break;
case 0x3F0u:
CreateDialogParamA(hInstance, (LPCSTR)0x3F1, a1, sub_40120E, 0);
break;
case 0x3EFu:
EndDialog(a1, 0);
break;
}
break;
case 0x10u:
EndDialog(a1, 0);
break;
}
return 0;
}

void __stdcall convert_szName_to_hex(HWND hDlg)
{
int i; // eax@1
int iLen; // ebx@1
int iIndex; // ST14_4@2
HWND v4; // eax@4
HWND v5; // eax@4

RtlZeroMemory(szBuf, 256); // Set a block of memory with 0's.
RtlZeroMemory(szHex, 256);
iLen = lstrlenA(szName);
i = 0;
do
{
iIndex = i;
wsprintfA(szBuf, "%x", szName[i]); // convert szName[i] to Hexa and store in a szBuf
lstrcatA(szHex, szBuf); // append szBuf to szHex
i = iIndex + 1;
}
while ( iIndex + 1 < iLen );
if ( lstrcmpA(szHex, szSerial) ) // compare szHex with szSerial
{
MessageBoxA(hDlg, "No,no! Try it again!", "Reverse Engineering Association", 0);
}
else
{
MessageBoxA(hDlg, "Congratulation! You've done with it", "Reverse Engineering Association", 0);
v4 = GetDlgItem(hDlg, 1004);
EnableWindow(v4, 0);
v5 = GetDlgItem(hDlg, 1005);
EnableWindow(v5, 0);
}
}

Posted in IDA Tutorials, Phân tích RCA crackme bằng Olly và IDA+HexRays | Leave a Comment »

Fix FoxitReader_Part2

Posted by kienmanowar on September 12, 2008

Hôm nay tiếp tục phần 2 :
Mới được Merc share instant demo mới, nên làm tiếp cái movie nữa về fix FoxIt Reader. Phần trước ta mới bypass file pdf cấm copy và cấm take snapshot. Lần này tôi dùng một chương trình convert pdf và chọn tùy chọn là cấm cho in smilie. Cái cấm cho in này cũng ác thật, nếu trong trường hợp bạn có một tài liệu hay bằng pdf, đọc thấy thích và muốn in ra làm sách gối đầu giường nhưng ngặt nỗi bạn lại không thể in được……lúc này quả thật rất ức chế. Theo thông thường thì bạn sẽ tìm tới các trình remove protect cùa pdf còn tôi thì lại mày mò với FoxIt. Sau một hồi “nghịch” tôi cũng đã bypass và in thành công, do đó làm cái movie hướng dẫn các bạn thực hiện. Hi vọng nó giúp ích nhiều cho các bạn…. :)

Download movie ở đây:

http://www.4shared.com/file/62682052/df536fe5/Fix_FoxitReader_part2.html

Best Regards

kienmanowar

Posted in Fix Foxit Reader_Part2, My Tutorials | Leave a Comment »

0llyDbg moded for Execryptor & THEMIDA

Posted by kienmanowar on September 17, 2008

Modified Execryptor
Modified THEMIDA
Add the possibility of deleting all points of stopping Remove all breakpoints
auto path UDD & plugin
Reference Search directly from the toolbar
Show offset in status bar
Amendment to show the number of additions to the list
Additions located

1 – advancedolly.dll
2 – analyzethis.dll
3 – API_Break.dll
4 – bookmarks2.dll
5 – cmdbar.dll
6 – HideOD.dll
7 – NonaWrite.dll
8 – ODbgScript.dll
9 – OllyBugfix.dll
10 – OllyDump.dll
11 – OllyMoreMenu.dll
12 – PhantOm.dll
13 – Poison.dll
14 – ustrref.dll

This amendment took me time so there is no difference between them and the original
They accept each others additions modified
Do not forget pray for me and my family

Download link :

http://rapidshare.com/files/143392198/RAMODBG.rar.html

Posted in Ollydbg moded for Execryptor & THEMIDA, RE Tools | Leave a Comment »

ARTeam: xFile Generic Tool for Hiding Tools, by anorganix

Posted by kienmanowar on September 18, 2008

ARTeam: xFile Generic Tool for Hiding Tools, by anorganix

xFile 1.4.0.36 Released!

The File Update Module increases the size of a file to the specified value. Just enter the “Desired Size” in bytes and you’re all set. Works with all file types, with compressed/packed files also, but files with integrity check are not supported. Also, backup option has been implemented.

The Hide Caption Tool is ideal for hiding the caption of any application. Just build a list with the full/partial captions you want to hide and hit Enable. Changes apply in realtime and checks are made often to hide all instances of the application.

The Junk Cleanup Module is useful for deleting Olly’s UDD and BAK files. Also, there is an option to backup files before deletion (ZIP).

NEW! The Resource Fix Module (based on DreamTheatre’s engine) comes in handy after unpacking. Just rebuild the resources, so that you can edit them without crashing the program. You can also dump the resources to file.

Additional features:
* Drag and Drop support
* file CRC Calculator
* auto-refresh of UDD folder
* auto-save settings
* Hide Caption works faster (Partial Captions are now supported)
* fixed minor UI bugs

get it here: http://arteam.accessroot.com/releases.html

Have phun!

Posted in RE Tools | Leave a Comment »

diablo2oo2’s Universal Patcher – [dUP]

Posted by kienmanowar on September 19, 2008

diablo2oo2’s Universal Patcher – [dUP]

[Current Version]

Version: 2.17

[Features]
-multiple file patcher
-create Offset and Search&Replace patch/loader
-compare files (RawOffset and VirtualAddress) with different filesize
-registry patcher, also for loaders
-attach files to patcher
-get filepaths from registry
-usage of CRC32 and filesize checks
-patching packed files
-compress patcher with your favorite packer
-saving projects
-use custom skin in your patcher
-add music (Tracker Modules: xm,mod,it,s3m,mtm,umx,v2m,ahx,sid) to patcher
-and many more…

Download : http://free.pages.at/d2k2//downloads/dup2.rar

Posted in RE Tools | 1 Comment »

Basic types of software of protection

Posted by kienmanowar on September 19, 2008

Basic types of software of protection

Bài viết của LuCiFer trên diễn đàn REA

1. Registration – Number (Serial – Number) Protection :

Những chương trình sử dụng loại này yêu cầu người sử dụng nhập vào một registration – number để đăng ký. Có nhiều loại registration – number ,bao gồm :

Registraion – number luôn luôn giống nhau.

Registration – number thay đổi dựa vào các thông tin nhập vào như tên công ty,tên người sử dụng v.v…

Registration – number thay đổi dựa vào máy của người dùng.

Registration – number được bảo vệ trong các chương trình được viết bằng Visua Basic hoặc Borland Delphi.

Registration – number được kiểm tra online.

Registration – number Không Đổi :

Một chương trình được bảo vệ bằng phương pháp này yêu cầu người dùng nhập vào một số đăng ký như hình bên :

Tiện lợi của phương pháp bảo vệ này so với các kĩ thuật bảo vệ Registration – number khác là correct Registration- number không cần lưu trong bộ nhớ rồi đem so sánh với Registration- number được nhập vào mà cả hai sẽ được XORed hoặc tính toán rồi lấy hai kết quả đó để so sánh với nhau. Dĩ nhiên là các lập trình viên có thể sử dụng các phép tính phức tạp hoặc mã hóa nhiều sections của chương trình để làm cho các crackers khó mà tìm được một Registration-number chính xác.

Registration-number Thay Đổi Dựa Vào Thông Tin Nhập Vào :

Đây là một protection được sử dụng phổ biến. Với loại protection này thì trước khi nhập vào Registration-number bạn phải nhập tên, công ty, hoặc các thông tin khác và một Correct Registration-number sẽ thay đổi dựa vào các thông tin bạn nhập vào

……………….

………………..

Download toàn bộ bài viết:

the-basic-types-of-software-of-protection

Thanx to LuCiFer

Best Regards

kienmanowar

Posted in Basic types of software of protection, Other Tutorials | Leave a Comment »

Solution for KLiZMA’s UnpackMe #1

Posted by kienmanowar on September 19, 2008

After 2 months…
KLiZMA wrote another unpackme for you.

Rulz:

1. Unpack it maliciously…
2. Change “UNREGISTERED” to “REGISTERED”
3. Write tutorial about…

Download unpackme here: http://www.crackmes.de/users/klizma/unpackme_1

——

Solution by me:

+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
| Solution:     UnpackMe#1_by_KLiZMA           |
| Author:     kienmanowar                    |
| Protection:    Unknown packer (like Upx)      |
| Language:      Borland Delphi                 |
| Date:        05/13/06               |
| Great thanx to iamidiot for give me your hint |
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+

Tools: Ollydbg, PEid v0.94, RDG Packer Detector v0.6.3 Beta, ImpRec v1.6

ÛÛÛ [ Manual Unpacking ] ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ

Try to detect this Unpackme with PEid and RDG, i get some information :

PEiD :
+ Normal Scan : Nothing found *
+ Hardcore Scan : UPolyX v0.5 *

RDG :
+ Normal Scan : UG2002 Cruncher v0.3b3
+ Advanced Scan : UPX v0.8x (UPX Heuristico Scrambler)

With these information, i don’t know what exactly packer in which this UnpackMe used. So I use PEid plugin (Generic OEP Finder)to find OEP of UnpackMe, It gives me : 00463C80. Okie :) may be this is the right OEP!!!

Close PeID and open Ollydbg to load this UnpackMe in. A messagebox apears, choose No. I have :

0047E000 >  60              pushad            <== Stop here (EP)
0047E001    E8 00000000     call    unpackme.0047E006
0047E006    5D              pop     ebp
0047E007    81ED 48124000   sub     ebp, unpackme.00401248
0047E00D    60              pushad
0047E00E    E8 2B030000     call    unpackme.0047E33E
0047E013    61              popad
0047E014    8A7D 60         mov     bh, byte ptr ss:[ebp+60]
0047E017    6262 DB         bound   esp, qword ptr ds:[edx-25]
0047E01A    6A 62           push    62
0047E01C    6262 EF         bound   esp, qword ptr ds:[edx-11]
0047E01F    D7              xlat    byte ptr ds:[ebx+al]
0047E020    EA 7022628A 496>jmp     far 6049:8A622270
0047E027    6262 9D         bound   esp, qword ptr ds:[edx-63]
0047E02A    F7              ???                                      ; Unknown command
0047E02B    8D70 22         lea     esi, dword ptr ds:[eax+22]
0047E02E    62E9            bound   ebp, ecx                         ; Illegal use of register
0047E030    BA F2F29DF7     mov     edx, F79DF2F2

Oh !! I see Pushad signature, like UPX. Press Alt + M to open Memory map Window.

Memory map
Address    Size     (  Owner       Section    Contains      Type   Access    Initial   Mapped as
................................................................................................
00370000   00003000 (           0                           Map    R         R
00400000   00001000 (  unpackme 0             PE header     Imag   R         RWE
00401000   0004B000 (  unpackme 0  .KLiZMA                  Imag   R         RWE
0044C000   00031000 (  unpackme 0  .KLiZMA    code          Imag   R         RWE
0047D000   00001000 (  unpackme 0  .rsrc      data,imports  Imag   R         RWE
0047E000   00001000 (  unpackme 0  .KLiZMA    SFX           Imag   R         RWE
00480000   00004000 (           0                           Map    R E       R E
00540000   00002000 (           0                           Map    R E       R E
00550000   00103000 (           0                           Map    R         R
00660000   0006A000 (           0                           Map    R E       R E
.................................................................................................

In this Window, select section :

00401000   0004B000 (  unpackme 0  .KLiZMA                  Imag   R         RWE

And Right click and set a Memory Breakpoint on Access.And then Press F9 to Run, Olly breaks here :

0047CCA3    8807            mov     byte ptr ds:[edi], al    <== Stop here after Press F9 (1st)
0047CCA5    47              inc     edi
0047CCA6    01DB            add     ebx, ebx
0047CCA8    75 07           jnz     short unpackme.0047CCB1
0047CCAA    8B1E            mov     ebx, dword ptr ds:[esi]
0047CCAC    83EE FC         sub     esi, -4
0047CCAF    11DB            adc     ebx, ebx
0047CCB1  ^ 72 ED           jb      short unpackme.0047CCA0

Come back Memory Map Window and clear Memory BP.And then back to CPU Window, scroll down to find the signature :) :

0047CDEB    83C3 04         add     ebx, 4
0047CDEE  ^ EB E1           jmp     short unpackme.0047CDD1
0047CDF0    FF96 84CE0700   call    near dword ptr ds:[esi+7CE84]
0047CDF6    61              popad                <=== Aha Popad
0047CDF7  ^ E9 846EFEFF     jmp     unpackme.00463C80        <=== Jmp to OEP (Like OEP found in Peid)

As you see, this signature like UPX. And now, set BP at : 0047CDF7  ^ E9 846EFEFF     jmp     unpackme.00463C80
Press F9 to Run, Break at this BP, remove this and Press F8 , kaka we stop at OEP of UnpackMe :

00463C80    55              push    ebp                <=== Right OEP
00463C81    8BEC            mov     ebp, esp
00463C83    83C4 F0         add     esp, -10
00463C86    B8 903A4600     mov     eax, unpackme.00463A90
00463C8B    E8 A41FFAFF     call    unpackme.00405C34
00463C90    A1 F8584600     mov     eax, dword ptr ds:[4658F8]
00463C95    8B00            mov     eax, dword ptr ds:[eax]
00463C97    E8 14B2FEFF     call    unpackme.0044EEB0

Now, dump with Ollydump Plugin, not check Rebuilt Import. Press Dump and Save as : dumped.exe. Fire up ImportRec, select Process, write OEP , Press IAT Auto Search, Get Imports and finally Fix Dump.We have dumped_.exe. Test it: kaka it runs before i double click :) lol and detect again by PEid : Borland Delphi 6.0 – 7.0.

ÛÛÛ [ Cracking ] ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ

After MUP this UnpackMe, come to part 2 to change “UNREGISTERED” to “REGISTERED”. To do this task, Load dumped_.exe into Ollydbg. Press F9 to Run it, we’ll see a beautiful girl with “UNREGISTERED” string below. Back to Ollydbg, Press Alt+M to open Memory map Window, here we select :

Memory map, item 0
Address=00010000
Size=00001000 (4096.)
Owner=         00010000 (itself)
Section=
Type=Priv 00021004
Access=RW
Initial access=RW

Right click and select Search (or Ctrl+B),then type : UNREGISTERED in Ascii textbox and Press OK to Search this string.After that Olly break at :

Memory map, item 25
Address=0047D000
Size=00001000 (4096.)
Owner=dumped_  00400000
Section=.rsrc
Contains=data,resources
Type=Imag 01001002
Access=R
Initial access=RWE

and we have in Dump window :
00479140  55 4E 52 45 47 49 53 54 45 52 45 44 0C 46 6F 6E  UNREGISTERED.Fon
00479150  74 2E 43 68 61 72 73 65 74 07 0F 44 45 46 41 55  t.CharsetDEFAU
00479160  4C 54 5F 43 48 41 52 53 45 54 0A 46 6F 6E 74 2E  LT_CHARSET.Font.
00479170  43 6F 6C 6F 72 07 08 63 6C 57 69 6E 64 6F 77 0B  ColorclWindow

Okies, the string which we want to find is in Section : .rsrc (resource). So back to CPU Window, right click in Dump Window and Select Go to (Ctrl+G), we type the address of string : 00479140. Select UNREGISTERED string and edit this to REGISTERED. Finally, Save this edited file : dumped_edited.exe. Ok, Run this and see the result :) .

Finish!
Best Regards
_[Kienmanowar]_

ÛÛÛ [ Thanz ] ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ

–++–==[ Greatz Thanks To ]==–++–
My family, Computer_Angel, Moonbaby , Zombie_Deathman, Littleboy, Benina, QHQCrker, the_Lighthouse, Merc, Hoadongnoi, Nini … all REA’s members, TQN, HacNho, RongChauA, Deux, tlandn, light.phoenix, dqtln, ARTEAM …. all my friend, and YOU.

–++–==[ Thanks To ]==–++–
iamidiot, WhyNotBar, trickyboy, dzungltvn, takada, hurt_heart, haule_nth, hytkl v..v..

–++–==[ Special Thanks  ]==–++–
And then thanx to the Author : KLiZMA and all the people read my tutor!

If you have any suggestions, comments or corrections email me: kienbigmummy[at]gmail.com

Sorry in my bad English. Because English is not my mother language, I’m VietNamese.

Welcome all to : reaonline.net

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³    °±²Û CONTACT INFORMATION                                                ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

URL : http://www.reaonline.net
contact me : kienbigmummy@gmail.com

Posted in My Tutorials, Solution for KLiZMA's UnpackMe #1 | Leave a Comment »

Solution for KeyGenMe_by_ZeroTen_#1

Posted by kienmanowar on September 19, 2008

Easy Crackme//KeyGenme.
=======================
Try to find a valid Key for your name.
NO PATCHING!

ZeroTen

Difficulty: 1 – Very easy, for newbies
Platform: Windows
Language: C/C++

Download crackme here: http://www.crackmes.de/users/zeroten/crackme_keygenme_by_zeroten_1
—————————-
Solution :

///////////////////////////////////////////////////////////////////////////////////////////
Program : CrackMe_KeyGenMe_by_ZeroTen_#1.exe
Description : Easy Crackme//KeyGenme.Try to find a valid Key for your name.NO PATCHING!
Tools : OllyDbg
Difficult : Easy (but not for newbies :D )
Packer/Protector/Compiler : N/A
Objective : Keygen
Cracker : kienmanowar
///////////////////////////////////////////////////////////////////////////////////////////

1. First, run this keygenme and input Name, Password and Serial then click Login. Hola, the keygenme terminate without Nag.
Retry to test with one char in Name textbox, blah blah i get the Nag : “At least, more than 4 letters”.

2. Okie, Load to Olly and search all ref strings. I find it here :

Text strings referenced in CrackMe_:.text, item 10
Address=00401C88
Disassembly=PUSH CrackMe_.004871A6
Text string=ASCII "At least, more than 4 letters"

3. Double click to this line, and scroll up to find the start point of this routine.And then set a BP :

00401A18 >/. 55 PUSH EBP ; _TForm1_Button1Click <== Set BP
00401A19 |. 8BEC MOV EBP, ESP
00401A1B |. 83C4 94 ADD ESP, -6C
00401A1E |. 53 PUSH EBX
00401A1F |. 56 PUSH ESI
00401A20 |. 57 PUSH EDI
00401A21 |. 8BD8 MOV EBX, EAX

4. F9 to run and input data (ex: kienmanowar / 1234 / 56789) then press Log in.Wow, stop at BP that i set.Trace downward i get the
the first point. That code will use the Lenght of szName to calculate and store the result in edi reg :

00401A43 >|. 8B83 64030000 MOV EAX, DWORD PTR DS:[EBX+364] ; *TForm1.Edit1:TEdit (szUserName)
00401A49 |. E8 42B40400 CALL ; <== eax : Length(szName)
00401A4E |. 837D FC 00 CMP DWORD PTR SS:[EBP-4], 0 ; <== Length(szName) != 0
00401A52 |. 74 08 JE SHORT
00401A54 |. 8B55 FC MOV EDX, DWORD PTR SS:[EBP-4] ; <== edx : szName
00401A57 |. 8B4A FC MOV ECX, DWORD PTR DS:[EDX-4] ; <== ecx : Length(szName)
00401A5A |. EB 02 JMP SHORT
00401A5C >|> 33C9 XOR ECX, ECX ; |> 8D3C89 LEA EDI, DWORD PTR DS:[ECX+ECX*4] ; <== edi = ecx + ecx*4 (LengthIsNotZero__)
00401A61 |. 8D45 FC LEA EAX, DWORD PTR SS:[EBP-4]
00401A64 |. BA 02000000 MOV EDX, 2 ; <== edx = 0x2
00401A69 |. 8D3CB9 LEA EDI, DWORD PTR DS:[ECX+EDI*4] ; <== edi = ecx + edi*4
00401A6C |. C1E7 03 SHL EDI, 3 ; <== edi = edi * 2^3
00401A6F |. 2BF9 SUB EDI, ECX ; <== edi = edi - ecx
00401A71 |. 8D3CF9 LEA EDI, DWORD PTR DS:[ECX+EDI*8] ; <== edi = ecx + edi*8
00401A74 |. 81C7 A31C0000 ADD EDI, 1CA3 ; <== edi = edi + 0x1CA3

5. Continue trace downward and analyze, i find 4 same forged codes to cheat my thinkin’ and one of them like this below :) :

00401A9B >|. 8B83 70030000 MOV EAX, DWORD PTR DS:[EBX+370] ; *TForm1.Edit2:TEdit (szPassWord)
00401AA1 |. E8 EAB30400 CALL ; <== eax : Length(szPassWord)
00401AA6 |. 8D55 F8 LEA EDX, DWORD PTR SS:[EBP-8]
00401AA9 |. 52 PUSH EDX
00401AAA |. 8D45 F4 LEA EAX, DWORD PTR SS:[EBP-C]
00401AAD |. 8B55 A0 MOV EDX, DWORD PTR SS:[EBP-60] ;
00401AB0 |. E8 5B110700 CALL ; <== Convert int to string
00401AB5 |. FF46 1C INC DWORD PTR DS:[ESI+1C] ;
00401AB8 |. 8D55 F4 LEA EDX, DWORD PTR SS:[EBP-C]
00401ABB |. 58 POP EAX
00401ABC |. E8 D7110700 CALL ;
00401AC1 |. 50 PUSH EAX
00401AC2 |. FF4E 1C DEC DWORD PTR DS:[ESI+1C]
00401AC5 |. 8D45 F4 LEA EAX, DWORD PTR SS:[EBP-C]
00401AC8 |. BA 02000000 MOV EDX, 2
00401ACD |. E8 82110700 CALL
00401AD2 |. FF4E 1C DEC DWORD PTR DS:[ESI+1C] ; |
00401AD5 |. 8D45 F8 LEA EAX, DWORD PTR SS:[EBP-8] ; |
00401AD8 |. BA 02000000 MOV EDX, 2 ; |
00401ADD |. E8 72110700 CALL ; \CrackMe_.00472C54
00401AE2 |. 59 POP ECX
00401AE3 |. 84C9 TEST CL, CL
00401AE5 |. 74 0C JE SHORT
00401AE7 |. A1 CCF44800 MOV EAX, DWORD PTR DS:[48F4CC]
00401AEC |. 8B00 MOV EAX, DWORD PTR DS:[EAX]
00401AEE >|. E8 9D260400 CALL ; ->:TApplication._Terminate()

6. By pass all of this code, i land here :

00401C47 >|. 8B83 64030000 MOV EAX, DWORD PTR DS:[EBX+364] ; *TForm1.Edit1:TEdit (szName)
00401C4D |. E8 3EB20400 CALL ; <== eax = Length(szName)
00401C52 |. 837D D8 00 CMP DWORD PTR SS:[EBP-28], 0
00401C56 |. 74 08 JE SHORT
00401C58 |. 8B55 D8 MOV EDX, DWORD PTR SS:[EBP-28] ; <== edx : szName
00401C5B |. 8B4A FC MOV ECX, DWORD PTR DS:[EDX-4] ; <== ecx : Length(szName)
00401C5E |. EB 02 JMP SHORT
00401C60 >|> 33C9 XOR ECX, ECX ; loc_401C60
00401C62 >|> 83F9 04 CMP ECX, 4 ; loc_401C62
00401C65 |. BA 02000000 MOV EDX, 2
00401C6A |. 0F9CC0 SETL AL
00401C6D |. 83E0 01 AND EAX, 1
00401C70 |. 50 PUSH EAX ; /Arg1
00401C71 |. 8D45 D8 LEA EAX, DWORD PTR SS:[EBP-28] ; |
00401C74 |. FF4E 1C DEC DWORD PTR DS:[ESI+1C] ; |
00401C77 |. E8 D80F0700 CALL ; \CrackMe_.00472C54
00401C7C |. 59 POP ECX
00401C7D |. 84C9 TEST CL, CL
00401C7F |. 74 18 JE SHORT
00401C81 |. 6A 00 PUSH 0 ; /Style = MB_OK|MB_APPLMODAL
00401C83 |. 68 C4714800 PUSH CrackMe_.004871C4 ; |Title = "BEEP!"
00401C88 |. 68 A6714800 PUSH CrackMe_.004871A6 ; |Text = "At least, more than 4 letters"
00401C8D |. 6A 00 PUSH 0 ; |hOwner = NULL
00401C8F >|. E8 204D0800 CALL ; \->UnrealizeObject.MessageBoxA()
00401C94 |. E9 F6000000 JMP

7. Ok my UserName has the length greater than 4 letters so that i bypass this check.After bypass, hola i land at the second important point.
The edx = edi + 0×1CA3 and will be converted to String and save into the szTruePassWord :

00401CAC >|. 8B83 70030000 MOV EAX, DWORD PTR DS:[EBX+370] ; *TForm1.Edit2:TEdit (szPassWord)
00401CB2 |. E8 D9B10400 CALL ; <== eax : Length(szPassWord)
00401CB7 |. 8D55 D4 LEA EDX, DWORD PTR SS:[EBP-2C]
00401CBA |. 52 PUSH EDX
00401CBB |. 8D97 A31C0000 LEA EDX, DWORD PTR DS:[EDI+1CA3] ; <== edx = edi + 0x1CA3
00401CC1 |. 8D45 D0 LEA EAX, DWORD PTR SS:[EBP-30] ; <== szTruePassWord
00401CC4 |. E8 470F0700 CALL ; <== ConvertIntToString (&szTruePassWord, edx)
00401CC9 |. FF46 1C INC DWORD PTR DS:[ESI+1C]
00401CCC |. 8D55 D0 LEA EDX, DWORD PTR SS:[EBP-30]
00401CCF |. 58 POP EAX
00401CD0 |. E8 C30F0700 CALL
00401CD5 |. 50 PUSH EAX
00401CD6 |. FF4E 1C DEC DWORD PTR DS:[ESI+1C]
00401CD9 |. 8D45 D0 LEA EAX, DWORD PTR SS:[EBP-30]
00401CDC |. BA 02000000 MOV EDX, 2
00401CE1 |. E8 6E0F0700 CALL
00401CE6 |. FF4E 1C DEC DWORD PTR DS:[ESI+1C] ; |
00401CE9 |. 8D45 D4 LEA EAX, DWORD PTR SS:[EBP-2C] ; |
00401CEC |. BA 02000000 MOV EDX, 2 ; |
00401CF1 |. E8 5E0F0700 CALL ; \CrackMe_.00472C54
00401CF6 |. 59 POP ECX
00401CF7 |. 84C9 TEST CL, CL
00401CF9 |. 0F84 83000000 JE

8. Lets continue, i found the last important point.The edx = edi – 0×1CA3 and will be converted to String and save into the szTrueSerial :

00401D12 >|. 8B83 78030000 MOV EAX, DWORD PTR DS:[EBX+378] ; *TForm1.Edit3:TEdit (szSerial)
00401D18 |. E8 73B10400 CALL ; <== eax = Length(szSerial)
00401D1D |. 8D55 CC LEA EDX, DWORD PTR SS:[EBP-34]
00401D20 |. 52 PUSH EDX
00401D21 |. 8D97 5DE3FFFF LEA EDX, DWORD PTR DS:[EDI-1CA3] ; <== edx = edi - 0x1CA3
00401D27 |. 8D45 C8 LEA EAX, DWORD PTR SS:[EBP-38] ; <== szTrueSerial
00401D2A |. E8 E10E0700 CALL ; <== ConvertIntToString (&szTruePassWord, edx)
00401D2F |. FF46 1C INC DWORD PTR DS:[ESI+1C]
00401D32 |. 8D55 C8 LEA EDX, DWORD PTR SS:[EBP-38]
00401D35 |. 58 POP EAX
00401D36 |. E8 5D0F0700 CALL
00401D3B |. 50 PUSH EAX
00401D3C |. FF4E 1C DEC DWORD PTR DS:[ESI+1C]
00401D3F |. 8D45 C8 LEA EAX, DWORD PTR SS:[EBP-38]
00401D42 |. BA 02000000 MOV EDX, 2
00401D47 |. E8 080F0700 CALL
00401D4C |. FF4E 1C DEC DWORD PTR DS:[ESI+1C] ; |
00401D4F |. 8D45 CC LEA EAX, DWORD PTR SS:[EBP-34] ; |
00401D52 |. BA 02000000 MOV EDX, 2 ; |
00401D57 |. E8 F80E0700 CALL ; \CrackMe_.00472C54
00401D5C |. 59 POP ECX
00401D5D |. 84C9 TEST CL, CL
00401D5F |. 74 13 JE SHORT

9. And finally we have the Good boy :

00401D61 |. 6A 00 PUSH 0 ; /Style = MB_OK|MB_APPLMODAL
00401D63 |. 68 EB714800 PUSH CrackMe_.004871EB ; |Title = "Correct!!by ZeroTen"
00401D68 |. 68 CA714800 PUSH CrackMe_.004871CA ; |Text = "Now post your solution/KeyGen ;) "
00401D6D |. 6A 00 PUSH 0 ; |hOwner = NULL
00401D6F >|. E8 404C0800 CALL ; \->UnrealizeObject.MessageBoxA()

/

//////////////////////////////////
// Keygen source code //
//////////////////////////////////
int iDefault = 0×1CA3;

// Calculate Value
Value=0;
Value = LenUser + LenUser*4;
Value = LenUser + Value*4;
Value = Value * 8;
Value = Value – LenUser;
Value = LenUser + Value*8;
Value = Value + iDefault;

//Calculate szPassWord
iTemp = Value + iDefault;
wsprintf(szPassWord,”%i”,iTemp);

//Calculate szSerial
iTemp = Value – iDefault;
wsprintf(szSerial,”%i”,iTemp);

SetDlgItemText(IDC_PassWord,szPassWord);
SetDlgItemText(IDC_Serial,szSerial);

///////////////////////
The realkey for my username :
Username : kienmanowar
Password : 29369
Serial : 14707
///////////////////////

That’s all. Thanx for reading my tutor.
Sorry for my bad English!!! :|

–++–==[ Greatz Thanks To ]==–++–
My family, Computer_Angel, Moonbaby , Zombie_Deathman, Littleboy, Benina, QHQCrker,
the_Lighthouse, Merc, Hoadongnoi, Nini … all REA‘s members, TQN, HacNho, RongChauA,
Deux, tlandn, light.phoenix, dqtln, ARTEAM …. all my friend, and YOU.

–++–==[ Thanks To ]==–++–
iamidiot, WhyNotBar, trickyboy, dzungltvn, takada, hurt_heart, haule_nth, hytkl, moth, XIANUA, nhc1987 v..v..

I want to thank Teddy Roggers for his great site, Reversing.be folks(especially haggar),
Arteam folks(Shub-Nigurrath, MaDMAn_H3rCuL3s) and all folks on crackmes.de, thank
to all members of unpack.cn (especially fly and linhanshi). Great thanks to lena151(I like your tutorials).
And finally, thanks to RICARDO NARVAJA and all members on CRACKSLATINOS.

If you have any suggestions, comments or corrections email me: kienmanowar[at]reaonline.net

Posted in My Tutorials, Solution for KeyGenMe_by_ZeroTen_#1 | Leave a Comment »

OllyDBG v1.10 plugin – StrongOD v0.18 [2008.09.18]

Posted by kienmanowar on September 20, 2008

OllyDBG v1.10 plugin – StrongOD v0.18 [2008.09.18]

OllyDBG v1.10 plugin – StrongOD v0.18
Temptress Moon Shadow by sea [CUG]
================================================== ==================
[2008.09.18 v0.18]
1, to repair the Ctrl G calculation rva, offset when a small BUG
2, when the program is not running the state, Detach before running program
3, restoration of the original data OD zone copy BUG
4, repair od after the CPU running very high occupancy rate BUG
5, you can set it to skip some of the exception handling

[2008.09.02 v0.17]
1, to skip some of the improper handling of the abnormal OD
2, correctly handle the instructions int 2d

[2008.08.31 v0.16]
1, joined the drive to protect the process, the hidden window, over most of the anti-debugging
2, driver support for the custom equipment 000 (ollydbg.ini of DeviceName, equipment were not more than 8 characters)
ollydbg.ini of [StrongOD], you can set up their own

HideWindow = 1 to hide the window
HideProcess = 1 to hide the process
ProtectProcess = 1 protection process
DriverKey =- 82693034 and the key driver of communication
DriverName = fengyue0 who drives (not more than 8 characters)

3, OD will be the creation of the parent process into the process explorer.exe (copied from shoooo code)

////////////////////////////////////////////////// ///////////

The increase in the version of the driver, if a blue screen, set up minidump spread to the Forum, thank you
OllyDbg original use as much as possible, and other generally do not need the anti-anti plugin in conjunction with plug-in (including phant0m)

Od plug-in will be on the plugin directory, run the original od, and then shut down
Ollydbg.ini found in the [Plugin StrongOD] items
Change their look
DriverName – driver file name, the object of equipment
DriverKey – and the key driver of communication
HideWindow – whether hidden window for a hidden, 0 for not hide
HideProcess – whether hidden od process for a hidden, 0 for not hide
ProtectProcess – whether hidden to protect the process of Od, for the protection of 1, 0 for failing to protect

5 above, there is no interface option, you can set your favorite way, if the election does not KernalMode, then the top 5 option null and void

Phant0m driver and the driver compared to the following advantages:

1, in support of a number of OD, can support up to 100 OD, and phant0m only support an OD
2, CloseHandle to close the handle the wrong time to return to STATUS_INVALID_HANDLE, instead of STATUS_SUCCESS
3, xp over the use of NtQueryInformationProcess (hProcess, ProcessDebugObjectHandle ,…) and NtQueryInformationProcess (hProcess, ProcessDebugFlags ,…) anti-debugging
4, OD process ntdll.dll some of the functions (such as: NtOpenProcess) was inline hook when the blue screen

The following are no special note are the original OD add a plug-in plug-in StrongOD operate:

Ollydbg.ini in the first [Plugin StrongOD] the following HideWindow, ProtectProcess into the value of 1, the value of KernelMode turned into a preserve:

1, Themida / WinLicense

Plug-in option to set a minimum

Original run OD, included in the main program Themida v1.9.9.0, stopped at the entrance after the removal of all breakpoints, Shift + F9 up-and-run
2, ExeCryptor v2.4.1

Plug-in option to set a minimum

Original run OD, set up break point on break point in the system to stop
ExeCryptor v2.4.1 included in the main program, stopped at the breakpoint system, according to Alt + B, remove the breakpoint EP
And then Shift + F9, you can
3, TTProtect v1.05 DEMO

Plug-in option to set a minimum

Original run OD, loading TTProtect v1.05 DEMO main program, Shift + F9
4, VMProtect v1.65.2

vmp v1.65 added to the xp system under the OD of the new anti,Plug-in option to set a minimum

Original run OD, loading VMProtect v1.65.2 main program, Shift + F9
Detail : http://www.unpack.cn/viewthread.php?tid=28854&highlight=
Regards
kienmanowar

Posted in RE Tools, StrongOD v0.18 [2008.09.18] | 5 Comments »

Exeinfo for Win32 by A.S.L

Posted by kienmanowar on September 22, 2008

Exeinfo for Win32 by A.S.L.

History :
13.09.2008 – added new skin, tools/ antipacker / sign counter / new signatures / bug fixed – ver.0.0.1.9 C
26.07.2008 – added new tool , new log file ,new sign – ver.0.0.1.9 A
08.05.2008 – bug fixed , new signatures , OEP Delphi fixer ver.0.0.1.8 G
16.03.2008 – many changes , new plugin for peid & die , new signatures ,new hints  ver.0.0.1.8 F
12.02.2008 – view startup ASM , non exe detection added ( wmv, php ….) , signatures added, and …
23.12.2007 non exe detection added ( pdf,gif,avi,mp3 …) , few signatures added
~ ~ ~ ~ …
15.03.2006 added few detection – 0.0.0.2 Beta
09.03.2006 first primitive version – 0.0.0.1 Beta

Download here: http://users.cjb.net/exeinfo/plugin-peid-exeinfo.zip

Regards

Posted in Exeinfo for Win32 by A.S.L, RE Tools | 5 Comments »

Solution for NrZ0e1’s CrackMe #1

Posted by kienmanowar on September 22, 2008

It’s very simple:
Just solve the program will end after pressing ‘enter’.
Enjoy! :-)

Additional ( no must ):
Write a patch!

Difficulty: 1 – Very easy, for newbies
Platform: Windows
Language: C/C++

Download crackme : http://www.crackmes.de/users/nrz0e1/crackme_1

———

Solution :

///////////////////////////////////////////////////////////////////////////////////////////
Program : NrZ0e1’s CrackMe #1
Description : It’s very simple:Just solve the program will end after pressing ‘enter’.Enjoy! :-)
Tools       : OllyDbg
Difficult   :  Easy
Packer/Protector/Compiler : N/A
Objective : Patch
Cracker   :  kienmanowar
///////////////////////////////////////////////////////////////////////////////////////////

1. First, run this crackme and press Enter, blah blah the crackme disappear.

2. Okie, Load to Olly. Scroll down and i find the start point of this crackme here :

00401150  /.  55                          PUSH    EBP
00401151  |.  8BEC                        MOV     EBP, ESP
00401153  |.  68 28A14000                 PUSH    CrackMe.0040A128  ; /Arg1 = 0040A128 ASCII " CrackMe #1 by NrZ0e1
;14/09/2007
Solve the program is stopping from now!
[Enter]"
00401158  |.  E8 A32B0000                 CALL    CrackMe.00403D00  ; \CrackMe.00403D00

3. Look down, we will see the Good boy :

00401184  |.  68 84A14000                 PUSH    CrackMe.0040A184   ; /Arg1 = 0040A184 ASCII
;"You solved the problem !!!! I am proud of you ! ;-) "
00401189  |.  E8 722B0000                 CALL    CrackMe.00403D00   ; \CrackMe.00403D00

4. Ok now, i set bp at 00401150, F9 to run and stop at the bp. Use F8 key to trace downward, after trace over this call

00401176  |.  E8 75290000                 CALL    CrackMe.00403AF0

The crackeme run, back to Crackme and press Enter, blah we return to OllyDbg. Continue to trace downward and stop at this call :

0040117C  |> \6A 01                       PUSH    1                  ; /Arg1 = 00000001
0040117E  |.  E8 C1610000                 CALL    CrackMe.00407344   ; \CrackMe.00407344 <== Stop here
00401183  |.  59                          POP     ECX
00401184  |.  68 84A14000                 PUSH    CrackMe.0040A184   ; /Arg1 = 0040A184 ASCII
;"You solved the problem !!!! I am proud of you ! ;-) "
00401189  |.  E8 722B0000                 CALL    CrackMe.00403D00   ; \CrackMe.00403D00

5. The Call at 0040117E will call ExitProcess Api to terminate this crackme, so i nop this call like this :

0040117C  |> \6A 01                       PUSH    1                                 ; /Arg1 = 00000001
0040117E      90                          NOP                                       ; \CrackMe.00407344
0040117F      90                          NOP
00401180      90                          NOP
00401181      90                          NOP
00401182      90                          NOP

6. Press F9 to Run, wow the Good boy appear!!!

That’s all. Thanx for reading my tutor.
Sorry for my bad English!!! :|

–++–==[ Greatz Thanks To ]==–++–
My family, Computer_Angel, Moonbaby , Zombie_Deathman, Littleboy, Benina, QHQCrker,
the_Lighthouse, Merc, Hoadongnoi, Nini … all REA‘s members, TQN, HacNho, RongChauA,
Deux, tlandn, light.phoenix, dqtln, ARTEAM …. all my friend, and YOU.

–++–==[ Thanks To ]==–++–
iamidiot, WhyNotBar, trickyboy, dzungltvn, takada, hurt_heart, haule_nth, hytkl, moth, XIANUA, nhc1987 v..v..

I want to thank Teddy Roggers for his great site, Reversing.be folks(especially haggar),
Arteam folks(Shub-Nigurrath, MaDMAn_H3rCuL3s) and all folks on crackmes.de, thank
to all members of unpack.cn (especially fly and linhanshi). Great thanks to lena151(I like your tutorials).
And finally, thanks to RICARDO NARVAJA and all members on CRACKSLATINOS.

>>>> If you have any suggestions, comments or corrections email me: kienmanowar[at]reaonline.net

Posted in My Tutorials, Solution for NrZ0e1's CrackMe #1 | Leave a Comment »

Solution for Zart’s mishka tribute

Posted by kienmanowar on September 22, 2008

One of my first keygenme’s in a long time. Was made to let newbies have a chance at getting into keygenning and hopefully lead into harder and harder ones.

make a keygen, do whatever you need to for this, just submit solution and keygen

serial fishing should be extremely easy, but then again – that wasn’t the point was it?

Difficulty: 1 – Very easy, for newbies
Platform: Windows
Language: C/C++

Download keygenme : http://www.crackmes.de/users/zart/mishka_tribute

————–
Solution :
///////////////////////////////////////////////////////////////////////////////////////////
Program : Zart’s Keygenme
Description : make a keygen, do whatever you need to for this, just submit solution and keygen.
Tools : IDA, OllyDbg
Difficult : Easy
Packer/Protector/Compiler : N/A
Objective : Keygen
Cracker : kienmanowar{REATEAM}
///////////////////////////////////////////////////////////////////////////////////////////

1. First, run this keygenme, wow i here the nice tune :) . Input Name and Serial then press Enter, blah blah the crackme disappear.Without Nag :(

2. Load to Olly and search all Ref text strings…..nothing special. Okie, fire up IDA,anaylize this keygenme and open Strings (Shift-F12). I found the Good Boy :D

.data:00407028 szSerialcheckedout-nowrightakeygen_ db 0Ah ; DATA XREF: _main+15Ao_main
.data:00407028 db 'Serial checked out - now right a keygen.',0Ah,0

3.Double click to _main+15Ao we will back to the asm code.

.text:00401246 push offset szSerialcheckedout-nowrightakeygen_ ; "\nSerial checked out - now right a keyge"...
.text:0040124B jmp short loc_401252 ; Jump
.text:0040124B
.text:0040124D ; ---------------------------------------------------------------------------
.text:0040124D
.text:0040124D loc_40124D: ; CODE XREF: _main+158j
.text:0040124D push offset szSerialfailedcheck ; "\nSerial failed check!\n"
.text:0040124D

4. Ok reload this keygenme in Olly and press Ctrl+G to go to 0×00401246.Scroll up and set BP at the beginning of this sub.

004010EC >/$ B8 69414000 MOV EAX, ; _main <== set BP here
004010F1 |. E8 DA2E0000 CALL
004010F6 |. 83EC 24 SUB ESP, 24
004010F9 |. 53 PUSH EBX

5. Press F9 to run and we stop at the BP, trace down until we reach the asm code that gets characters from UserName and Serial. In this asm code,
i relize that it gets each char from Username, append char and store it in another buffer.Here it is :

0040119A >|> /FF15 9C604000 /CALL NEAR DWORD PTR DS:[] ; [loc_40119A
004011A0 |. |85C0 |TEST EAX, EAX
004011A2 |.^ 74 F6 |JE SHORT
004011A4 |. |FF15 98604000 |CALL NEAR DWORD PTR DS:[] ; [_getch
004011AA |. |837D E4 00 |CMP DWORD PTR SS:[EBP-1C], 0
004011AE |. |8845 E8 |MOV BYTE PTR SS:[EBP-18], AL
004011B1 |. |75 5E |JNZ SHORT
004011B3 |. |3C 0D |CMP AL, 0D
004011B5 |. |75 33 |JNZ SHORT
004011B7 |. |837D EC 00 |CMP DWORD PTR SS:[EBP-14], 0
004011BB |. |75 0F |JNZ SHORT
004011BD |. |8B0D 10604000 |MOV ECX, DWORD PTR DS:[] ; MSVCIRT.cout
004011C3 |. |68 60704000 |PUSH keygenme.00407060 ; ASCII 0A,"You must enter a name!\n Name: "
004011C8 |. |FFD6 |CALL NEAR ESI
004011CA |.^ EB CE |JMP SHORT
004011CC >|> |8B0D 10604000 |MOV ECX, DWORD PTR DS:[] ; loc_4011CC
004011D2 |. |68 54704000 |PUSH keygenme.00407054 ; ASCII "Serial: "
004011D7 |. |C745 E4 01000000 |MOV DWORD PTR SS:[EBP-1C], 1
004011DE |. |FFD6 |CALL NEAR ESI
004011E0 |. |50 |PUSH EAX
004011E1 |. |FF15 18604000 |CALL NEAR DWORD PTR DS:[] ; MSVCIRT.flush
004011E7 |. |59 |POP ECX
004011E8 |.^ EB B0 |JMP SHORT
004011EA >|> |FF75 E8 |PUSH DWORD PTR SS:[EBP-18] ; loc_4011EA
004011ED |. |8B0D 10604000 |MOV ECX, DWORD PTR DS:[] ; MSVCIRT.cout
004011F3 |. |FFD7 |CALL NEAR EDI
004011F5 |. |50 |PUSH EAX
004011F6 |. |FF15 18604000 |CALL NEAR DWORD PTR DS:[] ; MSVCIRT.flush
004011FC |. |59 |POP ECX
004011FD |. |FF75 E8 |PUSH DWORD PTR SS:[EBP-18]
00401200 |. |8D4D D0 |LEA ECX, DWORD PTR SS:[EBP-30]
00401203 |. |FF75 EC |PUSH DWORD PTR SS:[EBP-14]
00401206 |. |FF15 24604000 |CALL NEAR DWORD PTR DS:[<&MSVCP60.std::basic_string; MSVCP60.std::basic_string<char,std::char_traits,std::allocator >::append
0040120C |. |FF45 EC |INC DWORD PTR SS:[EBP-14]
0040120F |.^ EB 89 |JMP SHORT
00401211 >|> |3C 0D |CMP AL, 0D ; loc_401211
00401213 |. |74 23 |JE SHORT
00401215 |. |FF75 E8 |PUSH DWORD PTR SS:[EBP-18]
00401218 |. |8B0D 10604000 |MOV ECX, DWORD PTR DS:[] ; MSVCIRT.cout
0040121E |. |FFD7 |CALL NEAR EDI
00401220 |. |50 |PUSH EAX
00401221 |. |FF15 18604000 |CALL NEAR DWORD PTR DS:[] ; MSVCIRT.flush
00401227 |. |59 |POP ECX
00401228 |. |8D049B |LEA EAX, DWORD PTR DS:[EBX+EBX*4]
0040122B |. |0FBE4D E8 |MOVSX ECX, BYTE PTR SS:[EBP-18]
0040122F |. |8D5C41 D0 |LEA EBX, DWORD PTR DS:[ECX+EAX*2-30]
00401233 |.^\E9 62FFFFFF \JMP

analyze and build the pseudocode in IDA :

while ( TRUE )
{
while ( TRUE )
{
while ( !kbhit() )
;
iKeyInput = getch();
LOBYTE(iTempChar) = iKeyInput;
if ( v18 )
break;
if ( iKeyInput == Enter_key )
{
if ( iSize )
{
v18 = 1;
szStr = ostream__operator__(cout, "\nSerial: ");
flush(szStr);
}
else
{
ostream__operator__(cout, "\nYou must enter a name!\nName: ");
}
}
else
{
v11 = ostream__operator__(cout, iTempChar);
flush(v11);
std__basic_string_char_std__char_traits_char__std__allocator_char____append(&szStrBuffer, iSize++, iTempChar); //Append String
}
}
if ( iKeyInput == Enter_key )
break;
v12 = ostream__operator__(cout, iTempChar);
flush(v12);
szSerial = (char)iTempChar + 10 * szSerial - 48;
}

6. Continue trace and analyze asm code, i stop here ;

00401238 >|> \8D45 D0 LEA EAX, DWORD PTR SS:[EBP-30] ; loc_401238
0040123B |. 50 PUSH EAX ;
0040123C |. E8 BFFDFFFF CALL ; <== Trace Into

7. Trace into sub_calculate_serial() :

00401005 |. 33C0 XOR EAX, EAX ; <== eax = 0
00401007 |. 33F6 XOR ESI, ESI ; <== esi = 0
00401009 |. 8B51 08 MOV EDX, DWORD PTR DS:[ECX+8] ; <== Length(szTempString)
0040100C |. 57 PUSH EDI
0040100D |. 85D2 TEST EDX, EDX
0040100F |. BF BA430000 MOV EDI, 43BA ; <== edi = 0x43BA
00401014 |. 76 25 JBE SHORT
00401016 |. 53 PUSH EBX
00401017 |. 8B59 04 MOV EBX, DWORD PTR DS:[ECX+4] ; |> 8B0D 2C604000 /MOV ECX, DWORD PTR DS:[<&MSVCP60.`std::basic_string; loc_40101A
00401020 |. 85DB |TEST EBX, EBX
00401022 |. 74 03 |JE SHORT
00401024 |. 8D0C33 |LEA ECX, DWORD PTR DS:[EBX+ESI]
00401027 >|> 0FBE09 |MOVSX ECX, BYTE PTR DS:[ECX] ; <== ecx = szTempString[i]
0040102A |. 0FAFC7 |IMUL EAX, EDI ; <== eax = eax * edi
0040102D |. 03C1 |ADD EAX, ECX ; <== eax = eax + ecx
0040102F |. 69FF FAE60600 |IMUL EDI, EDI, 6E6FA
00401035 |. 46 |INC ESI ; <== esi++
00401036 |. 3BF2 |CMP ESI, EDX ; <== while esi < Length(szTempString)
00401038 |.^ 72 E0 \JB SHORT ; <== Then continue

build pseudocode :

int iReaKey; // eax@1
unsigned int iLenszStrBuffer; // edx@1
unsigned int iInit; // edi@1
unsigned int iIndex; // esi@1
int v5; // ebx@2
void *szChar; // ecx@3

iReaKey = 0;
iIndex = 0;
iLenszStrBuffer = *(_DWORD *)(a1 + 8); // Length of szStrBuffer
iInit = 0x43BAu;
if ( iLenszStrBuffer )
{
v5 = *(_DWORD *)(a1 + 4); // Point to szStrBuffer
do
{
szChar = _C;
if ( v5 )
szChar = (void *)(v5 + iIndex); // Get char for szStrBuffer
iReaKey = *(_BYTE *)szChar + iInit * iReaKey;
iInit *= 0x6E6FAu;
++iIndex;
}
while ( iIndex < iLenszStrBuffer );
}
return iReaKey;

8. After trace and analyze all the asm code, the soucre keygen for this keygenme :

char szName[64]={0};
char szSerial[64]={0};
char szTempString[128]={0};
char szTemp[64]={0};
int i=0,j=0,LenUser=0,iRealKey=0,iValue=0;

LenUser=GetDlgItemText(IDC_Name,szName,70);
if (LenUser 14)
{
MessageBox("----------===== Your name atleast 1 chart ====---------- \n\n ----------===== But not over 14 charts ====---------- ",
"Hey !! Please input your name again !! ");
}
else
{
i = 0;
while (i 0;j--)
{
szTemp[j-1] = szName[i];
}
strncat(szTempString,szTemp,i);
}

LenUser = strlen(szTempString);
i = 0;
_asm
{
xor eax,eax
xor esi,esi
xor edx,edx
mov edi,0x43BA
}
while (i < LenUser)
{
_asm
{
mov eax, iRealKey
lea ecx, dword ptr[szTempString]
movsx ecx,byte ptr[ecx+esi]
imul eax, edi
add eax, ecx
imul edi, edi, 0x6E6FA
inc esi
mov iRealKey,eax
}
i++;
}
wsprintf(szSerial,"%d",iRealKey);
}

SetDlgItemText(IDC_Serial,szSerial);

********************************
Right key
UserName: kienmanowar
Serial : 114
********************************

That's all. Thanx for reading my tutor.
Sorry for my bad English!!! :|

--++--==[ Greatz Thanks To ]==--++--
My family, Computer_Angel, Moonbaby , Zombie_Deathman, Littleboy, Benina, QHQCrker,
the_Lighthouse, Merc, Hoadongnoi, Nini ... all REA‘s members, TQN, HacNho, RongChauA,
Deux, tlandn, light.phoenix, dqtln, ARTEAM .... all my friend, and YOU.

--++--==[ Thanks To ]==--++--
iamidiot, WhyNotBar, trickyboy, dzungltvn, takada, hurt_heart, haule_nth, hytkl, moth, XIANUA, nhc1987 v..v..

I want to thank Teddy Roggers for his great site, Reversing.be folks(especially haggar),
Arteam folks(Shub-Nigurrath, MaDMAn_H3rCuL3s) and all folks on crackmes.de, thank
to all members of unpack.cn (especially fly and linhanshi). Great thanks to lena151(I like your tutorials).
And finally, thanks to RICARDO NARVAJA and all members on CRACKSLATINOS.

>>>> If you have any suggestions, comments or corrections email me: kienmanowar[at]reaonline.net

Posted in My Tutorials, Solution for Zart's mishka tribute | Leave a Comment »

OllyDbg_tut11

Posted by kienmanowar on September 22, 2008

Một cái đầu lạnh để vững vàng, một trái tim đỏ lửa để yêu và làm việc hết mình!

I. Giới thiệu chung

Chào các bạn, chúng ta lại gặp nhau trong phần 11 của loạt bài viết về OllyDbg. Lần trước, khi release phần 10 trên hai site : REA(reaonline.net)HVA(hvaonline.net) nhận thấy lượng download rất nhiều, chứng tỏ rằng các bài viết của tôi vẫn được các bạn quan tâm và ủng hộ. Đó chính là nguồn động viên lớn cho tôi để tôi tiếp tục viết tiếp các phần tiếp theo.Tiện đây tôi cũng xin lan man một chút, trước đây tôi cũng đã từng có một thời gian tham gia việc training và được quen biết với những đồng nghiệp mà sau này vẫn là những anh em tốt của tôi, lúc đó mặc dù công việc của chúng tôi là giảng dạy kiến thức cho người khác nhưng người sếp (người anh cả của chúng tôi) đã định hướng cho chúng tôi rằng: “Chúng ta đứng trên bục giảng không có nghĩa chúng ta tự coi mình là thầy của người khác, không có nghĩa chúng ta là người hiểu biết hơn những người đang ngồi nghe chúng ta nói, mà chúng ta chỉ là những người truyền đạt lại những kiến thức mà chúng ta biết, khơi gợi cho học viên khả năng tự tìm tòi và tự nghiên cứu.Quan hệ giữa học viên và giảng viên là quan hệ hoàn toàn bình đẳng, mọi vấn đề được đem ra trao đổi thẳng thắn theo phương pháp phản biện như thế mới tạo tâm lý thoải mái cho người học, khiến cho buổi học không phải là nơi truyền đạt kiến thức theo kiểu một chiều như những gì chúng ta thấy trên các trường lớp ở Việt Nam”.

Qua loạt tuts này cũng vậy, kiến thức tôi truyền tải cho các bạn chưa chắc đã đúng 100%, đó chỉ là những gì cá nhân tôi tích lũy được và truyền tải lại cho các bạn, cho nên nếu trong quá trình các bạn đọc thấy có những kiến thức nào tôi viết sai hoặc chưa đúng thì cứ góp ý thẳng thắn, vì như thế mới chứng tỏ các bạn thật sự quan tâm tới bộ tài liệu này. Ở phần trước tôi đã giới thiệu sơ qua về cách thiết lập BP, các thao tác thông qua command bar để đặt các bp với các lệnh BP và BPX, cung cấp thông tin về việc đặt memory bp và cách xử lý để có thể đặt bp nếu như chương trình sử dụng cơ chế anti-bp. Trong phần 11 này các bạn sẽ tìm hiểu thêm về các dạng Break Points khác như Hardware Breakpoints, ConditionalMessage BreakPoints, những điều thú vị đang nằm ở phía trước…. N0w….L3t’s G0!!!!!!!!!

II. BreakPoints in OllyDbg

1.Hardware Breakpoints :

Hardware Breakpoint là gì nhỉ? Tự nhiên nếu có ai hỏi tôi một câu hỏi như vậy chắc tôi cũng không biết phải giải thích thế nào. Ngay cả trong bài viết của lão làng Ricardo Navarja cũng không giải thích chi tiết về nó. Vậy là phải tự mình tìm hiểu rồi, đọc trong help file của Olly thì chỉ nhận được một chút thông tin như sau :

Hardware breakpoint (available only when running Debugger under Windows ME, NT, 2000 or XP). 80×86-compatible processors allow you to set 4 hardware breakpoints. Unlike memory breakpoint, hardware breakpoints do not slow down the execution speed, but cover only up to 4 bytes. OllyDbg can use hardware breakpoints instead of INT3 when stepping or tracing through the code.

Điều đầu tiên ta thu thập được qua đoạn này là Hardware breakpoint (viết tắt HWBP) không thể sử dụng được nếu như bạn dùng Olly trên môi trường Windows 98. Điều thứ hai là chúng ta được phép thiết lập tới 4 HWBP, so với Memory BP là quá đã rồi vì như ta đã biết tại một thời điểm Olly chỉ cho phép có duy nhất một memory bp. Thêm vào đó HWBP không làm châm quá trình thực thi của chương trình. Điều cuối cùng ta nhận được là HWBP không sử dụng INT3, vậy thì nó sử dụng lệnh gì để dừng sự thực thi của chương trình?? Chúng ta tiếp tục tìm hiểu thêm vậy J. Đi lòng vòng một hồi tôi cũng có thêm được một chút thông tin: HWBP được hỗ trợ trực tiếp bởi CPU, sử dụng một số thanh ghi đặc biệt hay còn được gọi là debug registers. Có bốn thanh ghi đó là : DR0, DR1, DR2, DR3, bốn thanh ghi này sẽ được sử dụng để lưu giữ những địa chỉ mà ta thiết lập HWBP. Điều kiện của mỗi break points để cho dừng sự thực thi của chương trình lại được lưu trong một thanh ghi đặc biệt khác là CPU register, đó là thanh ghi DR7. Khi bất kì một điều kiện nào thỏa mãn (TRUE) thì processor sẽ quăng một exception là INT1 (khà khà vậy là nó dùng INT1 nhé) và quyền điều khiển lúc này sẽ được trả về cho trình Debug của chúng ta. Có bốn khả năng để dừng sự thực thi của một chương trình :

  1. Khi một câu lệnh được thực thi.
  2. Khi nội dung của memory có thay đổi (modified).
  3. Khi một ví trí memory được đọc ra hoặc được cập nhật(updated).
  4. Khi một input-output port được tham chiếu tới. (cái này tôi cũng chưa tìm hiểu).

Khả năng của tôi cũng chỉ biết giải thích đến như thế, các bạn muốn tìm hiểu thêm vui lòng tìm đọc các tài liệu khác. Bây giờ là phần thực hành, mở Olly lên và load crackme vào nào :

Download toàn bộ bài viết tại đây :

ollydbg_tut11

Best Regards

kienmanowar

Posted in OllyDbg Tutorials, OllyDbg tut_11 | 3 Comments »

VB Decompiler

Posted by kienmanowar on September 23, 2008

VB Decompiler

Author: GPcH Soft

———

VB Decompiler is decompiler for programs (EXE, DLL or OCX) written in Visual Basic 5.0/6.0. As you know, programs in Visual Basic can be compiled into interpreted p-code or into native code.

Since p-code consists of high-level commands, there is a real possibility to decompile it into the source code (of course, the names of variables, functions, etc. will not be decompiled). VB Decompiler restores many p-code instructions and although there is a long way to the generation of the source code that can be compiled, the decompiler will make analyzing the program algorithm much easier and partially restore its source code.

If a program was compiled into the native code, restoring the source code from machine instructions is not possible. But VB decompiler can help to analyze the program even in this situation as well. It contains a powerful disassembler that supports Pentium Pro commands including MMX and SSE. It allows you to disassemble all functions. There is also a code analyzer that searches for all API function calls and string references in the disassembled code and changes them into comments for analyzed strings. In general, VB Decompiler is an ideal tool for analyzing programs and it is perfect if you lose the source code and need to partially restore the project.

VB Decompiler v5.0 has been released (14.06.08)

What’s new in this version:
- New unpacker engine
- OptionButton decompilation
- Russian help file rewriten
- New plugin functions: GetFrxIconCount, GetFrxIconOffset, GetFrxIconSize
- Address in String Reference window
- Strings editor in String Reference window
- Collapse and expand “If” and “For” constructions in text window
- BugFix: Parameters parser fixed
- BugFix: Resize in Windows Vista SP1

P-Code Example

Native Code Example

Posted in RE Tools, VB Decompiler | 1 Comment »

[ARTOOL] xADT 1.4, by Shub-Nigurrath

Posted by kienmanowar on September 24, 2008

Hi all,
version 1.4 is ready to go out, this is a major release of the already released xADT Program.

You can find it at http://releases.accessroot.com/

This is a major release because a lot of work have been done to add novel and missing anti-debugging tests.

The rough list of improvements is:

  • several new tests, a total of 20 (!) new tests have been added to this version
  • complete C++ sources of 8 plugins (1 which was already distributed as binary in version 1.3 and 7 new for version 1.4)
  • 6 tutorials specific for some tests, explaining how the tests works and how to skip the detection.
  • a standalone program made by chupachu performing the same tests I already included in the version 1.3
  • 2 standalone parallel programs: chupachu tester (the same tests are also distributed as xADT’s plugins) and EDD by Hellsp@wn
  • several fixes here and there.

I whish to thanks several people who contributed with ideas, code and testing:
metr0, Evilcry, ChupaChu, MOID, ReWolf, Defsanguje, ap0x, … and all the ARTeam members!

For a complete history and instructions check the complete history written in the file readme.txt

version 1.4
-slightly modified the readme FAQ section
-Everything has been tested with Windows XPSP3 and sources are have been tested with VS2008 and VS60
-fixed an error in the PDK _cdecl convention wasn’t explicitly declared

plugins:
-minor bugfixing of some previously released plugins
-Updated FindWindow Complex with recent keywords (like PHANTOM, 0LLY, BR3AKPOINTS,…)
-fixed xadt_ollybof.dll. Now it’s named Allybof. PAY ATTENTION: due to the nature of the test whole xADT might crash
if tested outside OllyDbg (see notes within the readme.txt file)
-fixed SIDT Test (now is called ex-SIDT) which was crashing the system on multi-processor machines

new-plugins: total of 20 new tests
+ex-SIDT, a fixup of the old SSIDT test, thanks to deroko who rewrote the driver (now is multprocessor aware). This is a PoC of multi-plugin using drivers
+ex-SIDT also performs a Ring0 test of debug registers
+NtQueryInfoProc_hook_detection (idea of Metr0/SnD), plus standalone Proof-of-concepts
+DeleteFiber (idea of evilcry), plus documentation on the theory of the test
+NtSystemDebugControl (idea of evilcry), plus documentation on the theory of the test. This plugins implements 3 dimostrative tests
+xadt_SofticeServicesTest by deroko, which tests the present of SOFTICE using OpenServiceA/EnumServicesStatusA/EnumServicesStatusExA
(3 internal tests done)
+int2Atrick (idea of ReWolf), plus documentation on the theory of the test
+MiscTricks from ideas documented here http://www.securityfocus.com/infocus/1893 (also included in distribution).
All tests not already implemented in xADT have been included (9 tests)

+full sources (projects tested with VS60/VS2008) of the following plugins, often with explations on theory and how you can hide:
ex-SIDT, sources of driver and plugin
int2Atrick,
DeleteFiber,
NtSystemDebugControl,
SICE_Tricks,
MiscTricks,
xadt_SofticeServicesTest
NtQueryInfoProc_hook_detection sources of standalone C and ASM programs and of the whole plugin
+added ZwQueryObject_readme.txt which explains a possible way to solve the ZwQueryObject test (thanks to deroko)

standalone tools:
+All the tests ChupaChu released since version 1.3 as a separate standalone program too: “testbed_chupachu.exe”
+Included in the distribution the program EDD Extreme Debug Detector by Hellsp@wn, this program does less tests but it’s handy to have it in this package too

Some notes on the Tests.

  • 1. Some tests are just PoC and can be improved, I released the sources for them, an example is the test NtQueryInfoProc_hook_detection which can also be used with other anti-debug tests and not only with NtQueryInfoProc
  • 2. The xadt_Allybof test is though to exploit the export name buffer overflow vulnerability of Olly, trying to crash it. This plugin is from Defsanguje. By it’s nature the test works perfectly if xADT is debugged by OllyDbg, but crashes xADT if the program is running normally. Then pay attention and eventually do not launch this test or remove the dlls (the test is made of two dlls: xadt_Allybof.dll and Allybof.dll) from the plugin folder.
  • 3. Several tests are connected to execution time thresholds which detect the presence of a debugger, because the same code goes slower than usual. This timing based tests are sensible to slow machines, because in these cases the thresholds should be higher. I didn’t coded any thresholds adaptation routine, so you might get some false positive on slow machines or virtually emulated machines (which are slow too). You can disassemble the dll or recompile it to adapt the thresholds to your needs.
  • 4. xADT has been tested with all these combinations:
    • Operative Systems on real PCs and Virtual PC:
      • Windows XP SP2/SP3,
      • Windows Vista
    • OllyDbg:
      • SND OllyDbg,
      • normal OllyDbg,
      • OllDbg modded using xFile,
      • hidden using xFile,advancedolly,analyzethis,hidedebugger,ollydump

Posted in RE Tools | Leave a Comment »

ARTeam: IDA plugin to depack aplib/lzma statically compressed data into IDA

Posted by kienmanowar on September 25, 2008

ARTeam: IDA plugin to depack aplib/lzma statically compressed data into IDA

Hi all,
deroko just released a plugin for IDA 5.2 and following, to decompress aplib or lzma packed data in your target when analyzing with IDA.

The plugin supports aPlib which is quite common in malware, but there’s also support for packman lzma compression, even if this one is very rare.

Run plugin by pressing CTRL+9 and you will be prompted with a window for unpacking or simply go to Edit->plugins->aplib depack

Full C sources are included, aswell. See the readme.txt for further details and instructions.

http://arteam.accessroot.com/releases.html

By Shub from ARtEAM

Posted in RE Tools | Leave a Comment »

ARTeam: IDA plugin to analyze dumped memory regions inside IDA

Posted by kienmanowar on September 25, 2008

ARTeam: IDA plugin to analyze dumped memory regions inside IDA

Hi all,
this is another interesting release from deroko/ARTeam.

A set made of two programs (an IDA plugin and a dumper) useful to analyze dumped memory regions inside IDA. Useful for malware or VMs to analysis of dynamically allocated memory code sections (full sources included)

dump_all/load_all set of tools by deroko ARTeam

dump_all.exe is program which will dump all regions of a certain executable into
specified folder. All dumps are stored as r00000000.dmp where
00000000 is virtual address of a paticilar memory region.
Advice is to create always new folder for these dumped regions, as
load_all will load all of these regions to IDA database. Just to keep
everything organized, and to avoid loading of wrong files, which could
occur under some cicumstances.

load_all.plw is and IDA plugin which will actually load all of these memory regions
into IDA database. Example plugin is compiled with IDA 5.2 SDK, but you
may compile it for other versions too.
Plugin will prompt you for file, so you are free to select any of these
.dmp, and plugin will load all of them into database. This could be useful
when analyzing malware or some protection with many buffers, for better
analyze of a VM, or import protection. This will avoid need to dump regions
manually.

http://arteam.accessroot.com/releases.html

BR,
Shubby

Posted in RE Tools | Leave a Comment »

diablo2oo2’s Ollydbg

Posted by kienmanowar on September 25, 2008

diablo2oo2’s Ollydbg

News

[20.09.2008]
Final version of dUP v2.18 is released today.  dUP 2 now can be translated to any language. Check out the forum for more information.

Also there is a new version of my PEID plugin “advanced scan” out.

And last i also updated my custom ollydbg package.

Download diablo2oo2’s Ollydbg

http://diablo2oo2.di.funpic.de/downloads/d2k2.ollydbg.public.rar

Posted in RE Tools | Leave a Comment »

Hex-Rays Decompiler Video Demo for IDA

Posted by kienmanowar on September 25, 2008

Description : The Hex-Rays Decompiler converts executable programs into a human readable C-like pseudo code text.

Author : Network Solutions Center (http://ccso.com/)

Download : http://ccso.com/files/hexraysdemo.swf

Regards

Posted in Hex-Rays Decompiler Video Demo for IDA, Other Tutorials | Leave a Comment »

IDA Pro Demo Video

Posted by kienmanowar on September 25, 2008

IDA Pro Demo Video

Description:  This is a demo video for IDA. The video is an analysis of a dynamic link library on a system compromised by spyware. It goes through and explains how to use some of the key features found in IDA.

Author : Network Solutions Center ( http://ccso.com/ )

Download : http://ccso.com/demo.wmv

Best Regards

Posted in IDA Pro Demo Video, Other Tutorials | Leave a Comment »

ARTeam: bypassing geolocalizazion with TOR, to download web things..

Posted by kienmanowar on September 26, 2008

ARTeam: bypassing geolocalizazion with TOR, to download web things..

Hi all,
sometimes you find things that cannot be download from outside a specific country, like for example several trygames programs or some other geo-localized filters.

If you need it’s extremely simple to bypass these limits using TOR

This the procedure more or less

This is a general procedure you can use to bypass any geological block that block you from accessing a specific http resource (it doesn’t works only for the browser, but for any program that opens an InternetOpen connection). It’s useful to change your IP to a specific nation or to take chance of some specific promotions (es. http://torandskype.blogspot.com/)

Anyway here are the steps:

  • You must first of all install TOR, particularly the vidalia bundle distribution (http://tor.eff.org)
  • Then configure it and launch just to see that everything works with TOR
  • Close TOR
  • Go to this web address http://torstatus.kgprog.com/index.php?SR=C…Code&SO=Asc and take the exit nodes names (first column) of the country (search for the flag icon) you need to exit to. Take care to select those with the bigger bandwidth available.
  • open the torrc text file that usually is found here c:\Documents and Settings\username\Application Data\Vidalia\torrc where username is your WinXP username of course. shocking.gif
  • Then open this file and add at the end a line with the nodes you selected above: for example this one:

Exitnodes ephemer, figure, bob, tor2uk4iravedahs, oinniun, hattor, gigatux

  • Now open again TOR and set the intenet explorer to browse the web through TOR. If you use internet explorer don’t ask me how! Anyway the usual settings are: 127.0.0.1:9050

If you use Firefox, it helps installing FoxyProxy, an extension that allows to set proxies automatically depending on specific url patterns (for example in order to always anonymously -through TOR- browse some specific sites or some specific URL patterns, helpful this one, to anonymously browse entire domains), or you can use the TorButton distributed with vidalia (but it’s worst).

If you have done all correctly you can use the following site to test how the net sees you:

Hope helps. If someone wants to do a video tutorial of this it’s welcome!

BR,
Shubby

Posted in Other Tutorials | Leave a Comment »

PE.Explorer.v1.99.R4

Posted by kienmanowar on September 29, 2008

PE.Explorer.v1.99.R4.Incl.Keyfilemaker.READ.NFO-EMBRACE

Designed for inspection and editing of Windows executable files, PE Explorer offers powerful static analysis and editing tools for working with EXE, DLL, ActiveX controls, and other executable file formats that run on MS Windows 32-bit platforms.

Whether you are an advanced computer user just wondered what makes an executable file tick, or software developer suffered from hard-to-find program bugs, PE Explorer is the software solution that will make it easy to find the answers.

All the Tools You Need in One Interface

PE Header and Section Viewer/Editor
Resource Viewer and Editor
Exported/Imported API Function List Viewer
Disassembler
Dependency Scanner
Digital Signature Viewer
UPX, Upack and NsPack Static Unpackers

What You Can Do with PE Explorer

See what’s inside an executable
Customize GUI elements of your favorite Windows programs
Track down what a program accesses and which DLLs are called
Understand the way a program works and interacts
Validate and verify signed PE files
Special support for Delphi applications
Open UPX-, Upack- and NsPack-compressed files seamlessly in
PE Explorer, without long workarounds

Download here:

PE.Explorer.v1.99.R4

Posted in RE Tools | 2 Comments »

Run TTProtect v1.05 in OllyDbg!

Posted by kienmanowar on September 30, 2008

Đợt rồi bên Unpack.cn mới xuất hiện một cái tên rất lạ TTProtect. Tuy mới ra đời những không vì thế mà giang hồ đánh giá thấp về nó. Theo như nhận xét của Còm đại ca thì “Về cơ bản, tính năng của TTProtect có vẻ nhái lại của Themida/Winlic. Là đàn em, có vẻ nó có tính năng antidebug tốt hơn”. Công nhận thằng này cũng ác, thử đủ kiểu nhưng không làm sao run/attach được trong Olly:

1. Run unpackme và Attach vào Olly tèo.
2. Load program bình thường và run cũng tèo.

Sau một hồi nghịch ngợm config cái đống Plug-in để Anti-Debug, không hiểu thế nào mà cuối cùng cũng run được nó.

Mấy hôm nay chú UnRegistered! cứ hỏi “Sao anh bypass Anti-Debug được để run trong Olly thế? Chỉ cho em với”. Tôi cũng chẳng biết trả lời thế nào, đành quay cái movie minh họa :

Download movie tại đây:

Run TTProtect in OllyDbg

Best Regards

kienmanowar

Posted in Other Tutorials, Run TTProtect v1.05 in OllyDbg! | 1 Comment »

IDA Stealth Plugin

Posted by kienmanowar on October 3, 2008

IDA Stealth Plugin

IDA Stealth is a plugin which aims to hide the IDA debugger from most common anti-debugging techniques.

The plugin is composed of two files, the plugin itself and a dll which is injected into the debuggee as soon as the debugger attaches to the process. The injected dll actually implements most of the stealth techniques either by hooking system calls or by patching some flags in the remote process.

Installation

To install the plugin, copy both files to the plugins directory of your IDA installation. Make sure, that the cfg subdirectory is writable, because that’s where the plugin stores its configuration.

If you find bugs or want to suggest new stealth techniques just drop me a mail or create a new forum topic.
Changelog

07/24/2008 – v1.0 Beta 1

* Bugfix: Multiple minor bugfixes
* Added: Fake OS version
* Added: Disable NtTerminateThread/NtTerminateProcess

07/14/2008 – v1.0 Alpha 4

* Bugfix: Injection of stealth dll could fail in some cases (see N-InjectLib)

07/13/2008 – v1.0 Alpha 3

* Added: Multiple stealth techniques (OpenProcess, DBG_PRINTEXCEPTION, hardware breakpoint protection, hide IDA process and windows, to name but a few)
* Improved: Overall stealth: xADT as well as Extreme Debugger Detector 0.5 are unable to detect an attached debugger (except for RDTSC based tests and scanning the HDD for various tools)
* Bugfix: Plugin didn’t correctly de-register from debug callback; crashed with newly created databases

07/06/2008 – v1.0 Alpha 2

* Bugfix: Injection of stealth dll failed if IMAGE_DIRECTORY_ENTRY_IAT of process was zero, so the plugin didn’t work with most packed executables
* Bugfix: NtQueryInformationProcess didn’t work (CheckRemoteDebuggerPresent was implicitly affected)

07/04/2008 – v1.0 Alpha

* First alpha release, some features still missing, needs testing, major bugs
* Known Bugs:
o Problems when modifying import directory of packed executables (error 0xC000007B)

09/02/2008 – v1.0 Beta 2

Bugfix: Due to improper checking of input parameters in the NtQuerySystemInformation hook, the debugged process could raise an exception, finally unveiling the existence of IDA Stealth
Bugfix: Hiding of possibly existing kernel debugger now working correctly
Bugfix: Fake parent process and Hide IDA from process list are no longer mutual exclusive
Bugfix: NtQueryInformationProcess hook accepted too small input buffers
Bugfix: NtQueryInformationProcess hook erroneously assumed the process handle to be always that of the current process
Bugfix: Exception caused by closing an invalid handle is now properly hidden from the debugged process by using SEH or Vectored exception handling
Bugfix: NtSetInformationThread wasn’t hooked at all due to a typo
Bugfix: Added checks to hook functions so they behave as expected when an invalid handle is passed. Affected functions:
NtSetInformationThread
SuspendThread
SwitchDesktop
NtTerminateThread
NtTerminateProcess
Bugfix: RtlGetVersion returned wrong platform ID and build number
Added: Console version of IDA is also hidden from process list

09/15/2008 – v1.0 Beta 3

* Bugfix: NtQuerySystemInformation hook possibly returned wrong error code when handling SystemKernelDebuggerInformation query
* Bugfix: NtQueryObject hook mistakenly assumed that all object names are zero terminated strings
* Improved: NtQueryInformationProcess considers the case that the debuggee itself might act as a debugger (see Tuts4You baord)
* Improved: Exception triggered by NtClose is now blocked in the first place (detailed description)
* Added: Countermeasures against anti-attach techniques

Download here:

IDAStealth

Posted in IDA Stealth Plugin, RE Tools | Leave a Comment »

Fifa 2009 Advanced Tutorials for PSP!

Posted by kienmanowar on October 3, 2008

Fifa 2009 Advanced Tutorials for PSP!

Posted in Fifa 09 Advanced Skills Tutorial, Movie | 2 Comments »

Fifa 09 Standard Skills Tutorial

Posted by kienmanowar on October 3, 2008

Fifa 09 Standard Skills Tutorial for PSP

Posted in Fifa 09 Standard Skills Tutorial, Movie | Leave a Comment »

Olly Schemes-Căn chỉnh màu trong Olly

Posted by kienmanowar on October 4, 2008

Đợt rồi tôi nhận được một số câu hỏi liên quan tới việc làm sao để cho Olly hiện thị các đoạn code với màu sắc rõ ràng. Trước nay tôi toàn tự manual edit, sau đó kiểm nghiệm lại cho tới khi đạt được điều mình ưng ý. Đợt rồi qua site của  Oleh Yuschuk tôi tình cờ thấy có thêm phần Schemes nói về cách căn chỉnh màu trong Olly, các bạn có thể tham khảo thêm tại đây (http://ollydbg.de/schemes.html).

Màu sắc mà tôi đang sử dụng là cái này :

[Colours]
Scheme[*]=10,14,16,0,5,13,17,13
Scheme name[*]=Alex black[Syntax]
Commands[*]=10,11,12,14,10,13,10,48,48,2,110,0,0,0
Operands[*]=0,73,0,0,0,0,0,0,0,0,0,0,0,0
Scheme name[*]=Alex black

Posted in Olly Schemes-Căn chỉnh màu cho Olly, Other Tutorials | Leave a Comment »

Heart Of Steel – Manowar

Posted by kienmanowar on October 9, 2008

Bạn đã nghe Heart Of Steel bao giờ chưa ?. Và tôi cũng muốn bạn đồng ý với tôi đó là bản Ballad hay nhất của Manowar. Liệu bạn có thể tìm ra một lời hát thứ hai ý nghĩa và sâu sắc như lời của Heart of Steel: “I fight the world and take all they can give. There are times my heart hangs low. Born to walk against the wind. Born to hear my name. No matter where I stand I’m alone”.

Tôi cho rằng rất nhiều bạn trẻ hiện nay đều muốn thể hiện được bản thân mình giữa một cộng đồng chung. Đấy là điều rất đáng hoan nghênh. Một tập thể mà bất cứ cá nhân nào cũng giống nhau thì đó là một tập hợp chứ không phải là một tập thể ( Định nghĩa tập hợp: gồm nhiều phần tử có chung với nhau một tính chất nhất định).

Nhưng phải chăng bạn đã thể hiện được cái “tôi” của chính mình. Bạn luôn muốn đưa ra ý kiến khác mọi người, nhưng không hiểu sao bạn không đủ dũng cảm để giơ cánh tay của mình lên. Bạn sợ rằng khi nói sai mình sẽ mất đi sự tin cậy, uy tín đối với tập thể. Hoặc khi làm việc gì đó, bạn có cách riêng để giải quyết vấn đề theo hướng của mình, nhưng do không thấy ai làm giống mình, hoặc không có ai ủng hộ nên bạn đành phải quên giải pháp của mình đi và gượng ép làm theo số đông. Nguyên nhân của sự e dè này là gì ?

Đó chính là lòng dũng cảm để đón nhận thất bại. Không có một ai thành công mà chưa hề thất bại, nhưng sau mỗi thất bại họ đều biết cách đứng dậy. Đối với bạn mọi việc cũng như vậy. Bạn sợ khi làm theo ý kiến mình, bạn sẽ không thành công, và cái lòng “tự kiêu” trong con người bạn không cho phép bạn thất bại. Bạn sẽ hy sinh đi bản thân mình để đón lấy thành công trong mọi việc.

Với Manowar thì khác. Họ có lòng dũng cảm để “I fight the World”, nhưng cái mà tôi khâm phục chính là lòng dũng cảm để “and take all they can give”. Nói ra ý kiến của mình thì dễ, nhưng dám đứng ra nhận trách nhiệm về ý kiến của mình thì không phải ai cũng làm được. Nhưng Manowar dám làm điều đó. Họ sinh ra là để đón nhận những điều khó khăn: ” We like it hard, We like it Fast”, là để đối đầu lại với ngọn gió lớn: “Born to walk against the wind”. Cho dù họ có đơn độc và bị cả thế giới chống đối, họ vẫn giữ vững được ý chí và lập trường của mình: “No matter where I stand I’m alone”.

Build a fire a thousand miles away
To light my long way home
I ride a comet
My trail is long to stay
Silence is a heavy stone
I fight the world and take all they can give
There are times my heart hangs low
Born to walk against the wind
Born to hear my name
No matter where I stand Im alone

Stand and fight
Live by your heart
Always one more try
Im not afraid to die
Stand and fight
Say what you feel
Born with a heart of steel

Burn the bridge behind you
Leave no retreat
Theres only one way home
Those who laugh and crowd the path
And cut each others throats
Will fall like melting snow
Theyll watch us rise with fire in our eyes
Theyll bow their heads
Their hearts will hang low
Then well laugh and they will kneel
And know this heart of steel was
Too hard to break
Too hard to hold

Stand and fight
Live by your heart
Always one more try
Im not afraid to die
Stand and fight
Say what you feel
Born with a heart of steel

—–Bài cảm nhận bên nhacrockonline———

Đây là video của bài này :)

Posted in Heart Of Steel - Manowar, Movie | Leave a Comment »

Die For Metal – Manowar

Posted by kienmanowar on October 10, 2008

Lyric :

They can’t stop us
Let ‘em try
For heavy metal
We will die!

Quit my job this morning said forever
I would hold my head up high
Cause i need metal in my life
Just like an eagle needs to fly

So i walked outside into the street
From a hall i heard thunder and screams
I walked inside so i could hear
and the guy beside me gave me a beer

He had his fist up in the air
and called me brother said my friends
are over there

They call themselves immortals
They’re the truest of the true
And in that very moment
I was born again like you

They said hold your head up high
Raise your fist up in the air
Play metal louder than hell
Louder than hell

They can’t stop us
Let ‘em try
For heavy metal
We would die!

Brothers stand beside me, there’s a battle on
Know my words are true
There’s a battle for true metal
They’re marching; they’re marching on
me and you

Ten thousand strong are here tonight
With twenty thousand fists up in the air
The power of true metal’s calling you
It’s everywhere

Hold your head up high
Raise your fist up in the air
Play metal louder than hell
Louder than hell

They can’t stop us
Let ‘em try
For heavy metal
We would die!

Movie :

Posted in Die For Metal - Manowar, Movie | Leave a Comment »

Kings Of Metal – Manowar

Posted by kienmanowar on October 10, 2008

Posted in Kings Of Metal, Movie | Leave a Comment »

1.4 Netcat The Almighty

Posted by kienmanowar on October 10, 2008

1.4 Netcat The Almighty
Tổng quan

Netcat là một công cụ được giới Hacking và Security đánh giá là tuyệt vời. Giải thích đơn giản thì netcat là một công cụ có thể “read and write to TCP and
UDP ports”. Netcat có thể chạy ở hai mode : “client” hoặc “server”. Một lời khuyên rất hay mà tôi thường gặp là “Nếu như bạn cảm thấy hay và còn lờ mờ về vấn đề hay công cụ đó hãy tự mình research”

1.4.1 Connecting to a TCP/UDP port with Netcat
Việc kết nối tới một TCP/UDP port trong nhiều trường hợp sẽ giúp ích cho chúng ta những vấn đề sau :

  • Chúng ta muốn kiểm tra xem một port đang open hay đã close (Khả năng quét cổng ngẫu nhiên.)
  • Chúng ta muốn đọc banner từ port
  • Chúng ta muốn kết nối tời một network service

Ok, chúng ta chạy thử netcat và xem help của nó :

1. Để kết nối tới một TCP port 22 tại địa chỉ nào đó và grap lấy banner của chương trình ssh server ta làm như sau (ở đây tôi lấy đại một địa chỉ) :

bt ~ # nc -vv vgr.net 22
Warning: inverse host lookup failed for 65.161.177.104: Unknown host
host6.net [65.161.177.104] 22 (ssh) open
SSH-2.0-OpenSSH_3.8.1p1
sent 0, rcvd 24
bt ~ #

2. Kết quả ta thấy cổng 22 đang open và SSH banner trả về là SSH-2.0-OpenSSH_3.8.1p1

3. Giờ thử connect tới port 80 xem thế nào nhé, thêm vào đó ta sẽ gửi một HTTP HEAD request tới server và đọc ra HTTP server banner. Ta làm như sau :

bt ~ # nc -vv vgr.net 80
Warning: inverse host lookup failed for 65.161.177.104: Unknown host
host6.net [65.161.177.104] 80 (http) open
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Date: Fri, 10 Oct 2008 03:12:20 GMT
Server: Apache
X-Powered-By: PHP/4.4.2
Connection: close
Content-Type: text/html; charset=ISO-8859-1

sent 17, rcvd 161
bt ~ #

Qua đây ta đoán được Server này sử dụng Apache làm Web Server, trên đó đã cài PHP với version có thể là 4.4.2.

1.4.2 Listening on a TCP/UDP port with Netcat
Một tính năng rất hay khác của netcat đó là listen trên một port TCP/UDP, nó mang tới khả năng trong việc ” network debugging client applications”, hoặc “receiving a TCP/UDP network connection”

Ta thử thực hiện một đoạn chat đơn giản sử dụng netcat, công việc này cần có hai máy. Máy của tôi có địa chỉ ip là 10.32.110.67 (OS: Linux), máy khác có ip là 10.32.110.57 (OS : WindowsXP).

1. Trên máy của tôi,tôi chạy netcat cho listen trên port 4444 và lắng nghe các kết nối tới máy tôi :

bt ~ # nc -lvvp 4444
listening on [any] 4444 …

2. Từ máy Windows tôi thực hiện kết nối tới máy tôi :

C:\nc111nt>nc.exe -vv 10.32.110.67 4444
10.32.110.67: inverse host lookup failed: h_errno 11004: NO_DATA
(UNKNOWN) [10.32.110.67] 4444 (?) open

Gõ thử dòng sau :

C:\nc111nt>nc.exe -vv 10.32.110.67 4444
10.32.110.67: inverse host lookup failed: h_errno 11004: NO_DATA
(UNKNOWN) [10.32.110.67] 4444 (?) open
Hi, how are you

Chuyển qua máy tôi :

bt ~ # nc -lvvp 4444
listening on [any] 4444 …
10.32.110.57: inverse host lookup failed: Unknown host
connect to [10.32.110.67] from (UNKNOWN) [10.32.110.57] 2219
Hi, how are you <== thông điệp nhận được
I’m fine. Thanx..And you? <== tôi gửi lại

Kết quả trên máy Windows :

C:\nc111nt>nc.exe -vv 10.32.110.67 4444
10.32.110.67: inverse host lookup failed: h_errno 11004: NO_DATA
(UNKNOWN) [10.32.110.67] 4444 (?) open
Hi, how are you
I’m fine. Thanx..And you?

1.4.3 Transferring files with Netcat
Netcat có thể được sử dụng để truyền nhận file như một simple ftp.Nó hỗ trợ truyền text và binary files.Thực hiện demo tranfer một file từ máy Windows tới máy Linux.

1. Tại máy Linux : ta cho netcat lắng nghe và chấp nhận kết nối đồng thời chuyển hướng bất kì một input nào từ máy Windows vào một file.

bt ~ # nc -lvp 4444 > output.txt
listening on [any] 4444 …

2. Tại máy Windows : ta tạo ra một file test.txt có nội dung tùy ý.Sau đó connect tới máy Linux và send file.

C:\nc111nt>echo “Hi! I want to transfer some files to you..lolz!!” > test.txt

C:\nc111nt>type test.txt
“Hi! I want to transfer some files to you..lolz!!”

C:\nc111nt>nc.exe -vv 10.32.110.67 4444 < test.txt
10.32.110.67: inverse host lookup failed: h_errno 11004: NO_DATA
(UNKNOWN) [10.32.110.67] 4444 (?) open

Do netcat không có thông báo hay dấu hiệu gì cho ta thấy rằng đang truyền file, cho nên ta đợi một lúc sau đó nhấn Ctrl + C để thoát khỏi netcat.

3. Tại máy Linux tiến hành kiểm tra
bt ~ # nc -lvp 4444 > output.txt
listening on [any] 4444 …
10.32.110.57: inverse host lookup failed: Unknown host
connect to [10.32.110.67] from (UNKNOWN) [10.32.110.57] 4084
bt ~ # cat output.txt
“Hi! I want to transfer some files to you..lolz!!”
bt ~ #

Dùng lệnh cat để kiểm tra nội dung của file output.txt như trên. :)

1.4.4 Remote Administration with Netcat
Một tên gọi khác của netcat được nhiều người gọi là “Netcat as a BackDoor”. Một trong những tính năng có thể gọi là tinh xảo của netcat đó là command redirection. Điều này được giải thích như sau :
“Netcat can take an exe file and redirect the input,output and error messages to a TCP/UDP port, rather than to the default console.”. Ta lấy ví dụ để cho dễ hiểu với file cmd.exe trên máy Windows.Bằng việc redirect stdin/stdout/stderr, chúng ta có thể bind chương trình cmd.exe vào một local port.Bất kì một người nào kết nối tới port này sẽ nhận được một command prompt. Hehe có vẻ lằng nhằng nhỉ, theo dõi một số ví dụ để dễ hình dung.

Giả sử, có hai user là Bob và Alice – hai user này đều muốn tìm cách kết nối tới máy của nhau.Hãy xem hình minh họa về mô hình mạng cũng như vai trò của từng người trong mô hình.

1.4.4.1 Scenario 1 – Bind Shell
Trong ví dụ 1 này, Bob muốn nhờ tới sự trợ giúp của Alice do đó anh ta đề nghị Alice kết nối tới máy của anh ta để giúp đỡ. Như bạn thấy trong hình trên Bob tác giả nói là (Bob has a non RFC 1918 address (http://www.faqs.org/rfcs/rfc1918.html)) và anh ta kết nối trực tiếp với internet.Tuy nhiên, ngược lại Alice lại đừng đằng sau một NAT connection.

Để giúp alice connect tới máy mình Bob làm như sau, anh ta cần phải bind cmd.exe ra một port TCP trên máy anh ta và sau đó thông báo cho Alice kết nối tới port đó.
Trên máy của Bob :

C:\nc111nt>nc -lvvp 4444 -e cmd.exe
listening on [any] 4444 …

Điều này hơi nguy hiểm bởi lẽ nếu một người nào đó không phải là Alice mà sử dụng việc scan port trên máy Bob và dùng nc kết nối tới thì sẽ nguy hiểm. Ở đây ta giả sử chỉ có Alice kết nối tới.

Tại máy của Alice

bt ~ # nc -v 10.32.110.57 4444
10.32.110.57: inverse host lookup failed: Unknown host
(UNKNOWN) [10.32.110.57] 4444 (krb524) open
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\nc111nt> <== hiện ra cái này là kết nối thành công :)

Tiếp theo thử gõ lệnh xem thế nào :

C:\nc111nt>dir
dir
Volume in drive C has no label.
Volume Serial Number is 4CD7-38CF

Directory of C:\nc111nt

10/10/2008 03:42 PM

.
10/10/2008 03:42 PM ..
12/28/2004 11:23 AM 12,166 doexec.c
07/09/1996 04:01 PM 7,283 generic.h
11/06/1996 10:40 PM 22,784 getopt.c
11/03/1994 07:07 PM 4,765 getopt.h
02/06/1998 03:50 PM 61,780 hobbit.txt
12/27/2004 05:37 PM 18,009 license.txt
11/28/1997 02:36 PM 544 makefile
12/29/2004 01:07 PM 61,440 nc.exe
12/29/2004 01:07 PM 69,662 netcat.c
12/27/2004 05:44 PM 6,833 readme.txt
10/10/2008 03:42 PM 53 test.txt
11 File(s) 265,319 bytes
2 Dir(s) 31,878,184,960 bytes free

C:\nc111nt>

1.4.4.2 Scenario 2 – Reverse Shell
Tình huống thứ hai, giờ đến lượt Alice muốn nhờ Bob giúp.Ta giả định rằng Alice không phải là người kiểm soát NAT device, vậy có cách nào để Bob kết nối tới máy của Alice và giúp đỡ cô ấy. :(

Một tính năng thú vị khác của netcat là khả năng send một command shell tới một listening host.Vì vậy trong tình huống này, mặc dù Alice không thể bind port tới cmd.exe trên máy của cô ấy và mong chờ Bob kết nối tới, cô ấy có thể send command prompt của cô ấy tới máy của Bob :) . Vậy thực hiện như sau :

Tại máy của Bob:

C:\nc111nt>nc -lvvp 4444
listening on [any] 4444 …

Tại máy của Alice :

bt ~ # nc -v 10.32.110.57 4444 -e /bin/bash
10.32.110.57: inverse host lookup failed: Unknown host
(UNKNOWN) [10.32.110.57] 4444 (krb524) open

Lúc này tại máy của Bob ta thấy như sau :

C:\nc111nt>nc -lvvp 4444
listening on [any] 4444 …
10.32.110.67: inverse host lookup failed: h_errno 11004: NO_DATA
connect to [10.32.110.57] from (UNKNOWN) [10.32.110.67] 44735: NO_DATA

Lúc này ta có thể gõ lệnh được rồi :

C:\nc111nt>nc -lvvp 4444
listening on [any] 4444 …
10.32.110.67: inverse host lookup failed: h_errno 11004: NO_DATA
connect to [10.32.110.57] from (UNKNOWN) [10.32.110.67] 44735: NO_DATA
ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:36:1E:01
inet addr:10.32.110.67 Bcast:10.32.110.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:188690 errors:1 dropped:0 overruns:0 frame:0
TX packets:16575 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:24337003 (23.2 MiB) TX bytes:3898205 (3.7 MiB)
Interrupt:16 Base address:0×2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1135 (1.1 KiB) TX bytes:1135 (1.1 KiB)

ls
Desktop
dnsz.sh
dodnsr.sh
dopings.sh
findicq.sh
icq-ips.txt
icq-srv.txt
index.html
output.txt

Chà thật là thú vị. Dưới đây là đôi lời của tác giả viết bài này :


Netcat has other nice features and uses such as simple sniffing abilities, port redirection and others which I will leave for you to research independently. The reason I didn’t want to call this Module “Netcat as a backdoor” is that students usually start thinking about the malicious implementations of such a backdoor, and one of the first questions asked is: “How to I get Netcat to run on the victim machine, without remote user intervention?”.I usually dismiss this question, with a horrified look on my face. The magic answer to this question is simply “remote code execution”.Ninety percent of attack vectors can be summarized with the pair of words “code execution”.For example,attacks such as Buffer Overflows, SQL injection, File Inclusion,Client Side Attacks, Trojan Horses – all aim to result in “code execution” on the victim machine.

Posted in 1.4 Netcat The Almighty, Linux, Some tutor about using BackTrack | Leave a Comment »

X-Ways.Winhex.v15.1.SR-4.Incl.Keymaker-ZWT

Posted by kienmanowar on October 13, 2008

X-Ways.Winhex.v15.1.SR-4.Incl.Keymaker-ZWT

WinHex is in its core a universal hexadecimal editor, particularly helpful in the realm of computer forensics, data recovery, low-level data processing, and IT security. An advanced tool for everyday and emergency use: inspect and edit all kinds of files, recover deleted files or lost data from hard drives with corrupt file systems or from digital camera cards. Features include (depending on the license type):

  • Disk editor for hard disks, floppy disks, CD-ROM & DVD, ZIP, Smart Media, Compact Flash, …
  • Native support for FAT, NTFS, Ext2/3, ReiserFS, Reiser4, UFS, CDFS, UDF
  • Built-in interpretation of RAID systems and dynamic disks
  • Various data recovery techniques
  • RAM editor, providing access to physical RAM and other processes’ virtual memory
  • Data interpreter, knowing 20 data types
  • Editing data structures using templates (e.g. to repair partition table/boot sector)
  • Concatenating and splitting files, unifying and dividing odd and even bytes/words
  • Analyzing and comparing files
  • Particularly flexible search and replace functions
  • Disk cloning (under DOS with X-Ways Replica)
  • Drive images & backups (optionally compressed or split into 650 MB archives)
  • Programming interface (API) and scripting
  • 256-bit AES encryption, checksums, CRC32, hashes (MD5, SHA-1, …)
  • Erase (wipe) confidential files securely, hard drive cleansing to protect your privacy
  • Import all clipboard formats, incl. ASCII hex values
  • Convert between binary, hex ASCII, Intel Hex, and Motorola S
  • Character sets: ANSI ASCII, IBM ASCII, EBCDIC, (Unicode)
  • Instant window switching. Printing. Random-number generator.
  • Supports files >4 GB. Very fast. Easy to use.

X-Ways.Winhex.v15.1.SR-4.Incl.Keymaker-ZWT

http://rapidshare.com/files/153199317/zwhx1514.zip.html

Posted in RE Tools, WinHex | Leave a Comment »

1.5 Using Wireshark (Ethereal)

Posted by kienmanowar on October 13, 2008

1.5  Using Wireshark (Ethereal)
Tổng quan

Việc học và hiểu tốt về một công cụ sniffer là một trong những yêu cầu tối cần thiết đối với những người làm việc liên quan tới network. Việc sử dụng tốt sniffer sẽ giúp chúng ta :

  • Capture được các gói tin từ nhiều nguồn khác nhau
  • Hiểu sâu hơn về bộ giao thức TCP/IP
  • Phân tích các gói tin được capture để hiểu rõ hơn về chức năng của giao thức mạng
  • Giúp đỡ trong việc phân tích và khắc phục sự cố mạng

1.5.1  Peeking at a Sniffer
Ok thực hiện một demo nhỏ, tôi bật WireShark lên và cấu hình nó, sau đó tôi truy cập vào website : www.milw0rm.com. Sau khi truy cập xong, tôi cho dừng việc capture packets của WireShark và tiến hành phân tích ngữ nghĩa của dòng traffic.


Packet1 : ARP Broadcast. Tại sao lại có nó nhỉ, hehe quay trở lại ví dụ của chúng ta, ta đang cố gắng thực hiện một kết nối ra ngoài Internet, và trước khi máy tính của chúng ta có thể thực sự trao đổi được dữ liệu, nó cần phải xác định defaut gateway nằm ở đâu trong mạng Local network (tức là mạng LAN hiện thời của chúng ta). Địa chỉ IP của default gateway đã được cấu hình trên máy tính của chúng ta rồi, tuy nhiên địa chỉ MAC của nó thì chúng ta chưa biết. Do đó từ máy tính của tôi gửi đi một thông điệp tới toàn mạng LAN rằng “Ai có địa chỉ IP là 192.168.0.1? Hãy trả lời lại cho 192.168.0.186″.

Packet2 : Toàn bộ máy tính trong mạng local subnet của tôi đều nhận được gói tin Arp broadcast này và chúng kiểm tra xem có phù hợp với yêu cầu từ máy tôi hay không.Lúc này chỉ có duy nhất địa chỉ 192.168.0.1 trả lời lại cho gói tin ARP của tôi và nó gửi lại cho máy tôi một gói tin là ARP unicast reply, trong đó chứa thông tin về địa chỉ MAC của default gateway.

Packet3 : Ok, giờ thì máy tính của tôi đã biết được nơi mà nó cần  phải gửi các packets để làm sao các packets đó đi ra được Internet, chúng ta cần resolve địa chỉ IP của website : www.milw0rm.com. Máy tính của tôi gửi một gói tin là DNS query tới DNS Server được chỉ ra trong phần cấu hình TCP/IP trên máy của tôi và hỏi DNS Server rằng : Địa chỉ ip của site milw0rm.com là gì?

Packet4 : Thằng DNS Server trả lời lại cho ta biết rằng FQDN của thằng www.milw0rm.com có bí danh là milw0rm.com

Packet5 : Tiếp theo máy tính của ta chấp nhận câu trả lời từ phía DNS Server và tiếp tục đi tìm câu trả lời cuối cùng là địa chỉ IP của milw0rm.com là gì ?

Packet6 : Lúc này thằng DNS Server sẽ trả lời lại và nói cho máy ta biết địa chỉ IP của site milw0rm.com là 213.150.45.196.

Packet7 : Có được câu trả lời về IP của milw0rm, máy của chúng ta tiến hành thủ tục bắt tay 3 bước (3 way handshake) với địa chỉ ip 213.150.45.196 tại port 80 và bắt đầu bằng việc gửi đi một SYN request.

Packet8 : Thằng Web Server sau khi nhận được gói SYN request của ta sẽ trả lời lại bằng một ACK và SYN về máy của ta.

Packet9 : Lúc này máy chúng ta kết thúc quá trình bắt tay 3 bước bằng cách gửi lại ACK về Web Server.

Packet10 : Sau khi kết thúc quá trình bắt tay tức là máy chúng ta lúc này có thể nói chuyện bằng service sử dụng các specific protocol. Do dúng ta dùng Web browser, cho nên máy chúng ta sẽ gửi một HTTP GET để yêu cầu lấy trang index page, và tất cả các linked images về browser của ta.

Packet11 – end : Toàn bộ trang index của  milw0rm đã được load về browser trên máy của chúng ta.

Sau khi phân tích như trên các bạn có thể thấy rằng chương trình sniffer thực sự rất hữu ích, nó giúp ta hình dung rõ ràng nhất những gì đang xảy ra trong môi trường mại của chúng ta.

1.5.2  Capture filters
Nhìn hình minh họa ở trên các bạn sẽ nhận thấy nó rất đẹp, đẹp là bởi vì nó không có các gói tin thuộc dạng “background noise”. Phải thú thực những gì mà ta làm ở trên là một ví dụ lý tưởng, đối với những môi trường nhiều máy tính truy cập các bạn sẽ nhận thấy khi ta capture sẽ nhận được vô số các gói tin hỗn độn nằm ngoài mục đích mong muốn của chúng ta. Những gói tin broadcast, các miscellaneous network services và các running applications khiến cho chúng ta nhiều lúc bị rối rắm trong quá trình phân tích các traffic.

Chính vì lý do này mà chúng ta phải cần tới các bộ lọc.Nhiệm vụ của filter sẽ giúp cho chúng ta loại ra các gói tin không cần thiết trong phiên capture. Các bạn hãy từ mình nghiên cứu và khám phá về nó.

1.5.3  Following TCP Streams
Như bạn thấy trong ví dụ về milw0rm.com ở trên, ta thấy rằng các packet từ 11- cho tới hết là khá  khó khăn trong việc phân tích bởi nó bao gồm các fragments. Các chương trình sniffer hiện đại như WireShark có khả năng ráp nối lại toàn bộ thông tin của một session cụ thể và hiện thị nó dưới dạng dễ nhìn và dễ hiểu hơn.

Posted in 1.5 Using Wireshark (Ethereal), Linux, Some tutor about using BackTrack | Leave a Comment »

OllyDbg Tut_12

Posted by kienmanowar on October 15, 2008

Một cái đầu lạnh để vững vàng, một trái tim đỏ lửa để yêu và làm việc hết mình!

I. Giới thiệu chung

Chào các bạn, trong phần bài viết trước ở phần 11 tôi đã hướng dẫn các bạn tìm hiểu về hai dạng Break Points là Hardware BreakpointsConditional Breakpoints, cũng như các cách thiết lập cho hai dạng BP này. Lẽ ra trong phần 11 tôi cũng định giới thiệu luôn về dạng Message BreakPoints, nhưng thiết nghĩ nếu gộp luôn vào trong phần 11 sẽ khiến các bạn quá tải và dẫn đến “tẩu hỏa” mất J. Cho nên tôi cắt riêng phần Message Breakpoints ra và quyết định giới thiệu về nó trong phần 12 này. Rất nhiều điều thú vị đang nằm ở phía trước…. N0w….L3t’s G0!!!!!!!!!

II. BreakPoints in OllyDbg

1.Message Breakpoints :

Message Breakpoint là gì nhỉ? Sao lại lắm lọai BP đến thế J. Khi gặp bất kì những vấn đề nào mới, trong đầu tôi luôn xuất hiện những câu hỏi liên quan đến vấn đề đó. Sau đó, tôi tìm cách tiếp cận thông tin để giải quyết cho những câu hỏi của tôi. Trước tiên, tôi chẳng biết Message Breakoint nó là cái gì, cho nên tôi tra help của Olly trước, hi vọng sẽ tìm ra chút thông tin nào đó về nó. Đọc trong help file của Olly thì chỉ nhận được một chút thông tin như sau :

Message breakpoint is same as conditional logging except that OllyDbg automatically generates condition allowing to break on some message (like WM_PAINT) on the entry point to window procedure. You can set it in the Windows window

Thông tin đầu tiên gợi mở cho tôi là thằng Message breakpoint này gần tương tự như Conditional Log BP ngoài trừ việc khác ở chỗ Olly hoàn toàn tự động tạo ra các điều kiện cho phép dừng lại tại các Message. Mà cái Message ở đây chính là các Windows Message. Tôi không phải là dân chuyên lập trình cho nên tôi tìm hiểu tiếp các thông tin khác trên Net về Windows Message :

“The messages in Windows are used to communicate most of the events, at least in the basic levels. If you want a window or control (which is a specialized window) does something, you must send a message to him. If another window wants you do something, then it sends a message to you. If an event occurs, such as when the user moves the mouse, presses the keyboard, etc… the system sends a message to the affected window. This window receives the message and acts suitably.”

-Message là một trong những phương tiện giao tiếp quan trọng nhất trong môi trường Windows.

-Lập trình trong Windows chủ yếu là đáp ứng lại những sự kiện.

-Message có thể báo hiệu nhiều sự kiện gây ra bởi người sử dụng, hệ điều hành, hoặc chương trình khác.

-Có hai lọai message: window message và thread message.

Window Message:

-Tất cả các message đều được trữ trong một Message Queue(một nơi trong bộ nhớ). Những message này sau đó sẽ được luân chuyển giữa các ứng dụng.

Message Loop:

-Bạn có thể gọi những message bằng cách tạo ra một Message Queue.

-Message Loop là một vòng lặp kiểm tra những message trong Message Queue.

-Khi một message được nhận, Message Loop giải quyết nó bằng cách gọi Message Handler (một hàm được thiết kế để giúp Message Loop xử lý message)<hầu hết công việc lập trình của mình sẽ tập trung vào đây>

-Message Loop sẽ kết thúc khi nhận được message WM_QUIT (lúc người dùng chọn File/Exit || click vào nút Close || bấm Alt+F4)

-Khi bạn tạo cửa sổ (ứng dụng) Windows sẽ tạo cho bạn một Message Handler mặc định. Bạn sẽ vào đây để sửa chữa giúp ứng dụng phản hồi lại những sự kiện theo ý bạn muốn ->chương trình của bạn.

-Tất cả những control chuẩn đều như thế. Lấy một button làm ví dụ: khi nó nhận WM_PAINT message nó sẽ vẽ button; khi bạn click chuột trái lên nó sẽ nhận WM_LBUTTONDOWN message và nó sẽ vẽ hình button bị nhấn xuống; khi buông chuột ra nó nhận WM_LBUTTONUP message và sẽ vẽ lại button bình thường.

-Tên của window message thường có dạng WM_ và hàm để xử lý message đó thường có dạng On. Ví dụ hàm xử lý WM_SIZE message là OnSize.

-Message thường có hai tham số lưu trữ thông tin về sự kiện(32 bit): lParam kiểu LONG và wParam kiểu WORD. Ví dụ: WM_MOUSEMOVE sẽ trữ tọa độ chuột trong một tham số còn tham số kia sẽ có cờ hiệu để ghi nhận trạng thái của phím ATL, Shift, CTRL và những nút trên con chuột.

-Message có thể trả về một giá trị giúp bạn gửi dữ liệu ngược trở về chương trình gửi nó. Ví dụ: WM_CTLCOLOR message chờ bạn trả về một HBRUSH (khi dùng AppWizard để tạo nhanh ứng dụng bạn chú ý những hàm có dạng On… và nhận xét những kiểu trả về của nó, bạn sẽ hiểu hơn về cơ chế liên kết giữa các thành phần ứng dụng với nhau)

Nguồn : http://www.eco-blue.net/index.php?showtopic=571&mode=threaded&pid=2527

……….
……….

Download toàn bộ bài viết :

ollydbg_tut12

Best Regards

kienmanowar

Posted in OllyDbg Tutorials, OllyDbg tut_12 | Leave a Comment »

Reverse Engineering with OllySocketTrace

Posted by kienmanowar on October 15, 2008

Today I would like to share with you a really great plugin for OllyDbg (a 32-bit assembler-level, analyzing debugger for Windows).

The plugin is OllySocketTrace from Harmony Security. Its job is to trace the socket operations performed by a process. It records all buffers sent and received. It also records all parameters and return values, and the trace is highlighted with a unique color for each socket being traced.

Here is a screen shot of the plugin in action:

I find this tool, together with Wireshark, very handy when I’m analyzing and reverse engineering unknown protocols. Allow me to show you how I use it. In our work here at Websense Security Labs, we frequently use IDA Pro. When IDA Pro runs, it sends packets over the LAN. We can use OllySocketTrace to see what IDA Pro sends over the network and why.

Here is a screen capture of the socket events that IDA Pro generates.

We can see that IDA Pro uses the UDP protocol to send packets. We can also see in the very clear presentation, how many packets are sent and to where.
But this wonderful plugin doesn’t stop there, it also includes a Hint section to help us to understand even more about what is going on.

For example, we can see that IDA Pro broadcast a UDP packet over the LAN on port 23945, and that it is waiting for an answer.

The reason that it’s waiting is that it is checking to see if another IDA Pro session is running and if it has a valid licence.

Game over!

Security Researcher: Moti Joseph

Posted in Other Tutorials, Reverse Engineering with OllySocketTrace | Leave a Comment »

PEiD v0.95

Posted by kienmanowar on October 29, 2008

PEiD detects most common packers, cryptors and compilers for PE files. It can currently detect more than 600 different signatures in PE files.

PEiD is special in some aspects when compared to other identifiers already out there!

1. It has a superb GUI and the interface is really intuitive and simple.
2. Detection rates are amongst the best given by any other identifier.
3. Special scanning modes for *advanced* detections of modified and unknown files.
4. Shell integration, Command line support, Always on top and Drag’n'Drop capabilities.
5. Multiple file and directory scanning with recursion.
6. Task viewer and controller.
7. Plugin Interface with plugins like Generic OEP Finder and Krypto ANALyzer.
8. Extra scanning techniques used for even better detections.
9. Heuristic Scanning options.
10. New PE details, Imports, Exports and TLS viewers
11. New built in quick disassembler.
12. New built in hex viewer.
13. External signature interface which can be updated by the user.

Download : http://www.peid.info/files/PEiD-0.95-20081021.zip

Posted in PEiD v0.95 Build date: Oct 21, 2008, RE Tools | 1 Comment »

Trial-Reset 3.4 Final

Posted by kienmanowar on October 29, 2008

Trial-Reset is an registry cleaning tool. The main function of Trial-Reset is remove the keys generated by commercial and freeware protector.Trial-Reset doesn’t crack the program but only extends the Trial period.

History

What’s new v3.4 Final (Public):

-Updated support for WinLicense (Ring-0 Protection)

What’s new v3.3 (Public):

-Added support for License Protector 2.x

-Updated support for Enigma Protector 1.4x

-Updated support for ActiveMark 6.x

-Minor bugs fixes

What’s new v3.2 (Public):

-Updated support for PCGuard 5.02

-Add Autocleaning at Startup

-Fixed ExeCryptor 2.x bug

-Minor bugs fixes

What’s new v3.01 Final (Public):

-Fixed graphical problem

What’s new v3.0 Final (Public):

-Update Backup command

-Updated support for Obsidium 1.3x

-Minor bugs fixes

What’s new v3.0 RC9 (Public):

-Added support for ProActivate 1.x

-Update ASProtect 2.x

-Added Plugin Icon

What’s new v3.0 RC8 (Public):

-Added support for NTkrnl Protector 0.x

-Fixed junction loop

-Fix Vista x64 bugs

Download here:

http://rapidshare.com/files/156909058/Trial-Reset-34Final.rar.html

Posted in RE Tools, Trial-Reset 3.4 Final | 2 Comments »

OllyDbg tutorial_13

Posted by kienmanowar on November 2, 2008

Một cái đầu lạnh để vững vàng, một trái tim đỏ lửa để yêu và làm việc hết mình!

I. Giới thiệu chung

Chào các bạn, hôm nay chúng ta lại gặp nhau ở phần 13 của loạt bài viết về Olly :) . Vẫn còn rất nhiều phần khác nữa tới đây, chỉ sợ sức lực tôi có hạn không thể viết hết được thôi.. khà khà. Trong toàn bộ 12 bài viết trước, tôi đã lần lượt giới thiệu cho các bạn về Ollydbg, các kiến thức cơ bản về ASM, các câu lệnh thường được sử dụng, cách patch chương trình cũng như các kiểu BP từ cơ bản đến nâng cao trong Olly và còn nhiều thông tin khác nữa…. Tôi hi vọng rằng qua 12 bài viểt đó các bạn đã tự trang bị cho mình những kĩ năng cơ bản nhất để làm việc với Olly, cũng như tích lũy được những kinh nghiệm để có thể làm việc tiếp với những bài viết chuyên sâu tiếp theo của loạt tutor này. Vậy ở phần 13 này chúng ta sẽ làm gì nhỉ? Thực ra là phần 13 này không có trong kịch bản của lão Rincardo đâu, mà là tự tôi viết. Vì trong phần 12 của lão, cuối bài lão có nói lão sẽ xử lý Crackme Cruehead để tóm được Serial nhưng rồi lão lại không viết ở phần 13, thay vào đó lão đi xử lý các crackme khác. Cho nên tôi quyết định tự tay xử lý Crackme này để phục vụ các bạn :) . Rất nhiều điều thú vị đang nằm ở phía trước…. N0w….L3t’s F1nish H1M !!!!!!!

II. Let’s Finish Him :)

Nói là xử lý nhưng chúng ta phải làm thế nào nhỉ? Người có kiến thức và kinh nghiệm thì bảo : “Hãy kiểm tra chương trình trước xem có bị pack bởi packer nào không? Nếu bị pack thì giải quyết packer trước rồi tính tiếp. Còn nếu không bị pack thì quá khỏe, chạy thử chương trình xem nó hoạt động ra sao và tìm kiếm thông tin. Sau khi có được những thông tin quan trọng thì load chương trình vào Olly, tìm các cách để tiếp cận, đặt BP ở những điểm mấu chốt, sau đó trace code, comment những chỗ quan trọng, nếu fish được serial thì tốt, còn không thì tìm ra thuật toán và code keygen v..v..Bạn hãy tự mình thực hành đi đã, nếu bị bí chỗ nào hãy post lên để hỏi!”

Những người biết thì thưa thớt nhưng lại thích khoe khoang cũng phán đại :”Thì load vào Olly, tìm cái chuỗi liên quan đến Nag ấy, rồi đặt BP chứ còn làm gì nữa! Không làm được thì show code lên đây tôi giúp cho v..v..”

Riêng cá nhân của tôi thì thấy rằng: “Phải tự mình đúc kết các kinh nghiệm trước khi lâm trận cái đã, khi bạn chưa biết gì mà đã vội nhảy vào trận chiến thì chẳng khác nào lấy trứng chọi đá. Vậy kinh nghiệm ở đâu ra? Kinh nghiệm có được khi bạn đọc những bài viết của người khác, có được khi bạn thực hành với những trường hợp tương tự nhưng bạn thử nghiệm những hướng tiếp cận khác ,kinh nghiệm có được khi bạn tham gia thảo luận một chủ đề kĩ thuật v..v.. Để rồi từ đó bạn rút tỉa dần dần và tích lũy lại thành kinh nghiệm của riêng mình.Rồi sẽ đến một lúc nào đó, lại có người muốn ta chia sẻ kinh nghiệm của mình. Không ai có đủ thời gian và kiên nhẫn để chỉ dạy từng bước cho bạn, bạn phải tự mình tìm tòi và khám phá, khi nào bạn cảm thấy thực sự cần đến sự giúp đỡ tôi nghĩ lúc đó sẽ có người sẵn sàng giúp bạn :)

Quay trở lại phần chính của bài viết này là giải quyết crackme CrueHead để tỉm ra môt valid serial. Một hướng tiếp cận cơ bạn sẽ như tôi trình bày bên dưới đây, đương nhiên không nằm ngoài khả năng có những cách tiếp cận khác, điều đó nằm ở sự khám phá của các bạn :) .

1. Kiểm tra xem chương trình có bị pack hay không?

Pack file nghĩa là như thế nào? Tại sao phải kiểm tra xem có bị pack? Hiểu một cách đơn giản thì pack file là nén file thực thi (PE file : .dll, .exe, .ocx, v..v..) để làm giảm kích thước của file, việc nèn này ngoài việc nén code, data của chương trình thì trình packer còn thêm cả đoạn decompress stub vào PE file để làm nhiệm vụ unpack chương trình trong memory. Việc nén này không nên hiểu như ta dùng Winrar/Winzip để nén file, vì Winrar/Winzip sau khi nén file xong ta không thể thực thi file đó được mà ta phải làm một bước là extract file, sau đó mới run file.

Khi một file không bị pack thì lúc ta load chương trình vào Olly ta sẽ dừng lại tại EP của chương trình (hay còn gọi là OEP gốc). Còn nếu chương trình đã bị pack, khi ta load vào Olly ta sẽ dừng lại tại EP của packer chứ không phải là EP của chương trình. Do đó nhiệm vụ của chúng ta là phải unpack chương trình trước đã (tức là ta đi tìm lại OEP gốc), rồi mới thực hiện các hướng tiếp cận khác. Đó chính là lý do tại sao ta phải kiểm tra chương trình. Vậy ta kiểm tra như thế nào? Tôi thường sử dụng một số chương trình sau để check :

…………….

Download toàn bộ bài viết tại đây :

ollydbg_tut13

Regards

kienmanowar

Posted in OllyDbg Tutorials, OllyDbg tut_13 | Leave a Comment »

Những ngày ngập lụt!!!

Posted by kienmanowar on November 2, 2008

Cả khu nhà chìm trong biển nước, rác rười và đủ các thứ linh tinh trôi nổi lềnh phềnh :) .Nhìn mà thấy hãi cảnh “Hà Lội”, không dám đi đâu, hoàn toàn cô lập. Điện nước thì bị cắt lên cắt xuống :| . Mượn tạm máy của vợ chụp demo mấy kiểu ảnh post lên cho mọi người ngắm chơi :D

Posted in OllyDbg Tutorials | Leave a Comment »

RDG Packer Detector v0.6.6 2k8

Posted by kienmanowar on November 12, 2008

New skin!

-Detection improved for Fast and Powerful Mode!
-Signatures Database Up-to-date!
-Heuristic Detection of Binders
-Overlay Detection and Extraction!
-Automatic Check and Update!
-MD5 Hash Detection Very Fast!
-Multiple Support for Plug-ins, for RDG Packer Detector and for other detectors!
-Multiple Detection of formatted MPG,GIF,RAR,ZIP,MP3 etc.
-Detection and extraction of associated files!.

Download here:

http://www.egrupos.net/grupo/rdgsoft/ficheros/3/verFichero/29/RDG%20Packer%20Detector%20v0.6.6%202k8.rar

Posted in RE Tools | 1 Comment »

OllyDRX – Almost Perfect Edition, OllyDRX Public Release

Posted by kienmanowar on November 13, 2008

This Olly is moded by DeRox!

OllyDbg 1.10:
———————————————————————-
+ New look
+ Modified code for almost perfect hiding
+ Win32 API help reference
+ Modified code for expanded windows
+ Modified code for %s overflow RCE exploit
+ Modified code to make symbols load properly
+ OllyDRX Plugin Patcher
+ Plugin Development Kit & Script Editor v2.0

Tools:
———————————————————————-
DUP2.18.3 + DRX Skins
LordPE Deluxe b
PEiD 0.95
Resource Hacker 3.4.0.79
.NET Reflector 5.1.4.0
DeDe 3.50.02 Build 1619
ASCII-Tabelle (PDF)
Universal Extractor 1.6
VB Decompiler Lite 5.0
Import Reconstructor 1.7c
Wark 1.3
PE Tools 1.5.400
VeoVeo 3.4
TeLock 0.98
MASM v10
WinASM v5.1.5.0
CrypTool 1.4.21
Hiew 7.26 *removed*
W32Dsm 8.93 + BratPatch 3 final *removed*

Plugins:
———————————————————————-
+BP-OLLY Ver 2.0 beta 4
Olly Advanced 1.25 Master Edition
AnalyzeThis! v0.1
Bookmark v1.06
CommandBar 3.20.110
ODbgScript v1.64.3
OllyDump v3.00.110
Olly TBar Manager (Gold)
Olly More Menu 1.3b
DataRipper 1.3
CleanupEx 1.12.108

Scripts:
———————————————————————-
629 Scripts

Unpackers:
———————————————————————-
Stripper 2.11 RC2
DilloDIE 1.6
Unpacker Execryptor 1.0 RC1
UnThemida 2.0
Themida/WinLicense Unpacker 2.0

Greetz goes out 2:
———————————————————————-
Complete SnD Team (4 been right here tongue.gif )
Special: Fungus (4 Olly Redux tut), Lena151 (4 her great tuts 4 newbs), Oleh Yuschuk (4 OllyDbg), Teddy Rogers (4 his board), Diablo2002 (4 DuP), Ecliptic (4 his nice art wink.gif ), ARTeam (4 great tuts) and all they have been coded scripts plugins & tools. And all other i forgot. rolleyes.gif
Very special thx: my family & friends.

Download here:

http://rapidshare.com/files/163191823/OllyDRX-final.rar

Pass to unrar: derox

Posted in RE Tools | 8 Comments »

DataRipper 1.3 Ollydbg Plugin

Posted by kienmanowar on November 14, 2008

Ollydbg plugin – Data Ripper 1.3

9th November 2008 – 1.3 release

1) Fixed Delphi format bug
2) Added Visual Basic and Ascii formats

26th February 2006 – 1.21 release

1) fixed window handle bug

28th January 2006 – 1.2 release

1) Improved handling of Ollydbg close when Data Ripper is open.
2) Compatiblity with Ollydbg Shadow
3) Data Ripper dialog stays on top (option)

17th January 2006 – 1.1 release

1) “Data Ripper” menu added to dissassembler window. Code bytes can now be ripped as data.
2) Added option to override the warning to save file.
3) Added option to rip data immediately Data Ripper is launched using previous settings.
4) Added “Apply” function to Settings dialog.
5) Handled issue with multiple plugin instances.

10th January 2006 – first release

Data Ripper is an easy way to rip any kind of data from an app being debugged using Ollydbg. The ripped data can be formatted and “declared” in the syntax of the popular programming languages MASM, C/C++ and Delphi.

Data Ripper is useful whenever you need to rip data, tables etc out of an app so the data can be used in another compiled program.

NOTES

1) To install copy DataRipper.dll to the Ollydbg plugin directory

2) Data Ripper maintains settings between debugging sessions in the Ollydbg.ini file. Temporary data is stored in a file DataRipper.tmp.

3) Data Ripper can rip data up to the Windows size limit.

HELP

Basic Use

1) Highlight the data to be ripped in any memory window of Ollydbg.

2) Right click and select “Data Ripper” in the Ollydbg popup window

3) The Data Ripper dialog will popup with an empty file “untitled”

4) Select the “Settings” dialog and check the “Language” “Format” and other settings are ok. You can specify

Language  : ASM, C/C++, Delphi, Comma Separated Values CSV or Data String.
“Declare” : indicates whether the programming language declaration information header
and trailer are required
Format    : select bytes, words or dwords. Note if the number of data bytes selected in Ollydbg
does not correspond exactly with the word or dword format setting, trailing bytes
are set to zero.
Hex       : if set output is in hexadecimal otherwise decimal
Items/Line: how many bytes, words, dwords per line (Max 255)
Indent    : spaces indented on each line (max 255)

5) Press “Rip Data” and the app data will be ripped and formatted into a Data Ripper file.

6) Data Ripper provides basic “richedit” editing functions. After any editing, merging with other files etc is done, save the ripped data file.

7) If you want to change the langugage, format, items/line etc, open up the “Settings” dialog, “Save” the new settings and press “Rip Data” again. Data Ripper will ask you if you want the save the file that is already there before the reformatted data is displayed.

8) Close Data Ripper.

Report any problems to http://www.sndforum.da.ru

Ziggy
January 2006

Link download:

http://www.tuts4you.com/download.php?view.42

Posted in RE Tools | Leave a Comment »

Trojan.Zhelatin.Pk Reverse Engineering

Posted by kienmanowar on November 14, 2008

Trojan.Zhelatin.Pk Reverse Engineering

From Evilcry:
I’ve released a paper on Trojan.Zhelatin.pk RCE Analysis, that can be downloaded

http://evilcry.netsons.org/tuts/Mw/Zhelatin.pdf

Best Regards

Posted in Other Tutorials | Leave a Comment »

.NET Framework Rootkits

Posted by kienmanowar on November 14, 2008

This page covers a new method that enables an attacker to change the .NET language, and to hide malicious code inside its core.

Abstract

This paper introduces a new method that enables an attacker to change the .NET
language.

The paper covers various ways to develop rootkits for the .NET framework, so that
every EXE/DLL that runs on a modified Framework will behave differently than what
it’s supposed to do. Code reviews will not detect backdoors installed inside the
Framework since the payload is not in the code itself, but rather it is inside the
Framework implementation. Writing Framework rootkits will enable the attacker to
install a reverse shell inside the framework, to steal valuable information, to fixate
encryption keys, disable security checks and to perform other nasty things as
described in this paper.

This paper also introduces “.Net-Sploit” – a new tool for building MSIL rootkits that
will enable the user to inject preloaded/custom payload to the Framework core DLL.

………

Download full paper here:

http://www.applicationsecurity.co.il/LinkClick.aspx?fileticket=ycIS1bewMBI%3d&tabid=161&mid=555

Regards

Posted in Other Tutorials | Leave a Comment »

FastScanner v2.0 by AT4RE

Posted by kienmanowar on November 17, 2008

FastScanner v2.0 by AT4RE

Description:
FastScanner is a Detector for most packers , cryptors and compilers for PE Files Programmed in ASM and designed for ‎fast access to most needed plugins.

FastScanner v2.0 Change log:
11/15/2008

1- Arabic interface now available.
2- New Skin for both the scanner and the PE-Editor.
3- Bug Fixed in the scanning algorithm. Now, it’s more powerful.
4- Updated signature file to detect most compilers, packers and protectors.
5- Add a TotalScan button in the scanner.
6- Add a Disasm button in the scanner.
7- Add a sections viewer button in the scanner’s main window.
8- Display the signature file date in the scanner’s main window.
9- Add a new plugin to detect and save overlay.
10- Add a new plugin => Signs-Imitator.
11- Bug fixed in the Add-Sig plugin.
12- Big update in the PE-Editor plugin:
a- section viewer and editor ( add section – delete section – edit section header).
b- new buttons to view exports and imports table.
c- new tab to view and edit the PE’s directory table.
d- new tab to view and dump any process from memory.
e- make a backup copy of the modified files.

Download here:

http://zeak47.freehostia.com/at4re_fs_2_eng.html

Posted in RE Tools | Leave a Comment »

Reversing MFC Applications

Posted by kienmanowar on November 18, 2008

MFC Programs seems to be the mainstream of Win32 GUI programming these days, other than QT applications that are rapidly gaining popularity recently. A few days ago, I suddenly got interested in embedded system reversing but was confronted by the task to reverse an application that uploads the firmware image to the embedded system. As expected, the application was MFC, and I was a bit taken back. I wasn’t that confident in MFC reversing.

I’ve seen many people (including me) reverse MFC applications in the same way as reversing pure Win32 API applications. Put breakpoints on certain APIs, search for a target string, search for a certain constant, etc etc… There is no problem with that. The same principles used in non-MFC app reversing can also be applied to MFC apps except…

Except you can’t find the Window Procedure within the application. Window Procedures are like the root function of where all the messages are processed, and when you know where it’s located, you can always track down your target in a root to descendant kind of approach. It may take more time than the ‘start from a certain function, string etc’ approach, but when the later approach may sometimes make you get lost in a labyrinth of code and functions, the formal usually never goes wrong.

The problem is, all the WndProc code is managed by the MFC framework, and the framework gives a slight twist to it to make it work in a different process than what we already know about Window Procedures. The principles are the same, but the structure is a little bit different, and the Message dispatcher code is no longer handled by the programmer. The question is, where is that code and what does it look like? And how could we use it to our advantage?

That will be the main focus of this tutorial, and I will start with showing the usual approach, and point out the problems that may occur in certain situations.

Download here:

http://www.tuts4you.com/download.php?view.2509

Posted in Other Tutorials | Leave a Comment »

Anti-Reverse Engineering Guide

Posted by kienmanowar on November 22, 2008

Introduction Into Windows Anti-Debugging – Josh Jackson

Anti-Reverse Engineering Guide

Author : Josh Jackson + Nicolas Falliere

Introduction

In recent times, tools for use in reverse engineering have flourished. There are plenty of resource sites for those who are interested in the field, and the field is very much worth the time invested in it. I found that learning C++ while introducing myself to reverse engineering and assembly language really helped me to understand how code works, and improved my C/C++ coding and my ASM coding at the same time. However, reverse engineering also has a darker side. Crackers are individuals who use their knowledge of reverse engineering to reverse another programmer’s code, often to decode how a serial is processed or to remove a protection from a trial. Naturally, a pioneer will want to protect their investment; this can be done with tools such as Themida, Execryptor, Armadillo, and even a protection system coded by a CodeProject resident Jim Charles named Eagle Protector. This article is meant to inform individuals of some anti-debugging techniques, and is not meant to be all-inclusive, nor does it explore some of the more complex routines that commercial protectors use.

Background

An individual reading this should have a solid understanding of ASM, how computers handle memory, the Win32 Debugging API, and at least some knowledge of Windows internals. This code most likely will not work on any *nix platform due to the fundamental differences of the Operating Systems. Any other knowledge in the field of reverse engineering is also a plus. One great thing about learning and implementing anti-debugging is that you also develop your reversing skills, which is a great plus to anyone interested in the field. Along with the other mentioned subjects, an interested reader should also be familiar with the tools used for binary application reversing such as OllyDBG, WinDBG, SoftICE, IDA Pro, and others. Here are some links to some information that is important for readers to be familiar with before reading the following text:

Download tutorial:

http://www.tuts4you.com/download.php?view.2516

Best Regards

Posted in Anti-Reverse Engineering Guide, Other Tutorials | Leave a Comment »

OllyEye plug-in

Posted by kienmanowar on November 26, 2008

OllyEye plug-in

Today, I would like to present a new plug-in that I wrote called OllyEye. I wrote the plug-in to speed up the process of hunting vulnerability in applications. Here is a screenshot of the OllyEye plug-in:

How does OllyEye work?

Sometimes we want to find out where in a module the code parsing is done. In the example below, we want to find the code that parses the QuickTime video codecs that are in Windows media player.  We know that the codecs support the raw, rle, jpeg, mjpb, and rpza tags, so all we need to do is to search for those tags in our module–in this case, the ”quartz.dll” module.

The OllyEye hunter knows that it should check for the video codec’s tags such as code.equals (“rpza”) and that in assembly it should be done with the CMP command that represents it. For this reason, it searches for the CMP command that matches the ‘rpza’ keyword.  Here we can see the results of the OllyEye when the hunter searches for such patterns:

At the address 0×748FD28B, we see CMP EAX,617A7072. The ASCII translation of 617A7072h is ‘azpr’, which is one of the QuickTime video codec’s supported tags. Now all the hunter has to do is set a breakpoint there, load the movie file, and wait for the breakpoint to be triggered.

A QuickView in IDA shows us that our address, 0×748FD28B, is inside the QTDec::CheckInputType when the QTDec is QT=QuickTime and Dec= Decoder. Based on this information, we know that we reviewed part of QuickView codec’s decoder.

Attached here is the source code of the OleEye plugin. You are welcome to extend it and to shoot us the update.

Game 0ver.

Security Researcher: Moti Joseph

Posted in OllyEye plug-in, Other Tutorials | Leave a Comment »

Free issues : Linux+ and Hakin9

Posted by kienmanowar on November 27, 2008

* Ubuntu Installation&Configuration…
* OpenNMS on Ubuntu Linux…
* Shell Scripting…
* Virtual X Sessions…
* File System Optimization for High Load and Stability…
* An Introduction to Digital Forensics…
* Ipv6 Approach for DoS Attacks over IP Telephony…
* Secure your System with Afick Intrusion Detection Scanner…
* Scaling Linux Servers…
* MapFS: The Data Center Storage Optimizer…
* Sidebar: Gearing Up…
* Favorite Media Programs in Ubuntu…
* Tricks&Tips…
* The “killer feature” of Freedomware…
* Should Critical Infrastructure be Built on Linux?…

Download here :Linux+

———————-

hakin9 4/2008 (17) – File Inclusion Attacks:

BASICS
File Inclusion Attacks
ALI RECAI YEKTA, ERHAN YEKTA
After reading this article, you will come to know about File Inclusion Attacks’ methods and defense techniques against them.

ATTACK
Hacking RSS Feeds: Implementing RSS Feeds
ADITYA K. SOOD
This paper discusses the infection vectors that occur due to insecure coding by developers and includes other related security issues. It provides a detailed analysis of the errors and efficient measures to correct those errors, while keeping in mind the original security concerns.

Alternate Data Streams or “Doctor Jekyll and Mr. Hyde” Move to NTFS (Part II)
LAIC AURELIAN
The second part of the ADS series. This article reveals everything you should know about ADS, focusing on its practical use. You will learn how to create, use and delete ADS.

All in Memory Execution under Linux
ANTHONY DESNOS, FREDERIC GUIHERY, MICKAEL SALAUN
A vaery useful paper on all in memory execution under Linux. The authors show its rules, all in memory’s tools and protection methods against the execution.

The Real Dangers of Wireless Networks
STEPHEN ARGENT
The paper explains how to break into Wireless Networks and use Ettercap, Driftnet and Wireshark for sniffing. While reading this article, you will learn how to manipulate packets and view MSN conversations over the network.

DEFENSE
How to Deploy Robustness Testing
MIKKO VARPIOLA, ARI TAKANEN
In this article authors explore various means of testing for the security mistakes, with the focus on deploying robustness testing into the software development lifecycle.

Protecting Data in a Postgres Database
ROBERT BERNIER
Part III of the three-part series on Postgres. This article addresses the issue of restricting access to data via the use of data encryption. After reading this paper, you will manage to use cryptographic functions obtained from two contributions modules.

Download here : Hakin9_File Inclusion Attacks

Best Regards
kienmanowar

Posted in Other Tutorials | Leave a Comment »

MagicHideOllyDbg 1.01

Posted by kienmanowar on December 2, 2008

MagicHideOllyDbg 1.01

Author : EasyStudy

————-

Here’s a quick list of MagicHideOllyDbg’s function:

- erases debug-heap padding
- erases BeingDebugged flag in the PEB
- erases NtGlobalFag in the PEB
- adjusts heap flags to default values
- disables kernel32!OutputDebugStringA() function
- forces kernel32!CheckRemoteDebuggerPresent() to always return an error
- forces kernel32!UnhandledExceptionFilter() to ignore debugger presence
- forces kernel32!Process32NextW() to return immediately
- forces ntdll!NtSetInformationThread() to ignore HideThreadFromDebugger class
- forces ntdll!NtQueryInformationProcess() function to ignore ProcessDebugPort class
- intercepts ntdll!NtQuerySystemInformation() function but does nothing with it
- randomises “CPU – ” text in OllyDbg

Download here: http://www.tuts4you.com/request.php?2521

Regards

Posted in RE Tools | Leave a Comment »

TiGa’s Video Tutorial Site – Reverse Engineering Using IDA Pro

Posted by kienmanowar on December 2, 2008

TiGa’s Video Tutorial Site – Reverse Engineering Using IDA Pro

Tiga’s new website hosting his/her reverse engineering video using IDA Pro

http://www.woodmann.com/TiGa/idaseries.html

Visual Debugging with IDA – The Interactive Disassembler
http://www.woodmann.com/TiGa/packages/TiGa-vid1.zip

Remote Debugging with IDA Pro
http://www.woodmann.com/TiGa/packages/TiGa-vid2.zip

Debugging a faulty application with IDA Pro
http://www.woodmann.com/TiGa/packages/TiGa-vid3.zip

How to Solve Crackmes for Dummies in Video
http://www.woodmann.com/TiGa/packages/TiGa-vid4.zip

x64 Disassembling Primer and fixing obfuscated APIs
http://www.woodmann.com/TiGa/packages/TiGa-vid5.zip

TLS-CallBacks and preventing debugger detection with IDA Pro
http://www.woodmann.com/TiGa/packages/TiGa-vid6.zip

Unwrapping a Flash Video Executable (exe2swf)
http://www.woodmann.com/TiGa/packages/TiGa-vid7.zip

Stop fishing and start keygenning!
http://www.woodmann.com/TiGa/packages/TiGa-vid8.zip

Alien Autopsy rev. 2008
http://www.woodmann.com/TiGa/packages/TiGa-vid9.zip

Unpacking deroko’s x64 UnpackMe
http://www.woodmann.com/TiGa/packages/TiGa-vid10.zip

Solving pnluck’s x64 CrackMe
http://www.woodmann.com/TiGa/packages/TiGa-vid11.zip

Regards

Posted in Other Tutorials | Leave a Comment »

Windows Sysinternals Suite Build 2008.12.11

Posted by kienmanowar on December 12, 2008

Windows Sysinternals Suite Build 2008.12.11

The Sysinternals Troubleshooting Utilities have been rolled up into a single Suite of tools. This file contains the individual troubleshooting tools and help files. It does not contain non-troubleshooting tools like the BSOD Screen Saver or NotMyFault. Microsoft acquired Sysinternals in July, 2006. Whether you’re an IT Pro or a developer, you’ll find Sysinternals utilities to help you manage, troubleshoot and diagnose your Windows systems and applications. If you have a question about a tool or how to use them, please visit the Sysinternals Forum for answers and help from other users and our moderators.

The Suite is a bundling of the following selected Sysinternals Utilities:
* AccessChk: This tool shows you the accesses the user or group you specify has to files, Registry keys or Windows services.
* AccessEnum: This simple yet powerful security tool shows you who has what access to directories, files and Registry keys on your systems. Use it to find holes in your permissions.
* AdExplorer: Active Directory Explorer is an advanced Active Directory (AD) viewer and editor.
* AdInsight: An LDAP (Light-weight Directory Access Protocol) real-time monitoring tool aimed at troubleshooting Active Directory client applications.
* AdRestore: Undelete Server 2003 Active Directory objects.
* Autologon: Bypass password screen during logon.
* Autoruns: See what programs are configured to startup automatically when your system boots and you login. Autoruns also shows you the full list of Registry and file locations where applications can configure auto-start settings.
* BgInfo: This fully-configurable program automatically generates desktop backgrounds that include important information about the system including IP addresses, computer name, network adapters, and more.
* BlueScreen: This screen saver not only accurately simulates Blue Screens, but simulated reboots as well (complete with CHKDSK), and works on Windows NT 4, Windows 2000, Windows XP, Server 2003 and Windows 9x.
* CacheSet: CacheSet is a program that allows you to control the Cache Manager’s working set size using functions provided by NT. It’s compatible with all versions of NT.
* ClockRes: View the resolution of the system clock, which is also the maximum timer resolution
* Contig: Wish you could quickly defragment your frequently used files? Use Contig to optimize individual files, or to create new files that are contiguous.
* Ctrl2cap: This is a kernel-mode driver that demonstrates keyboard input filtering just above the keyboard class driver in order to turn caps-locks into control keys. Filtering at this level allows conversion and hiding of keys before NT even “sees” them. Ctrl2cap also shows how to use NtDisplayString() to print messages to the initialization blue-screen.
* DebugView: Another first from Sysinternals: This program intercepts calls made to DbgPrint by device drivers and OutputDebugString made by Win32 programs. It allows for viewing and recording of debug session output on your local machine or across the Internet without an active debugger.
* DiskExt: Display volume disk-mappings
* DiskView: Graphical disk sector utility
* Diskmon: This utility captures all hard disk activity or acts like a software disk activity light in your system tray.
* Du: View disk usage by directory
* EFSDump: View information for encrypted files
* Filemon: This monitoring tool lets you see all file system activity in real-time.
* Handle: This handy command-line utility will show you what files are open by which processes, and much more.
* Hex2dec: Convert hex numbers to decimal and vice versa.
* Junction: Create Win2K NTFS symbolic links
* LDMDump: Dump the contents of the Logical Disk Manager’s on-disk database, which describes the partitioning of Windows 2000 Dynamic disks.
* ListDLLs: List all the DLLs that are currently loaded, including where they are loaded and their version numbers. Version 2.0 prints the full path names of loaded modules.
* LiveKd: Use Microsoft kernel debuggers to examine a live system.
* LoadOrder: See the order in which devices are loaded on your WinNT/2K system
* MoveFile: Allows you to schedule move and delete commands for the next reboot.
* LogonSessions: List the active logon sessions on a system.
* NewSID: Learn about the computer SID problem everybody has been talking about and get a free computer SID changer, NewSID.
* NTFSInfo: Use NTFSInfo to see detailed information about NTFS volumes, including the size and location of the Master File Table (MFT) and MFT-zone, as well as the sizes of the NTFS meta-data files.
* PageDefrag: Defragment your paging files and Registry hives!
* PendMoves: Enumerate the list of file rename and delete commands that will be executed the next boot
* Portmon: Monitor serial and parallel port activity with this advanced monitoring tool. It knows about all standard serial and parallel IOCTLs and even shows you a portion of the data being sent and received. Version 3.x has powerful new UI enhancements and advanced filtering capabilities.
* Process Explorer: Find out what files, registry keys and other objects processes have open, which DLLs they have loaded, and more. This uniquely powerful utility will even show you who owns each process.
* Process Monitor: Monitor file system, Registry, process, thread and DLL activity in real-time.
* ProcFeatures: This applet reports processor and Windows support for Physical Address Extensions and No Execute buffer overflow protection.
* PsExec: Execute processes with limited-user rights.
* PsFile: See what files are opened remotely.
* PsGetSid: Displays the SID of a computer or a user.
* PsInfo: Obtain information about a system.
* PsKill: Terminate local or remote processes.
* PsList: Show information about processes and threads.
* PsLoggedOn: Show users logged on to a system
* PsLogList: Dump event log records.
* PsPasswd: Changes account passwords.
* PsService: View and control services.
* PsShutdown: Shuts down and optionally reboots a computer.
* PsSuspend: Suspend and resume processes.
* PsTools: The PsTools suite includes command-line utilities for listing the processes running on local or remote computers, running processes remotely, rebooting computers, dumping event logs, and more.
* RegDelNull: Scan for and delete Registry keys that contain embedded null-characters that are otherwise undeleteable by standard Registry-editing tools.
* RegHide: Creates a key called “HKEY_LOCAL_MACHINESoftwareSysinternalsCan’t touch me!0″ using the Native API, and inside this key it creates a value.
* Regjump: Jump to the registry path you specify in Regedit.
* Regmon: This monitoring tool lets you see all Registry activity in real-time.
* RootkitRevealer: Scan your system for rootkit-based malware
* SDelete: Securely overwrite your sensitive files and cleanse your free space of previously deleted files using this DoD-compliant secure delete program.
* ShareEnum: Scan file shares on your network and view their security settings to close security holes.
* Sigcheck: Dump file version information and verify that images on your system are digitally signed.
* Streams: Reveal NTFS alternate streams
* Strings: Search for ANSI and UNICODE strings in binaryimages.
* Sync: Flush cached data to disk
* TCPView: Active socket command-line viewer.
* VolumeId: Set Volume ID of FAT or NTFS drives
* Whois: See who owns an Internet address.
* Winobj: The ultimate Object Manager namespace viewer is here.
* ZoomIt: Presentation utility for zooming and drawing on the screen.

Sysinternals Suite 2008-12-11
Process Monitor v2.03: This update to Process Monitor, a real-time file, registry, process and network monitor, adds the ability to import and export configuration settings, shows an icon in the operations column depicting the event class of the operation, and fixes a symbol configuration bug on Windows XP.
Autoruns v9.36: Autoruns changes the Hide Microsoft Entries to only hide Windows entries, fixes a bug in the Find behavior, allows enabling and disabling entries using the space bar, and fixes a number of minor bugs.
Disk Usage v1.33: Du adds a new option, -u, that has it exclude duplicate hard-linked files from its summary.
Process Explorer v11.31: This update works around a bug in the latest Debugging Tools for Windows debug engine DLL and fixes a bug that could cause objects to show up as when Process Explorer was run without administrative rights.

Download here  :
http://download.sysinternals.com/Files/SysinternalsSuite.zip

Posted in OllyDbg Tutorials | Leave a Comment »

Installing Oracle 9i on RHEL5.

Posted by kienmanowar on December 16, 2008

I have to install Oracle 9i on RHEL5, i follow all steps to set up OS, environment variables, install all require rpm files. When run the /runinstaller , select appropriate choices. After few clicks  Oracle will be installed. However i  face a problem during dbca configuration, like this :
err

Try to fix but i can’t find the solution, i guess may be wrong with JRE, after few minutes for google :) … i found the solution to run DbCA. Here is all the steps from nirajkvinit’s blog to install oracle9i :

Assuming

· You know how to operate a Linux Box. (Navigating directories/ knowhow of basic commands)

· You know how to install software modules/libraries (Mostly rpms for RHEL5).

· You have a system installed with RHEL5 or you know how to install it.

Important tips during installation of RHEL5

· Do not install Virtualization support during RHEL5 installation. I don’t know why but my Oracle 9i Installation behaved erratically whenever this Virtualization module was present in my system. It installs a different Kernel (Xen). So skip it.

· During RHEL5 Installation disable SELinux. If you couldn’t do it in the first place then don’t worry, read ahead to know how to disable it.

1. Installing Oracle 9i on RHEL5 (Logged in as root)

· Disabling SELinux – Disable SELinux now (If you couldn’t disable it during installation).

#gedit /etc/selinux/config

And make sure to set the SELINUX Flag disabled.

SELINUX=disabled

Installing JRE – Newer version of JRE behaved badly in my Oracle installation, so Download the Java Runtime Enviroment (I used j2re-1_3_1_19-linux-i586.bin) from http://java.sun.com/products/archive/j2se/1.3.1_19/index.html . Fire the command prompt and navigate to the location where you have stored the downloaded file. Most probably it will be Root’s Desktop Directory. So go there.

#cd /root/Desktop

Give the file, execute permission and then execute it. When the JRE is exracted, move the extracted directory into the “/usr/local” directory.

# chmod +x j2re-1_3_1_19-linux-i586.bin
# ./ j2re-1_3_1_19-linux-i586.bin
# mv jre1.3.1_19 /usr/local/

· Installing missing libraries You don’t know whether you have the required packages installed or not. Right! Don’t sweat. Run following commands to check whether you have those packages or not. If they are installed, the command prompt will return you their version, else ‘Not installed’ message.

#rpm -q compat-db compat-gcc-34 compat-gcc-34-c++ compat-libgcc-296 compat-libstdc++-296

If everything is alright, then it will show the following:

[root@localhost ~]# rpm -q compat-db compat-gcc-34 compat-gcc-34-c++ compat-libgcc-296 compat-libstdc++-296

compat-db-4.2.52-5.1

compat-gcc-34-3.4.6-4

compat-gcc-34-c++-3.4.6-4

compat-libgcc-296-2.96-138

compat-libstdc++-296-2.96-138

[root@localhost ~]# rpm -q compat-libstdc++-33 gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libgcc make libXp

compat-libstdc++-33-3.2.3-61

gcc-4.1.1-52.el5

gcc-c++-4.1.1-52.el5

glibc-2.5-12

glibc-common-2.5-12

glibc-devel-2.5-12

glibc-headers-2.5-12

libgcc-4.1.1-52.el5

make-3.81-1.1

libXp-1.0.0-8

If you get the ‘Not installed’ message with any of the package; then load your installation media (RHEL5 Installation Disk), and run the following commands to install the necessary packages.

#cd /media/cdrom/Server

#rpm -Uvh make-3*

#rpm -Uvh glibc-2*

#rpm -Uvh compat-libstdc++-33-3*

#rpm -Uvh compat-gcc-34-3*

#rpm -Uvh compat-gcc-34-c++-3*

#rpm -Uvh gcc-4*

#rpm -Uvh libXp-1*

#rpm -Uvh compat-db-4*

· Installing patches – You need to download two patches and install it. These patches are:

http://oss.oracle.com/projects/compat-oracle/dist/files/RedHat/compat-libcwait-2.1-1.i386.rpm

http://oss.oracle.com/projects/compat-oracle/dist/files/RedHat/compat-oracle-rhel4-1.0-5.i386.rpm

Navigate to the location where you have stored the downloaded file. Most probably it will be Root’s Desktop Directory. So go there.

#cd /root/Desktop

#rpm -Uvh compat-libcwait-2.1-1.i386.rpm

#rpm -Uvh compat-oracle-rhel4-1.0-5.i386.rpm –nodeps

· Now the Workarounds – Some libraries aren’t available for RHEL5, so you can use the substitutes available in the RHEL5 itself. All you have to do is linking. So, here you go.

1. #cd /usr/lib
#ln -s libstdc++-3-libc6.2-2-2.10.0.so libstdc++-libc6.1-1.so.2

2. #cd /usr/bin
#ln -s gcc34 gcc32

3. #cd /usr/lib
#ln -s libgdbm.so.2.0.0 libdb.so.2

· User and Group Creation – Oracle installer wouldn’t run as the root user, so you need to create a user. It would be better, if you create a special group for Oracle. To do these, run the following commands in the command prompt.

#groupadd oinstall

#groupadd dba

#groupadd oper

#useradd -g oinstall -G dba oracle

#passwd oracle

· ORACLE_BASE Directory Creation -Login as root and create base directory for Oracle ($ORACLE_BASE).

# cd /opt
# mkdir oracle
# chown –R oracle.oinstall oracle

#cd oracle

#mkdir 920

· Setting Environment VariablesNow since you have created the oracle user, you need to setup its environment variables. For that, you need to update oracle’s .bash_profile file.

Open bash profile of Oracle:

#gedit /home/oracle/.bash_profile

Now add the following lines in the file –

PATH=$PATH:$HOME/bin; export PATH

ORACLE_BASE=/opt/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/920; export ORACLE_HOME

ORACLE_SID=orcl; export ORACLE_SID

LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH

ORACLE_OEM_JAVARUNTIME=/usr/local/jre1.3.1_19; export ORACLE_OEM_JAVARUNTIME

PATH=$PATH:$ORACLE_HOME/bin; export PATH

if [ $USER = "oracle" ]; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

fi

Save and close the file.

· Setting up the kernel parameters – You also need to do a little modification in the the kernel parameters. You need to open the sysctl.conf file -

#gedit /etc/sysctl.conf

And add the following lines -

kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144

Save and close the file. You need to run a command to update the parameters

#sysctl –p

· Logout of root and login again as oracle user.

2. Installing Oracle 9i on RHEL5 (Logged in as oracle):

· Download Oracle 9iDownload the Oracle 9i (9.2.0.4) software from Oracle website. Store the files in oracle’s home directory. Launch the command prompt and navigate there.

$cd /home/oracle

Unzip the files -

$ gunzip ship_9204_linux_disk1.cpio.gz
$gunzip ship_9204_linux_disk2.cpio.gz
$gunzip ship_9204_linux_disk3.cpio.gz

Unpack the cpio files –

$cpio -idmv “<” ship_9204_linux_disk1.cpio
$cpio -idmv “<” ship_9204_linux_disk2.cpio
$cpio -idmv “< “ship_9204_linux_disk3.cpio

· Setting Oraparam.ini fileWhen all archives files are extracted you’ll have three directories Disk1, Disk2 and Disk3. Locate the oraparam.ini and update it with new information. Oraparam.ini is in Disk1/install/linux/ directory.

$gedit /home/oracle/Disk1/install/linux/oraparm.ini

Modify JRE_LOCATION variable and set it to

JRE_LOCATION=/usr/local/jre1.3.1_19

Save the file and close.

· Starting Oracle Installer – Now you are all set for Oracle installation. In the command prompt go to the Disk1 directory and run runInstaller file.

$cd /home/oracle/Disk1

$./runinstaller

–> When you see DBCA Fail, do the following :

You need to change the installer’s JRE. Launch the command prompt, and do the following –

$cd $ORACLE_HOME
$rm JRE
$ln -s $ORACLE_BASE/jre/1.3.1 JRE
$cd JRE/bin
$ln -s java jre
$cd i386/native_threads/
$ln -s java jre

When you are done, select DBCA and every failed services and click retry button, one-be-one. Your installation will succeed.

Posted in Installing Oracle 9i on RHEL5., Linux | 2 Comments »

Armadillo v6.xx Finger-Print-Patcher V0.1

Posted by kienmanowar on December 18, 2008

标 题: Armadillo v6.XX Finger-Print-Patcher新鲜出炉
作 者: playboysen
时 间: 2008-12-10,17:18
链 接: http://bbs.pediy.com/showthread.php?t=78424

Hello everyone!
Today I provide a script about Armadillo v6.XX Finger-Print-Patch as a gift for coming Christmas Day.
You know I intended to publish it on Christmas Day.However,I’ve to be busy hunting for a job as a graduate.
Welcome to test it and please email me if you have any questions or ideas…

Notes:
1.Make sure you’ve hided your OD and ignored all exceptions!
2.Run our script.(You have to know your machine ID and a usable machine ID)
3.You’d better prepare a Trial-Reset.


////////////////////////////////////////////////////////////////////////////////
// ////////////
// FileName : Armadillo v6.xx Finger-Print-Patcher V0.1 ///////////
// Features : //////////
// This script can store the new HWID information /////////
// permanently on your system.Unpacking of HWID ////////
// targets is not more required. ///////
// //////
// Environment : WinXP,ODBYdyk V1.10,OllyScript V1.65 /////
// Support : Armadillo V6.00/V6.04/V6.22... ////
// Standard/Enhanced hardware locking ///
// Thanks to : Pediy,UpackCN,Chinapyg //
// Author : Playboysen /
// Date : 2008-12-10 /
///////////////////////////////////////////////////////////////////

var OldID
var NewID

bphwc

msg “Make sure you’ve hided your OD and ignored all exceptions!\r\nPress OK to continue~~”
gpa “OpenMutexA”,”kernel32.dll”
bp $RESULT
esto
exec
pushad
pushfd
push edx
xor eax,eax
push eax
push eax
call kernel32.CreateMutexA
……

More info here :
Armadillo v6.XX Finger-Print-Patcher新鲜出炉

Posted in