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
[HACK] OpenSSL AES Download URL Encrypti
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Completed

2020-03-25 18:51:54
Hello,  :)

I would like to tell you that I have put here the full version which works very well with ttv3-mysqli ?

Author : [color=rgb(243, 121, 52)]WiiLF [/color]
[color=rgb(204, 204, 204)]Update :[/color][color=rgb(243, 121, 52)] SPIRITBLUE[/color]
SQL : [color=rgb(209, 72, 65)]No[/color]

WiiLF said...
I decided to releases just a little bit of my own work to our community tracker, for those here since I feel a little selfish. Its easy. So this lets you encrypt your download URls with SHA256 encryption.

1st Update:  base64_encode fix, works 100% now no dead request.
2nd Update: Further minimized URL and minor fixes.

This will produce this type of URl:
[color=rgb(255, 255, 255)][URL unfurl="true"]http://www.domain.com/4/kTwgGHNprLlP4BRinKEFhq9Cpch9Txr36kE0BoBK7ZmAiQjkJvzAqBA4bKWOVgjeonTqTysYV3BiM00dAbQ9vbn9phfvD-sRhta37VIi-OO8wKLmrp2dFgZpIsKq1qlW/[/url][/color]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[color=rgb(255, 255, 255)]Open torrent-details.php and find:
<a href=\"download.php?id=$id&amp;name=" . rawurlencode($row["filename"]) . "\"> 



Replace with :
<a href='/" . $row["id"] . "/" . $download_title . "/'> 
[/color]



Add in file [color=rgb(251, 160, 38)]backend[/color] / URL file [color=rgb(250, 197, 28)]encrypt.php[/color]


In backend / functions.php look for :
<a href=\"download.php?id=$id&amp;name=" . rawurlencode($row["filename"]) . "\"> 



Replace with :
<a href='/" . $row["id"] . "/" . $download_title . "/'> 



Add to .htaccess
[color=rgb(255, 255, 255)]

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/$ /download.php?id=$1&name=$2 [L]
[/color]


[ATTACH type="full" width="1106px" alt="Capturde.PNG"]5406[/ATTACH]
URLencrypt.rar
Download
Capturde.PNG
Capturde.PNG

2020-03-27 02:50:16
Thank you, good to see its been ported. There is 1 bug with this, and I believe it was the login redirect, but I'll track it down again. I just know there was 1 issue after I compiled this and it was hit or miss @ 15K members
2020-03-27 06:08:40
backend/functions.php and torrents-details.php also needs
require_once("backend/URLencrypt.php");


To add to functions.php (to encrypt your index page downloads) find
    // Expanding Area
   $expandrows = array();
   if (!empty($site_config["torrenttable_expand"])) {
       $expandrows = explode(",", $site_config["torrenttable_expand"]);
       $expandrows = array_map("strtolower", $expandrows);
       $expandrows = array_map("trim", $expandrows);
   }
   // End


add below

///openSSL torrent encryption
require_once("backend/URLencrypt.php");
///end torrent encryption


find
<a href=\"download.php?id=$id&amp;name=" . rawurlencode($row["filename"]) . "\">


replace with
<a href='/" . $row["id"] . "/" . $download_title . "/'>

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2020-03-27 08:25:04
PHP OpenSSL module is required for this mod.
2020-03-27 09:26:47
I posted how to turn this on several years ago, but I will repost it here if it helps anyone. This using ubuntu linux
Enable .htaccess in apache2 config

First Step:

Open file in your editor

sudo nano /etc/apache2/apache2.conf

Second Step:

remove comment sign (#) if you find it before this line ( line number 187 approx.)

AccessFileName .htaccess

Third Step:

Then find the line where there is

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

replace "None" with "All"

AllowOverride All



Also run:

sudo a2enmod rewrite


then restart apache:

sudo service apache2 restart

Here is an .htaccess file to use. Feel free to open it up with any text editor to see im not an asshole adding wierd shit to a file trying to screw someone over. Im not that guy. I dont do that. but if you have a custom htaccess, just add the lines to your current copy and save it :)
htaccess.rar
Download

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Unknown User
2020-03-27 20:56:51
Easier way to use pseudo-cryptographically secure key

1. Create new column (varchar 255) in torrents table named for example 'cryptographical_key'
2. Update torrents-upload.php with insert value add the last value to be ".bin2hex(random_bytes(10))."
3. Update download.php -  '$res = SQL_Query_exec("SELECT filename, banned, external, announce FROM torrents WHERE id =".intval($id)); '
to $res = SQL_Query_exec("SELECT filename, banned, external, announce FROM torrents WHERE cryptographical_key = $key
4. Update torrents-details.php - add into SELECT 'cryptographical_key', then for download instead of 'download.php?id=$id'
add download.php?id=".$row['cryptographical_key']."

The final result will be something like domain.com/download.php?id=af6d1ddfdd95a91f985a
2020-03-27 23:58:37
thanks shadows. Everything you do is appreciated :)
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2023-01-02 19:16:30
old topic, but in backend/URLencypt, find
authkey

replace with
authKey

misspelling error
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2023-01-02 21:38:12
This would be better using a private/public keypair, like my announcement and messages encryption (same system).

That would be the final update to this mod. I personally abandoned this shortly after porting it back in 2020, but seeing this today.. I think its worth giving it a shot again.

Not only that.. it eliminates the GET id.. which prevents timing attacks.

What do I mean?
TT isnt written to prevent this. And several pages are vulnerable to:

?id=27+1

A generator can step that up with a simple for loop, and download the entire database in about a few seconds, and proxy a GZip compression request - alltorrents.gz - This can be done in Python in about 30 minutes.

You guys must use
intval($_GET['id'])
- it protects against this internally.
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: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728