windows privilege escalation by dhruv shah

28
Windows Privilege Escalation Because gaining shell to the system is just not enough

Upload: owasp

Post on 13-Apr-2017

304 views

Category:

Internet


3 download

TRANSCRIPT

Page 1: Windows privilege escalation by Dhruv Shah

Windows Privilege Escalation

Because gaining shell to the system is just not enough

Page 2: Windows privilege escalation by Dhruv Shah

C:\> type disclaimer.txt

• The opinions expressed in this presentation are mine and not those of my employer.

Page 3: Windows privilege escalation by Dhruv Shah

• Dhruv Shah• @snypter• http://security-geek.in

Page 4: Windows privilege escalation by Dhruv Shah

What are we here for ?

• Different scenarios leading to privilege escalation

• Design issues , implementation flaws, untimely system updates , permission issues etc

• We ain’t talking about overflows here , just logics and techniques

Page 5: Windows privilege escalation by Dhruv Shah

Flavours are we looking at ?

• Windows XP• Windows 7 • Windows 2003

Page 6: Windows privilege escalation by Dhruv Shah

Two Types of Escalation

• Admin to System– Easy , not much effort needed

• User to System– Here is where the real deal lies in

Page 7: Windows privilege escalation by Dhruv Shah

Admin to System

( Piece of Cake )

• The famous “at” command

• “psexec” anyone ?

Page 8: Windows privilege escalation by Dhruv Shah

Demo

Page 9: Windows privilege escalation by Dhruv Shah

System Privilege using “at”

Page 10: Windows privilege escalation by Dhruv Shah

Pass the Hash

• Managed to get the user hash• Password is complex will take long time to

crack via rainbowtables• Boom Boom Pow.

Page 11: Windows privilege escalation by Dhruv Shah

Abusing Scheduled Tasks

• Admin creates a scheduler task with System privileges

Page 12: Windows privilege escalation by Dhruv Shah

Abusing Scheduled Tasks

• Sadly the file to be executed is accessible by everyone

Page 13: Windows privilege escalation by Dhruv Shah

Demo

Page 14: Windows privilege escalation by Dhruv Shah

Creds in Files

• C:\users\victim\Desktop\password.xls• C:\>dir /b /s web.config• C:\>dir /b /s unattend.xml• C:\>dir /b /s sysprep.inf• C:\>dir /b /s sysprep.xml• C:\>dir /b /s *pass*• Registries are also a good place to have a look

at

Page 15: Windows privilege escalation by Dhruv Shah

Weak Directory Permissions

Lets have some fun

Page 16: Windows privilege escalation by Dhruv Shah

Demo

Page 17: Windows privilege escalation by Dhruv Shah

Abusing Service misconfigurations

• Possible attack vectors ?– Editing the service config– Editing the binary path

Todays Discusssion – Unquoted Service path Vulnerability

Page 18: Windows privilege escalation by Dhruv Shah

Unquoted Service Path

Page 19: Windows privilege escalation by Dhruv Shah

Unquoted Service Path

• c:\program*files\sub*dir\program*name• c:\program.exe files\sub dir\program name• c:\program files\sub.exe dir\program name• c:\program files\sub dir\program.exe name

Page 20: Windows privilege escalation by Dhruv Shah

Unquoted Service Path

Page 21: Windows privilege escalation by Dhruv Shah

Unquoted Service Path

Page 22: Windows privilege escalation by Dhruv Shah

Demo

Page 23: Windows privilege escalation by Dhruv Shah

Editing Service Binaries

• What are service binaries ? • How do we exploit them ?

• Lets exploit upnphost of the Windows system a default servcice that runs

Page 24: Windows privilege escalation by Dhruv Shah

Editing Service Binaries

Page 25: Windows privilege escalation by Dhruv Shah

Editing Service Binaries

Page 26: Windows privilege escalation by Dhruv Shah

Editing Service Binaries

Page 27: Windows privilege escalation by Dhruv Shah

Demo

Page 28: Windows privilege escalation by Dhruv Shah

Thank you

• Questions ?