Top Banner
Basic housekeeping Plugging obvious security holes in web sites. Chris9an Heilmann, Paris Web, Paris, October 2009
89

Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Jan 15, 2015

Download

Documents

My talk at Paris Web 2009 about basic web security and how to avoid opening your site for attacks.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Basic housekeeping

Plugging obvious security holes in web sites.

Chris9an Heilmann, Paris Web, Paris, October 2009

Page 2: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 3: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 4: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

A few things to remember about basic web security.

Page 5: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

A bit of pimping...Gérer la sécurité de vos applica9ons web (Salle 1)

Présenté par : Sébas9en Pauchet (WS Interac9ve), 

Frank Taillandier (Académie de Toulouse)

a.k.a. Dirty Tricks with @DirtyF

Page 6: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

The most annoying thing is that the dangers on the web are underes9mated.

Page 7: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 8: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Reasons for aRacks:Spam injec9on.Iden9ty theT.Data mining.Botnet / Zombies / DOS

Page 9: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

A lot of clever terms are used in security.

SQL injec9on  XSS  CSRFClickJacking  Phishing

Page 10: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

In the end, a lot is about keeping your web products clean.

Page 11: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

This very much starts on the server side.

Page 12: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Think about your folders.

Page 13: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 14: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 15: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 16: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 17: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Telling the world too much.

Page 18: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

You don’t want the admin folders of your app to be indexed by Google SearchEngines.

Page 19: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Your system might tell more about your site than you are aware of.

Page 20: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Error messages are only needed in produc9on ‐ on live servers they can tell more than you want to.

Page 21: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Keep your server setup secure.

Page 24: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Basic server measures:Turn off folder browsing.Stop bot indexing (robots.txt).Secure your setup.Turn off error messaging.Disallow remote fileinclusion.Delete old and orphan files.

Page 25: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

The next danger is blindly relying on soTware.

Page 26: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Predefined backdoors and passwords.

Page 27: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

admin/adminadmin/passworddefault/defaultuser/userpreset/presetbuil9n/buil9n

Page 28: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Plugins

Page 29: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Basic soTware measures:Change every password.Check for presets.RTFM.Keep Plugins up‐to‐date.Check for security holes.Don’t trust “easy setup”.Upgrade.

Page 30: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Front end security issues. 

Page 31: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

This is not hard.Don’t trust any user data.HTML is not a database.JavaScript is not a secure data container.Do not rely on JavaScript.

Page 32: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Frontend is public.If you comment, comment on the backend, do not “comment out” func9onality.

Page 33: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Frontend is insecure.Anything in the frontend is executed and can be used to steal all your cookies.

(frames, images, scripts, links...)

Page 34: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

hRp://us2.php.net/manual/en/book.filter.php

Filtering

Page 35: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Whitelis9ng

Page 36: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Clickjacking.

Page 37: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 38: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Basic frontend measures:Break frames.Filter inputs.Whitelist inputs.Avoid hacks (expression()).Avoid URL assembling.

Page 39: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Our users

Page 40: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Social engineering.

Page 41: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

SocEng basics:Show authority.Create fake need of urgency.Take over responsibility.

Page 42: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Condi9oning helps. :‐(

Page 43: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

I approve of this!

Page 44: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Social networks

Page 45: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 46: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 47: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 48: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Step 1: Log in yourself

Page 49: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Step 2: Get list of followers

Page 50: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 51: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Step 3: Set the trap

Page 53: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 54: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Step 4: Lure his followers

Page 55: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

None of this!

Page 56: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Predictability

Page 57: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Basic people measures:Don’t allow for auto log‐in.Share security responsibilitywith the users.Avoid stressful interfaces.Be very open about your communica9on.

Page 58: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Bot aRacks.

Page 59: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

hRp://caca.zoy.org/wiki/PWNtcha

Captchas to the rescue?

Page 60: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Bot aRack measures.Honeyponng.Timed interfaces.Cookie check / Crumbing.Spike detec9on. OpenID / third party logins.

Page 61: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Nothing beats being up‐to‐date!

Page 62: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 63: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

None of this!

Page 64: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

I approve of this!

Page 65: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

You learn a lot from logs.

Page 66: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009
Page 67: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

No strength in numbers.

Page 68: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Check your posts.

Page 69: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

And query terms.

Page 70: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Some not‐so sci‐fi ideas...

Page 71: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Guest passes.

Page 72: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

oAuth

Page 73: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

OpenID

Page 74: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Caja/ADsafe

Page 75: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Caja limits and secures web standards.

Page 76: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

★ Custom aRributes★ Custom tags★Unclosed tags★ <embed>★ <iframe>★ <link rel=‘…★ javascript:void(0) ★ Radio buRons in IE★ Rela9ve url’s

Caja vs. “HTML”

Page 77: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

★ eval()★ new Func9on()★ Strings as event handlers (node.onclick = '...';)★ Names ending with double / triple underscores★ with func9on (with (obj) { ... })★ Implicit global variables (specify var variable)★ Calling a method as a func9on★ document.write ★ window.event★ .onclick★ OpenSocial gadgets.io.makeRequest return JS

Caja vs “JavaScript”

Page 78: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

★ * hacks★ _ hacks★ IE condi9onals★ Insert‐aTer clear fix★ expression()★@import★ Background images in IE

Caja vs “CSS”

Page 79: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Throwaway logins.

Page 80: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

New challenges.

Page 81: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Social Network aRacks

Page 82: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

The mobile web.

Page 83: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Camera access.

Page 84: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Loca9on based services.

Page 85: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Biometric recogni9on.

Page 86: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Right now things are not safe.

Page 87: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

But you can help making the web safer.

Page 88: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

Keep it clean, keep it up‐to‐date and be alert.

Page 89: Basic Housekeeping - Plugging Obvious Security Holes In Web Sites - Paris Web2009

  Chris9an Heilmann  hRp://wait‐9ll‐i.com   hRp://developer‐evangelism.com  hRp://twiRer.com/codepo8   

MERCI!