"m-jay, post: 67216, member: 20288":
$post = array($type=>"@".$file);
This line is php5.5 @ is depicted you can try some thing like this
$post = array($type=>curl_file_create(.$file)
function itorrents_upload($type,$file){
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "http://itorrents.org/autoupload.php");
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$post = array($type=>curl_file_create($file));
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($curl);
curl_close($curl);
#echo $response;
}
itorrents_upload('torrent',"$torrent_dir/$id.torrent"); function itorrents_upload($url,$file){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
$data = array('name' => 'torrent', // Don't change
'type' => 'application/x-bittorrent',
'file' => $file );
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
return $response;
}
itorrents_upload('http://itorrents.org/autoupload.php',"$torrent_dir/$fname");
function itorrents_upload($url,$type,$file){
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
$post = array($type=>"@".$file);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
return $response;
}
"mostvotedplaya, post: 67201, member: 20335":
That is a issue that he would have to resolve, but in terms of the exploit that was available here that was resolved.
"mostvotedplaya, post: 67198, member: 20335":
I would call that more of a mirroring service for torrents.
I made an actual API uploading service for TT some years ago, the core really needs this feature.
"mostvotedplaya, post: 67192, member: 20335":
Have you tested this is actually a problem because for me i am having difficulty making the flaw work. By looking at the write it, it means the editsecret column must be empty, but in the version 2.08 i have seen we check to prevent that from being empty.
$id = (int) $_GET["id"];
$md5 = $_GET["secret"];
$email = $_GET["email"];if ($changedemail) {
$sec = mksecret();
$hash = md5($sec . $email . $sec);
$obemail = rawurlencode($email);
$updateset[] = "editsecret = " . sqlesc($sec);
$thishost = $_SERVER["HTTP_HOST"];
$thisdomain = preg_replace('/^www\./is', "", $thishost);
$body = <<<EOD
You have requested that your user profile (username {$CURUSER["username"]})
on {$site_config["SITEURL"]} should be updated with this email address ($email) as
user contact.
If you did not do this, please ignore this email. The person who entered your
email address had the IP address {$_SERVER["REMOTE_ADDR"]}. Please do not reply.
To complete the update of your user profile, please follow this link:
{$site_config["SITEURL"]}/account-ce.php?id={$CURUSER["id"]}&secret=$hash&email=$obemail
Your new email address will appear in your profile after you do this. Otherwise
your profile will remain unchanged.
EOD;
sendmail($email, "$site_config[SITENAME] profile update confirmation", $body, "From: $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
$mailsent = 1;
} //changedemail
// Here we generate a cryptographically secure key via random_bytes
function crypt_secret(int $length = 64){ // 64 = 32
$length = ($length < 4) ? 4 : $length;
return bin2hex(random_bytes(($length-($length%2))/2));
}
// Here we get the new hash method
if ($changedemail) {
$hash = crypt_secret();
$obemail = rawurlencode($email);
$updateset[] = "editsecret = " . sqlesc($hash);
$thishost = $_SERVER["HTTP_HOST"];
$thisdomain = preg_replace('/^www\./is', "", $thishost);
$body = <<<EOD
You have requested that your user profile (username {$CURUSER["username"]})
on {$site_config["SITEURL"]} should be updated with this email address ($email) as
user contact.
If you did not do this, please ignore this email. The person who entered your
email address had the IP address {$_SERVER["REMOTE_ADDR"]}. Please do not reply.
To complete the update of your user profile, please follow this link:
{$site_config["SITEURL"]}/account-ce.php?id={$CURUSER["id"]}&secret=$hash&email=$obemail
Your new email address will appear in your profile after you do this. Otherwise
your profile will remain unchanged.
EOD;
sendmail($email, "$site_config[SITENAME] profile update confirmation", $body, "From: $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
$mailsent = 1;
} //changedemailfunction pager2($rpp, $count, $href, $opts = array()) {
$pages = ceil($count / $rpp);
if (!$opts["lastpagedefault"])
$pagedefault = floor(($count - 1) / $rpp);
if (isset($_GET["page"])) {
$page = (int) $_GET["page"];
if ($page < 0)
$page = $pagedefault;
}
else
$page = $pagedefault;
$pager = "";
$mp = $pages - 1;
$as = "<b><< ".T_("PREVIOUS")."</b>";
if ($page >= 1) {
$pager .= "<a href=\"{$href}page=" . ($page - 1) . "\">";
$pager .= $as;
$pager .= "</a>";
}
else
$pager .= $as;
$pager .= " ";
$as = "<b>".T_("NEXT")." >></b>";
if ($page < $mp && $mp >= 0) {
$pager .= "<a href=\"{$href}page=" . ($page + 1) . "\">";
$pager .= $as;
$pager .= "</a>";
}
else
$pager .= $as;
if ($count) {
$pagerarr = array();
$dotted = 0;
$dotspace = 3;
$dotend = $pages - $dotspace;
$curdotend = $page - $dotspace;
$curdotstart = $page + $dotspace;
for ($i = 0; $i < $pages; $i++) {
if (($i >= $dotspace && $i <= $curdotend) || ($i >= $curdotstart && $i < $dotend)) {
if (!$dotted)
$pagerarr[] = "...";
$dotted = 1;
continue;
}
$dotted = 0;
$start = $i * $rpp + 1;
$end = $start + $rpp - 1;
if ($end > $count)
$end = $count;
$text = "$start - $end";
if ($i != $page)
$pagerarr[] = "<a href=\"{$href}page=$i\"><b>$text</b></a>";
else
$pagerarr[] = "<b>$text</b>";
}
$pagerstr = join(" | ", $pagerarr);
$pagertop = "<p align=\"center\">$pager<br />$pagerstr</p>\n";
$pagerbottom = "<p align=\"center\">$pagerstr<br />$pager</p>\n";
}
else {
$pagertop = "<p align=\"center\">$pager</p>\n";
$pagerbottom = $pagertop;
}
$start = $page * $rpp;
return array($pagertop, $pagerbottom, "LIMIT $start,$rpp");
} "MicroMonkey, post: 67181, member: 311":
try just changing the DESC to ASC. Just a guess
// encrypt email
$maildomain = (substr($email, strpos($email, "@") + 1));
$mail = $crypt->b64encode($email, $clef);
$maildomain = $crypt->b64encode($maildomain, $clef);
$a = (@mysqli_fetch_row(@SQL_Query_exec("select count(*) from email_bans where mail_domain='$mail'"))); "m-jay, post: 67084, member: 20288":
added 1 more edit to that post
"m-jay, post: 67081, member: 20288":
heres the code for updating simple search http://www.torrenttrader.xyz/index.php?threads/encrypt-email-ttv3.9812/page-2#post-67078
This is better for searching then the advanced one, with the simple one you dont have to search full name, full email, full ip etc because its not linked to functions.
For some reason i still cant search @gmail or gmail but if you try search the first part of the email it will find it, play around testing it ive had a go and it finds ips with just searching 2 numbers, it appears in the simple search its just the email that could be improved.
The advanced one for search is awful maybe we could take the search from the simple and use that or edit the functions out :unsure: