"); echo ''; echo ''; echo ''; //header("Location: /wap/index.wml"); // exit; } else { $wapuser = false; echo ''; echo ''; echo ' TelefonWeb SMS '; echo "\n\n"; } // We empty the buffer and send the first part of the web page to the user: flush(); ob_flush(); echo "\n"; flush(); ob_flush(); flush(); ob_flush(); // We check not to overuse this script, and also avoids making the same call twice when clicked double. $counter_file = "ultimacces.txt"; if (file_exists($counter_file)) $visits = file($counter_file); else $visits[0]=0; if($visits[0] + 15 > time()) die("Overuse. Please wait 15 seconds.."); $fp = fopen($counter_file , "w"); fputs($fp , time()); fclose($fp); // Proveidor de Betamax / Betamax provider used ex: justvoip.com, voipbusterpro.com, internetcalls.com ... if(isset($_REQUEST["provider"])) { $servidor = 'https://myaccount.' . $_REQUEST["provider"]; // . '.com'; } // Usuari i contrasenya / Account user and password if(!isset($_REQUEST["us"]) || !isset($_REQUEST["ps"])) { die("Missing Login information"); } $usuari = $_REQUEST["us"]; $contrasenya = $_REQUEST["ps"]; // $disp=1; // Ensenya el header i el contingut de les pàgines que descarrega. / Show the header and the content of the downloaded pages if($_REQUEST["disp"] ==1) { $disp=1; } // Url del compte Betamax (No necessari) / Betamax account URL (Not needed) ex. 'https://myaccount.justvoip.com' if(isset($_REQUEST["server"])) { $servidor = $_REQUEST["server"]; } if($servidor == "") { $servidor = "https://myaccount.smsdiscount.com"; } // tela= Telèfon origen / Source telephone // telb= Telèfon destí / Destination telephone if (isset($_REQUEST["tel"])) { $tel= $_REQUEST["tel"]; }else{ die("Missing Tel"); } $tels2 = split(",", $tel); for($i=0; $i < count($tels2); $i++) { if (!is_numeric($tels2[$i])) die("Invalid Tel:" . $tels2[$i]); } if (isset($_REQUEST["m"])) { $message= transcribe(urldecode($_REQUEST["m"])); }else{ die("Missing SMS Message to be sent"); } if (isset($_REQUEST["from"])) { $callerid= $_REQUEST["from"]; }else{ $callerid= $usuari; } // Si un número de telèfon no està en format internacional, assumeix que aquest prefix / If one telephone number is not specified in the international format, it assumes it will have as prefix if($_REQUEST["default"] !="") { if (substr($from,0,2)!= "00" && substr($from,0,1)!= "+") { $from = $_REQUEST["default"] . $from; } if(count($tels2)>0) { for($i=0; $i < count($tels2); $i++) { if (substr($tels2[$i],0,2)!= "00" && substr($tels2[$i],0,1)!= "+") { $tels2[$i] = $_REQUEST["default"] . $tels2[$i]; } } $tel = join(",", $tels2); } else { if (substr($tel,0,2)!= "00" && substr($tel,0,1)!= "+") { $tel = $_REQUEST["default"] . $tel; } } } //$horaestiu = 0; //if(date("I")) // $horaestiu = 3600; $horaestiu = 3600; if (isset($_REQUEST["day"])) { $day= $_REQUEST["day"]; }else{ $day= gmdate("d", time() +3600 + $horaestiu -60); // to simulate the time that the user took to write the sms } if (isset($_REQUEST["month"])) { $month= $_REQUEST["month"]; }else{ $month= gmdate("m", time() +3600 + $horaestiu -60); } if (isset($_REQUEST["hour"])) { $hour= $_REQUEST["hour"]; }else{ $hour= gmdate("H", time() +3600 + $horaestiu -60); } if (isset($_REQUEST["minute"])) { $minute= $_REQUEST["minute"]; }else{ $minute= gmdate("i", time() +3600 + $horaestiu -60); } if (strlen($tel)<5 || (substr($tel,0,2)!= "00" && substr($tel,0,1)!= "+")) { die("Invalid number tel: $tel"); } echo "To: $tel From:$callerid
"; echo "SMS: $message
"; echo "Sending..
\n"; // We empty the buffer and send the first part of the web page to the user: flush(); ob_flush(); echo "\n"; flush(); ob_flush(); flush(); ob_flush(); /*************************************************************************** Browser Emulating file functions v2.0.1b (adaptat i millorat per / adapted & improved by: MMinoves) (c) Kai Blankenhorn www.bitfolge.de/browseremulator kaib@bitfolge.de This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. **************************************************************************** Changelog: v2.0.1 fixed authentication bug added global debug switch v2.0 03-09-03 added a wrapper class; this has the advantage that you no longer need to specify a lot of parameters, just call the methods to set each option added option to use a special port number, may be given by setPort or as part of the URL (e.g. server.com:80) added getLastResponseHeaders() v1.5 added Basic HTTP user authorization minor optimizations v1.0 initial release ***************************************************************************/ /** * BrowserEmulator class. Provides methods for opening urls and emulating * a web browser request. **/ class BrowserEmulator { var $headerLines = Array(); var $postData = Array(); var $authUser = ""; var $authPass = ""; var $port; var $lastResponse = Array(); var $debug = false; function BrowserEmulator() { $this->resetHeaderLines(); $this->resetPort(); } /** * Adds a single header field to the HTTP request header. The resulting header * line will have the format * $name: $value\n **/ function addHeaderLine($name, $value) { $this->headerLines[$name] = $value; } /** * Deletes all custom header lines. This will not remove the User-Agent header field, * which is necessary for correct operation. **/ function resetHeaderLines() { $this->headerLines = Array(); /*******************************************************************************/ /************** YOU MAX SET THE USER AGENT STRING HERE *******************/ /* */ /* default is "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)", */ /* which means Internet Explorer 6.0 on WinXP */ $this->headerLines["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"; /*******************************************************************************/ } /** * Add a post parameter. Post parameters are sent in the body of an HTTP POST request. **/ function addPostData($name, $value) { $this->postData[$name] = $value; } /** * Deletes all custom post parameters. **/ function resetPostData() { $this->postData = Array(); } /** * Sets an auth user and password to use for the request. * Set both as empty strings to disable authentication. **/ function setAuth($user, $pass) { $this->authUser = $user; $this->authPass = $pass; } /** * Selects a custom port to use for the request. **/ function setPort($portNumber) { $this->port = $portNumber; } /** * Resets the port used for request to the HTTP default (80). **/ function resetPort() { $this->port = 80; } /** * Make an fopen call to $url with the parameters set by previous member * method calls. Send all set headers, post data and user authentication data. * Returns a file handle on success, or false on failure. **/ function fopen($url) { $this->lastResponse = Array(); preg_match("~([a-z]*://)?([^:^/]*)(:([0-9]{1,5}))?(/.*)?~i", $url, $matches); $protocol = $matches[1]; $server = $matches[2]; $port = $matches[4]; $path = $matches[5]; if ($port!="") { $this->setPort($port); } elseif ($protocol == 'https://') // by marti: { $this->setPort(443); // $server = "ssl://" . $server; // print "PORT SEGUR"; } if ($path=="") $path = "/"; $socket = false; $old_error_state = error_reporting(0); $socket = fsockopen(($protocol == 'https://' ? 'ssl://' : '') . $server, $this->port, $errno, $errstr); // by marti error_reporting($old_error_state); if (!$socket) { //die ("Cannot connect: $errno - $errstr
\n"); die ("Error connecting to the server.
\n"); } else{ $this->headerLines["Host"] = $server; if ($this->authUser!="" && $this->authPass!="") { $this->headerLines["Authorization"] = "Basic ".base64_encode($this->authUser.":".$this->authPass); } if (count($this->postData)==0) { $request = "GET $path HTTP/1.0\r\n"; } else { $request = "POST $path HTTP/1.0\r\n"; } if ($this->debug) echo $request; fputs ($socket, $request); if (count($this->postData)>0) { $PostStringArray = Array(); foreach ($this->postData AS $key=>$value) { $PostStringArray[] = "$key=$value"; } $PostString = join("&", $PostStringArray); $this->headerLines["Content-Length"] = strlen($PostString); } foreach ($this->headerLines AS $key=>$value) { if ($this->debug) echo "$key: $value\r\n"; fputs($socket, "$key: $value\r\n"); // echo "$key: $value\r\n"; } if ($this->debug) echo "\r\n"; fputs($socket, "\r\n"); if (count($this->postData)>0) { if ($this->debug) echo "$PostString"; fputs($socket, $PostString."\r\n"); } } if ($this->debug) echo "\r\n"; if ($socket) { $line = fgets($socket, 1000); if ($this->debug) echo $line; $this->lastResponse[] = $line; $status = substr($line,9,3); while (trim($line = fgets($socket, 1000)) != ""){ if ($this->debug) echo "$line"; $this->lastResponse[] = $line; if ($status=="401" AND strpos($line,"WWW-Authenticate: Basic realm=\"")===0) { fclose($socket); return FALSE; } } } return $socket; } /** * Make an file call to $url with the parameters set by previous member * method calls. Send all set headers, post data and user authentication data. * Returns the requested file as an array on success, or false on failure. **/ function file($url) { $file = Array(); $socket = $this->fopen($url); if ($socket) { $file = Array(); while (!feof($socket)) { $file[] = fgets($socket, 10000); } } else { return FALSE; } return $file; } function getLastResponseHeaders() { return $this->lastResponse; } } /* // example code $be = new BrowserEmulator(); $be->addHeaderLine("Referer", "http://previous.server.com/"); $be->addHeaderLine("Accept-Encoding", "x-compress; x-zip"); $be->addPostData("Submit", "OK"); $be->addPostData("item", "42"); $be->setAuth("admin", "secretpass"); // also possible: // $be->setPort(10080); $file = $be->fopen("http://restricted.server.com:10080/somepage.html"); $response = $be->getLastResponseHeaders(); while ($line = fgets($file, 1024)) { // do something with the file } fclose($file); */ ///////////////////////////////////////////////////// // Inici: $be = new BrowserEmulator(); // $be->addHeaderLine("Referer", "https://myaccount.justvoip.com/clx/index.php"); // $be->addHeaderLine("Accept-Encoding", "x-compress; x-zip"); $be->addHeaderLine("Accept",'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*'); $be->addHeaderLine("Accept-Language",'ca'); $be->addHeaderLine("User-Agent",'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)'); // $be->addPostData("part", "menu"); // $be->addPostData("username", $usuari); // $be->addPostData("password", $contrasenya); $file = $be->fopen($servidor . "/clx/index.php"); $response = $be->getLastResponseHeaders(); if ($disp==1) { echo "
1head:"; echo "
1body:"; // echo str_replace("Set-Cookie: ","", $response[4]); echo "
sessio=" . substr($response[4],22,54-22); } $sessio = substr($response[4],22,54-22); ////////////////////////////////////////////////////////////////// // setwindowname.php $be2 = new BrowserEmulator(); $be2->addHeaderLine("Referer", $servidor . "/clx/index.php"); //$be2->addHeaderLine("Accept-Encoding", "x-compress; x-zip"); $be2->addHeaderLine("Accept",'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*'); $be2->addHeaderLine("Accept-Language",'ca'); $be2->addHeaderLine("User-Agent",'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)'); $be2->addHeaderLine("Cookie", "PHPSESSID=" . $sessio); // $be2->addPostData("Cookie", "PHPSESSID=" . $sessio); $file2 = $be2->fopen($servidor . "/clx/setwindowname.php"); $response2 = $be2->getLastResponseHeaders(); if ($disp==1) { echo "
2head:"; $linies2 = array(); echo "
2body:"; // echo str_replace("Set-Cookie: ","", $response[4]); echo "
window=" . substr($linies2[50],15,24); } $windowm = substr($linies2[50],15,24); ////////////////////////////////////////////////////////// $be3 = new BrowserEmulator(); $be3->addHeaderLine("Referer", $servidor . "/clx/index.php"); //$be3->addHeaderLine("Accept-Encoding", "x-compress; x-zip"); $be3->addHeaderLine("Accept",'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*'); $be3->addHeaderLine("Accept-Language",'ca'); $be3->addHeaderLine('Content-Type','application/x-www-form-urlencoded'); $be3->addHeaderLine("User-Agent",'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)'); $be3->addHeaderLine("Cookie", "PHPSESSID=" . $sessio . "; windowname=" . $windowm ); // $be3->addPostData("PHPSESSID", $sessio); $be3->addPostData("part", "menu"); $be3->addPostData("username", $usuari); $be3->addPostData("password", $contrasenya); $file3 = $be3->fopen($servidor . "/clx/index.php?part=menu&justloggedin=true"); $response3 = $be3->getLastResponseHeaders(); if ($disp==1) { echo "
3head:"; echo "
3body:"; } // echo str_replace("Set-Cookie: ","", $response[4]); // echo "sessio=" . substr($response3[4],22,54-22); // $sessio = substr($response3[4],22,54-22); ///////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////// $be4 = new BrowserEmulator(); $be4->addHeaderLine("Referer", $servidor . "/clx/index.php?part=menu&justloggedin=true"); //$be4->addHeaderLine("Accept-Encoding", "x-compress; x-zip"); $be4->addHeaderLine("Accept",'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*'); $be4->addHeaderLine("Accept-Language",'ca'); $be4->addHeaderLine("Content-Type","application/x-www-form-urlencoded"); $be4->addHeaderLine("User-Agent",'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)'); $be4->addHeaderLine("Cookie", "PHPSESSID=" . $sessio . "; windowname=" . $windowm . "; voipusername=espaide"); // $be3->addPostData("PHPSESSID", $sessio); // $be3->addPostData("windowname", "wci9we87do5k3o1c46hecn2n"); // $be4->addPostData("part", "menu"); // $be4->addPostData("username", $usuari); // $be4->addPostData("password", $contrasenya); $file4 = $be4->fopen($servidor . "/clx/webcalls2.php"); $response4 = $be4->getLastResponseHeaders(); if ($disp==1) { echo "
4head:"; echo "
4body:"; } // echo str_replace("Set-Cookie: ","", $response[4]); // echo "sessio=" . substr($response3[4],22,54-22); // $sessio = substr($response3[4],22,54-22); /////////////////////////////// // setwindow name de nou: $be2b = new BrowserEmulator(); $be2b->addHeaderLine("Referer", $servidor . "/clx/index.php"); //$be2->addHeaderLine("Accept-Encoding", "x-compress; x-zip"); $be2b->addHeaderLine("Accept",'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*'); $be2b->addHeaderLine("Accept-Language",'ca'); $be2b->addHeaderLine("User-Agent",'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)'); $be2b->addHeaderLine("Cookie", "PHPSESSID=" . $sessio . "; windowname=" . $windowm . "; voipusername=espaide"); // $be2b->addPostData("Cookie", "PHPSESSID=" . $sessio); $file2b = $be2b->fopen($servidor . "/clx/setwindowname.php"); $response2b = $be2b->getLastResponseHeaders(); if ($disp==1) { echo "
2head:"; } $linies2b = array(); if ($disp==1) echo "
2body:"; // echo str_replace("Set-Cookie: ","", $response[4]); if ($disp==1) echo "
window=" . substr($linies2b[50],15,24); $windowm = substr($linies2b[50],15,24); ////////////////////////////////////////////////////////// // Section BE3B: In some servers this section has to be commented. // Aquesta pagina be3b no cal quan executo el programa per ex. localment amb el phped. $be3b = new BrowserEmulator(); $be3b->addHeaderLine("Referer", $servidor . "/clx/index.php"); //$be3->addHeaderLine("Accept-Encoding", "x-compress; x-zip"); $be3b->addHeaderLine("Accept",'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*'); $be3b->addHeaderLine("Accept-Language",'ca'); $be3b->addHeaderLine('Content-Type','application/x-www-form-urlencoded'); $be3b->addHeaderLine("User-Agent",'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)'); $be3b->addHeaderLine("Cookie", "PHPSESSID=" . $sessio . "; windowname=" . $windowm ); // $be3->addPostData("PHPSESSID", $sessio); // $be3->addPostData("windowname", "wci9we87do5k3o1c46hecn2n"); $be3b->addPostData("part", "menu"); $be3b->addPostData("username", $usuari); $be3b->addPostData("password", $contrasenya); $file3b = $be3b->fopen($servidor . "/clx/index.php?part=menu&justloggedin=true"); $response3b = $be3b->getLastResponseHeaders(); if ($disp==1) { echo "
3head:"; echo "
3body:"; } // End Section BE3B ////////////////////////////////////////////////////////// $be5a = new BrowserEmulator(); $be5a->addHeaderLine("Referer", $servidor . "/clx/webcalls2.php?panel=true"); //$be4->addHeaderLine("Accept-Encoding", "x-compress; x-zip"); $be5a->addHeaderLine("Accept",'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*'); $be5a->addHeaderLine("Accept-Language",'ca'); $be5a->addHeaderLine("Content-Type","application/x-www-form-urlencoded"); $be5a->addHeaderLine("User-Agent",'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)'); $be5a->addHeaderLine("Cookie", "PHPSESSID=" . $sessio . "; windowname=" . $windowm . "; voipusername=espaide"); // $be3->addPostData("PHPSESSID", $sessio); $file5a = $be5a->fopen($servidor . "/clx/websms2.php"); $response5a = $be5a->getLastResponseHeaders(); if ($disp==1) { echo "
5ahead:"; echo "
5abody:"; ////////////////////////////////////////////////////////// $be5 = new BrowserEmulator(); $be5->addHeaderLine("Referer", $servidor . "/clx/websms2.php"); //$be4->addHeaderLine("Accept-Encoding", "x-compress; x-zip"); $be5->addHeaderLine("Accept",'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*'); $be5->addHeaderLine("Accept-Language",'ca'); $be5->addHeaderLine("Content-Type","application/x-www-form-urlencoded"); $be5->addHeaderLine("User-Agent",'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)'); $be5->addHeaderLine("Cookie", "PHPSESSID=" . $sessio . "; windowname=" . $windowm . "; voipusername=espaide"); // $be3->addPostData("PHPSESSID", $sessio); $be5->addPostData("action","send"); $be5->addPostData("panel",""); $be5->addPostData("message",$message); $be5->addPostData("callerid",$callerid); // NOM USUARI $be5->addPostData("bnrphonenumber",$tel); $be5->addPostData("day",$day); $be5->addPostData("month",$month); $be5->addPostData("hour",$hour); $be5->addPostData("minute",$minute); $be5->addPostData("gmt","1"); //gmt time $file5 = $be5->fopen($servidor . "/clx/websms2.php"); $response5 = $be5->getLastResponseHeaders(); if ($disp==1) { echo "
5head:"; echo "
5body:"; if ($impres != "") { echo "
Done!
"; }else { echo "
Failed
"; } echo "
" . gmdate("ymd D H:i:s", time() +3600 + $horaestiu) . ""; // Final / End ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* echo " SINTAXI DE LA URL ÉS LA SEGÜENT: / URL SINTAX IS AS FOLLOWS:
call.php?provider=justvoip&disp=0&default=0034&forcea=0034&forceb=0034&us=USER&ps=PASSWORD&tela=TELEPHONEA&telb=TELEPHONEB
No utilizeu aquesta web per males finalitats. La utilització de la mateixa implica acceptar la responsabilitat de tota possible sobrecàrrega del sistema de trucades utilitzat. Gràcies.
"; */ if ($wapuser) { echo '
'; echo '
'; } else { echo "\n\n"; echo ''; } function transcribe($string) { $string = strtr($string, "\xA1\xAA\xBA\xBF\xC0\xC1\xC2\xC3\xC5\xC7 \xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1 \xD2\xD3\xD4\xD5\xD8\xD9\xDA\xDB\xDD\xE0 \xE1\xE2\xE3\xE5\xE7\xE8\xE9\xEA\xEB\xEC \xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF8 \xF9\xFA\xFB\xFD\xFF", "!ao?AAAAAC EEEEIIIIDN OOOOOUUUYa aaaaceeeei iiidnooooo uuuyy"); $string = strtr($string, array('\\'=>'', '/'=>'', "\xC4"=>"Ae", "\xC6"=>"AE", "\xD6"=>"Oe", "\xDC"=>"Ue", "\xDE"=>"TH", "\xDF"=>"ss", "\xE4"=>"ae", "\xE6"=>"ae", "\xF6"=>"oe", "\xFC"=>"ue", "\xFE"=>"th")); return($string); } ?>