Home
Calendar
Certifications
Columns
Features
Forum
Resources
Vitals
Latest Additions
April 2013 Free Giveaway Sponsor - eLearnSecurity
Human Intelligence to Navigate the Security Data Deluge
February 2013 Free Giveaway Winner of SANS CyberCon Training
Interview: Bugcrowd Founders on Herding Ninjas for Crowdsourced Bug Bounties
Network Forensics: The Tree in the Forest
March 2013 Free Giveaway Sponsor - Mile2
Book Review: Violent Python
February 2013 Free Giveaway Sponsor - SANS
Holiday 2012 Free Giveaway Winner of Metasploit Pro by Rapid7
Course Review: SANS FOR408 Computer Forensic Investigations – Windows In-Depth
The Security Consulting Sugar High
Tutorial: Fun with SMB on the Command Line
Interview: Ilia Kolochenko, CEO of High-Tech Bridge
October 2012 Free Giveaway Winner of LearningGate Training
The Broken: Assessing Corporate Security in 2012 to Make a Better 2013
EH-Net Login
Welcome Guest.
Username:
Password:
Remember me
Lost Password?
No account yet?
Register
Who's Online
We have 31 guests and 1 member online
You are here:
Home
Columns
Heffner
[Article]-Intro to Reverse Engineering - No Assembly Required
EH-Net
May 21, 2013, 03:03:35 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Go back to The Ethical Hacker Network Online Magazine
Home Page
Home
Help
Calendar
Login
Register
EH-Net
>
Columns
>
Heffner
(Moderator:
don
) >
[Article]-Intro to Reverse Engineering - No Assembly Required
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: [Article]-Intro to Reverse Engineering - No Assembly Required (Read 65425 times)
0 Members and 1 Guest are viewing this topic.
don
Editor-In-Chief
Administrator
Hero Member
Offline
Posts: 4165
Editor-In-Chief
[Article]-Intro to Reverse Engineering - No Assembly Required
«
on:
August 07, 2007, 03:16:24 AM »
My apologies to Craig for the delay in publishing this paper as I was a little busy attending BH/DefCon and the neverending work on
ChicagoCon
. But this one is definitely worth the wait as many of you expressed interest in the topic of this article. Well done, Mr. Heffner.
Permanent Link:
[Article]-Intro to Assembly and Reverse Engineering
Quote
Last time we went over the C programming language in an introductory article specifically focusing on getting the security professional on the road to coding (or at least the road to understanding). This time around we extend the series of coding articles for non-programmers with an area of high interest in the infosec community, reverse engineering.
This paper is intended as an introduction to reverse engineering for someone who has no experience whatsoever on the subject. You should have some basic knowledge of C programming, and access to a Windows or Linux box (preferably both) using the x86 architecture (i.e., your average computer). No knowledge of assembly code, registers, or the like is assumed, although it helps. This introduction section of the paper is intended for the newcomer who has little or no understanding of what reverse engineering is, and may be skipped by those looking for more technical details.
As always, feedback is encouraged as well as future topic ideas for Craig.
Don
«
Last Edit: August 09, 2007, 11:58:22 AM by don
»
Logged
CISSP, MCSE, CSTA, Security+ SME
crapbot
Newbie
Offline
Posts: 1
Re: [Article]-Intro to Reverse Engineering - No Assembly Required
«
Reply #1 on:
August 07, 2007, 07:52:31 AM »
Great article. Are there any books that you would recommend ? Books targeted at people that know C/ASM and are looking to learn about reverse engineering, specifically, malware reverse engineering.
Cheers
«
Last Edit: August 09, 2007, 11:58:44 AM by don
»
Logged
nebu10uz
Sr. Member
Offline
Posts: 368
Re: [Article]-Intro to Reverse Engineering - No Assembly Required
«
Reply #2 on:
August 08, 2007, 05:01:06 AM »
Excellent! I really enjoyed this paper.
Thanks Craig for explaining this topic in a simple and clear visual manner. I think this is the first time I really understood the basic of Assembly and RCE. I know that this is just an introduction but it really helps to grasp the fundamentals for other advance related topics. Looking forward the second part of this article.
Keep up the good work!!
«
Last Edit: August 09, 2007, 11:58:58 AM by don
»
Logged
Security+, OSCP, CEH
don
Editor-In-Chief
Administrator
Hero Member
Offline
Posts: 4165
Editor-In-Chief
Re: [Article]-Intro to Reverse Engineering - No Assembly Required
«
Reply #3 on:
August 09, 2007, 12:20:13 PM »
Help get Craig the deserved attention on this awesome paper:
Digg It!!
http://digg.com/programming/Intro_to_Reverse_Engineering_No_Assembly_Required
Don
Logged
CISSP, MCSE, CSTA, Security+ SME
Paul
Newbie
Offline
Posts: 7
Great Paper!!
«
Reply #4 on:
August 12, 2007, 05:15:54 PM »
Thanks for your awesome paper. I have been interested in learning more on RCE and have been held up by the fact that no one writes to the true entry level person. Your overview of registers was very well wrote.
I ran through the Hello World examples and had slight differences. I understand each disassembler will spit something different, I am wondering if you can tell me what is going on though. I m using gdb 6.6-debian.
Dump of assembler code for function main:
0x080483a0 <main+0>: lea 0x4(%esp),%ecx
0x080483a4 <main+4>: and $0xfffffff0,%esp
0x080483a7 <main+7>: pushl 0xfffffffc(%ecx)
0x080483aa <main+10>: push %ebp
0x080483ab <main+11>: mov %esp,%ebp
0x080483ad <main+13>: push %ecx
0x080483ae <main+14>: sub $0x4,%esp
0x080483b1 <main+17>: movl $0x1,0x80495cc
0x080483bb <main+27>: call 0x8048374 <myprint>
0x080483c0 <main+32>: mov $0x0,%eax
0x080483c5 <main+37>: add $0x4,%esp
0x080483c8 <main+40>: pop %ecx
0x080483c9 <main+41>: pop %ebp
0x080483ca <main+42>: lea 0xfffffffc(%ecx),%esp
0x080483cd <main+45>: ret
End of assembler dump.
The first three lines are where I am confused. I read about load effective address, but I don't know what it is loading.
Also in myprint(), I am using:
0x0804838b <myprint+23>: call 0x80482bc <puts@plt>
I understand this is the print statement although do you have any input on puts vs print?
Thanks for the awesome paper, when is part two coming out?
Logged
ddnc
Newbie
Offline
Posts: 1
Re: [Article]-Intro to Reverse Engineering - No Assembly Required
«
Reply #5 on:
August 13, 2007, 08:12:47 AM »
Hey Paul,
Code:
lea 0x4(%esp),%ecx
pushl 0xfffffffc(%ecx)
These instructions serve to save the stack pointer on the stack. Notice that at main+42, this value is loaded back into ESP in order to restore the stack pointer before returning.
Code:
and $0xfffffff0,%esp
This instruction zeros out the last byte in the ESP register. This is done to ensure that the stack pointer is aligned on a 16-byte boundary (the default stack boundary is 16) in order to increase CPU execution time. There's a short semi-discussion on it at the Kernel Trap forums:
http://kerneltrap.org/node/8236
.
As far as puts() goes, it's not much different from printf() when just printing out a string. You should see the memory address where the string is located pushed onto the stack just before the call to puts(). It will place a positive number in the EAX register if successful (probably 1), and a -1 in EAX if it fails.
Logged
nebu10uz
Sr. Member
Offline
Posts: 368
Re: [Article]-Intro to Reverse Engineering - No Assembly Required
«
Reply #6 on:
March 30, 2008, 06:30:10 PM »
I found a mistake in this article:
Quote
jnz jnz 0x08ffff01 Jump if the zero flag is set to 1
The jnz (jump if not zero) instruction jumps if the zero flag is clear.
Code:
jnz Jump if the zero flag is set to 0
For example, if an operation such as CMP turns out to be true, the result will be zero which means that the zero flag will be set to 1. If the next instruction is a jnz, the jump will not be taken. However, if the CMP operation is not true, the result will be a non-zero value meaning that the zero flag is clear or 0. Since the zero flag is clear the next jump (jnz) will be taken.
I've been doing some research on reversing and assembly lately for a crack me challenge and spotted this error when I went back on reading this article.
Logged
Security+, OSCP, CEH
shawal
Jr. Member
Offline
Posts: 88
Re: [Article]-Intro to Reverse Engineering - No Assembly Required
«
Reply #7 on:
March 30, 2008, 10:46:50 PM »
crapbot ,
try "The Art of Assembly Programming" by Randall Hyde
blackazarro,
could you please post the URL for the challange you are trying to crack?
Logged
RHCE, GIAC GCIH.
nebu10uz
Sr. Member
Offline
Posts: 368
Re: [Article]-Intro to Reverse Engineering - No Assembly Required
«
Reply #8 on:
March 30, 2008, 11:33:35 PM »
Quote
try "The Art of Assembly Programming" by Randall Hyde
Thanks for the reference, I'll check it out.
Quote
could you please post the URL for the challange you are trying to crack?
I was talking about the crackme02 posted by Don last week:
http://www.ethicalhacker.net/component/option,com_smf/Itemid,54/topic,2277.0/
I already solved it. I guess you just of to find the password in the right place.
Logged
Security+, OSCP, CEH
shawal
Jr. Member
Offline
Posts: 88
Re: [Article]-Intro to Reverse Engineering - No Assembly Required
«
Reply #9 on:
March 31, 2008, 12:36:05 AM »
blackazarro,
oh! that i did solve it too, however i did not require the assembly skills for that
Logged
RHCE, GIAC GCIH.
nebu10uz
Sr. Member
Offline
Posts: 368
Re: [Article]-Intro to Reverse Engineering - No Assembly Required
«
Reply #10 on:
March 31, 2008, 12:46:53 AM »
Me either. I went on studying assembly before I attempted the challenge.
Logged
Security+, OSCP, CEH
_Marshel_
Jr. Member
Offline
Posts: 61
Life Is too short to be someone else.
Re: [Article]-Intro to Reverse Engineering - No Assembly Required
«
Reply #11 on:
March 31, 2008, 04:16:21 AM »
speaking of reverse engineering, what is the best book/tutorial/way to learn assembly ?
Logged
shawal
Jr. Member
Offline
Posts: 88
Re: [Article]-Intro to Reverse Engineering - No Assembly Required
«
Reply #12 on:
March 31, 2008, 08:33:03 AM »
_Marshel_
check the following URL:
http://webster.cs.ucr.edu/AoA
http://webster.cs.ucr.edu/AoA/Linux/HTML/AoATOC.html
the site is not very user friendly, however if you manage to navigate you will be able to collect the rewards
You seem to be hunting for books these days, good luck
Logged
RHCE, GIAC GCIH.
_Marshel_
Jr. Member
Offline
Posts: 61
Life Is too short to be someone else.
Re: [Article]-Intro to Reverse Engineering - No Assembly Required
«
Reply #13 on:
March 31, 2008, 08:58:58 AM »
I'm a worm that feeds on reading
I'm always hunting for books.
Logged
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
EH-Net
-----------------------------
=> Calendar Of Events
===> ChicagoCon 2007
===> ChicagoCon 2008s
===> ChicagoCon 2008f
===> ChicagoCon 2009s
=> Ethical Hacktivism
=> News Items and General Discussion About EH-Net
===> Greetings
=> Special Events
-----------------------------
Ethical Hacking Discussions and Related Certifications
-----------------------------
=> General Certification
===> Networking
===> OS
===> Security
=> Compliance, Regulations & Standards
=> Control Systems
=> Cyber Warfare
=> Forensics
===> CCE / MCCE - (Master) Certified Computer Examiner
===> CHFI - Computer Hacking Forensic Investigator
===> EnCE - EnCase® Certified Examiner
===> GCFA - GIAC Certified Forensics Analyst
=> Hardware
=> Incident Response
===> CSIH - Computer Security Incident Handler
===> GCIH - GIAC Certified Incident Handler
=> Malware
===> Advisories
=> Mobile
=> Network Pen Testing
===> CEH - Certified Ethical Hacker
===> CPTC - Certified Penetration Testing Consultant
===> CPTE - Certified Penetration Testing Engineer
===> CSTA - Certified Security Testing Associate
===> eCPPT - eLearnSecurity Certified Professional Penetration Tester
===> ECSA - EC-Council Certified Security Analyst
===> GPEN - GIAC Certified Penetration Tester
===> OSCP - Offensive Security Certified Professional
=> Physical Security
=> Programming
=> Social Engineering
=> Web Applications
=> Wireless
===> CWNP Certs
===> GAWN - GIAC Assessing Wireless Networks
===> OSWP - Offensive Security Wireless Professional
=> Other
-----------------------------
Columns
-----------------------------
=> Editor-In-Chief
=> Andress
=> Gates
=> Haddix
=> Hadnagy
=> Heffner
=> Hoffman
=> Linn
=> RichM
=> Murray
=> J. Peltier
=> Weidman
=> Wilson
-----------------------------
Features
-----------------------------
=> /root
=> Book Reviews
=> Opinions
=> Skillz
===> Examples
===> May 06 - Star Hacks, Episode V: The Empire Hacks Back
===> July 06 - Hack Bill!
===> Sept 06 - Netcat in the Hat
===> Nov 06 - Hitch-Hackers Guide to the Galaxy
===> Dec 06 - A Christmas (Hacking) Story
===> Feb 07 - Charlottes Web Site
===> April 07 - Microsoft Office Space
===> June 07 - Serenity Hack
===> Oct 07 - Worst. Ethical. Hacker. Challenge. Ever.
===> Dec 07 - Frosty the Snow Crash
===> March 2008 - It Happened One Friday
===> Oct 2008 - Scooby Doo and the Crypto Caper
===> Dec 08 - Santa Claus Is Hacking to Town
===> Feb 2009 - Brady Bunch Boondoggle
===> July 2009 - Prison Break
===> October 2009 - SSHliders
===> December 2009 - Miracle on Thirty-Hack Street
===> December 2010 - The Nightmare Before Charlie Browns Christmas
-----------------------------
Resources
-----------------------------
=> Career Central
===> Looking For Work
===> Looking To Hire
=> Links to cool sites.
=> Mass Media
=> News from the Outside World
=> Tools
=> Tutorials
===> Tutorial Requests
Loading...
Exclusive Deal
SANSFIRE 2013
June 15 - 22
5% Off
w/ Code
:
EHN_5
SANS Deals 4 EH-Netters
5% OFF
Any
SANS Course
in Any Format!
Coupon Code:
EHN_5
Including
SANS Rocky Mountain 2013
&
SANS Boston 2013
Polls
Compared to this year, 2013 will be:
Great!
Better.
About the same.
Little worse.
FUBAR!
Recent Forum Topics
OSCP - Offensive Security Certified Professional
: Failed my first attempt at the OSCP exam
(94) by
azmatt
Programming
: Finished Python Course in Codecademy now what?
(11) by
securitian
Tools
: Social-Engineer Toolkit (SET) Version 5.0 “The Wild West” Released
(2) by
m0wgli
Malware
: EICAR?
(3) by
UKSecurityGuy
Advisories
: HTB23154: Multiple Vulnerabilities in Exponent CMS
(0) by
AndyP
Advisories
: HTB23153: Multiple Vulnerabilities in Jojo CMS
(0) by
AndyP
Advisories
: HTB23151: Cross-Site Request Forgery (CSRF) in UMI.CMS
(0) by
AndyP
Tutorials
: Need guidance
(8) by
r0ckm4n
OSCP - Offensive Security Certified Professional
: Class Scheduled 6/8 - Linux n00b
(7) by
Taemyks
OSCP - Offensive Security Certified Professional
: OSCP exam scheduled
(6) by
gbhat
Incident Response
: LinkedIn Forensics
(0) by
AFENTIS_Forensics
General Certification
: Red Team/Blue Team
(1) by
ajohnson
Career Central
: Starter cert?
(3) by
Grendel
Network Pen Testing
: Beginner Ethical Hacker
(1) by
m0wgli
General Certification
: CPT Practical Submission
(0) by
z28power4u
Web Applications
: Nessus and Nikto
(4) by
Seen
Network Pen Testing
: Cracking salted MD5 hash
(4) by
n37sh@rk
CEH - Certified Ethical Hacker
: Passed my C|EH
(3) by
n37sh@rk
Mass Media
: EC-council hacked, irony at his best?
(0) by
j0rDy
Web Applications
: SQL Injection into an INSERT statement.
(6) by
eyenit0
Network Pen Testing
: Solution for sipXtapi INVITE Message CSeq Field Header Remote Overflow
(1) by
m0wgli
Web Applications
: dns
(2) by
H1t M0nk3y
Other
: BSides Boston
(0) by
3xban
Career Central
: InfoSec in Central, FL
(2) by
tturner
Web Applications
: Web vulnerability scanner
(4) by
H1t M0nk3y
EH-Net News Feeds
Latest Additions
Privacy Notice
for TDCC & All Properties
© 2013 The Ethical Hacker Network
Joomla!
is Free Software released under the GNU/GPL License.