Skip to content

Instantly share code, notes, and snippets.

@phyesix
Created June 19, 2021 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phyesix/f7050a60ffd664a5af488fbb9a9af529 to your computer and use it in GitHub Desktop.
Save phyesix/f7050a60ffd664a5af488fbb9a9af529 to your computer and use it in GitHub Desktop.
Wordpress Comment Bot
<?php
function curl_gir($site) {
$ch = curl_init($site);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, $site);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_NOBODY, 0);
$index = curl_exec($ch);
return $index;
}
?>
<html>
<head>
<title>Wordpress Comment Bot</title>
</head>
<style type="text/css">
body {
padding: 50px;
}
h3 {
font-size: 10px;
color: #2196f3;
margin: 0;
}
</style>
<body>
<h1>Wordpress Comment Bot</h1>
<form action="" method="POST">
<input type="text" name="author" placeholder="Gönderen"><br><br>
<input type="text" name="email" placeholder="E-Mail"><br><br>
<input type="text" name="url" placeholder="https://site.com"><br><br>
<textarea type="text" name="yorum" placeholder="yorumunuzu giriniz" style="width: 760px; height: 183px;"></textarea><br><br>
<textarea type="text" name="siteler" placeholder="site adresleri alt alta" style="width: 760px; height: 183px;"></textarea><br><br>
<input type="text" name="p" placeholder="Password"><br><br>
<button type="submit" name="yorum_gonder">Yorumu Gönder</button>
</form>
<?php
if(isset($_POST["yorum_gonder"])) {
if(empty($_POST["author"] and $_POST["email"] and $_POST["url"] and $_POST["siteler"] and $_POST["yorum"] and $_POST["p"])) {
echo '<h3>boş alan bırakmayınız.</h3>';
exit;
}
if($_POST["p"] !== "storax206") {
echo '<h3>yanlış.</h3>';
exit;
}
function ana_adres($adres) {
$adres_bol = explode("/", $adres);
$www_sil = str_replace("www.", "", $adres_bol[2]);
return $www_sil;
}
function curlRequest($url) {
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($c);
curl_close($c);
return $data;
}
$yorum = $_POST["yorum"];
$forsite = explode("\r\n", $_POST['siteler']);
foreach ($forsite as $site) {
//$context = stream_context_create(array('http' => array('header'=>'Connection: close\r\n')));
//$gir = file_get_contents($site,false,$context);
$gir = curlRequest($site);
preg_match_all("#name=\"comment_post_ID\" value=\"(.*?)\"#si",$gir,$post_id);
$post_id_real = $post_id[1][0];
preg_match_all("#name='comment_post_ID' value='(.*?)'#si",$gir,$post_id);
$post_id_real_2 = $post_id[1][0];
if($post_id_real == "") {
$post_id_real = $post_id_real_2;
}
//print_r($post_id_real);
preg_match_all("#<form action=\"(.*?)\"#si",$gir,$comment_url);
$comment_url_real = $comment_url[1][0];
preg_match_all("#<form action='(.*?)'#si",$gir,$comment_url);
$comment_url_real_2 = $comment_url[1][0];
if($comment_url_real == "") {
$comment_url_real = $comment_url_real_2;
}
//print_r($comment_url_real);
$ana_adres = ana_adres($site);
$yeni_adres = $comment_url_real;
$curl_gir = curl_gir($yeni_adres);
if(strstr($curl_gir, "404")) {
echo '<h3>'.$yeni_adres.' bu adrese ulaşılamıyor(404)</h3>';
exit;
}
$ch = curl_init($yeni_adres);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36");
curl_setopt($ch, CURLOPT_REFERER, $site);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "comment=".$yorum."&author=".$_POST["author"]."&email=".$_POST["email"]."&url=".$_POST["url"]."&comment_post_ID=".$post_id_real."&comment_parent=0");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_NOBODY, 0);
$index = curl_exec($ch);
echo '<h3>Gönderilmiş olması gerekiyor! kontrol ediniz : <a rel="nofollow" href="'.htmlspecialchars($site).'" target="_blank">Gönderiye git</a> - '. $post_id_real . ' - ' . $comment_url_real . ' </h3>';
}
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment