Command Injection
Example:
<?php
if (isset($_GET['domain'])){
echo '<pre>';
$domain = $_GET['domain'];
$lookup = system("nslookup {$domain}");
echo($lookup);
echo '</pre>';
}
?><?php
if (isset($_GET['domain'])){
echo '<pre>';
$domain = escapeshellarg($_GET['domain']);
$lookup = system("nslookup {$domain}");
echo($lookup);
echo '</pre>';
}
?>from subprocess import call
call(["nslookup", domain]) //note the use of the array to avoid string concatssystem("nslookup", domain) #only pass arrays to avoid string concatsLast updated