127
WSUSPENDU / 125 Yves Le Provost & Romain Coltel ANSSI WSUSpendu USE WSUS TO HANG ITS CLIENTS WEDNESDAY , 26 TH JULY 2017 YVES LE PROVOST & ROMAIN COLTEL

WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

ANSSI

WSUSpenduUSE WSUS TO HANG ITS CLIENTS

WEDNESDAY, 26TH JULY 2017

YVES LE PROVOST & ROMAIN COLTEL

Page 2: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Who we are, what we do…

2

- Yves Le Provost- Security auditor for more than 10 years- Currently works for French cyber defense Agency (ANSSI)- Specializes in SCADA and database assessments, but masters any other field ;-)

- Romain Coltel- Former security auditor- Currently works for a disruptive startup- Developing next-gen Active Directory security product

Page 3: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel 3

How do you compromise anActive Directory domain?

Page 4: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Sample of an Active Directory domain

4

Servers Domain controllersUsers workstations

Page 5: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

First step

5

Servers Domain controllersUsers workstations

1. Targeted phishing email, with malware: get a foothold in the network

Page 6: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Next step

6

Servers Domain controllersUsers workstations

2. Propagate compromise between workstations until…

Page 7: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Next step

7

Servers Domain controllersUsers workstations

3. You get a server administrative account, and use it to continue propagation…

Page 8: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Next step

8

Servers Domain controllersUsers workstations

4. Until you get an Active Directory administrative account

Page 9: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Next step

9

Servers Domain controllersUsers workstations

5. Get domain secrets

Page 10: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Game over

10

Servers Domain controllersUsers workstations

6. Use secrets to access all data

Page 11: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel 11

How do you compromise anESAE-managed forest?

Page 12: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Classic administration

12

Production forest(s)

Admin workstations Various resources

Page 13: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Tier administration model

13

Tier 0

Tier 1

Tier 2

Production forest(s)

Control of enterprise identities in the environment

Control of enterprise servers and applications

Control of user workstations and devices

Page 14: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Better administration

14

Production forest(s)

Tier 0

Tier 2

Tier 1

Reference: https://docs.microsoft.com/en-us/windows-server/identity/securing-privileged-access/securing-privileged-access-reference-material

Page 15: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

So, what is an ESAE?

15

Tier 0

Tier 1

Tier 2

Production forest(s) ESAE

- Single forest, single domain- One-way trust, using selective authentication, with the

production forest(s) - Contains small number of ESAE administrative accounts

- Dedicated to ESAE- Contains production forest(s) tier 0 administrators

- Simple users in the ESAE forest- Only connect to tier 0 resources on production- Highly secured accounts

- Workstations/servers hardened

Enhanced Security Administrative Environment

Page 16: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Why use an ESAE?

16

Servers Domain controllersUsers workstations

Page 17: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Why use an ESAE?

17

Tier 1 Tier 0Tier 2

Page 18: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Why use an ESAE?

18

- Helps protect tier 0 resources against compromise- Which helps to protect against an overall compromise

Page 19: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Why use an ESAE?

19

- Helps protect tier 0 resources against compromise- Which helps to protect against an overall compromise

- Can use the same Active Directory account to administrate multiple forests- In fact, don’t use an ESAE for only one forest…

Page 20: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Why use an ESAE?

20

- Helps protect tier 0 resources against compromise- Which helps to protect against an overall compromise

- Can use the same Active Directory account to administrate multiple forests- In fact, don’t use an ESAE for only one forest…

- Doesn’t protect enterprise’s assets, but a mandatory step to get to that

Page 21: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel 21

How do you compromise anESAE-managed forest?

Well, you can’t, that’s the point.

Page 22: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

What if a WSUS server serves updates to the DCs?

22

?

WSUS server

Tier 1 Tier 0Tier 2

Page 23: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel 23

Can you compromise anESAE-managed forest using a WSUS server?

Page 24: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Windows Server Update Services (WSUS) architecture

24

WSUS server

Enterprise network

HTTPS

WSUS clients

Microsoft Updatewww

Page 25: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Windows Server Update Services (WSUS) architecture

25

WSUS server

Enterprise network

HTTP

WSUS clients

Microsoft Updatewww

HTTPS

Page 26: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Windows Server Update Services (WSUS) architecture

26

WSUS server

Enterprise network

HTTP

WSUS clients

Microsoft Updatewww

HTTPS

Page 27: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

WSUS server components

27

Windows service

Database

Web service

Synchronization

Deployment

WSUS server

WSUS clients

Microsoft Update

Page 28: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

28

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

Page 29: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

29

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

1. Windows service downloads update metadata (binaries size, download URL, command-line arguments, …)

Page 30: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

30

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

2. Windows service transmits the metadata to the database

Page 31: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

31

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

3. The database uses functions to parse metadata inputs, incorporates them into its tables

Page 32: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

32

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

4. Updates are approved, either by an admin or by automatic approval rules

Page 33: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

33

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

5. Approved updates binaries (psf, cab, exe, …) are downloaded

Page 34: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

34

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

6. Each binary signature is checked

Page 35: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

35

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

7. Each binary is stored for the Web service to be able to get them

Page 36: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

36

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

8. Clients are looking for new updates ; Web service gets approved updates metadata from the database

Page 37: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

37

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

9. Web service transmits the metadata to the WSUS clients

Page 38: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

38

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

10. Each client evaluates if the updates is installable

Page 39: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

39

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

11. If an update is installable on a client, the associated binary is downloaded

Page 40: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

40

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

12. Each downloaded binary’s signature is checked

Page 41: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates journey within a WSUS server

41

Windows service

Database

Web service

WSUS server

WSUS clients

Microsoft Update

13. Each binary is executed, with SYSTEM privileges, with possible command line parameters from the metadata

Page 42: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to connect to the database

42

HKLM\Software\Microsoft\Update Services\Server\Setup

Initial configuration

Page 43: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to connect to the database

43

HKLM\Software\Microsoft\Update Services\Server\Setup

SqlServerName = "MICROSOFT##WID" →

Page 44: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

What’s in the database?

44

Everything:- Full WSUS configuration- Updates metadata- Approvement states- …

Some stats:- 31 views- 35 triggers- 52 functions- 108 tables- 380 stored procedures

Page 45: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

State-of-the-art

45

WSUS attacks: Black Hat USA 2015, WSUSpect

Microsoft Update

Enterprise network

WSUS clients

WSUS server

Page 46: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

State-of-the-art

46

Microsoft Update

Enterprise network

WSUS server

WSUSpect

1. Get a mitm position

WSUS clients

Page 47: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

State-of-the-art

47

Microsoft Update

Enterprise network

WSUS server

WSUSpect

2. Intercepts new update queries

WSUS clients

Page 48: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

State-of-the-art

48

Microsoft Update

Enterprise network

WSUS server

WSUSpect

3. Infects the on-network metadata with a new, malicious update

WSUS clients

Page 49: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

State-of-the-art

49

Microsoft Update

Enterprise network

WSUS server

WSUSpect

4. The client sees a new available and installable update

WSUS clients

Page 50: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

State-of-the-art

50

Microsoft Update

Enterprise network

WSUS server

WSUSpect

5. Fetches the related binary

WSUS clients

Page 51: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

State-of-the-art

51

Microsoft Update

Enterprise network

WSUS server

WSUSpect

6. Checks if binary signature is okay: it is.

WSUS clients

Page 52: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

State-of-the-art

52

Microsoft Update

Enterprise network

WSUS server

WSUSpect

7. Installs the binary, with SYSTEM privileges, with metadata command-line arguments

WSUS clients

Page 53: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

State-of-the-art

53

WSUS attacks: Black Hat USA 2015, WSUSpect

Awesome attack!

But some limitations:- Gain a mitm position

- Meaning no network limitation is in place- Get a useful one

- Meaning TLS has to be disabled

Doesn’t give us access to the ESAE-managed domain controllers

Page 54: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

So, where are we?

54

We know:- That injecting into the metadata between WSUS server/client is possible- Where metadata are stored: in the database- How to connect to this database

We want:- To inject a metadata to compromise a client, without a network attack

Page 55: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

So, where are we?

55

We know:- That injecting into the metadata between WSUS server/client is possible- Where metadata are stored: in the database- How to connect to this database

We want:- To inject a metadata to compromise a client, without a network attack

So, let’s try to inject a new update into the database!

Page 56: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

So, where are we?

56

We know:- That injecting into the metadata between WSUS server/client is possible- Where metadata are stored: in the database- How to connect to this database

We want:- To inject a metadata to compromise a client, without a network attack

So, let’s try to inject a new update into the database!

…let’s start by studying how updates are inserted…

Page 57: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to check for inserted rows on SQLServer?

57

First try:- Look for update information in tables

Page 58: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to check for inserted rows on SQLServer?

58

First try:- Look for update information in tables- Find update information in some tables

Page 59: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to check for inserted rows on SQLServer?

59

First try:- Look for update information in tables- Find update information in some tables- Try to insert data in one of the identified tables

Page 60: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to check for inserted rows on SQLServer?

60

First try:- Look for update information in tables- Find update information in some tables- Try to insert data in one of the identified tables- Get slapped by a trigger…

Page 61: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to check for inserted rows on SQLServer?

61

First try:- Look for update information in tables- Find update information in some tables- Try to insert data in one of the identified tables- Get slapped by a trigger…- Read and understand the trigger

Page 62: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to check for inserted rows on SQLServer?

62

First try:- Look for update information in tables- Find update information in some tables- Try to insert data in one of the identified tables- Get slapped by a trigger…- Read and understand the trigger- Try to respect this trigger by inserting into another table

Page 63: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to check for inserted rows on SQLServer?

63

First try:- Look for update information in tables- Find update information in some tables- Try to insert data in one of the identified tables- Get slapped by a trigger…- Read and understand the trigger- Try to respect this trigger by inserting into another table- Second slap, this time by a foreign key…

Page 64: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to check for inserted rows on SQLServer?

64

First try:- Look for update information in tables- Find update information in some tables- Try to insert data in one of the identified tables- Get slapped by a trigger…- Read and understand the trigger- Try to respect this trigger by inserting into another table- Second slap, this time by a foreign key…- Study the relation between tables

Page 65: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to check for inserted rows on SQLServer?

65

First try:- Look for update information in tables- Find update information in some tables- Try to insert data in one of the identified tables- Get slapped by a trigger…- Read and understand the trigger- Try to respect this trigger by inserting into another table- Second slap, this time by a foreign key…- Study the relation between tables- Take an aspirin

Page 66: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to check for inserted rows on SQLServer?

66

First try:- Look for update information in tables- Find update information in some tables- Try to insert data in one of the identified tables- Get slapped by a trigger…- Read and understand the trigger- Try to respect this trigger by inserting into another table- Second slap, this time by a foreign key…- Study the relation between tables- Take an aspirin- Try to insert data into a table to respect the trigger and the foreign keys constraints

Page 67: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to check for inserted rows on SQLServer?

67

First try:- Look for update information in tables- Find update information in some tables- Try to insert data in one of the identified tables- Get slapped by a trigger…- Read and understand the trigger- Try to respect this trigger by inserting into another table- Second slap, this time by a foreign key…- Study the relation between tables- Take an aspirin- Try to insert data into a table to respect the trigger and the foreign keys constraints- Get kicked by another trigger

Page 68: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to check for inserted rows on SQLServer?

68

First try:- Look for update information in tables- Find update information in some tables- Try to insert data in one of the identified tables- Get slapped by a trigger…- Read and understand the trigger- Try to respect this trigger by inserting into another table- Second slap, this time by a foreign key…- Study the relation between tables- Take an aspirin- Try to insert data into a table to respect the trigger and the foreign keys constraints- Get kicked by another trigger…- Throw laptop across the room

Page 69: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to check for inserted rows on SQLServer?

69

Second try:- Define triggers on tables (remember: 108 tables) to trace inserts- Get SQLServer to activate audit logs

Way too complicated…

Page 70: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

SQL profiler to the rescue

70

- Monitors SQL queries as done on the database- Use it while WSUS is synchronizing with Microsoft Update

Import update sample:

Notice the horizontal slider? It’s a very large XML

Page 71: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Isolate the right calls

71

- WSUS service is only using stored procedure calls

- Calls five stored procedures to insert one update:- spImportUpdate- spSaveXmlFragment (actually called a bunch of times)- spSetBatchURL- spDeploymentAutomation- spProcessPrerequisitesForRevision

Page 72: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Isolate the right calls

72

- WSUS service is only using stored procedure calls

- Calls five stored procedures to insert one update:- spImportUpdate- spSaveXmlFragment (actually called a bunch of times)- spSetBatchURL- spDeploymentAutomation- spProcessPrerequisitesForRevision

Page 73: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Copy/Paste a valid update

73

- Lessons learned:- Image-typed columns can store cab files

- Which can store a file named “blob”- Which can store an even bigger XML- Ones bigger than SQLServer’s NVARCHAR max size (8K)

spSaveXmlFragment NULL,4D53434600000000FB07…

MSCF: Cabinet file

“blob”

Page 74: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Copy/Paste a valid update

74

- Lessons learned:- Minimalization cannot be pushed too far

- Works on Windows 7 and Windows 10:1607

1607

Page 75: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Copy/Paste a valid update

75

- Lessons learned:- Minimalization cannot be pushed too far

- Works on Windows 7 and Windows 10:1607- Doesn’t work on versions in-between- Doesn’t work on server versions

2008(R2) 2012(R2) 2016

1511 1607

Page 76: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Introducing WSUSpendu@

76

Microsoft Updatewww

Enterprise network

Open-source: https://github.com/AlsidOfficial/WSUSpendu

@Thx Maman

WSUS clients

WSUSserver

Page 77: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Introducing WSUSpendu

77

Microsoft Updatewww

Enterprise network

1. Injects update metadata in the database, signed binary in the Web service

WSUS clients

WSUSserver

Page 78: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Introducing WSUSpendu

78

Microsoft Updatewww

Enterprise network

2. The client sees a new available and installable update

WSUS clients

WSUSserver

Page 79: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Introducing WSUSpendu

79

Microsoft Updatewww

Enterprise network

3. Fetches the related binary

WSUS clients

WSUSserver

Page 80: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Introducing WSUSpendu

80

Microsoft Updatewww

Enterprise network

4. Checks if binary signature is okay: it is.

WSUS clients

WSUSserver

Page 81: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Introducing WSUSpendu

81

Microsoft Update

WSUSserver

www

Enterprise network

5. Installs the binary, with SYSTEM privileges, with metadata command-line arguments

WSUS clients

Page 82: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Demonstration…

82

Page 83: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

What if a WSUS server serves updates to the DCs?

83

WSUS server

Tier 1 Tier 0Tier 2

?

Page 84: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Compromise an ESAE-managed forest

84

WSUS server

Tier 1 Tier 0Tier 2

Page 85: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Compromise an ESAE-managed forest

85

WSUS server

Tier 1 Tier 0Tier 2

Page 86: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Sometimes, even compromise the ESAE forest itself

86

Tier 0

Tier 1

Tier 2

Production forest(s) ESAE

- WSUS server in the ESAE, which distributes its updates to the ESAE resources

Page 87: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Sometimes, even compromise the ESAE forest itself

87

Tier 0

Tier 1

Tier 2

Production forest(s) ESAE

- WSUS server in the ESAE, which distributes its updates to the ESAE resources

- This WSUS server takes its updates from the production environment

- Not in Microsoft ESAE’s blueprint, but happens ¯\(ツ)/¯

Page 88: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Sometimes, even compromise the ESAE forest itself

88

Tier 0

Tier 1

Tier 2

Production forest(s) ESAE

- WSUS server in the ESAE, which distributes its updates to the ESAE resources

- This WSUS server takes its updates from the production environment

- Not in Microsoft ESAE’s blueprint, but happens ¯\(ツ)/¯

- Technically possible due to WSUS server-chaining

Page 89: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Upstream/Downstream update servers notion

89

Enterprise network

HTTPS

HTTPMicrosoft Update

www

WSUS clients

WSUS

Page 90: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Upstream/Downstream update servers notion

90

Enterprise network

HTTPS

HTTPMicrosoft Update

www

WSUS1 clients

WSUS1

WSUS2

Page 91: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Upstream/Downstream update servers notion

91

Enterprise network

HTTPS

HTTPMicrosoft Update

www

WSUS1 clients

WSUS1

WSUS2

WSUS2 clients

Page 92: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Upstream/Downstream update servers notion

92

Enterprise network

HTTPS

HTTP

WSUS clients

Microsoft Updatewww

WSUSUpstream

WSUSDownstream

WSUS clients

Page 93: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Upstream/Downstream update servers notion

93

Enterprise network

HTTPS

HTTPMicrosoft Update

www

WSUS clients

WSUSUpstream

WSUSDownstream

WSUS clients

Page 94: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Upstream/Downstream update servers notion

94

Enterprise network

HTTPS

HTTPMicrosoft Update

www

WSUS clients

WSUSUpstream

WSUSDownstream

WSUS clients

Page 95: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Upstream/Downstream update servers notion

95

Enterprise network

HTTPS

HTTPMicrosoft Update

www

WSUS clients

WSUSDownstream

WSUSDownstream

WSUS clients

Page 96: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Upstream/Downstream update servers notion

96

Enterprise network

HTTPS

HTTPMicrosoft Update

www

Upstream

WSUS clients

WSUSDownstream

WSUS clients

WSUSDownstream

Page 97: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel 97

Compromising Microsoft’s most secureenvironment was almost too easy.

Page 98: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel 98

We need to go deeper…

Page 99: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Disconnected network case

99

Internet-connected network

Page 100: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Disconnected network case

100

Internet-connected network Disconnected network

Physical boundary

Page 101: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Using disconnected network

101

Why?- Protect sensitive data, classified information- Protect industrial networks- Just don’t want to be connected to the Internet…

Page 102: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Using disconnected network

102

Why?- Protect sensitive data, classified information- Protect industrial networks- Just don’t want to be connected to the Internet…

For which security improvement?- Isolation as protection- "No reach, no issue"

Page 103: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Using disconnected network

103

Why?- Protect sensitive data, classified information- Protect industrial networks- Just don’t want to be connected to the Internet…

For which security improvement?- Isolation as protection- "No reach, no issue"

Is it sufficient? … Due to sensitivity, you have to:- continue securing your network/servers/apps/…- thus, stay up-to-date

Page 104: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates for disconnected network

104

Enterprise network

HTTPS

HTTP

WSUS clients

Microsoft Updatewww

WSUS

Page 105: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates for disconnected network

105

Enterprise network

HTTPS

HTTP

WSUS clients

Microsoft Updatewww

External device

WSUS

Page 106: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Updates for disconnected network

106

External device

WSUS

Enterprise network

HTTPS

HTTP

WSUS clients

Microsoft Updatewww

WSUS on disconnected network

Page 107: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Get updates to the disconnected network

107

Microsoft solution:

- wsusutil, export / import tool for metadata

- Binaries need to be transfered manually

Page 108: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Get updates to the disconnected network

108

Microsoft solution:

- wsusutil, export / import tool for metadata

- Binaries need to be transfered manually

Mostly-used solution:

- WSUS on a Virtual Machine

- Clone the VM

- Transfer the clone onto the disconnected network

Page 109: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

WSUSpendu & disconnected network

109

Once metadata are imported, still needs approbation

- Approbation through auto-approval rules

- Social Engineering

Airgap-attack ready

- Inject malicious update in database

- Disconnected database is syncronised with connected database

- Update is approved and deployed

- Payload is executed on designated target…

Page 110: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Demonstration…

110

Page 111: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Compromise a disconnected network

111

Internet-connected network Disconnected network

Physical boundary

Page 112: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Compromise a disconnected network

112

Internet-connected network Disconnected network

Physical boundary

Page 113: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Compromise a disconnected network

113

Internet-connected network Disconnected network

Physical boundary

Page 114: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel 114

That’s scary and all good, buthow do I protect myself?

Page 115: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to protect your architecture

115

WSUS recommendations- Activate TLS

Page 116: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to protect your architecture

116

WSUS server

Tier 1 Tier 0Tier 2

www

WSUS recommendations- Activate TLS- Include WSUS server in tier-0

Page 117: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to protect your architecture

117

Tier 1 Tier 0Tier 2

www

WSUS recommendations- Activate TLS- Include WSUS server in tier-0

Page 118: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to protect your architecture

118

Tier 1 Tier 0Tier 2

www

WSUS recommendations- Activate TLS- Include WSUS server in tier-0

Page 119: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to protect your architecture

119

Tier 1 Tier 0Tier 2

www

WSUS recommendations- Activate TLS- Include WSUS server in tier-0

Page 120: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to protect your architecture

120

WSUS server

Tier 1 Tier 0Tier 2

www

WSUS recommendations- Activate TLS- Include WSUS server in tier-0

Page 121: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to protect your architecture

121

www

Internet-connected network Disconnected networkPhysical boundary

WSUS recommendations- Activate TLS- Include WSUS server in tier-0- Independant network Independant WSUS server

Page 122: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to protect your architecture

122

www

Internet-connected network Disconnected networkPhysical boundary

Dedicated network

WSUS recommendations- Activate TLS- Include WSUS server in tier-0- Independant network Independant WSUS server

Page 123: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to protect your architecture

123

www

Internet-connected network Disconnected networkPhysical boundary

Dedicated network

WSUS recommendations- Activate TLS- Include WSUS server in tier-0- Independant network Independant WSUS server

Page 124: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

How to protect your architecture

124

“[metadataintegrity]GetFragmentSigningConfig failed with 0x8024402C. Using default enforcement mode: Audit.”

Seen on a Windows 10 1703 (Creators update):

Page 125: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Conclusion

125

Stop updating

Page 126: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Conclusion

126

Stop updating

Control relationship WSUS server → clients

Page 127: WSUSpendu - BHUSA2017...Yves Le Provost & Romain Coltel WSUSPENDU / 125 So, what is an ESAE? 15 Tier 0 Tier 1 Tier 2 Production forest(s) ESAE - Single forest, single domain - One

WSUSPENDU / 125Yves Le Provost & Romain Coltel

Thank you all.

ROMAIN COLTEL

ANSSIYVES LE PROVOST