SlideShare a Scribd company logo
PHPIDS
Monitoring attack surface activity


A presentation by Mario Heiderich
For OWASP AppSec Europe 2008
Who?



Mario Heiderich


  CSO for ormigo.com in Cologne, Germany

  Lead developer / co-founder PHPIDS

  GNUCITIZEN core member
What?


        Webapp Security – say what!
         The developers' dilemma
          Webapp alarm devices
           Regex black-mæjick
             Blacklisting 2.0
Tough love


               <img/
/onerror=“[$y=('al')]&[$z=$y+'ert']
   [a=(1?/ev/:0)[-1]+$y]($z)(1)“
               src=x>

    What does this code do? Anyone?
The dilemma


        Usability vs. Security
         Insecurity 2.0
          One in a million

        Unaware malignity?
Who knows?


   Developers and time pressure
  Complexity – do you really know HTML?
    JS, SQL, PHP, LDAP, XML, OMG...
             It's full of ... vectors

     I don't see it - thus it doesn't exist
Do what now?


         Install a WAF Appliance?
      Strip what's looking weird?
      Employ a logfile monkey?
    Fallback to static HTML?
Maybe no!


           PHPIDS detects badness
                  Pricing: 0€
                      LGPL
                 Slim, fast and...
... tested by security experts all over the world
                  over months
What does it do?




          Not much, really!
Receiving



               First of all:
    The developer defines what to scan.
Converting


   The input is being analysed, converted and
 normalized to a certain level before hitting the
            regular expressions.

          And the mysterious PHPIDS Centrifuge.
Matching


 A XML/JSON ruleset covering various attack
           detection patterns

       About 70 tagged regex rules

 XSS, SQLI, RCE, LFI, DT, LDAPInjections, DoS...
Blacklistingmagic



Generic attack detection – we will talk about that
               in some minutes...

             Meaning the PHPIDS Centrifuge
Reporting



             As slim as possible

              An attack was detected...
... a result object is filled with the necessary data
Measuring

       Any rule carries a numerical impact value.
   Attack + Matching rules = Overall Impact.
 <filter>
     <rule><![CDATA[(?:^>[ws]*</?w{2,}>)]]></rule>
     <description>finds unquoted attribute breaking in...</description>
     <tags>
          <tag>xss</tag>
          <tag>csrf</tag>
     </tags>
     <impact>2</impact>
 </filter>
Reacting



 Developers can define reactions based on the
 impact. Or the tags. Or the matching of one or
             several certain rules...
Logging

Use the integrated loggers – create backend tools like this:
But...



Isn't it super slow to pump user input through 70
      regular expressions including a massive
 conversion process – again about 30-40 regular
                   expressions?
Nup

  Not when dealing with full-stack frameworks like
   CakePHP, Symphony, ZF or even WordPress
Choosing wisely


Nup? Nup! That's due to the caching mechanisms
             and a pre-selection.

95% of the user input won't even hit the rules and
              pass as harmless.
But²...



          What about false alerts?
Yes – depending on the application they exist. So the PHIDS
         sometimes needs some days to learn...
Candy Time!




  so - what about the PHPIDS Centrifuge?
The Centrifuge
       Blacklisting alone is useless
     Say thanks to SQL and JavaScript

            ale&#x200d;rt(1)

        aa' ^+ -(0) + -(0) = '0

   Unlimited ways of obfuscating payload
Know your foe



     So what characterizes an attack?

    Special chars! Loads of them!
Let's see..

if (strlen($value) > 25) {
    // Check for the attack char ratio
    $stripped_length = strlen(
        preg_replace('/[wsp{L}.,/]*/ms', null, $value));
    $overall_length = strlen(
        preg_replace('/w{3,}/', '123',
        preg_replace('/s{2,}/ms', null, $value)));

    if($stripped_length != 0 && $overall_length/$stripped_length <= 3.5) {
        $value .= quot;n$[!!!]quot;;
    }
}
There's more...

if (strlen($value) > 40) {
      // Replace all non-special chars
    $converted = preg_replace('/[wsp{L}]/', null, $value);

   // Split string into an array, unify and sort
   $array = str_split($converted);
   $array = array_unique($array);
   asort($array);

   // Normalize certain tokens
   $schemes = array(
      '~' => '+', '^' => '+', '|' => '+', '*' => '+', '%' => '+',
        '&' => '+', '/' => '+' );
... and done!
      $converted = implode($array);
      $converted = str_replace(array_keys($schemes),
      array_values($schemes), $converted);
      $converted = preg_replace('/[+-]s*d+/', '+', $converted);
      $converted = preg_replace('/[()[]{}]/', '(', $converted);
      $converted = preg_replace('/[!?,.:=]/', ':', $converted);
      $converted = preg_replace('/[^:(+]/', null,
stripslashes($converted));

     // Sort again and implode
     $array = str_split($converted);
     asort($array);
     $converted = implode($array);

     if (preg_match('/(?:({2,}+{2,}:{2,})|(?:({2,}+{2,}:+)|' .
           '(?:({3,}++:{2,})/', $converted)) {
           return $value . quot;nquot; . $converted;
     }
}
The tests tell us...


 ...that almost all real world attacks, JS worms,
SQL Injection exploits and other stuff are detected
            by the PHPIDS Centrifuge.

  Those who weren't detected got caught by the
                     rules.
Btw.. the tests!



  PHPIDS is unit tested, regression tested and
              community driven.

   Please don't have a look the test files!
Back to our friend...
So...


        The PHPIDS detects attacks.
     Developers can choose on how to react.
The PHPIDS knows them weird encodings and charsets.
                   It's free and OSS.
                   It's community driven
    60 Members, ~1000 Posts in the various testing threads
Plus



 It's in use on dozens of real hightraffic sites.

   neu.de, shoppero.com, astalavista.com, ormigo.com,
             doccheck.com, sevenload.de...
10x guys!


         The PHPIDS core members,
 Gareth Heyes, David Lindsay, Eduardo Vela,
  Kishor, Giorgio Maone, Reiners, Ronald, tx,
 kuza55, the guys from schokokeks.org and so
                 many others!
Questions?


              Now's the time to ask!

Else you would have to check the whitepaper for yourself
  – or drop me a line or post to the group or the forum or check
                          sla.ckers.org.
Thanks a lot for listening!

More Related Content

What's hot

Building fast interpreters in Rust
Building fast interpreters in RustBuilding fast interpreters in Rust
Building fast interpreters in Rust
Ingvar Stepanyan
 
Your code is not a string
Your code is not a stringYour code is not a string
Your code is not a string
Ingvar Stepanyan
 
Starting Out With PHP
Starting Out With PHPStarting Out With PHP
Starting Out With PHP
Mark Niebergall
 
Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020
Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020
Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020
Andrew Lavers
 
Top 10 php classic traps confoo
Top 10 php classic traps confooTop 10 php classic traps confoo
Top 10 php classic traps confoo
Damien Seguy
 
Campaña sucia en Mendoza
Campaña sucia en MendozaCampaña sucia en Mendoza
Campaña sucia en Mendoza
Mario Guillermo Simonovich
 
Password Storage And Attacking In PHP - PHP Argentina
Password Storage And Attacking In PHP - PHP ArgentinaPassword Storage And Attacking In PHP - PHP Argentina
Password Storage And Attacking In PHP - PHP Argentina
Anthony Ferrara
 
Defensive Coding Crash Course Tutorial
Defensive Coding Crash Course TutorialDefensive Coding Crash Course Tutorial
Defensive Coding Crash Course Tutorial
Mark Niebergall
 
Slides
SlidesSlides
Slidesvti
 
P6 OO vs Moose (&Moo)
P6 OO vs Moose (&Moo)P6 OO vs Moose (&Moo)
P6 OO vs Moose (&Moo)
lichtkind
 
Qore for the Perl Programmer
Qore for the Perl ProgrammerQore for the Perl Programmer
Qore for the Perl Programmer
Brett Estrade
 
Cryptography For The Average Developer - Sunshine PHP
Cryptography For The Average Developer - Sunshine PHPCryptography For The Average Developer - Sunshine PHP
Cryptography For The Average Developer - Sunshine PHP
Anthony Ferrara
 
Password Storage and Attacking in PHP
Password Storage and Attacking in PHPPassword Storage and Attacking in PHP
Password Storage and Attacking in PHP
Anthony Ferrara
 
Living with garbage
Living with garbageLiving with garbage
Living with garbage
lucenerevolution
 
주로사용되는 Xss필터와 이를 공격하는 방법
주로사용되는 Xss필터와 이를 공격하는 방법주로사용되는 Xss필터와 이를 공격하는 방법
주로사용되는 Xss필터와 이를 공격하는 방법guestad13b55
 
Redis for the Everyday Developer
Redis for the Everyday DeveloperRedis for the Everyday Developer
Redis for the Everyday Developer
Ross Tuck
 
Groovy on the Shell
Groovy on the ShellGroovy on the Shell
Groovy on the Shell
sascha_klein
 
Perl Basics for Pentesters Part 1
Perl Basics for Pentesters Part 1Perl Basics for Pentesters Part 1
Perl Basics for Pentesters Part 1
n|u - The Open Security Community
 

What's hot (20)

Building fast interpreters in Rust
Building fast interpreters in RustBuilding fast interpreters in Rust
Building fast interpreters in Rust
 
Your code is not a string
Your code is not a stringYour code is not a string
Your code is not a string
 
Starting Out With PHP
Starting Out With PHPStarting Out With PHP
Starting Out With PHP
 
Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020
Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020
Redis is not just a cache, Andrew Lavers, ConFoo Montreal 2020
 
Top 10 php classic traps confoo
Top 10 php classic traps confooTop 10 php classic traps confoo
Top 10 php classic traps confoo
 
Cdexpert
CdexpertCdexpert
Cdexpert
 
Campaña sucia en Mendoza
Campaña sucia en MendozaCampaña sucia en Mendoza
Campaña sucia en Mendoza
 
Password Storage And Attacking In PHP - PHP Argentina
Password Storage And Attacking In PHP - PHP ArgentinaPassword Storage And Attacking In PHP - PHP Argentina
Password Storage And Attacking In PHP - PHP Argentina
 
Defensive Coding Crash Course Tutorial
Defensive Coding Crash Course TutorialDefensive Coding Crash Course Tutorial
Defensive Coding Crash Course Tutorial
 
Slides
SlidesSlides
Slides
 
P6 OO vs Moose (&Moo)
P6 OO vs Moose (&Moo)P6 OO vs Moose (&Moo)
P6 OO vs Moose (&Moo)
 
Qore for the Perl Programmer
Qore for the Perl ProgrammerQore for the Perl Programmer
Qore for the Perl Programmer
 
Cryptography For The Average Developer - Sunshine PHP
Cryptography For The Average Developer - Sunshine PHPCryptography For The Average Developer - Sunshine PHP
Cryptography For The Average Developer - Sunshine PHP
 
Password Storage and Attacking in PHP
Password Storage and Attacking in PHPPassword Storage and Attacking in PHP
Password Storage and Attacking in PHP
 
Living with garbage
Living with garbageLiving with garbage
Living with garbage
 
Tt subtemplates-caching
Tt subtemplates-cachingTt subtemplates-caching
Tt subtemplates-caching
 
주로사용되는 Xss필터와 이를 공격하는 방법
주로사용되는 Xss필터와 이를 공격하는 방법주로사용되는 Xss필터와 이를 공격하는 방법
주로사용되는 Xss필터와 이를 공격하는 방법
 
Redis for the Everyday Developer
Redis for the Everyday DeveloperRedis for the Everyday Developer
Redis for the Everyday Developer
 
Groovy on the Shell
Groovy on the ShellGroovy on the Shell
Groovy on the Shell
 
Perl Basics for Pentesters Part 1
Perl Basics for Pentesters Part 1Perl Basics for Pentesters Part 1
Perl Basics for Pentesters Part 1
 

Viewers also liked

Phorum MySQL tricks
Phorum MySQL tricksPhorum MySQL tricks
Phorum MySQL tricksguestd34230
 
PresentacióN1
PresentacióN1PresentacióN1
PresentacióN1
sandracpa
 
From One to a Cluster
From One to a ClusterFrom One to a Cluster
From One to a Clusterguestd34230
 
Palabras
PalabrasPalabras
Palabras
guest0bb89c
 
Lifelong Learning and Museums
Lifelong Learning and MuseumsLifelong Learning and Museums
Lifelong Learning and Museums
Lynda Kelly
 
CONVIVENCIA
CONVIVENCIACONVIVENCIA
CONVIVENCIAguisse21
 

Viewers also liked (7)

Security @ work
Security @ workSecurity @ work
Security @ work
 
Phorum MySQL tricks
Phorum MySQL tricksPhorum MySQL tricks
Phorum MySQL tricks
 
PresentacióN1
PresentacióN1PresentacióN1
PresentacióN1
 
From One to a Cluster
From One to a ClusterFrom One to a Cluster
From One to a Cluster
 
Palabras
PalabrasPalabras
Palabras
 
Lifelong Learning and Museums
Lifelong Learning and MuseumsLifelong Learning and Museums
Lifelong Learning and Museums
 
CONVIVENCIA
CONVIVENCIACONVIVENCIA
CONVIVENCIA
 

Similar to OWASP PHPIDS talk slides

Security module for php7 – Killing bugclasses and virtual-patching the rest! ...
Security module for php7 – Killing bugclasses and virtual-patching the rest! ...Security module for php7 – Killing bugclasses and virtual-patching the rest! ...
Security module for php7 – Killing bugclasses and virtual-patching the rest! ...
44CON
 
The Ultimate IDS Smackdown
The Ultimate IDS SmackdownThe Ultimate IDS Smackdown
The Ultimate IDS SmackdownMario Heiderich
 
Integris Security - Hacking With Glue ℠
Integris Security - Hacking With Glue ℠Integris Security - Hacking With Glue ℠
Integris Security - Hacking With Glue ℠
Integris Security LLC
 
OWASP Poland Day 2018 - Pedro Fortuna - Are your Java Script based protection...
OWASP Poland Day 2018 - Pedro Fortuna - Are your Java Script based protection...OWASP Poland Day 2018 - Pedro Fortuna - Are your Java Script based protection...
OWASP Poland Day 2018 - Pedro Fortuna - Are your Java Script based protection...
OWASP
 
node.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Servernode.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Server
David Ruiz
 
Secure Programming
Secure ProgrammingSecure Programming
Secure Programming
alpha0
 
Tips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software EngineeringTips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software Engineering
jtdudley
 
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebCharla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo Web
Mikel Torres Ugarte
 
AntiRE en Masse
AntiRE en MasseAntiRE en Masse
AntiRE en Masse
Kurt Baumgartner
 
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
IstSec'14 - İbrahim BALİÇ -  Automated Malware AnalysisIstSec'14 - İbrahim BALİÇ -  Automated Malware Analysis
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
BGA Cyber Security
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applications
chartjes
 
Simplest-Ownage-Human-Observed… - Routers
 Simplest-Ownage-Human-Observed… - Routers Simplest-Ownage-Human-Observed… - Routers
Simplest-Ownage-Human-Observed… - RoutersLogicaltrust pl
 
Filip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersFilip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersYury Chemerkin
 
Let's write secure Drupal code! - DrupalCamp London 2019
Let's write secure Drupal code! - DrupalCamp London 2019Let's write secure Drupal code! - DrupalCamp London 2019
Let's write secure Drupal code! - DrupalCamp London 2019
Balázs Tatár
 
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdf
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdfEN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdf
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdf
GiorgiRcheulishvili
 
Good practices for PrestaShop code security and optimization
Good practices for PrestaShop code security and optimizationGood practices for PrestaShop code security and optimization
Good practices for PrestaShop code security and optimization
PrestaShop
 
Eight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsEight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsAleksandr Yampolskiy
 
Automated code audits
Automated code auditsAutomated code audits
Automated code audits
Damien Seguy
 
DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)Oleg Zinchenko
 
BSides IR in Heterogeneous Environment
BSides IR in Heterogeneous EnvironmentBSides IR in Heterogeneous Environment
BSides IR in Heterogeneous Environment
Stefano Maccaglia
 

Similar to OWASP PHPIDS talk slides (20)

Security module for php7 – Killing bugclasses and virtual-patching the rest! ...
Security module for php7 – Killing bugclasses and virtual-patching the rest! ...Security module for php7 – Killing bugclasses and virtual-patching the rest! ...
Security module for php7 – Killing bugclasses and virtual-patching the rest! ...
 
The Ultimate IDS Smackdown
The Ultimate IDS SmackdownThe Ultimate IDS Smackdown
The Ultimate IDS Smackdown
 
Integris Security - Hacking With Glue ℠
Integris Security - Hacking With Glue ℠Integris Security - Hacking With Glue ℠
Integris Security - Hacking With Glue ℠
 
OWASP Poland Day 2018 - Pedro Fortuna - Are your Java Script based protection...
OWASP Poland Day 2018 - Pedro Fortuna - Are your Java Script based protection...OWASP Poland Day 2018 - Pedro Fortuna - Are your Java Script based protection...
OWASP Poland Day 2018 - Pedro Fortuna - Are your Java Script based protection...
 
node.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Servernode.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Server
 
Secure Programming
Secure ProgrammingSecure Programming
Secure Programming
 
Tips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software EngineeringTips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software Engineering
 
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebCharla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo Web
 
AntiRE en Masse
AntiRE en MasseAntiRE en Masse
AntiRE en Masse
 
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
IstSec'14 - İbrahim BALİÇ -  Automated Malware AnalysisIstSec'14 - İbrahim BALİÇ -  Automated Malware Analysis
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applications
 
Simplest-Ownage-Human-Observed… - Routers
 Simplest-Ownage-Human-Observed… - Routers Simplest-Ownage-Human-Observed… - Routers
Simplest-Ownage-Human-Observed… - Routers
 
Filip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersFilip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routers
 
Let's write secure Drupal code! - DrupalCamp London 2019
Let's write secure Drupal code! - DrupalCamp London 2019Let's write secure Drupal code! - DrupalCamp London 2019
Let's write secure Drupal code! - DrupalCamp London 2019
 
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdf
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdfEN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdf
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdf
 
Good practices for PrestaShop code security and optimization
Good practices for PrestaShop code security and optimizationGood practices for PrestaShop code security and optimization
Good practices for PrestaShop code security and optimization
 
Eight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsEight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programs
 
Automated code audits
Automated code auditsAutomated code audits
Automated code audits
 
DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)
 
BSides IR in Heterogeneous Environment
BSides IR in Heterogeneous EnvironmentBSides IR in Heterogeneous Environment
BSides IR in Heterogeneous Environment
 

Recently uploaded

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 

Recently uploaded (20)

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 

OWASP PHPIDS talk slides

  • 1. PHPIDS Monitoring attack surface activity A presentation by Mario Heiderich For OWASP AppSec Europe 2008
  • 2. Who? Mario Heiderich  CSO for ormigo.com in Cologne, Germany  Lead developer / co-founder PHPIDS  GNUCITIZEN core member
  • 3. What? Webapp Security – say what! The developers' dilemma Webapp alarm devices Regex black-mæjick Blacklisting 2.0
  • 4. Tough love <img/ /onerror=“[$y=('al')]&[$z=$y+'ert'] [a=(1?/ev/:0)[-1]+$y]($z)(1)“ src=x> What does this code do? Anyone?
  • 5. The dilemma Usability vs. Security Insecurity 2.0 One in a million Unaware malignity?
  • 6. Who knows? Developers and time pressure Complexity – do you really know HTML? JS, SQL, PHP, LDAP, XML, OMG... It's full of ... vectors I don't see it - thus it doesn't exist
  • 7. Do what now? Install a WAF Appliance? Strip what's looking weird? Employ a logfile monkey? Fallback to static HTML?
  • 8. Maybe no! PHPIDS detects badness Pricing: 0€ LGPL Slim, fast and... ... tested by security experts all over the world over months
  • 9. What does it do? Not much, really!
  • 10. Receiving First of all: The developer defines what to scan.
  • 11. Converting The input is being analysed, converted and normalized to a certain level before hitting the regular expressions. And the mysterious PHPIDS Centrifuge.
  • 12. Matching A XML/JSON ruleset covering various attack detection patterns About 70 tagged regex rules XSS, SQLI, RCE, LFI, DT, LDAPInjections, DoS...
  • 13. Blacklistingmagic Generic attack detection – we will talk about that in some minutes... Meaning the PHPIDS Centrifuge
  • 14. Reporting As slim as possible An attack was detected... ... a result object is filled with the necessary data
  • 15. Measuring Any rule carries a numerical impact value. Attack + Matching rules = Overall Impact. <filter> <rule><![CDATA[(?:^>[ws]*</?w{2,}>)]]></rule> <description>finds unquoted attribute breaking in...</description> <tags> <tag>xss</tag> <tag>csrf</tag> </tags> <impact>2</impact> </filter>
  • 16. Reacting Developers can define reactions based on the impact. Or the tags. Or the matching of one or several certain rules...
  • 17. Logging Use the integrated loggers – create backend tools like this:
  • 18. But... Isn't it super slow to pump user input through 70 regular expressions including a massive conversion process – again about 30-40 regular expressions?
  • 19. Nup Not when dealing with full-stack frameworks like CakePHP, Symphony, ZF or even WordPress
  • 20. Choosing wisely Nup? Nup! That's due to the caching mechanisms and a pre-selection. 95% of the user input won't even hit the rules and pass as harmless.
  • 21. But²... What about false alerts? Yes – depending on the application they exist. So the PHIDS sometimes needs some days to learn...
  • 22. Candy Time! so - what about the PHPIDS Centrifuge?
  • 23. The Centrifuge Blacklisting alone is useless Say thanks to SQL and JavaScript ale&#x200d;rt(1) aa' ^+ -(0) + -(0) = '0 Unlimited ways of obfuscating payload
  • 24. Know your foe So what characterizes an attack? Special chars! Loads of them!
  • 25. Let's see.. if (strlen($value) > 25) { // Check for the attack char ratio $stripped_length = strlen( preg_replace('/[wsp{L}.,/]*/ms', null, $value)); $overall_length = strlen( preg_replace('/w{3,}/', '123', preg_replace('/s{2,}/ms', null, $value))); if($stripped_length != 0 && $overall_length/$stripped_length <= 3.5) { $value .= quot;n$[!!!]quot;; } }
  • 26. There's more... if (strlen($value) > 40) { // Replace all non-special chars $converted = preg_replace('/[wsp{L}]/', null, $value); // Split string into an array, unify and sort $array = str_split($converted); $array = array_unique($array); asort($array); // Normalize certain tokens $schemes = array( '~' => '+', '^' => '+', '|' => '+', '*' => '+', '%' => '+', '&' => '+', '/' => '+' );
  • 27. ... and done! $converted = implode($array); $converted = str_replace(array_keys($schemes), array_values($schemes), $converted); $converted = preg_replace('/[+-]s*d+/', '+', $converted); $converted = preg_replace('/[()[]{}]/', '(', $converted); $converted = preg_replace('/[!?,.:=]/', ':', $converted); $converted = preg_replace('/[^:(+]/', null, stripslashes($converted)); // Sort again and implode $array = str_split($converted); asort($array); $converted = implode($array); if (preg_match('/(?:({2,}+{2,}:{2,})|(?:({2,}+{2,}:+)|' . '(?:({3,}++:{2,})/', $converted)) { return $value . quot;nquot; . $converted; } }
  • 28. The tests tell us... ...that almost all real world attacks, JS worms, SQL Injection exploits and other stuff are detected by the PHPIDS Centrifuge. Those who weren't detected got caught by the rules.
  • 29. Btw.. the tests! PHPIDS is unit tested, regression tested and community driven. Please don't have a look the test files!
  • 30. Back to our friend...
  • 31. So... The PHPIDS detects attacks. Developers can choose on how to react. The PHPIDS knows them weird encodings and charsets. It's free and OSS. It's community driven 60 Members, ~1000 Posts in the various testing threads
  • 32. Plus It's in use on dozens of real hightraffic sites. neu.de, shoppero.com, astalavista.com, ormigo.com, doccheck.com, sevenload.de...
  • 33. 10x guys! The PHPIDS core members, Gareth Heyes, David Lindsay, Eduardo Vela, Kishor, Giorgio Maone, Reiners, Ronald, tx, kuza55, the guys from schokokeks.org and so many others!
  • 34. Questions? Now's the time to ask! Else you would have to check the whitepaper for yourself – or drop me a line or post to the group or the forum or check sla.ckers.org.
  • 35. Thanks a lot for listening!