Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
User Posts

Go to Profile

"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)


Still not working.

Try adding

	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");


After rename() part into torrents-upload.php

Then create new .torrent file and upload it.

Test if it exists on ittorrents.org/torrent/YOUR_HASH_UPPERCASE.torrent
To explain this. This part doesn't work with PHP 7.2+
$post = array($type=>"@".$file); and for some reason redirects to cloudflare checking browser from itorrents.

Here is a try n.2 ->

Still no luck

 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");


[USER=20349]@leoncoder[/USER] any input?
[USER=20349]@leoncoder[/USER] let's use some of your php skills here as I heard you are pretty good at it :D

This is what I developed so far


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;
}


[ICODE]itorrents_upload('http://itorrents.org/autoupload.php','torrent',"$torrent_dir/$fname ");[/ICODE]
— 2019-09-10 12:09:29 in
trackers.dev
"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.

I still prefer pseudo-crypto hash rather than mksecret which is based on loop + mt_rand
"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.

The problem is that this script which 1337x uses offer automation for old PHP 5.4 - 5.6 only
It won't work with mksecret + $email if you use it with encrypt email mod from [USER=20288]@m-jay[/USER]
"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.

Edit_secret is defined when you change email in account.php form. Once you receive email and update the new email from mail link, edit secret is removed for security reasons that no one else from outside can generate email change.
This is based on Demonoid's email change recovery. I tried to create a similar method they use for the secret key which is 64 characters long.

Right now there is a SQL injection into account-ce.php which has the following build:

$id = (int) $_GET["id"];
$md5 = $_GET["secret"];
$email = $_GET["email"];


So the url [ICODE]/account-ce.php?id=1&secret=1bd58e7017f3661a5b32bb66b352fea7&email=new_admin_mail@mail.com[/ICODE] will change the admin email and give access to the attacker to the admin mail which they can reset via password reset.

secret is generated by[ICODE] md5($email)[/ICODE] which can easily be decrypted.
--------------------------------

My fix is instead of generating email hash via md5, to generate a really strong cryptographically secure key.

1. Go to database, users -> change column 'edit_secret' and set varchar to 64.

2. Find the following in the account.php -
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


Replace with: -

// 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;
           } //changedemail


3. Open account-ce.php
Find [ICODE]if ($md5 != md5($sec . $email . $sec)) [/ICODE]
Replace with [ICODE]if ($md5 != $sec)[/ICODE]
Also there is a major problem with announces. If site has 20k torrents there could be over half million columns of repeated announces...

It's really, really bad how big it can grow.
I did a different approach to this, you just gave me an idea how to access it :P
$pagedefault = floor(($count - 1) / $rpp);

function 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>&lt;&lt;&nbsp;".T_("PREVIOUS")."</b>";
   if ($page >= 1) {
       $pager .= "<a href=\"{$href}page=" . ($page - 1) . "\">";
       $pager .= $as;
       $pager .= "</a>";
   }
   else
       $pager .= $as;
   $pager .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
   $as = "<b>".T_("NEXT")."&nbsp;&gt;&gt;</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&nbsp;-&nbsp;$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");
}
Thanks [USER=1398]@serph[/USER]

That worked great.
"MicroMonkey, post: 67181, member: 311":

try just changing the DESC to ASC. Just a guess

Changing that will just make it as default. The pagination pager should open last page when open a torrent details like on demonoid
[USER=20288]@m-jay[/USER] The email ban check part is incorrect. It shouldn't be encrypted as those mails are decrypted into email_bans table.

// 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'")));
Ah not that, it will just swap the order of comment by DESC
I want to set the last page of comments when there are several pages of comments so users can continue discussion without having to go on the latest page.

Here's the example on the demonoid -> https://www.dnoid.to/files/details/7676/077675117/#comments
[USER=20288]@m-jay[/USER], can you please check your site and tell me if the performance for logged out users is faster like 30-40% than for logged in? If you use encrypt mail + bcrypt
[USER=20288]@m-jay[/USER] can you please try adding encrypt mail option to this, I think that is the issue.
"m-jay, post: 67084, member: 20288":

added 1 more edit to that post


[USER=20288]@m-jay[/USER]
Edit: Okay I fixed it. I think we need a full-text search to cover wildcard?

Edit2: I think it doesn't work cause of encryption. It gets encrypted part decrypted, but it doesn't know how to find the rest of encrypted email.
"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:

There are some errors into the code you've posted. I've fixed the characters errors, but search doesn't work there :/
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728