WordPress.org

Make WordPress Core

Ticket #44458: local-file-inclusion-example.php

File local-file-inclusion-example.php, 346 bytes (added by WFMattR, 15 months ago)

Test plugin that has a sample Local File Inclusion bug - do not install on a production site

Line 
1<?php
2/*
3Plugin Name: Local File Inclusion Vulnerability Example
4Plugin URI: http://localhost/
5Description: A simple example of a local file inclusion (LFI) vulnerability
6Author: mattr
7Version: 1.0
8*/
9
10
11function lfi_example() {
12        if(isset($_GET['lfi_example'])) {
13                include $_GET['lfi_example'];
14        }
15}
16
17add_action('plugins_loaded', 'lfi_example');