-
Notifications
You must be signed in to change notification settings - Fork 0
/
vulnerability-playground.php
58 lines (46 loc) · 1.69 KB
/
vulnerability-playground.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
*
* @wordpress-plugin
* Plugin Name: Vulnerability Playground
* Plugin URI: https://patchstack.com
* Description: This plugin designed to contain vulnerable function or process to be used to exercise on hacking WordPress ecosystem.
* Version: 1.0.0
* Author: Patchstack
* Author URI: https://patchstack.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: vulnerability-playground
* Domain Path: /languages
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
define( 'PLUGIN_NAME_PLUGIN_NAME', 'vulnerability-playground' );
define( 'PLUGIN_NAME_VERSION', '1.0.0' );
define( 'PLUGIN_NAME_URL', plugin_dir_url( __FILE__ ) );
define( 'PLUGIN_NAME_PATH', plugin_dir_path( __FILE__ ) );
define( 'PLUGIN_NAME_BASE_DIR', plugin_dir_path( __FILE__ ) );
define( 'PLUGIN_NAME_BASE_NAME', plugin_basename( __FILE__ ) );
function create_the_custom_table() {
global $wpdb;
$charset_collate = $wpdb->get_charset_collate();
$table_name = $wpdb->prefix . 'custom_questions';
$sql = "CREATE TABLE " . $table_name . " (
question_id int(11) NOT NULL AUTO_INCREMENT,
title tinytext NOT NULL,
description tinytext,
type tinytext,
category tinytext,
PRIMARY KEY (question_id)
) $charset_collate;";
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($sql);
}
register_activation_hook(__FILE__, 'create_the_custom_table');
$vuln_types = array("afd", "afr", "afu", "bac", "csrf", "lfi", "phpoi", "privesc", "rce", "sqli", "ssrf", "xss");
foreach($vuln_types as $vuln_type){
include_once $vuln_type . "/init.php";
}
?>