[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-572452-105":53,"doc-detail-572452-en":127},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":120,"head_meta":122,"extra_data":124,"updated_unix":126},105,"en","web-application-penetration-testing-local-file-inclusion-lfi-testing-techniques","Web Application Penetration Testing - Local File Inclusion (LFI) - Testing Techniques","","Web Application Penetration Testing document focused on Local File Inclusion (LFI) testing techniques for penetration testers and students. It explains how LFI vulnerabilities are identified during web app assessments, including manipulating file parameters to target sensitive files such as /etc/passwd. The material covers PHP wrappers and specific wrapper-based methods (expect, file://, php://filter, and ZIP wrapper), plus additional exploitation vectors like /proc/self/environ, useful shells, null byte technique, truncation bypass, and log file contamination.",{"@graph":63,"@context":119},[64,80,102],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":51,"@type":70,"position":76},"https://docshare.wps.com/template/general/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/web-application-penetration-testing-local-file-inclusion-lfi-testing-techniques/572452/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/web-application-penetration-testing-local-file-inclusion-lfi-testing-techniques/572452.png","ImageObject",442,249,{"name":88,"@type":89},"sagouaw","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-21","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",7,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"How do you identify potential LFI vulnerabilities in web applications?","Question",{"text":109,"@type":110},"Look for scripts that include files from the web server, then test by manipulating the file location parameter to see whether path traversal can disclose server files.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"What role do PHP wrappers play in bypassing input filters for LFI?",{"text":114,"@type":110},"PHP wrappers can be abused to bypass filtering by using alternative URI schemes and stream wrappers that change how the server processes the supplied parameter.",{"name":116,"@type":107,"acceptedAnswer":117},"Which techniques are covered for exploiting or evading LFI filters?",{"text":118,"@type":110},"The document covers methods including null byte technique, truncation LFI bypass, log file contamination, and wrapper-based approaches such as php://filter and ZIP wrapper LFI.","https://schema.org",{"og:url":78,"og:type":121,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":123,"canonical":78},"index,follow",{"doc_id":125,"site_id":56},572452,1792087010,{"code":4,"msg":5,"data":128},{"doc_id":125,"user_id":129,"nickname":88,"user_avatar":130,"doc_module":9,"category_id":50,"category_name":51,"doc_title":59,"doc_description":61,"doc_content":131,"file_id":132,"file_url":133,"file_type":134,"file_size":135,"view_count":101,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":20,"language":136,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":137,"faqs":138,"seo_title":139,"seo_description":61,"update_tm":140,"read_time":47},3985747862151,"https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd","Web Application Penetration Testing  \nLocal File Inclusion (LFI) Testing Techniques  \nJan 04, 2017, Version 1.0  \n©2017 – Aptive Consulting Ltd  \nThis document and the templates used in its production are the property of Aptive Consulting Ltd and cannot be copied (both in full or in part) without the permission of Aptive Consulting Ltd.  \nWhile precautions have been taken in the preparation of this document, Aptive Consulting Ltd the publisher, and the author(s) assume no responsibility for errors, omissions, or for damages resulting from the use of the information contained herein.  \nThe intent of this document is to help penetration testers and students identify and test LFI vulnerabilities on future penetration testing engagements by consolidating research for local file inclusion LFI penetration testing techniques. LFI vulnerabilities are typically discovered during web app penetration testing using the techniques contained within this document. Additionally, some of the techniques mentioned in this paper are also commonly used in CTF style competitions.  \nExample of Vulnerable Code................................................................................................................. 4  \nIdentifying LFI Vulnerabilities within Web Applications .................................................................... 4  \nPHP Wrappers......................................................................................................................................... 5  \nPHP Expect Wrapper.......................................................................................................................... 5  \nPHP file:// Wrapper ............................................................................................................................ 6  \nPHP php://filter................................................................................................................................... 7  \nPHP ZIP Wrapper LFI ......................................................................................................................... 9  \nLFI via /proc/self/environ.................................................................................................................... 10  \nUseful Shells ......................................................................................................................................... 10  \nNull Byte Technique ............................................................................................................................. 10  \nTruncation LFI Bypass ......................................................................................................................... 11  \nLog File Contamination ........................................................................................................................... 11  \nApache / Nginx ..................................................................................................................................... 12  \nEmail a Reverse Shell .................................................................................................................................. 12  \nReferences ................................................................................................................................................ 14  \ninput, allowing and attacker to manipulate the input and inject path traversal characters and include other files from the web server.  \nExample of Vulnerable Code  \nThe following is an example of PHP code vulnerable to local file inclusion.  \n\u003C?php  \n$file = $_GET['file'];  \nif(isset($file))  \n{  \ninclude(\"pages/$file\");}  \nelse  \n{  \ninclude(\"index.php\");}  \n?>  \nIdentifying LFI Vulnerabilities within Web Applications  \nLFI vulnerabilities are easy to identify and exploit. Any script that includes a file from a web server is a good candidate for further LFI testing, for example:  \n/script.php?page=index.html  \nA penetration tester would attempt to exploit this vul","cbCaimIkqZnYAHp3","https://ap.wps.com/l/cbCaimIkqZnYAHp3","pdf",1292510,"English","# Web Application Penetration Testing\n## Local File Inclusion (LFI) Testing Techniques\n## Example of Vulnerable Code\n## Identifying LFI Vulnerabilities within Web Applications\n## PHP Wrappers\n## PHP Expect Wrapper\n## PHP file:// Wrapper\n## PHP php://filter\n## PHP ZIP Wrapper LFI\n## LFI via /proc/self/environ\n## Useful Shells\n## Null Byte Technique\n## Truncation LFI Bypass\n## Log File Contamination\n## Apache / Nginx\n## Email a Reverse Shell\n## References","[{\"question\":\"How do you identify potential LFI vulnerabilities in web applications?\",\"answer\":\"Look for scripts that include files from the web server, then test by manipulating the file location parameter to see whether path traversal can disclose server files.\"},{\"question\":\"What role do PHP wrappers play in bypassing input filters for LFI?\",\"answer\":\"PHP wrappers can be abused to bypass filtering by using alternative URI schemes and stream wrappers that change how the server processes the supplied parameter.\"},{\"question\":\"Which techniques are covered for exploiting or evading LFI filters?\",\"answer\":\"The document covers methods including null byte technique, truncation LFI bypass, log file contamination, and wrapper-based approaches such as php://filter and ZIP wrapper LFI.\"}]","Web Application Penetration Testing - Local File Inclusion (LFI) - Testing Techniques | PDF",1791927448]