Transcript
Page 1: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Devfest IstanbulWeb Application Attacks and Trusting

Frameworks

Page 2: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

whoami

● Mehmet INCE● Cyber Security Engineer/Pentest Lead at

INTELRAD● 150+ vulnerability publication● Application Security● Infosec Blogger www.mehmetince.net● PHP, Python, etc..● @mdisec

Page 3: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Önerme

security is a serious business.

Page 4: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks
Page 5: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Web Uygulama Güvenliği’nde iddia● Framework kullanıyoruz. ( ORM, Prepared statements )● Input validation yapmaktayız.● Output encoding bizim işimiz.● Düzenli olarak farklı firmalardan penetrasyon testi hizmeti

alıyoruz.● WAF, IPS/IDS cihazlarımız var.● Yazılımımız açık kaynak kodlu. Community gücü bizimle.● Geliştiricilerimize secure coding training eğitimleri aldırıyoruz.● Bug bounty programımız var, zafiyet bulan herkese ücret

ödüyoruz.

Page 6: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Tüm maddeleri yapan bir firmada çalışan ?

Page 7: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Çünkü

● Drupal core - SQL injection ( stacked query enabled! ) - http://goo.gl/RPgX1z

● Wordpress 4.0.1 Stored XSS - http://goo.gl/xuvXfB

● Codeigniter Object Injection - http://goo.gl/72lzGV

Page 8: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Çünkü...

● Symfony CSRF ( CVE-2014-6072 )

● Laravel cookie forgery, decryption, and RCE - http://goo.gl/qieZzZ

● RoR SQLi & Crypto Weakness

Page 9: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Çünkü…

“Framework kullanıyoruz.” olmazsa olmazlardan biridir ama asla yeterli değildir, zira framework’ünde kendisi bir yazılımdır. Güvenlik açığı olabilir. ( RoR, CI, Laravel, Symfony, ASP.NET )

Page 10: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Çünkü…

Açık kaynak güvenlik açısından önemlidir. Lakin tüm örnekler açık kaynak kodlu ve 1.000~ committer’ı olan projelerdi. http://goo.gl/fDHGFZ

( Aramıza hoşgeldin ASP.NET :p )

Page 11: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Çünkü….

Hiçbir WAF, IPS/IDS Codeigniter Object Injection zafiyetini tespit edemez. Çünkü ? ( Exploit the OR )

Page 12: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Yani..

security is a serious business.

Page 13: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Codeigniter Object Injection Vuln

Page 14: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Codeigniter Session MechanismSession class initializer method.

Page 15: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Codeigniter Session Mechanism

Page 16: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Codeigniter Session Mechanism

Page 17: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Codeigniter Encryption Class

Page 18: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Codeigniter Custom XOR

Page 19: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Where we are

User Request Session Class initializer sess_create()

is encrypt cookie enabled ?T: Encode with Mcrypt _set_cookie()

F : Encode with Xor

Page 20: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

How to read Session Data

Page 21: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

How to exploit

- Encryption key biliniyorsa- Cookie object manipulation

- Encryption key belirsiz ise- Mcrypt aktif ise

- CBC mode exploit- Custom XOR ise

- md5 hash brute force

Page 22: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Codeigniter Based Applications

- Bonfire Vulnerable- No-CMS Vulnerable- PyroCMS Vulnerable- FUEL CMS Vulnerable- ...

Page 23: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

DEMO

Page 24: Devfest istanbul'14  - Web Application Attacks and Trusting Frameworks

Teşekkürler

twitter.com/mdisec

www.mehmetince.net

[email protected]