* * 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 . */ header('Content-Type: text/html; charset=UTF-8'); if($_SERVER['REQUEST_METHOD']==='HEAD'){ exit; // headers sent, no further processing needed } include('common_config.php'); echo ''; echo "Daniel - $I[testtitle]"; echo ''; echo ''; echo ''; echo ''; echo '

Online-Test

'; print_langs(); echo "

$I[testdesc]

"; echo "
"; echo ""; echo "

$I[link]:

'; echo "

"; if(!empty($_REQUEST['addr'])){ if(ob_get_level()>0){ ob_end_flush(); } try{ $db=new PDO('mysql:host=' . DBHOST . ';dbname=' . DBNAME, DBUSER, DBPASS, [PDO::ATTR_ERRMODE=>PDO::ERRMODE_WARNING, PDO::ATTR_PERSISTENT=>PERSISTENT]); }catch(PDOException $e){ } if(!preg_match('~(^(https?://)?([a-z0-9]*\.)?([a-z2-7]{16})(\.onion(/.*)?)?$)~i', trim($_REQUEST['addr']), $addr)){ 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([$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([$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 lasttestexecute([$time, $md5, $time]); } echo "

$I[testoffline]

"; } curl_close($ch); } } echo '

Onion Link List - ' . VERSION . '

'; echo ''; ?>