Advertisement
Synthetics

Spam bot/Guest book

Jul 26th, 2011
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. Guessbook:
  2.  
  3. if(isset($_POST['name']) && isset($_POST['message'])) {
  4. $name = $_POST['name'];
  5. $message = $_POST['message'];
  6. $fh = fopen("messages.txt",'a');
  7. fwrite($fh,"{$name}: {$message}
  8. ");
  9. fclose($fh);
  10. }
  11. echo file_get_contents("messages.txt");
  12. ?>
  13.  
  14. Spambot:
  15.  
  16. $ch = curl_init("http://localhost/spam/guestbook.php");
  17. curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
  18. curl_setopt($ch,CURLOPT_POST,true);
  19. curl_setopt($ch,CURLOPT_POSTFIELDS,"name=G-Brain&message=SPAM+HERE!");
  20. for($i = 0;$i <= 1000;$i++) {
  21. curl_exec($ch);
  22. echo "{$i} ";
  23. }
  24. curl_close($ch);
  25. ?>
  26.  
  27. It would be good practice to, just allow only an X amount of posts per second/minute/hour as to avoid getting fucked.
  28.  
  29. Enjoy
  30.  
  31.  
  32. _____ _____ _____
  33. /\ \ |\ \ /\ \
  34. /::\ \ |:\____\ /::\____\
  35. /::::\ \ |::| | /::::| |
  36. /::::::\ \ |::| | /:::::| |
  37. /:::/\:::\ \ |::| | /::::::| |
  38. /:::/__\:::\ \ |::| | /:::/|::| |
  39. \:::\ \:::\ \ |::| | /:::/ |::| |
  40. ___\:::\ \:::\ \ |::|___|______ /:::/ |::| | _____
  41. /\ \:::\ \:::\ \ /::::::::\ \ /:::/ |::| |/\ \
  42. /::\ \:::\ \:::\____\/::::::::::\____/:: / |::| /::\____\
  43. \:::\ \:::\ \::/ /:::/~~~~/~~ \::/ /|::| /:::/ /
  44. \:::\ \:::\ \/____/:::/ / \/____/ |::| /:::/ /
  45. \:::\ \:::\ \ /:::/ / |::|/:::/ /
  46. \:::\ \:::\____\/:::/ / |::::::/ /
  47. \:::\ /:::/ /\::/ / |:::::/ /
  48. \:::\/:::/ / \/____/ |::::/ /
  49. \::::::/ / /:::/ /
  50. \::::/ / /:::/ /
  51. \::/ / \::/ /
  52. \/____/ \/____/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement