Private BitTorrent Trackers Under Threat From Major Exploit

Written by enigmax on April 18, 2008 

Thousands of private BitTorrent trackers using the popular TBDev code are vulnerable to hostile takeover. According to a security researcher, a successful execution of the exploit could result in the attacker gaining admin rights to the tracker. However, knowledge and a little care can mitigate the effects.

The popular TBDev code on which thousands of private BitTorrent trackers are built, is said to be vulnerable to a major exploit. A successful attack could allow a malicious attacker to deface the main tracker page (index.php) and hijack the account of anyone who logs into the application. Worryingly it’s even possible to hijack an administrator’s account by using a social engineering attack to get them to click on specially crafted hyperlink, although most admins won’t be tricked by this method.

According to Michael Brooks, a security researcher who brought this issue to our attention, this particular TBDev exploit is down to the fact the developers didn’t protect the administrative interface from Cross Site Scripting attacks (XSS).

The attack uses CSRF in a chain with other flaws to obtain synergy - Michael calls this CSRF Bouncing.

“Unfortunately this Cross Site Scripting attack is accessible by an attacker using a Cross Site Request Forgery” Michael told TorrentFreak. “The Cross Site Scripting flaw is particularly valuable. The XSS payload is stored in the main index.php for the application. This means that an attacker can expose every visitor to their payload.”

Michael goes on: “The CSRF flaw is POST based so it does require the administrator to execute javascript. Finding the administrator account isn’t difficult if you have a user account on the system. Like with just about every SQL powered application the administrator is the first user account created. From this profile you will be able to send a personal message and you may even be able to obtain the admin’s email address.”

Worryingly, even if the attacker doesn’t have a user account, it’s possible to get one using an XSS flaw.

Michael explained how a malicious attacker increases his chances of a success with the exploit, by combining it with a little social engineering.

“In this case I am using the reflective XSS flaw to make it appear as though the administrator is viewing his own web application. The social engineering attack could look something like this: ‘I think there is a bug in your site. Can you check this link, it just does not look right http://localhost/redir.php?url=’ . This now means the flaw is no longer a “Cross Site” Request Forgery, because the request is being sent from the same website.”

After a successful attack it’s possible to deface the site and “hijack every user’s authentication token indefinitely”.

So what can be done to avoid this exploit? Michael told TorrentFreak:

“The most important thing to keep in mind is do not click on links that look like this. The link can be easily modified to be shorter, but the important part is avoiding links to TBDev’s /redir.php.”

exploit

“However this isn’t the only way that the flaw can be exploited. If you visit a website that the hacker controls then he can also trigger the attack. If you think you might have clicked on a bad link, change your password immediately.”

So what should an admin do if they already fell victim to the exploit?

“To remove the persistent XSS payload the administrator might have to login to the SQL server manually and delete the offending entry in the “news” table (since they won’t be able to use the web application to delete the news posting) using DELETE FROM news WHERE body LIKE ‘%fromCharCode%’.

The difficult part is that every user will have to change their password. In PHP I suggest defending against XSS using htmlspecialchars($var,ENT_QUOTES); . There are cases where XSS can still be possible without ENT_QUOTES. To defend against CSRF i suggest using PHP CSRF Guard.”

An administrator on a TBDev tracker we spoke with suggested a very quick fix off the top of his head:

in news.php change

$body = $_POST["body"];

to

$body = htmlspecialchars($_POST["body"],ENT_QUOTES);

We put this to Michael who told us: “The fix isn’t bad however the same fix also needs to be applied to $_GET["url"] in redir.php or the administrator account as well as others are subjected to hijack. There are other security problems with this application, but the XSS is the most serious as it leads to immediate attack.”

Earlier today TorrentFreak contacted a number of admins with details of the exploit. Michael tells us he has notified the relevant people of the flaw but it may take a few days until an official patch is made available.

The full details of the exploit are available here.

Previously: Pirate Bay Trial Star Witness Employed by Plaintiff

Next: Biohazard Bassist Blasts BitTorrent

65 Responses

Pages: [1] 2 3 » Show All

1 Apr 18, 2008 at 19:30 by Rycon

Crazy haxxors..

2 Apr 18, 2008 at 19:30 by Anonymous

or you could just install what.cd project gazelle. and get hacked in less time than it takes for tbdev

3 Apr 18, 2008 at 19:36 by fixxxxxxxed

thanks freaks!!

fixed my tracker in 2 mins!!

4 Apr 18, 2008 at 19:43 by George

OH MY GOD!

5 Apr 18, 2008 at 19:49 by troll

All the fuckwits on here (and everywhere else) spouting that private trackers are more secure, this just goes to show how little you know losers.

6 Apr 18, 2008 at 19:54 by mike jones

they r safer even with that prob prob can be fixed quick

7 Apr 18, 2008 at 19:56 by Anonymous

[quote comment="350756"]or you could just install what.cd project gazelle. and get hacked in less time than it takes for tbdev[/quote]

Hahahaha.

You’re kidding right?

8 Apr 18, 2008 at 20:10 by coolyou

yeah 8th

whatever noones gonna gwt caught

9 Apr 18, 2008 at 20:13 by h33t

good spot enigmax, thanks dude

10 Apr 18, 2008 at 20:19 by Anonymous

old news is old

11 Apr 18, 2008 at 20:42 by Anonymous

[QUOTE]An administrator on a TBDev tracker we spoke with suggested a very quick fix off the top of his head:
… crappy fix here…[/quote]
The exploit deals not with news.php, but with redir.php. If the attacker convinces the sysop to visit a certain url, it can do whatever he wants, including pretending to post a news item.

12 Apr 18, 2008 at 20:42 by punk

[QUOTE]An administrator on a TBDev tracker we spoke with suggested a very quick fix off the top of his head:
… crappy fix here…[/quote]
The exploit deals not with news.php, but with redir.php. If the attacker convinces the sysop to visit a certain url, it can do whatever he wants, including pretending to post a news item.

13 Apr 18, 2008 at 20:55 by James

WHY wouldn’t you escape something as important as that??? This is madness!

14 Apr 18, 2008 at 21:14 by ARS-ART

MADNESS!

15 Apr 18, 2008 at 21:39 by SirNull

Madness? THIS IS… oh nevermind.

16 Apr 18, 2008 at 22:15 by worship

ALL GLORY TO THE HYPNOTOAD!!!

17 Apr 18, 2008 at 22:31 by randomguy

HYPNOTOAD!!!HYPNOTOAD!!!HYPNOTOAD!!!HYPNOTOAD!!!HYPNOTOAD!!!HYPNOTOAD!!!

18 Apr 18, 2008 at 22:57 by Anony Mouse

Kinda funny, this has been fixed awhile back, and if sysops dun check new fixes, than whose fault is it?

Most sysops from tbdev have applied these patches. So yeah, this will work on the older scripts but not exclusive to tbdev, but to tbsource which most private trackers src originates from.

As u also notice, tbdev still support their code. Can u say as much for the other variants of tbsource code?

So this is a sysop issue. To check/make proper updates.

19 Apr 18, 2008 at 23:10 by Anonymous

[quote comment="350812"][quote comment="350756"]or you could just install what.cd project gazelle. and get hacked in less time than it takes for tbdev[/quote]

Hahahaha.

You’re kidding right?[/quote]
Lol, he must be joking.

20 Apr 18, 2008 at 23:25 by a/s/l

[quote comment="351138"][quote comment="350812"][quote comment="350756"]or you could just install what.cd project gazelle. and get hacked in less time than it takes for tbdev[/quote]

Hahahaha.

You’re kidding right?[/quote]
Lol, he must be joking.[/quote]

i believe it’s called trolling.

21 Apr 18, 2008 at 23:42 by Lee

thanks

http://www.mp3plz.com

Providing over 2 million mp3s yes free and no account needed

22 Apr 18, 2008 at 23:51 by Blaenk Denum

Enigmax, is this how Underground-Gamer got hacked? http://filesharefreak.com/2008/04/17/underground-gamer-hackedagain/

23 Apr 19, 2008 at 00:10 by uberfu

Interesting!

Pirating from the Pirates!

24 Apr 19, 2008 at 00:39 by john

old news, this only applies on the older version

25 Apr 19, 2008 at 00:56 by Anonymous

[quote comment="351158"][quote comment="351138"][quote comment="350812"][quote comment="350756"]or you could just install what.cd project gazelle. and get hacked in less time than it takes for tbdev[/quote]

Hahahaha.

You’re kidding right?[/quote]
Lol, he must be joking.[/quote]
i believe it’s called trolling.[/quote]

no not kidding. gazelle obviously a horrible attempt at a web 2.0 application. and it is only a matter of time before it is exploited to high hell. oh wait, there already has been an exploit for it.

Pages: [1] 2 3 » Show All

Responses are closed

All remaining responses will continue to be archived. Use the TorrentFreak forums if you want to discuss something.