Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.

Slides:



Advertisements
Similar presentations
Lecture 3 Some commonly used C programming tricks. The system command Project No. 1: A warm-up project.
Advertisements

Utilizing the GDB debugger to analyze programs Background and application.
Inline Assembly Section 1: Recitation 7. In the early days of computing, most programs were written in assembly code. –Unmanageable because No type checking,
Embedded Systems Programming Introduction to cross development techniques.
Objects & Object-Oriented Programming (OOP) CSC 1401: Introduction to Programming with Java Week 15 – Lecture 1 Wanda M. Kunkle.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to Python Programming Outline 2.1 Introduction 2.2 First Program in Python: Printing.
Memory & Storage Architecture Seoul National University Computer Architecture “ Bomb Lab Hints” 2nd semester, 2014 Modified version : The original.
Recitation 1 Programming for Engineers in Python.
M-files While commands can be entered directly to the command window, MATLAB also allows you to put commands in text files called M- files. M-files are.
ITEC 352 Lecture 11 ISA - CPU. ISA (2) Review Questions? HW 2 due on Friday ISA –Machine language –Buses –Memory.
Memory & Storage Architecture Seoul National University GDB commands Hyeon-gyu School of Computer Science and Engineering.
Introduction to Python
David O’Hallaron Carnegie Mellon University Processor Architecture Overview Overview Based on original lecture notes by Randy.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Computer Engineering 1 nd Semester Dr. Rabie A. Ramadan 2.
Malware Dynamic Analysis Veronica Kovah vkovah.ost at gmail See notes for citation1
CSE 232: C++ debugging in Visual Studio and emacs C++ Debugging (in Visual Studio and emacs) We’ve looked at programs from a text-based mode –Shell commands.
Algorithms  Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Monday, Mar 31, 2003Kate Gregory with material from Deitel and Deitel Week 12 Labs 4 and 5 are back File IO Looking ahead to the final.
An Introduction to Programming with C++ Sixth Edition Chapter 14 Sequential Access Files.
Assembly and Bomb Lab : Introduction to Computer Systems Recitation 4: Monday, Sept. 16, 2013 Marjorie Carlson Section A.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
XP New Perspectives on XML, 2 nd Edition Tutorial 7 1 TUTORIAL 7 CREATING A COMPUTATIONAL STYLESHEET.
File Handling in QBASIC
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
IO revisited CSE 2451 Rong Shi. stdio.h Functions – printf – scanf(normally stops at whitespace) – fgets – sscanf Standard streams – stdin(defaults to.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
GDB Introduction And Lab 2
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
Chapter 14: Sequential Access Files
Topic 02: Introduction to ActionScript 3.0
User-Written Functions
More GDB, Intro to x86 Calling Conventions, Control Flow, & Lab 2
Algorithms Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Computer Engineering 1nd Semester
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Lecture Note Set 1 Thursday 12-May-05
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Computer Architecture “Bomb Lab Hints”
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Topics Introduction to File Input and Output
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Computer Systems Programming
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah –
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
sscanf()- string scan function
T. Jumana Abu Shmais – AOU - Riyadh
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah –
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Topics Introduction to File Input and Output
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Input and Output Python3 Beginner #3.
Introduction to Python
Topics Introduction to File Input and Output
Format String Vulnerability
Presentation transcript:

Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail

All materials is licensed under a Creative Commons “Share Alike” license. http://creativecommons.org/licenses/by-sa/3.0/ Attribution condition: You must indicate that derivative work "Is derived from Xeno Kovah's ‘Intro x86-64’ class, available at http://OpenSecurityTraining.info/IntroX86-64.html" Attribution condition: You must indicate that derivative work "Is derived from Xeno Kovah's 'Intro x86-64’ class, available at http://OpenSecurityTraining.info/IntroX86-64.html”

Bomb lab From CMU architecture class - http://csapp.cs.cmu.edu/public/labs.html Thanks to Randal E. Bryant & David R. O’Hallaron for providing the source code so it could be ported to x86-64 (and Windows in the Intro RE class) The textbook for the class which the bomb lab is a part of is “Computer Systems: A Programmer's Perspective, 2nd Edition, Prentice Hall, 2011; Bryant and O'Hallaron”

Bomb lab 2 Goal is to reverse engineer multiple phases to determine the program’s desired input Create a text file with answers, one per line, named “answers” gdb -x myCmds bomb run with “r < answers” Should add/remove breakpoints on the different phases as you go along

Bomb lab - EXPERT MODE! If you already know a thing or two about asm (and were just here for the 64 bit update), let’s see how far you can get how fast if you play it on expert mode, without symbol information. Execute the following command in the directory where the bomb resides: strip bomb This is more like what you will actually see with malware. You’re not going to get symbols in that case. Now go ahead and see how fast you can go through the rounds ;)

Phase_2 hint sscanf() is defined as follows: int sscanf(const char *str, const char *format, ...); So if it was e.g. “sscanf(foo, “%d %d”, &a, &b)” It would take whatever string was pointed to by the first argument, parse it according to the second format string argument, and then store the parsed out values in the variables which were given by the subsequent n arguments (for n = 2 in this case) “On success, the function returns the number of variables filled"

Phase_2 hint sscanf() is defined as follows: int sscanf(const char *str, const char *format, ...); So if it was e.g. “sscanf(guess, “%d %d %d %d %d %d”, &var1, &var2, &var3, &var4, &var5, &var6,)”

GDB/Bomb Lab Cheat Sheet Christian Arllen found this, and it has many more example of gdb syntax, as well as some help for if you get stuck on the lab http://condor.depaul.edu/~jriely/csc373fa ll2010/extras/mygdbnotes.txt (get it on google cache while you can, because it's gone now)