master class: protocol interoperability

79
MASTER CLASS INTEROPERABILITY JULIEN KERIHUEL / @jkerihuel | 23/01/2015

Upload: julien-kerihuel

Post on 07-Aug-2015

108 views

Category:

Engineering


3 download

TRANSCRIPT

MASTER CLASS INTEROPERABILITY

JULIEN KERIHUEL / @jkerihuel | 23/01/2015

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 2 of 79 2 of 79

INTEROPERABILITY: THROUGH DCE/RPC HISTORY

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 3 of 79

WHAT IS DCE/RPC?

● DCE for Distributed Computing Environment● RPC for Remote Procedure Calls

“ This system allows programmers to write distributed software as if it were all working on the same computer, without having to worry about the underlying network code.”

Source: wikipedia

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 4 of 79

HISTORY OF DCE/RPC

● Idea of RPC in 1976 [RFC-707]

● OSF DCE/RPC Request for Technology– OSF DCE 1.1 Reference implementation published in 1993 (250K LOC, OSF 1.0 BSD-compatible license)– OSF DCE 1.2.2 on top of DCE/RPC 1.1 in 1996 (3.5 millions LOC, price per copy)

● Released under LGPL in 2005: FreeDCE implementation in Linux 2.4.X and 2.6.X

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 5 of 79

THE BIRTH OF MSRPC

● A Question of money● Lead to significant DCE/RPC improvements

– Transport over Named Pipes (NCACN_NP)– NTLM / GSSAPI– UNICODE support– IDL extensions

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 6 of 79

WHAT IS INTEROPERABILITY?

“The ability of making systems and organizations work together: inter-operate”

Compatibility vs de facto Standard vs Interoperability

Source: wikipedia

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 7 of 79

COMPATIBILITY DIFFERENT FROM INTEROPERABILITY

When two systems communicate together

Image: Camille Moulin

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 8 of 79

DE FACTO STANDARD DIFFERENT FROM INTEROPERABILITY

When dominant position lead other actors to be compatible with it

Master (1) / Slave (n) relationship

Open Standard / Closed Standard

Image: Camille Moulin

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 9 of 79

INTEROPERABILITY

N to N communication – not dependent of a 3rd party vendor

“Everybody talks the same language without restrictions”

Image: Camille Moulin

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 10 of 79

THE PATH TO INTEROPERABILITY

● Free Software is the link from standard to interoperability● Open Specifications

Image: Camille Moulin

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 11 of 79

INTEROPERABILITY AND OPENESS

● Closed protocols provide security by obfuscation● It is bad practice● Remember Blaster or Sasser worms?

Image: Camille Moulin

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 12 of 79 12 of 79

PROTOCOL ANALYSIS: DEFINITION/TECHNIQUES

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 13 of 79

PROTOCOL ANALYSIS DEFINITION

● It is the core methodology involved in Samba and OpenChange● Unique requirements are:

– Network packet analyzer– Methodology and Commitment

● Different from reverse engineering because no binary analysis or decompilation

Image: Camille Moulin

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 14 of 79

FRENCH CAFE TECHNIQUE

Robert Doisneau, 1966

THE CONCEPT

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 15 of 79

FRENCH CAFE TECHNIQUE

SambaXP 2005

THE REALITY

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 16 of 79

FRENCH CAFE TECHNIQUE

1. LISTEN AND REPEAT

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 17 of 79

FRENCH CAFE TECHNIQUE

1. LISTEN AND REPEAT

2. SWEAR WORDS AND ERROR PACKETS

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 18 of 79

FRENCH CAFE TECHNIQUE

1. LISTEN AND REPEAT

2. SWEAR WORDS AND ERROR PACKETS

3. WRITE A PROTOCOL SCANNER

1. Append additional blank bytes until the server changes its response in some way

2. Change additional bytes until server accepts it

3. Figure out what the command does

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 19 of 79

FRENCH CAFE TECHNIQUE

1. LISTEN AND REPEAT

2. SWEAR WORDS AND ERROR PACKETS

3. WRITE A PROTOCOL SCANNER

4. DIFFERENTIAL TECHNIQUE

1. Discover interactions between different command words

2. Change custom server until it behaves like real one

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 20 of 79

FRENCH WAITER TECHNIQUE

Switch roles and analyze customer's reaction

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 21 of 79

FRENCH WAITER TECHNIQUE

1. SALT COFFEE

1. Silently drink it?

2. Ask for another one?

3. Swear and Leave?

Salt shaker on white background" by Dubravko Sorić SoraZG on Flickr - http://www.flickr.com/photos/11939863@N08/3793288383/in/photostream/.

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 22 of 79

FRENCH WAITER TECHNIQUE

1. SALT COFFEE

2. IGNORE CUSTOMER CALLS

1. How long does he wait?

2. Call manager or other waiter?

3. Move to the café next door?

Image: photostock / FreeDigitalPhotos.net

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 23 of 79

FRENCH WAITER TECHNIQUE

1. SALT COFFEE

2. IGNORE CUSTOMER CALLS

3. PRETEND YOU DON'T UNDERSTAND FRENCH

1. How many tries before he leaves?

2. Does the client order in another language?

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 24 of 79

MIDL DECOMPILER

● Muddle: first MIDL decompiler ● Written by Matt Chapmann in 2000● Controversial and imperfect technique● Process RPC Service's executable to return IDL file● IDL - Interface Description Language

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 25 of 79 25 of 79

INTEROPERABILITY BY EXAMPLE

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 26 of 79

THE EXCHANGE LOGON CASE

Let's run a network analysis session on Exchange MAPI Logon

and figure out the IDL of the RPC call

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 27 of 79

NETWORK DATA REPRESENTATION

● Used by DCE/RPC and MSRPC for data marshalling/unmarshalling● Transfer syntax● Provides primitives and complex types● Little-endian based (least significant bit first)● Alignment enforced● http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 28 of 79

EXCHANGE LOGON: SDK & CAPTURE

1. Write a atomic program using MAPI SDK that logs onto Exchange Server

2. Capture the traffic with Wireshark and export stub data

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 29 of 79

EXCHANGE LOGON: HEXDUMP

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 30 of 79

EXCHANGE LOGON: HEXDUMP AND PROCESSING$ hexdump ­C <pkt>

00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

handle: struct policy_handle handle_type : 0x00000000 (0) uuid : 15c7f283-6674-4715-9933-ac9ffdbf2408

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 31 of 79

EXCHANGE LOGON: HEXDUMP AND PROCESSING$ hexdump ­C <pkt>

00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 32 of 79

EXCHANGE LOGON: HEXDUMP AND PROCESSING$ hexdump ­C <pkt>

00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 33 of 79

EXCHANGE LOGON: HEXDUMP AND PROCESSING$ hexdump ­C <pkt>

00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 34 of 79

EXCHANGE LOGON: HEXDUMP AND PROCESSING$ hexdump ­C <pkt>

00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 35 of 79

EXCHANGE LOGON: HEXDUMP AND PROCESSING$ hexdump ­C <pkt>

00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 36 of 79

EXCHANGE LOGON: HEXDUMP AND PROCESSING$ hexdump ­C <pkt>

00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 37 of 79

EXCHANGE LOGON: HEXDUMP AND PROCESSING$ hexdump ­C <pkt>

00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 38 of 79

EXCHANGE LOGON: HEXDUMP AND PROCESSING$ hexdump ­C <pkt>

00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 39 of 79

EXCHANGE LOGON: HEXDUMP AND PROCESSING$ hexdump ­C <pkt>

00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 40 of 79

EXCHANGE LOGON: Generate IDL with unknown fields[public,noprint] MAPISTATUS EcDoRpcExt2(

[in] policy_handle               *handle,[in] uint32                   *unknown1,[in, size_is(unknown3)]uint8 unknown2[],[in] uint32                   unknown3,[in] uint32                   *unknown4,[in, size_is(unknown6)]uint8    unknown5[],[in] uint32                   unknown6,[in] uint32                   *unknown7,

);

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 41 of 79

EXCHANGE LOGON: Generate IDL with unknown fields[public,noprint] MAPISTATUS EcDoRpcExt2(

[in] policy_handle               *handle,[in] uint32                   *unknown1,[in, size_is(unknown3)]uint8 unknown2[],[in] uint32                   unknown3,[in] uint32                   *unknown4,[in, size_is(unknown6)]uint8    unknown5[],[in] uint32                   unknown6,[in] uint32                   *unknown7,

);

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 42 of 79

EXCHANGE LOGON: Generate IDL with unknown fields[public,noprint] MAPISTATUS EcDoRpcExt2(

[in] policy_handle               *handle,[in] uint32                   *unknown1,[in, size_is(unknown3)]uint8 unknown2[],[in] uint32                   unknown3,[in] uint32                   *unknown4,[in, size_is(unknown6)]uint8    unknown5[],[in] uint32                   unknown6,[in] uint32                   *unknown7,

);

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 43 of 79

EXCHANGE LOGON: Generate IDL with unknown fields[public,noprint] MAPISTATUS EcDoRpcExt2(

[in] policy_handle               *handle,[in] uint32                   *unknown1,[in, size_is(unknown3)]uint8 unknown2[],[in] uint32                   unknown3,[in] uint32                   *unknown4,[in, size_is(unknown6)]uint8    unknown5[],[in] uint32                   unknown6,[in] uint32                   *unknown7,

);

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 44 of 79

EXCHANGE LOGON: Generate IDL with unknown fields[public,noprint] MAPISTATUS EcDoRpcExt2(

[in] policy_handle               *handle,[in] uint32                   *unknown1,[in, size_is(unknown3)]uint8 unknown2[],[in] uint32                   unknown3,[in] uint32                   *unknown4,[in, size_is(unknown6)]uint8    unknown5[],[in] uint32                   unknown6,[in] uint32                   *unknown7,

);

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 45 of 79

EXCHANGE LOGON: Generate IDL with unknown fields[public,noprint] MAPISTATUS EcDoRpcExt2(

[in] policy_handle               *handle,[in] uint32                   *unknown1,[in, size_is(unknown3)]uint8 unknown2[],[in] uint32                   unknown3,[in] uint32                   *unknown4,[in, size_is(unknown6)]uint8    unknown5[],[in] uint32                   unknown6,[in] uint32                   *unknown7,

);

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 46 of 79

EXCHANGE LOGON: the blob mistery

● With our IDL we don't have much info about Logon● The solution may lie in the blobs we reasonably identified

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 47 of 79

EXCHANGE LOGON: deeper underground

● Can we identify another structure within the blob?

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 48 of 79

EXCHANGE LOGON: deeper underground

● Can we identify another structure within the blob?

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 49 of 79

EXCHANGE LOGON: deeper underground

● Can we identify another structure within the blob?

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 50 of 79

EXCHANGE LOGON: deeper underground

● Can we identify another structure within the blob?

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 51 of 79

EXCHANGE LOGON: deeper underground

● Can we identify another structure within the blob?

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 52 of 79

EXCHANGE LOGON: deeper underground

● Strange … no 0x0● Very strange … lots of 0xa5● Very strange … 0x5a is the reverse of 0xa5

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 53 of 79

EXCHANGE LOGON: deeper underground

● XOR 0xA5

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 c6 a5 5b a5  a5 a4 a9 a1 a5 a5 a5 a5  |g.g...[.........|00000030  a5 a5 f6 a5 8a ca 98 e3  cc d7 d6 d1 85 ea d7 c2  |................|00000040  c4 cb cc df c4 d1 cc ca  cb 8a ca d0 98 e3 cc d7  |................|00000050  d6 d1 85 e4 c1 c8 cc cb  cc d6 d1 d7 c4 d1 cc d3  |................|00000060  c0 85 e2 d7 ca d0 d5 8a  c6 cb 98 f7 c0 c6 cc d5  |................|00000070  cc c0 cb d1 d6 8a c6 cb  98 e4 c1 c8 cc cb cc d6  |................|00000080  d1 d7 c4 d1 ca d7 a5 5a  5a 5a 5a 00 6f 00 00 00  |.......ZZZZ.o...|00000090  07 80 00 00 30 00 00 00  00 00 06 00 28 00 28 00  |....0.......(.(.|000000a0  ad a5 a4 a4 a4 a5 a7 a5  b5 a5 a4 a9 d9 a5 a5 a5  |................|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 54 of 79

EXCHANGE LOGON: deeper underground

● XOR 0xA5

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 63 00 fe 00  00 01 0c 04 00 00 00 00  |....c...........|00000030  00 00 53 00 2f 6f 3d 46  69 72 73 74 20 4f 72 67  |..S./o=First Org|00000040  61 6e 69 7a 61 74 69 6f  6e 2f 6f 75 3d 46 69 72  |anization/ou=Fir|00000050  73 74 20 41 64 6d 69 6e  69 73 74 72 61 74 69 76  |st Administrativ|00000060  65 20 47 72 6f 75 70 2f  63 6e 3d 52 65 63 69 70  |e Group/cn=Recip|00000070  69 65 6e 74 73 2f 63 6e  3d 41 64 6d 69 6e 69 73  |ients/cn=Adminis|00000080  74 72 61 74 6f 72 00 ff  ff ff ff                 |trator..........|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 55 of 79

EXCHANGE LOGON: deeper underground

● Welcome to the MAPI decoding world

$ hexdump ­C <pkt>00000000  00 00 00 00 83 f2 c7 15  74 66 15 47 99 33 ac 9f  |........tf.G.3..|00000010  fd bf 24 08 00 00 00 00  6f 00 00 00 00 00 06 00  |..$.....o.......|00000020  67 00 67 00 63 00 fe 00  00 01 0c 04 00 00 00 00  |....c...........|00000030  00 00 53 00 2f 6f 3d 46  69 72 73 74 20 4f 72 67  |..S./o=First Org|00000040  61 6e 69 7a 61 74 69 6f  6e 2f 6f 75 3d 46 69 72  |anization/ou=Fir|00000050  73 74 20 41 64 6d 69 6e  69 73 74 72 61 74 69 76  |st Administrativ|00000060  65 20 47 72 6f 75 70 2f  63 6e 3d 52 65 63 69 70  |e Group/cn=Recip|00000070  69 65 6e 74 73 2f 63 6e  3d 41 64 6d 69 6e 69 73  |ients/cn=Adminis|00000080  74 72 61 74 6f 72 00 ff  ff ff ff                 |trator..........|000000b0  a5 a5 a5 a5 a4 a5 a5 a5  b5 a5 a4 a9 d8 a5 a5 a5  |................|000000c0  d8 a5 a5 a5 a4 a5 a5 a5  30 00 00 00 08 10 00 00  |........0.......|

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 56 of 79

EXCHANGE LOGON: deeper underground

KEEP CALM AND DO NOT PANIC

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 57 of 79

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 58 of 79

THE RDESKTOP CASE

● Free client for RDP (Remote Desktop Protocol) used by Terminal Services Server● Developed by Matt Chapmann

Problem: RDP 4 & 5 communication are encrypted

WORKAROUND?

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 59 of 79

THE RDESKTOP CASE

Encrypted login packet BUT unencrypted transfer of other packets

$ rdesktop -hrdesktop: A Remote Desktop Protocol client.Version 1.7.1. Copyright (C) 1999-2011 Matthew Chapman et al.See http://www.rdesktop.org/ for more information.

Usage: rdesktop [options] server[:port][...] -e: disable encryption (French TS) -E: disable encryption from client to server -m: do not send motion events

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 60 of 79 60 of 79

THE OPENCHANGE CASE

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 61 of 79

2003: THE STARTING POINT - EPITECH

ZERO TO ONE EXPERIMENT

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 62 of 79

2005: THE MENTOR

ANDREW TRIDGELL (TRIDGE)FOUNDER OF THE SAMBA PROJECT

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 63 of 79

2006: THE HAPPY UNDERLINE

3 Decembre 2006:

Exchange Account created with OpenChange Server

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 64 of 79

2007: FIRST OPENCHANGE CLIENT LIBRARY RELEASE

● LibMAPI-0.2 MAILOOK Release @ SAMBAXP 2007

● GNOME Evolution Plugin based on libmapi released

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 65 of 79

2008: Open Specifications Program

Microsoft releases documentation on Exchange protocols

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 66 of 79

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 67 of 79

2008-2010: WAN ACCELERATION AND MAPIPROXY ERA

● Lay the foundations of current server architecture ● MITM Proxy && Stackable modules

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 68 of 79

2010-2012: First Storage Back Development for Server

● SOGo backend● Technology Preview● Backend developed in objective-C● Plugs onto services like Dovecot, Postfix, MySQL

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 69 of 79

2013-2015: Zentyal & Pivot

● Joined Zentyal as CTO● Development of OpenChange technology● Took the lead on openchange-sogo backend development● Hard learning curve for new openchange developers

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 70 of 79

2014-2015: Soften the Learning Curve

● Objectives:● Write OpenChange backends very quickly● Abstract MAPI complexity to the maximum

●Technology:● Python-C gateway● REST API

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 71 of 79 71 of 79

DEVELOPER PROGRAM

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 72 of 79

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 73 of 79

OBJECTIVES

● technical contest opened to open source developers, and aiming at challenging your innovation skills.

● manipulate Exchange protocols data to twist Microsoft Outlook graphical interface and make it do unexpected and amazing things.

● Leverage the Python-C gateway and REST-API to start very quickly

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 74 of 79

HOW DOES IT WORK?

● Decide to work alone or join a team● Register on http://www.protocolsplugfest.com/europe/developer-program/● Write your backend● Publish it on github repository under the terms of GPLv3 or later● 30th March 2015: deadline for submission● 5th April 2015: Finalist teams announced

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 75 of 79

PRICES

● INDUSTRY PASS TO PROTOCOLS PLUGFEST● 3 DAYS STANCE TO ATTEND PROTOCOLS PLUGFEST● 20 MINUTES TO PRESENT THE PROJECT IN THE EVENT MAIN TRACK

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 76 of 79

POSSIBLE PROJECT TOPICS

Social mediaBig dataStorage

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 77 of 79

PREPARE DEVELOPMENT ENVIRONMENT

1. Clone openchange-docker repository:

1. git clone https://github.com/openchange/docker

2. Clone openchange repo with Python-C/REST API support

1. git clone https://github.com/openchange/openchange

2. cd openchange

3. git fetch && git checkout jkerihuel/mapistore-python

3. Install docker 1.4.1

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 78 of 79

PREPARE DEVELOPMENT ENVIRONMENT

DEMO

PROTOCOLS PLUGFEST EUROPE 2015 | PRESENTATION'S TITLE (UPPERCASE) 79 of 79 79 of 79

QUESTIONS?

http://www.protocolsplugfest.com@plugfestcon