*
* 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_ENCODING, ''); 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([$addr]); if($orig=$phishing->fetch(PDO::FETCH_NUM)){ printf("$I[testphishing]
", "$orig[0].onion"); } $stmt=$db->prepare('SELECT null FROM ' . PREFIX . 'onions WHERE md5sum=? AND timediff=0 AND lasttest>?;'); $stmt->execute([$md5, time()-60]); if($stmt->fetch(PDO::FETCH_NUM)){ echo "$I[testonline]
"; }elseif(curl_exec($ch)!==false){ if(isSet($db)){ //update entry in database $stmt=$db->prepare('SELECT null FROM ' . PREFIX . 'onions WHERE md5sum=?;'); $stmt->execute([$md5]); if(!$stmt->fetch(PDO::FETCH_NUM)){ $db->prepare('INSERT INTO ' . PREFIX . 'onions (address, md5sum, timeadded) VALUES (?, ?, ?);')->execute([$addr, $md5, time()]); } $db->prepare('UPDATE ' . PREFIX . 'onions SET lasttest=?, lastup=lasttest, timediff=0 WHERE md5sum=?;')->execute([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([$time, $md5, $time]); } echo "$I[testoffline]
"; } curl_close($ch); } } echo '