Geautomatiseerd Website Vulnerability Management Ing. Sijmen Ruwhof (ZCE) PFCongres / 17 april 2010
Even voorstellen: Sijmen Ruwhof Afgestudeerd Information Engineer, met informatiebeveiliging als specialisatie Heeft software ontwikkeld die websites geautomatiseerd controleert op beveiligingslekken Passies Informatiebeveiliging (legaal hacken) Web development (met PHP!)
Even voorstellen: Secundity Beveiligingsaudits uitvoeren op webapplicaties
Vulnerability management Security trainingen Ontwikkelen van veilige webapplicaties
Vulnerability Management
Definiëren Detecteren Documenteren Verhelpen Valideren Publiceren
Doel presentatie Bewustwording Creëren van veiligheid mindset Beveiliging Het beveiligingsniveau van websites naar een hoger niveau tillen Proces implementatie Zelf het vulnerability management proces implementeren
Beveiliging in theorie Beschikbaarheid Bereikbaarheid, toegankelijkheid Integriteit Betrouwbaarheid, juist, rechtmatig, volledig, tijdig, eerlijk, waarheid Vertrouwelijkheid Cryptografie, need-to-know, autorisatie
Functioneel vs. Veilig
Vulnerabilities in websites
Invoervalidatie Misconfiguratie Informatie publicatie Verouderde software
OWASP Top 10 - 2010 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
Injection Cross Site Scripting (XSS) Broken Authentication and Session Management Insecure Direct Object References Cross Site Request Forgery (CSRF) Security Misconfiguration Failure to Restrict URL Access Unvalidated Redirects and Forwards Insecure Cryptographic Storage Insufficient Transport Layer Protection
Applicatie assessment kan Handmatig Geautomatiseerd, of Uitbesteed worden (hint hint ;-) Met behulp van gratis, betaalde of gehuurde software
Applicatie structuur
Mappen Bestanden Variabelen Sessies Processen Variabelen Formulieren
Verschillende methoden Whitebox Blackbox Greybox
Whitebox Alles is bekend: proces, structuur & variabelen Slimme software nodig om je applicatie te begrijpen Statisch
Blackbox Alleen via de interface Dynamisch
Greybox
Combinatie black- and whitebox Sensor heeft toegang tot broncode Realtime applicatie- en datamanipulatie Accurate en gedetailleerde rapporteren
Momenteel alleen nog: Acunetix’s AcuSensor technologie
Handmatige controle Theorie: Drie voorbeelden Praktijk: Demo
Vulnerability: SQL Injection Code
: SELECT * FROM table
WHERE id = {$_GET[‘id’]} Aanvalsvector : /?id=' Antwoord
: "You have an error in your SQL syntax"
Vulnerability: Remote File Inclusion
include $_GET[‘file’]; ?> Aanvalsvector : /?file=http://example.com/ Code
:
Antwoord
: “web page by typing "example.com""
Vulnerability: OS Command Injection Code
: shell_exec(“ping
“.$_GET[‘ip’]) ?> Aanvalsvector : /?ip=; cat /etc/passwd Antwoord
: "root:.*:0:[01]:” (reguliere expressie)
Demo
Geautomatiseerde controle
Voor- en nadelen Voorbeelden eenvoudig te controleren Valkuilen Configuratie Limieten Web security scanners
Voor- en nadelen
+ + + + + -
Integraal Snel Periodiek Kwantiteit Goedkoop Kwalitatief laag Niet creatief
Eenvoudig: Injecties
OS Command Injection SQL/LDAP Injection Cross Site Scripting Local File Inclusion File Enumeration Session Fixation Remote File Inclusion Buffer overflow
Eenvoudig: HTTP antwoord analyse
Automatisch aanvullen van wachtwoorden Caching configuratie Content encoding HttpOnly attribuut van cookies File uploads Session ID exposure Foutmeldingen
Kwaliteitseisen Effectiviteit Aanvalsvectoren Valse positieven Valse negatieven Efficiëntie Configuratie
Oppassen Kans op verstoring Database vervuiling Acties uitvoeren
Configuratie
Gebruiker authenticatie Mod_rewrite 404 pagina’s Uitsluiten: Mappen, bestanden, parameters, links POST verzoeken Uitgebreidheid aanvalsvectoren Beveiligingsmaatregelen ontwijken
Limieten
Onzichtbare applicatiestructuur Geen verbale foutmeldingen Anti-automation Logische fouten Race conditions Denial of service Social engineering File uploads
Top 10 web security scanners 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
Nikto Paros proxy WebScarab WebInspect Whisker/libwhisker BurpSuite Wikto Acunetix WVS Rational AppSan N-Stealth
Vulnerability management
Handmatig Geautomatiseerd Veel ondersteunende software beschikbaar Processen inrichten Checklists / procedures
Tips Voorkomen Beveiliging meenemen in applicatie ontwerp Trainen op veilig programmeren Bewustwording veiligheid vergroten Na functionele realisatie de beveiliging controleren Tegenhouden Installatie van webapplicatie firewall (PHPIDS)
Tips Controleren Security auditing & monitoring Applicatie penetratietesten Processen inrichten Invoeren vulnerability management Afhandelen van: calamiteiten, fouten, hack pogingen Forensisch onderzoek faciliteren Verantwoordelijke voor applicatie beveiliging
OWASP Gedrukte boeken beschikbaar tegen kostprijs: http://stores.lulu.com/owasp
Tot slot Zijn er nog vragen? “Security is when everything is settled. When nothing can happen to you. Security is the denial of life.”
Bedankt voor jullie aandacht! -- Sijmen Ruwhof