Introduction to Information Security מרצים : Dr. Eran Tromer: Prof. Avishai Wool: מתרגלים : Itamar Gilad

Slides:



Advertisements
Similar presentations
CSE 105 Structured Programming Language (C)
Advertisements

Programs in Memory Bryce Boe 2012/08/29 CS32, Summer 2012 B.
Recursion CS 367 – Introduction to Data Structures.
1 Lecture 4: Procedure Calls Today’s topics:  Procedure calls  Large constants  The compilation process Reminder: Assignment 1 is due on Thursday.
IT253: Computer Organization Lecture 6: Assembly Language and MIPS: Programming Tonga Institute of Higher Education.
Lecture 8: MIPS Instruction Set
Introduction to Information Security מרצים : Dr. Eran Tromer: Prof. Avishai Wool: מתרגלים : Itamar Gilad
Chapter FourModern Programming Languages1 Language Systems.
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
Computers: Tools for an Information Age
Disassembly תרגול 9 ניתוח קוד. How to - Disassembly of code Compilation of code:  gcc code.c  We get the file: a.out Disassembly:  objdump -d a.out.
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
Practical Session 8 Computer Architecture and Assembly Language.
Assembly & Machine Languages
Game Scripting By: Nicholas Haines. Aurora Neverwinter Toolset.
Language Systems Chapter FourModern Programming Languages 1.
Trying to like a boss… REVERSE ENGINEERING. WHAT EVEN IS… REVERSE ENGINEERING?? Reverse engineering is the process of disassembling and analyzing a particular.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
Application Security Tom Chothia Computer Security, Lecture 14.
Introduction to InfoSec – Recitation 2 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
Programming. What is a Program ? Sets of instructions that get the computer to do something Instructions are translated, eventually, to machine language.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 13: An Introduction to C++
Programming With C.
Goals: To gain an understanding of assembly To get your hands dirty in GDB.
Game Scripting by: Nicholas Haines. What is Scripting? Interpreted Language Interpreted Language –As the game runs.
EECS 354 Network Security Reverse Engineering. Introduction Preventing Reverse Engineering Reversing High Level Languages Reversing an ELF Executable.
Introduction to Information Security מרצים : Dr. Eran Tromer: Prof. Avishai Wool: מתרגלים : Itamar Gilad
Topic 2d High-Level languages and Systems Software
Introduction to InfoSec – Recitation 2 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
RIVERSIDE RESEARCH INSTITUTE Deobfuscator: An Automated Approach to the Identification and Removal of Code Obfuscation Eric Laspe, Reverse Engineer Jason.
C Language: Introduction
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
LANGUAGE SYSTEMS Chapter Four Modern Programming Languages 1.
Buffer Overflow Proofing of Code Binaries By Ramya Reguramalingam Graduate Student, Computer Science Advisor: Dr. Gopal Gupta.
CS Computer Science I. BCPL was developed in 1967 as a language for writing operating systems and software compilers In 1970, the creators of the.
Dr. Sajib Datta CSE Spring 2016 INTERMEDIATE PROGRAMMING.
Python 1 SIGCS 1 Intro to Python March 7, 2012 Presented by Pamela A Moore & Zenia C Bahorski 1.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Announcements You will receive your scores back for Assignment 2 this week. You will have an opportunity to correct your code and resubmit it for partial.
Introduction to InfoSec – Recitation 3 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (infosec15 at modprobe.net)
Practical Session 8. Position Independent Code- self sufficiency of combining program Position Independent Code (PIC) program has everything it needs.
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
Linking I Topics Assembly and symbol resolution Static linking Systems I.
DR. MIGUEL ÁNGEL OROS HERNÁNDEZ 2. Software de bajo nivel.
PV204 Security technologies Reverse engineering of binary applications Petr Švenda Faculty of Informatics, Masaryk University.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Radare Easing binary analysis for fun and profit.
Practical Session 3.
Shellcode COSC 480 Presentation Alison Buben.
Assembly language.
Static and dynamic analysis of binaries
Lecture 6: Assembly Programs
Introduction to programming
Problem Identification
CSCI-235 Micro-Computer Applications
The University of Adelaide, School of Computer Science
ACOE301: Computer Architecture II Labs
Additional Assembly Programming Concepts
Computer Architecture and Assembly Language
Lesson Objectives Aims Key Words Compiler, interpreter, assembler
Assembly Language Programming II: C Compiler Calling Sequences
Multi-modules programming
Program Execution in Linux
Computer Architecture and System Programming Laboratory
Computer Architecture and Assembly Language
Computer Architecture and System Programming Laboratory
Reverse Engineering for CTFs
Introduction to Computer Science
Presentation transcript:

Introduction to Information Security מרצים : Dr. Eran Tromer: Prof. Avishai Wool: מתרגלים : Itamar Gilad Nir Krakowski

Today Reverse Engineering 101 IDA (!) Binary patching 101 More tools

Reverse Engineering What does the following code do: o LEA EDX, [address to “Hello, world!”] o MOV ECX, 12 MYLOOP: o PUSH EDX o CALL printf o ADD ESP, 4 o LOOP MYLOOP

Reverse Engineering What is it? o Using the binary to recreate any knowledge needed Why? o Recreating lost platforms (ReactOS) o ‘Secret’ algorithms (Encryption, trade secrets, etc.) o Hidden features (and hidden backdoors) o Internal structures & implementation details o Bugs / Vulnerabilities that only exist in the binary o you name it!

So, what’s the problem? o Compiling is like a one-way function. o Information is lost, and we *often* loose access to – Variable and function names Comments o What do we still have - Import and export names (relations between modules) Structure of parameters to functions. Starting point Hard-coded strings Constants

RE Process Our objectives – o Find the most interesting piece of code in the least amount of time o Understand what it does and how o Find weaknesses and figure out how to exploit them Use leads – o Strings, UI o Dynamic debugging, breakpoints. o Library and system functions Interpret the assembled code by using intelligent guesses – o Context-based o Code is written by people using regular code conventions o Code is written in an upper level language, and compilers are usually pretty predictable

IDA The Interactive Dis-Assembler ( IDA ) is the most popular reverse engineering tool o Version 5.0 is free-ware and that is what we’ll use. IDA does several things automatically: o Disassemble x86 binary code into human readable format o Identifies ELF headers (executable file formats) o Signature based recognition for library functions and compiler tricks o Creates code graph by basic blocks o Code and data xrefs (references to memory addresses, functions) Provides a good environment for research: o Adding comments (‘;’) o Renaming labels: code blocks, variables, function names, structures. (‘n’) o Change interpretation of binary data (code->data, data->code, data type change, etc.)

IDA Options

IDA Demo [Helllo World]

IDA Demo [stricmp]

Binary patching What? o Changing instructions/data/metadata in the “production” binary Why? o You lost the source code o You never had the source code o Small changes that would be easier to test on their own o Hot patching o And many more

Binary patching example int verify_login(char * username, char * password) { if ((0 == strcmp(username, “root”)) && (0 == strcmp(password, “my_pass”)) { return 0; } else { return 1; }

Patch Layout Patch area (NOPs) Function body Function prolog Function Epilog

Execution Layout Patch area (CODE) Function body Function prolog Function Epilog

Patch Layout Patch area (NOPs) Function body Function prolog Function Epilog Divert execution around patch area

Patch Layout Patch area (NOPs) Function body Function prolog Function Epilog Jump into patch area

Patch Layout Patch area (NOPs) Function body Function prolog Function Epilog Jump back into original code

Patch Layout Patch area (CODE) Function body Function prolog Function Epilog

New tools! va_to_offset.py – A tool to map a virtual address (as you see in IDA) to a file offset patch_util_gcc.py – A script that lets you patch a binary by using simple text files with (bare) assembly instructions

This week’s exercise First reverse engineering task First binary patching task It isn’t hard – but please start early and contact us if you have any trouble with the setup