WordPress.org

Make WordPress Core

Ticket #37283: mysqli_LOCK_crash_POC.php

File mysqli_LOCK_crash_POC.php, 546 bytes (added by thebfg, 5 years ago)

proof of concept file

Line 
1<?php
2$con = mysqli_connect("localhost", "user", "password", "wpdatabase");
3if (mysqli_connect_errno()) {
4  printf("Connect failed: %s\n", mysqli_connect_error());
5  exit();
6}
7
8$query = "INSERT INTO `wpfs_options` ( `option_name`, `option_value`, `autoload` ) VALUES ('core_updater.lock', '1467665967', 'no') /* LOCK */";
9echo "Maybe it will crash? $query\n";
10$result = mysqli_query($con, $query);
11echo "If you see this, it did not crash: $query\n";
12if ( false===$result ) {
13  printf("error: %s\n", mysqli_error($con));
14}
15else {
16  echo 'done.';
17}