Activity 2.3 - Command Injection Vulnerabilities
/<form id="logform" method="post">
<div>
Search Term: <input type="text" name="search">
<div>
<div class="full-width"></br>
<button type="submit">Search</button>
</div>
</form>
<?php
if(isset($_POST['search'])) {
$searchterm=$_POST['search'];
echo "<div>";
echo "<h1>Searchterm:" . $searchterm . "</h1>";
echo "</div>";
echo "<pre>";
passthru("cat /home/hanne/sec480/week2/rockyou.txt | grep " . $searchterm);
echo "</pre>";
}
?>

Deliverable-1: Try the application out and search for a string of interest.

Deliverable-2: Figure out how to run commands of your choosing. Provide a screenshot similar to the one below that shows your application output as well as commands you've snuck in.




Last updated