Devfest istanbul'14 web app security and framework

24
Devfest Istanbul Web Application Attacks and Trusting Frameworks

description

Devfest istanbul'14 web app security and framework

Transcript of Devfest istanbul'14 web app security and framework

Page 1: Devfest istanbul'14   web app security and framework

Devfest Istanbul

Web Application Attacks and Trusting

Frameworks

Page 2: Devfest istanbul'14   web app security and framework

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 app security and framework

Önerme

security is a

seriousbusiness.

Page 4: Devfest istanbul'14   web app security and framework
Page 5: Devfest istanbul'14   web app security and framework

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 app security and framework

Tüm maddeleri yapan bir

firmada çalışan ?

Page 7: Devfest istanbul'14   web app security and framework

Çü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 app security and framework

Çü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 app security and framework

Çü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 app security and framework

Çü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 app security and framework

Çünkü….

Hiçbir WAF, IPS/IDS Codeigniter Object

Injection zafiyetini tespit edemez. Çünkü ?

( Exploit the OR )

Page 12: Devfest istanbul'14   web app security and framework

Yani..

security is a

seriousbusiness.

Page 13: Devfest istanbul'14   web app security and framework

Codeigniter Object Injection Vuln

Page 14: Devfest istanbul'14   web app security and framework

Codeigniter Session Mechanism

Session class initializer method.

Page 15: Devfest istanbul'14   web app security and framework

Codeigniter Session Mechanism

Page 16: Devfest istanbul'14   web app security and framework

Codeigniter Session Mechanism

Page 17: Devfest istanbul'14   web app security and framework

Codeigniter Encryption Class

Page 18: Devfest istanbul'14   web app security and framework

Codeigniter Custom XOR

Page 19: Devfest istanbul'14   web app security and framework

Where we are

User RequestSession Class

initializersess_create()

is encrypt cookie

enabled ?T: Encode with Mcrypt _set_cookie()

F : Encode with Xor

Page 20: Devfest istanbul'14   web app security and framework

How to read Session Data

Page 21: Devfest istanbul'14   web app security and framework

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 app security and framework

Codeigniter Based Applications

- Bonfire Vulnerable

- No-CMS Vulnerable

- PyroCMS Vulnerable

- FUEL CMS Vulnerable

- ...

Page 23: Devfest istanbul'14   web app security and framework

DEMO

Page 24: Devfest istanbul'14   web app security and framework

Teşekkürler

twitter.com/mdisec

www.mehmetince.net

[email protected]