Www.SecurityXploded.com. Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.

Slides:



Advertisements
Similar presentations
1/1/ / faculty of Electrical Engineering eindhoven university of technology Memory Management and Protection Part 3:Virtual memory, mode switching,
Advertisements

Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Parul Polytechnic Institute Subject Code : Name Of Subject : Microprocessor and assembly language programming Name of Unit : Introduction to Microprossor.
Week 3. Assembly Language Programming  Difficult when starting assembly programming  Have to work at low level  Use processor instructions >Requires.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Data Representation Computer Organization &
COMP3221 lec06-numbers-II.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 6: Number Systems - II
Data Representation COE 205
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
3-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Intel 8088 (8086) Microprocessor.
1 Chapter 4: Arithmetic for Computers (Part 1) CS 447 Jason Bakos.
8-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
COMP3221: Microprocessors and Embedded Systems--Lecture 4 1 COMP3221: Microprocessors and Embedded Systems Lecture 4: Number Systems (II)
ARM programmer’s model and assembler Embedded Systems Programming.
Introduction to Interrupts
EET 2261 Unit 2 HCS12 Architecture
Gursharan Singh Tatla Block Diagram of Intel 8086 Gursharan Singh Tatla 19-Apr-17.
Unit-1 PREPARED BY: PROF. HARISH I RATHOD COMPUTER ENGINEERING DEPARTMENT GUJARAT POWER ENGINEERING & RESEARCH INSTITUTE Advance Processor.
Defeating public exploit protections (EMET v5.2 and more)
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Introduction to Android Swapnil Pathak Advanced Malware Analysis Training Series.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Computers Organization & Assembly Language
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
1 Fundamental of Computer Suthida Chaichomchuen : SCC
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
10-Sep Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept Representing Information in Computers:  numbers: counting numbers,
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Chapter 4 - Implementing Standard Program Structures in 8086 Assembly Language from Microprocessors and Interfacing by Douglas Hall.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Module 6: Debugging a Windows CE Image.  Overview Debug Zones IDE Debug Setup IDE Debug Commands Platform Builder Integrated Kernel Debugger Other Debugging.
System Address Registers/Memory Management Registers Four memory management registers are used to specify the locations of data structures which control.
Arithmetic Logic Unit (ALU) Anna Kurek CS 147 Spring 2008.
Amit Malik SecurityXploded Research Group FireEye Labs.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Arithmetic Operations
Information Security - 2. Other Registers EFLAGS – 32 Bit Register CFPFAFZFSFTFIFDFOFIO PL IO PL NTRFVM Bits 1,3,5,15,22-31 are RESERVED. 18: AC, 19:VIF,
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
1 x86 Programming Model Microprocessor Computer Architectures Lab Components of any Computer System Control – logic that controls fetching/execution of.
The Microprocessor & Its Architecture A Course in Microprocessor Electrical Engineering Department Universitas 17 Agustus 1945 Jakarta.
Chapter 12 Processor Structure and Function. Central Processing Unit CPU architecture, Register organization, Instruction formats and addressing modes(Intel.
Interrupt Processing Sequence
Lec 3: Data Representation
Status Register Status = system byte (supervisor only) + user byte = system status + condition code register usually, it is not important to know.
ELECTRONICS AND COMMUNICATION ENGINEERING
Assembly Language Programming Part 3
Malware Incident Response  Dynamic Analysis - 2
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Basic Microprocessor Architecture
COMP3221: Microprocessors and Embedded Systems
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Arithmetic operations Programming
CS 301 Fall 2002 Computer Organization
Chapter 8 Central Processing Unit
University of Gujrat Department of Computer Science
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Presentation transcript:

Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions of any kind. Also the views/ideas/knowledge expressed here are solely of the trainer’s only and nothing to do with the company or the organization in which the trainer is currently working. However in no circumstances neither the trainer nor SecurityXploded is responsible for any damage or loss caused due to use or misuse of the information presented here.

Acknowledgement  Special thanks to null & Garage4Hackers community for their extended support and cooperation.  Thanks to all the Trainers who have devoted their precious time and countless hours to make it happen.

Reversing & Malware Analysis Training This presentation is part of our Reverse Engineering & Malware Analysis Training program. Currently it is delivered only during our local meet for FREE of cost. For complete details of this course, visit our Security Training page.Security Training page

harsimranwalia.info  b44nz0r  Research McAfee Labs  Mechanical Delhi  Independent Security Researcher  RE, Exploit Analysis/Development, Malware Analysis Twitter : b44nz0rb44nz0r

Outline  Break Point  Debug Registers  Flags  API Help

Types of Breakpoints  Software  Hardware  Memory

Breakpoint  Software breakpoints are set by replacing the instruction at the target address with 0xCC (INT3/ Breakpoint interrupt)  Hardware breakpoints are set via debug registers. Only 4 hardware breakpoints can be set  Debug registers: 8 debug registers present DR0 – DR3 : Address of breakpoint DR6 : Debug Status – To determine which breakpoint is active DR7 : Debug Control – Flags to control the breakpoints such as break on read or on-write  Debug registers are not accessible in Ring 3

Hardware Breakpoints

Memory  To access memory, need of permissions  Lots of permissions PAGE_GUARD PAGE_READWRITE PAGE_EXECUTE PAGE_EXECUTE_READ  To set memory breakpoint, the permissions of that memory region is set to PAGE_GUARD whenever an access is made to that memory STATUS_GUARD_PAGE_VIOLATION exception is raised On getting the exception the debugger changes the permission back to the original Notifies the user of the breakpoint

Breakpoints

Flags (Eflags Register)  1 register – 32 bits  Each bit signifies a flag  Few important ones are: Bit #AbbreviationDescription 0CFCarry flag 2PFParity flag 4AFAdjust flag 6ZFZero flag 7SFSign flag 8TFTrap flagTrap flag (single step) 9IFInterrupt enable flag 11OFOverflow flag

Flags Demystified  Carry flag is used to indicate when an arithmetic carry or borrow has been generated out of the most significant ALU bit position  Parity flag indicates if the number of set bits is odd or even in the binary representation of the result of the last operation  Adjust flag is used to indicate when an arithmetic carry or borrow has been generated out of the 4 least significant bits  Zero Flag is used to check the result of an arithmetic operation, including bitwise logical instructions. It is set if an arithmetic result is zero, and reset otherwise  Sign flag is used to indicate whether the result of last mathematic operation resulted in a value whose most significant bit was set  A trap flag permits operation of a processor in single-step mode  Overflow flag is used to indicate when an arithmetic overflow has occurred in an operation, indicating that the signed two's- complement result would not fit in the number of bits used for the operation

Basic Reversing Techniques  Check for readable strings  Import table (IAT) for imported Windows API  Setting breakpoint on interesting API  Single stepping

Variables  Found under Names tab ○ L - library function ○ F - regular function ○ C - instruction ○ A - ascii string ○ D - data ○ I - imported name

Contd..  Global variables are generally dword_ dword_ – as shown in image  Local variables are of the form var_ var_6C – as shown in image

Loop in IDA  Red Line If condition is false (zero flag = 0)  Green Line If condition is true (zero flag = 1)

Reversing a Simple Crackme

Crackme Code #include int main() { char a[10],b[10],c[10],d[10]; int i,j,k,l,r,s; printf("#Crackme\n\n"); printf("enter username: "); scanf("%s",a); printf("enter password: "); scanf("%s",b); k = strlen(a); l = strlen(b); if (k =10){ printf("\nInvalid! Username Length\n"); printf("\nHit Enter to Exit\n"); getchar(); } else { if (l != k){ printf("\nInvalid! Password Length\n"); printf("\nHit Enter to Exit\n"); getchar(); } else { i = k-1; j = 0; while (i >= 0){ c[j] = a[i]+i; i--; j++; } c[j] = 0; r = strlen(c); if (r == l){ i = strcmp(c,b); if (i == 0){ printf("\nCongratulations! You did it..\n"); printf("\nHit Enter to Exit\n"); } else { printf("\nAccess Denied! Wrong Password\n"); printf("\nHit Enter to Exit\n"); } getchar(); } getchar(); }

References  Complete Reference Guide for Reversing & Malware Analysis Training Complete Reference Guide for Reversing & Malware Analysis Training

Thank You !