Dynamic Analysis ddaa.

Slides:



Advertisements
Similar presentations
Introduction to the Omega Server CSE Overview Intro to Omega Basic Unix Command Files Directories Printing C and C++ compilers GNU Debugger.
Advertisements

Gnu Debugger (GDB) Topics Overview Quick Reference Card Readings: Quick Reference Card February 7, 2012 CSCE 212Honors Computer Organization.
The art of exploitation
Utilizing the GDB debugger to analyze programs Background and application.
Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
Memory & Storage Architecture Seoul National University Computer Architecture “ Bomb Lab Hints” 2nd semester, 2014 Modified version : The original.
OllyDbg Debuger.
Gdb is the GNU debugger on our CS machines. gdb is most effective when it is debugging a program that has debugging symbols linked in to it. With gcc and.
Debugging Cluster Programs using symbolic debuggers.
Trying to like a boss… REVERSE ENGINEERING. WHAT EVEN IS… REVERSE ENGINEERING?? Reverse engineering is the process of disassembling and analyzing a particular.
Practical Malware Analysis Ch 8: Debugging Rev
Introduction to InfoSec – Recitation 2 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
Memory & Storage Architecture Seoul National University GDB commands Hyeon-gyu School of Computer Science and Engineering.
Part 3: Advanced Dynamic Analysis Chapter 8: Debugging.
Compiling & Debugging Quick tutorial. What is gcc? Gcc is the GNU Project C compiler A command-line program Gcc takes C source files as input Outputs.
Goals: To gain an understanding of assembly To get your hands dirty in GDB.
Debugging Dwight Deugo Nesa Matic
Debugging. 2 © 2003, Espirity Inc. Module Road Map 1.Eclipse Debugging  Debug Perspective  Debug Session  Breakpoint  Debug Views  Breakpoint Types.
Introduction to InfoSec – Recitation 2 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
A Tutorial on Introduction to gdb By Sasanka Madiraju Graduate Assistant Center for Computation and Technology.
Debugging Xin Tong. GDB GNU Project debugger Allows you to see what is going on `inside' another program while it executes or crashed. (Faster than printing.
CSE 351 GDB Introduction. Lab 1 Status? How is Lab 1 going? I’ll be available at the end of class to answer questions There are office hours later today.
Data Display Debugger (DDD)
Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions.
Debugging 1/6/2016. Debugging 1/6/2016 Debugging  Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a program.
Dale Roberts Debugger Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and Information Science, School.
Unit - V. Debugging GNU Debugger helps you in getting information about the following: 1.If a core dump happened, then what statement or expression did.
EXPLOITATION CRASH COURSE – FALL 2013 UTD Computer Security Group – Andrew Folloder csg.utdallas.edu (credit: Scott Hand)
OUTLINE 2 Pre-requisite Bomb! Pre-requisite Bomb! 3.
HP-SEE Debugging with GDB Vladimir Slavnic Research Assistant SCL, Institute of Physics Belgrade The HP-SEE initiative.
GDB Introduction And Lab 2
Gnu Debugger (GDB) Topics Overview Quick Reference Card Readings: Quick Reference Card February 4, 2010 CSCE 212Honors Computer Organization.
Dale Roberts Debugger Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and Information Science, School.
Using the GNU Debugger (GDB)‏ Techzemplary Pvt.Ltd February 24 th 2008 Pranav Peshwe.
Institute of Radio Physics and Electronics ILug-Cal Introduction to GDB Institute of Radio Physics and Electronics and Indian GNU/Linux Users Group Kolkata.
CSCI 4061 Recitation 2 1.
DEBUG.
Computer System Laboratory
Static and dynamic analysis of binaries
Live Phishing Attack Authentication Activity from a Foreign Address.
Operating Systems CMPSC 473
CSE 374 Programming Concepts & Tools
Techniques, Tools, and Research Issues
Debugging Dwight Deugo
CSCE 212Honors Computer Organization
Debugging with gdb gdb is the GNU debugger on our CS machines.
Malware Incident Response  Dynamic Analysis - 2
gdb gdb is the GNU debugger on our CS machines.
Introduction to Computer Systems
Lab: ssh, scp, gdb, valgrind
Using Visual Studio with C#
Part 3: Advanced Dynamic Analysis
Important terms Black-box testing White-box testing Regression testing
Computer Architecture “Bomb Lab Hints”
Important terms Black-box testing White-box testing Regression testing
Debugging with Eclipse
Lab: ssh, scp, gdb, valgrind
Debuggers.
DEBUGGING JAVA PROGRAMS USING ECLIPSE DEBUGGER
GNU DEBUGGER TOOL. What is the GDB ? GNU Debugger It Works for several languages – including C/C++ [Assembly, Fortran,Go,Objective-C,Pascal]
CSC235 - Visual Studio Tutorial
Debugging Dwight Deugo
CSE 303 Concepts and Tools for Software Development
CSCE 212Honors Computer Organization
Debugging.
Makefiles, GDB, Valgrind
Exploitation Part 1.
Debugging with Eclipse
Hello World Program In Visual Studio and Debugging
By Hugues Leger / Intro to GDB debugger By Hugues Leger / 11/16/2019.
Presentation transcript:

Dynamic Analysis ddaa

What is it? Dynamic program analysis is the analysis of computer software that is performed by executing programs on a real or virtual processor. …… Examine the process during execution Observe registers, memory contents, …, etc. If you will analysis a malware, it should run in a VM.

Pros Observe the status of process during executing. Control the flow of process arbitrarily. Overcome the shell or obscure code. Find the problem happened in library.

Cons Influence the real program Code coverage depends on input data. Need an environment for executing program.

ltrace It intercepts and records the dynamic library calls which are called by the executed process and the signals which are received by that process

strace It intercepts and records the system calls which are called by a process and the signals

Other tools Process monitor (windows) Process explorer (windows) valgrind http://zh.wikipedia.org/wiki/Valgrind

Scenario “/home/xxx/flag” not found. We don’t know which port the program bind.

Your turn… http://secprog.cs.nctu.edu.tw/files/phantom Try to get the flag :p

Debugger Windows Linux We’ll focus on gdb in class windbg, ollydbg, immunity debugger, ida pro, … Usage is almost the same, expect windbg. Linux gdb gdbtui kgdb We’ll focus on gdb in class but you should learn how to use one of windows debugger at least.

Debugger (cont.) Set breakpoints Control process Once breakpoint is set to certain address, program will stop executing and send signal to debugger Control process Until arriving the instructions we interested Dump memory or information registers, stack, heap, or anything in memory map. Modify something, such as register, memory content. It may also change the control flow.

gdb - set breakpoints break [location] [condition] Set breakpoint at specified line or function. break *0x08045566 if $eax = 5566 watch [memory address] [condition] A watchpoint stops execution of your program whenever the value of an expression changes. enable | disable enable/disable breakpoint delete number delete # breakpoint

gdb - control process run continue nexti stepi finish Start debugged program. continue Continue program being debugged, after signal or breakpoint. nexti Next instruction. stepi Next instruction, but step into the function. finish run until return

gdb - Dump memory x/fmt [address] print [address] Examine memory fmt = repeat count + format letter + size letter x/10xw 0xffff5566 print [address] Print value of expression

gdb - modify something set [address]=[value] Evaluate expression EXP and assign result to variable VAR, using assignment syntax appropriate for the current language set $eax=5566 set *0xffff5566 = 5566 set can be used to configure some gdb options. set follow-fork-mode parent|child set disassembly-flavor att|intel

gdb - information info registers – register information info stack – call flow info breakpoint – breakpoint information info args/local – display variable (with debug info) info proc map – display memory region

gdb - others attach [pid] disassemble [address] list display Attach to a process or file outside of GDB. disassemble [address] Disassemble a specified section of memory. list List specified function or line. display Print value of expression EXP each time the program stops. display/i $pc

Demo hw0 - magic

Stack frame int main(){ f1(); return 0; } void f1(){ int v1,v2; f2(v1,v2,100); void f2(int a1,int a2, int a3){ printf(“%d\n%d\n%d”.a1,a2,a3);

Virtual memory

Breakpoint detail 0804867f <main>: 804867f: 55 push %ebp 8048680: 89 e5 mov %esp,%ebp 8048682: 83 e4 f0 and $0xfffffff0,%esp <= bp ===================================================== 8048682: cc int 3 8048683: e4 f0 ???????????

Anti-debugger shelling IsDebuggerPresent signal ptrace(PTRACE_TRACEME, 0, 1, 0)

Reference http://en.wikipedia.org/wiki/Dynamic_program_analysis http://repo.hackerzvoice.net/depot_ouah/linux-anti-debugging.txt https://github.com/hellogcc/100-gdb-tips/tree/master/src http://www.cs.fsu.edu/~redwood/OffensiveComputerSecurity/reversi ng/FSU_Reversing.pdf

0x512641 Q&A