*
* 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 3 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, see
$I[testdesc]
"; echo "$I[invalonion]
"; echo "$I[valid]: http://tt3j2x4k5ycaa5zt.onion
"; }else{ $ch=curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_USERAGENT, USERAGENT); curl_setopt($ch, CURLOPT_PROXY, PROXY); curl_setopt($ch, CURLOPT_PROXYTYPE, 7); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15); curl_setopt($ch, CURLOPT_URL, "http://$addr[4].onion/"); $addr=strtolower($addr[4]); $md5=md5($addr, true); //display warning, if a phishing clone was tested $phishing=$db->prepare('SELECT original FROM ' . PREFIX . 'phishing, ' . PREFIX . 'onions WHERE address=? AND onion_id=' . PREFIX . 'onions.id;'); $phishing->execute(array($addr)); if($orig=$phishing->fetch(PDO::FETCH_NUM)){ printf("$I[testphishing]
", "$orig[0].onion"); } if(curl_exec($ch)!==false){ if(isSet($db)){ //update entry in database $stmt=$db->prepare('SELECT * FROM ' . PREFIX . 'onions WHERE md5sum=?;'); $stmt->execute(array($md5)); if(!$stmt->fetch(PDO::FETCH_NUM)){ $db->prepare('INSERT INTO ' . PREFIX . 'onions (address, md5sum, timeadded) VALUES (?, ?, ?);')->execute(array($addr, $md5, time())); } $db->prepare('UPDATE ' . PREFIX . 'onions SET lasttest=?, lastup=lasttest, timediff=0 WHERE md5sum=?;')->execute(array(time(), $md5)); } echo "$I[testonline]
"; }else{ if(isSet($db)){ $time=time(); $db->prepare('UPDATE ' . PREFIX . 'onions SET lasttest=?, timediff=lasttest-lastup WHERE md5sum=? AND lasttest;')->execute(array($time, $md5, $time)); } echo "$I[testoffline]
"; } curl_close($ch); } } echo '