Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 1 addition & 55 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,68 +1,14 @@
<?php


// test


// test

$userInput = isset($_GET['cmd']) ? $_GET['cmd'] : '';
$message = isset($_GET['message']) ? $_GET['message'] : '';

function executeCommand($cmd) {
echo "123";
echo "123";
system($cmd);
}

function displayMessage($msg) {
echo "123";
echo "123";
echo "<div>Your message: " . $msg . "</div>";
}
?>




/*
fuk me



*/

echo "123";
echo "123";

<!DOCTYPE html>
<html>
<head>
<title>Vulnerable Test Pagee</title>
</head>
<body>
<h1>Command Test</h1>
<form method="GET">
<input type="text" name="cmd" value="<?php echo $userInput; ?>">
<input type="submit" value="Execute">
</form>

<?php
if (!empty($userInput)) {
executeCommand($userInput);
}
?>

<h1>Message Test</h1>
<form method="GET">
<input type="text" name="message" value="<?php echo $message; ?>">
<input type="submit" value="Display">
</form>

<?php
if (!empty($message)) {
displayMessage($message);
}
?>
echo $message;
</body>
</html>