Nathan Rittenhouse

Similar documents
MSRPC Auditing Tools and Techniques

Analysis of MS Multiple Excel Vulnerabilities

Alex Ionescu, Chief

Remote Procedure Calls (RPC)

It was a dark and stormy night. Seriously. There was a rain storm in Wisconsin, and the line noise dialing into the Unix machines was bad enough to

Showing differences between disassembled functions

CS354 gdb Tutorial Written by Chris Feilbach

Decisions, Decisions. Testing, testing C H A P T E R 7

CMSC 414 Computer and Network Security

Distributed Systems 8. Remote Procedure Calls

Exploiting the MSRPC Heap Overflow Part I

MS RPC Architecture & Security Problems Related

Operating Systems. 18. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Spring /20/ Paul Krzyzanowski

EE 122: Network Security

Distributed Systems. How do regular procedure calls work in programming languages? Problems with sockets RPC. Regular procedure calls

Who Am I. Chris Gates

Reserve Engineering & Buffer Overflow Attacks. Tom Chothia Computer Security, Lecture 17

DCERPC and Endpoint Mapper

Advances in the Samba Testsuite

Is Exploitation Over? Bypassing Memory Protections in Windows 7

Attack Vectors in Computer Security

Outline. COM overview. DCOM overview. Comparison DCOM and Corba

CSCI-1680 RPC and Data Representation John Jannotti

Development Using Samba 4

Overview. Communication types and role of Middleware Remote Procedure Call (RPC) Message Oriented Communication Multicasting 2/36

Diaphora An IDA Python BinDiffing plugin

CSCI-1680 RPC and Data Representation. Rodrigo Fonseca

Blackfin Online Learning & Development

Reliably Determining the Outcome of Computer Network Attacks

Foreword by Katie Moussouris... Acknowledgments... xvii. Introduction...xix. Chapter 1: The Basics of Networking... 1

Homework notes. Homework 2 grades posted on canvas. Homework 3 due tomorrow. Homework 4 posted on canvas. Due Tuesday, Oct. 3

Intro to Cracking and Unpacking. Nathan Rittenhouse

Remote Procedure Call (RPC) and Transparency

Fuzzing: Breaking software in an automated fashion

TOOLSMITHING AN IDA BRIDGE: A TOOL BUILDING CASE STUDY. Adam Pridgen Matt Wollenweber

Administrivia. Remote Procedure Calls. Reminder about last time. Building up to today

5 R1 The one green in the same place so either of these could be green.

Analyzing Systems. Steven M. Bellovin November 26,

CS61 Scribe Notes Lecture 18 11/6/14 Fork, Advanced Virtual Memory

This guide will walk you through the steps for installing and using wget on Windows.

CS 417 9/18/17. Paul Krzyzanowski 1. Socket-based communication. Distributed Systems 03. Remote Procedure Calls. Sample SMTP Interaction

REMOTE PROCEDURE CALLS EE324

Distributed Systems. 03. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Fall 2017

Hacking Blind BROP. Presented by: Brooke Stinnett. Article written by: Andrea Bittau, Adam Belay, Ali Mashtizadeh, David Mazie`res, Dan Boneh

A new DCERPC infrastructure for Samba

Lecture 15: Network File Systems

416 Distributed Systems. RPC Day 2 Jan 11, 2017

Exercise 6 - Addressing a Message

A new DCERPC infrastructure for Samba

Improving DCERPC Security

Programming and Data Structure

Improving DCERPC Security Hardening

Agenda. The Mindset Finding vulnerabilities Writing exploits Exploiting non-standard stuff

CSci Introduction to Distributed Systems. Communication: RPC

WHAT IS AN INTERNET BACKBONE? And what makes a good one?

Beyond Patch and Pray: Security by Design

Intro to x86 Binaries. From ASM to exploit

Dr. Robert N. M. Watson

There are many other applications like constructing the expression tree from the postorder expression. I leave you with an idea as how to do it.

1. Go to and then click on the Bookstore link. Select Faculty Adoptions.

Using BiDiBLAH: Very concise getting started guide.

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

Reverse Engineering Microsoft Binaries

Building up to today. Remote Procedure Calls. Reminder about last time. Threads - impl

Task-Oriented Solutions to Over 175 Common Problems. Covers. Eclipse 3.0. Eclipse CookbookTM. Steve Holzner

Click Next to Continue

AND WHAT MAKES A GOOD ONE?

Project 1 Balanced binary

CSE 358 Spring 2006 Selected Notes Set 8

Lecture 4 September Required reading materials for this class

Assessment. automation: Deux ex Machina. Rube Goldberg Machine? 2005 LAS VEGAS

18-600: Recitation #3

Linked Lists

Communication in Distributed Systems

Sandboxing Untrusted Code: Software-Based Fault Isolation (SFI)

prin'() tricks DC4420 slides, Feb 2012

Using a debugger. Segmentation fault? GDB to the rescue!

Last time. Security Policies and Models. Trusted Operating System Design. Bell La-Padula and Biba Security Models Information Flow Control

416 Distributed Systems. RPC Day 2 Jan 12, 2018

Memory Corruption 101 From Primitives to Exploit

Lecture (02) Network Protocols and Standards

Is stack overflow still a problem?

CTI-TC Weekly Working Sessions

A Report on RMI and RPC Submitted by Sudharshan Reddy B

Analyzing the Impact of Installing Microsoft Operating System Patches

Session 4 Starting the Air Raid Game

CSCI-1680 RPC and Data Representation. Rodrigo Fonseca

Introduction to RISC-V

Cisco Advanced Malware Protection (AMP) for Endpoints

Message Passing vs. Distributed Objects. 5/15/2009 Distributed Computing, M. L. Liu 1

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

Hash-Based Indexes. Chapter 11. Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1

Having fun with apple s IOKit. Ilja van sprundel

Buffer overflow is still one of the most common vulnerabilities being discovered and exploited in commodity software.

TomcatCon London 2017 Clustering Mark Thomas

The DNS. Application Proxies. Circuit Gateways. Personal and Distributed Firewalls The Problems with Firewalls

CS61 Scribe Notes Date: Topic: Fork, Advanced Virtual Memory. Scribes: Mitchel Cole Emily Lawton Jefferson Lee Wentao Xu

Application Firewalls

There is REST and then there is REST. Radovan Semančík November 2017

Week 5, continued. This is CS50. Harvard University. Fall Cheng Gong

Transcription:

Nathan Rittenhouse nathan_@mit.edu

Used for the Downadup worm Aff t l t i f NT b d Affects almost every version of NT based Windows systems

Two main binary RPC protocols SunRPC/ONCRPC and DCERPC Both are open specs DCERPC got adopted by Microsoft SunRPC got adopted on Unix based platforms

Reason for COM s existence Decouple interfaces from implementations Example Take two different DLLs written in C++ with different compilers Have one attempt to import/create an instance of a class in the other Attempt to call a member function of that class Look for the Dr. Watson screen

There isn t a standard C++ calling convention There aren t standard d calling conventions between multiple languages COM intends to fix thatt If a language supports COM, any COM object created can be used by any other language that supports COM

DCERPC is the transport mechanism for DCOM DCOM is Distributed ib t COM The interface and implementation are *so* decoupled, d function calls over a network are possible Without t the programmer having to do anything different DCERPC is the network transport protocol

Microsoft uses SMB as a transport mechanism for DCERPC SMB can run on top of UDP/TCP Originally chosen because SMB was versatile and could run on top of many different protocols Including Microsoft s NetBEUI Also provides authentication, allows remote user impersonation

Closed source vs. open source difference Both have languages for specifying i definitions fiiti SunRPC apps have interfaces generated via rpcgen, which h simply spits out some C files Does marshalling INSIDE of the target app XDR encoding method

DCERPC based apps are easier to RE if there s only binary Format strings which describe the interface AND its member functions, arguments, data types are embedded IN THE BINARY RPCRT4.DLL parses these and marshals data to interfaces/functions accordingly Uses NDR marshalling method

A LOT of the work of figuring out an application s interface is taken out Enables us to write fuzzers that can extract an IDL from another app and talk to it correctly Many assume since they don t give out the IDL for their app, no one can talk to it Wrong

Look at the security bulletin: http://www.microsoft.com/technet/security/bull com/technet/security/bull etin/ms08 067.mspx Look at the KB article: http://support.microsoft.com/?kbid=958644 Note which files are patched

Server service srvsvc.dll RPC request Means there s a vulnerable RPC function

Use Bindiff or Binary Diffing Studio Bindiff is MUCH nicer We will cover Bindiff, since BDS has caused me lots of pain in the past

Load both patched and unpatched versions into IDA Tell Bindiff to run its algorithm against the two This may take some time

Notice the addition of a jnb instruction before a string copy Notice wcscpy > StringCchCopy

Load both srvsvc.dll and netapi32.dll into IDA Run mida Notice no RPC interfaces found in netapi32.dll All are contained in srvsvc.dll

Use xref feature in IDA Track back to CanonicalizePathName Then _NetpwPathCanonicalize Examine imports of srvsvc, search for this function Match to NetprPathCanonicalize

Use similar method to samba vulnerability Notice the nacn_np, note other UUID info Modify an existing Metasploit exploit to hit this function Use NDR encoding rules found at TippingPoint website bi Could reverse them from other Metasploit exploits Or reverse RPCRT4.dll

Not a straight stack overflow Due to an unbound searching loop for a \ character Then concatenating ti the result with something else A string can become much longer than intended Done on stack, so stack smash If no other \ exists before the loop, stack overflow

Full exploit (done by Metasploit, not me) http://metasploit.com/svn/framework3/trunk/modules/exp loits/windows/smb/ms08_067_netapi.rb b Using pymsrpc to trigger this http://dvlabs.tippingpoint.com/blog/2008/11/06/using pymsrpc to trigger ms08 067 TippingPoint NDR encoding examples http://dvlabs.tippingpoint.com/blog/2007/11/24/msrpc tippingpoint ndr types Technical analysis http://www.dontstuffbeansupyournose.com/?p=35