Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * $ Bot TBDShoutBox v1
- * $ by Ahlspiess
- **/
- $bot = new TBDShout;
- $bot->username = 'ion';
- $bot->password = 'QWE!@#';
- $bot->host = 'http://w3.tbd.my';
- $bot->path = '/';
- $bot->Login();
- $bot->GetPostKey();
- $bot->FetchChat();
- class TBDShout {
- var $username, $password, $post_key;
- var $host, $path, $data;
- var $url, $post, $postfields;
- var $last_shout, $shouted;
- var $chat = array();
- var $nick = array();
- var $login_post = 'username=%s&password=%s&remember=yes&submit=Login&action=do_login&url=%s';
- var $add_shout = 'shout_data=%s&shout_key=%s';
- function Login() {
- $this->url = $this->host.$this->path.'/member.php';
- $this->post = 1;
- $this->postfields = sprintf($this->login_post, $this->username, $this->password, $this->host.$this->path);
- $this->Connect();
- $this->post = 0;
- $this->postfields = null;
- if(!preg_match("/You\ have\ entered\ an\ invalid\ username/", $this->data))
- {
- $this->e("[+] Login Successful!");
- }
- else
- {
- $this->e("[-] Login Failed!");
- exit;
- }
- }
- function SendShout($text) {
- $this->url = $this->host.$this->path.'/xmlhttp.php?action=add_shout';
- $this->post = 1;
- $this->postfields = sprintf($this->add_shout, urlencode($text), $this->post_key);
- $this->Connect();
- $this->post = 0;
- $this->postfields = null;
- sleep(1);
- }
- function FetchChat() {
- #print $shouted."\n";
- #print $last_shout."\n";
- $this->url = $this->host.$this->path.'/xmlhttp.php?action=show_shouts';
- $this->Connect();
- #print $this->data;
- if(preg_match("/Content\-Length\:\ 0/", $this->data))
- {
- $this->FetchChat();
- }
- preg_match_all("/\<a\ href\=\"member\.php\?action\=profile\&uid\=(.+?)\"\>(.+?)\<\/a\>\ \-\ (.+?)\ --\ (.+?)\<br\>/", $this->data, $var);
- #print_r($var);
- for($i=0;$i<count($var[1]);$i++)
- {
- //$var[2][$i] = preg_replace("/\<span\ style\=\"(.+)\"\>\<strong\>\<img\ src\=\"(.+)\"\/\>(.+?)\<\/strong\>\<\/span\>/", "$3", $var[2][$i]);
- //$var[4][$i] = preg_replace("/\<img\ src\=\"images\/smilies\/(.+?)\"\ style\=\"vertical\-align\:\ middle\;\"\ border\=\"0\"\ alt\=\"(.+?)\"\ title\=\"(.+?)\"\ \/\>/", ":$2:", $var[4][$i]);
- $var[2][$i] = preg_replace("/\<span\ style\=\"(.+)\"\>\<strong\>\<img\ src\=\"(.+)\"\/\>(.+?)\<\/strong\>\<\/span\>/", "$3", $var[2][$i]);
- $var[2][$i] = preg_replace("/\<span\ style\=\"(.+)\"\>\<strong\>(.+?)\<\/strong\>\<\/span\>/", "$2", $var[2][$i]);
- $var[4][$i] = preg_replace("/\<img\ src\=\"images\/smilies\/(.+?)\"\ style\=\"vertical\-align\:\ middle\;\"\ border\=\"0\"\ alt\=\"(.+?)\"\ title\=\"(.+?)\"\ \/\>/", ":$2:", $var[4][$i]);
- }
- if(!isset($this->shouted))
- {
- $this->e("[" . $var[3][9] . "] ". $var[2][9] . " - " . $this->unhtmlspecialchars($var[4][9]));
- $this->e("[" . $var[3][8] . "] ". $var[2][8] . " - " . $this->unhtmlspecialchars($var[4][8]));
- $this->e("[" . $var[3][7] . "] ". $var[2][7] . " - " . $this->unhtmlspecialchars($var[4][7]));
- $this->e("[" . $var[3][6] . "] ". $var[2][6] . " - " . $this->unhtmlspecialchars($var[4][6]));
- $this->e("[" . $var[3][5] . "] ". $var[2][5] . " - " . $this->unhtmlspecialchars($var[4][5]));
- $this->e("[" . $var[3][4] . "] ". $var[2][4] . " - " . $this->unhtmlspecialchars($var[4][4]));
- $this->e("[" . $var[3][3] . "] ". $var[2][3] . " - " . $this->unhtmlspecialchars($var[4][3]));
- $this->e("[" . $var[3][2] . "] ". $var[2][2] . " - " . $this->unhtmlspecialchars($var[4][2]));
- $this->e("[" . $var[3][1] . "] ". $var[2][1] . " - " . $this->unhtmlspecialchars($var[4][1]));
- $this->e("[" . $var[3][0] . "] ". $var[2][0] . " - " . $this->unhtmlspecialchars($var[4][0]));
- #for($ii=0;$ii<count($var[2]);$ii++)
- # {
- # if($this->msg[$ii] != $var[4][$ii])
- # {
- # $this->e($var[2][$ii] . " - " . $this->unhtmlspecialchars($var[4][$ii]));
- # }
- # $this->msg[$ii] = $var[4][$ii];
- # $this->nick[$ii] = $var[2][$ii];
- # }
- $this->shouted = 1;
- }
- if($this->last_shout != $var[4][0])
- {
- if($var[2][0] != 'loljohnburn') //ini saja2 jgn tnya kenapa ;D
- {
- if(preg_match("/^\!help/", $var[4][0])) {
- $this->help();
- } else if(preg_match("/^\!md5 ([a-zA-Z0-9]{32})$/", $var[4][0],$match)) {
- $this->decrypt($match[1]);
- } else if(preg_match("/^\!revIP ((1?\d{1,2}|2([0-4]\d|5[0-5]))(\.(1?\d{1,2}|2([0-4]\d|5[0-5]))){3})$/", $var[4][0],$match)) {
- $this->reverseip($match[1]);
- } else if(preg_match("/^\!c (.+)$/", $var[4][0],$match)) {
- $this->chatting($match[1],$var[2][0]);
- }
- // ko cuba la tukar jd switch mcm serabai je if byk2 aku dh try mcm2 tp xjd mklmla noob ;D
- /*switch($var[4][0])
- {
- case '!help':
- $this->help();
- break;
- case '!md5':
- $this->help();
- break;
- }*/
- }
- $this->e("[" . $var[3][0] . "] ". $var[2][0]." - ".$this->unhtmlspecialchars($var[4][0]));
- $this->last_shout = $var[4][0];
- $this->shouted = 1;
- }
- sleep(2);
- $this->FetchChat();
- }
- function help() {
- $this->SendShout('+----------------------------------------------------+');
- $this->SendShout('[+] !c <blabla> - untk chat ngan bot');
- $this->SendShout('[+] !revIP <ip> - reverse ip lookup');
- $this->SendShout('[+] !md5 <hash> - utk decrypt md5');
- $this->SendShout('[+] !help - utk print bende ni la');
- $this->SendShout('+----------------------------------------------------+');
- }
- function GetPostKey() {
- preg_match_all("/var\ my_post_key\ =\ \"(.+?)\"\;/", $this->data, $post_key);
- $this->post_key = $post_key[1][0];
- $this->e("[+] Post Key :" .$this->post_key);
- }
- function Connect() {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_HEADER, 1);
- curl_setopt($ch, CURLOPT_TIMEOUT, 15);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_URL, $this->url);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 ( .NET CLR 3.5.30729; .NET4.0E)");
- curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookie.txt');
- curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookie.txt');
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- if($this->post > 0) {
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $this->postfields);
- }
- $data = curl_exec($ch);
- if($data) {
- $this->data = $data;
- } else {
- $this->data = 0;
- }
- }
- function unhtmlspecialchars($string) {
- $string = str_replace('&', '&', $string);
- $string = str_replace(''', '\'', $string);
- $string = str_replace('"', '\"', $string);
- $string = str_replace('<', '<', $string);
- $string = str_replace('>', '>', $string);
- return $string;
- }
- function e($r) {
- print $r."\n";
- }
- function decrypt($md5){
- $url="http://md5.my-addr.com/md5_decrypt-md5_cracker_online/md5_decoder_tool.php";
- $md5=trim($md5);
- if(strlen($md5)!=32){ die("Invalid MD5 Hash");}
- $parameters="md5=$md5";
- $res=$this->postDataViaCurl($url,$parameters);
- $returnArray=array();
- $pattern='/Hashed string\<\/span\>: (.*)\<\/div\>/Uis';
- preg_match_all($pattern, $res, $returnArray, PREG_SET_ORDER);
- $nt=strip_tags(@$returnArray[0][1]);
- $nt=trim($nt);
- $result = (empty($nt)) ? '<not found>' : $nt;
- $this->SendShout($md5.':'.$result);
- }
- function reverseip($ip){
- $url="http://networktools.nl/reverseip/";
- $ip=trim($ip);
- $var = file_get_contents($url.$ip);
- if(preg_match("/\<\/b\>:(.*)(\<\/pre\>)/Us", $var,$match)) {
- $list = '';
- $domains = preg_split( '/\r\n|\r|\n/', trim($match['1']) );
- foreach($domains as $domain){
- $list .= $domain.', ';
- }
- }
- $list = rtrim($list, ', ');
- if (empty($list)) {
- $this->SendShout('<Domain not found lol>');
- } else {
- $this->SendShout('Domain hosted on '.$ip.': '.$list);
- }
- }
- function chatting($chat,$who){
- $chat = escapeshellcmd($chat);
- $response = exec("python chat.py $chat");
- $this->SendShout("@".$who.": ".$response);
- }
- function postDataViaCurl($url,$parameters){
- $ch = curl_init() or die("Sorry you need to have cURL extension Enabled");
- $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
- $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
- $header[] = "Cache-Control: max-age=0";
- $header[] = "Connection: keep-alive";
- $header[] = "Keep-Alive: 300";
- $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
- $header[] = "Accept-Language: en-us,en;q=0.5";
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12");
- curl_setopt($ch, CURLOPT_REFERER, $url);
- curl_setopt($ch, CURLOPT_POST, 1 );
- curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $postResult = curl_exec($ch);
- if (curl_errno($ch)) {
- return false;
- }
- curl_close($ch);
- return $postResult;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement