Seite 1 von 1

Möglicher Fix für Sicherheitslücke im Download Mod (Hotschi)

Verfasst: 10.05.2005 09:30
von oxpus
Etwas schockiert war ich schon vor einiger Zeit, als ich las, der Mod sei angreifbar.
Vielleicht hilft dieser Fix hier:

Code: Alles auswählen

##############################################################
## MOD Title:		Fix Download Mod for phpBB 2.0.9 and newer
## MOD Author: OXPUS < webmaster@oxpus.de > (Karsten Ude) http://www.oxpus.de
## MOD Description:	This Mod makes the Download Mod compatible for phpBB 2.0.9 and newer
## MOD Version:		1.0.1
##
## Installation Level:	Easy
## Installation Time:	2-5 Minutes
## Files To Edit:	5
##			downloads.php
##			load.php
##			admin/admin_dl_cat.php
##			admin/admin_dl_traffic_all_users.php
##			admin/admin_dl_traffic_single_user.php
##
## Included Files:	n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
##   2005-04-09 - Version 1.0.1
##      - Fix several security leaks
##
##   2004-04-26 - Version 1.0.0
##      - First release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
downloads.php

#
#-----[ FIND ]------------------------------------------
#
//
// Set page ID for session management
//
$userdata = session_pagestart($user_ip, PAGE_DOWNLOADS);
init_userprefs($userdata);
//
// End session management
//

#
#-----[ AFTER, ADD ]------------------------------------------
#
$cat = ( $HTTP_POST_VARS['cat'] ) ? intval($HTTP_POST_VARS['cat']) : intval($HTTP_GET_VARS['cat']);
$view = ( $HTTP_POST_VARS['view'] ) ? $HTTP_POST_VARS['view'] : $HTTP_GET_VARS['view'];
$id = ( $HTTP_POST_VARS['id'] ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']);

#
#-----[ OPEN ]------------------------------------------
#
load.php

#
#-----[ FIND ]------------------------------------------
#
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_DOWNLOADS);
init_userprefs($userdata);
//
// End session management
//

#
#-----[ AFTER, ADD ]------------------------------------------
#
$id = ( $HTTP_POST_VARS['id'] ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']);

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_dl_cat.php

#
#-----[ FIND ]------------------------------------------
#
      $cat_name = ( isset($HTTP_POST_VARS['cat_name']) ) ? trim($HTTP_POST_VARS['cat_name']) : "";

#
#-----[ AFTER, ADD ]------------------------------------------
#
      $path = ( isset($HTTP_POST_VARS['path']) ) ? trim($HTTP_POST_VARS['path']) : "";

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_dl_traffic_all_users.php

#
#-----[ FIND ]------------------------------------------
#
if ($x == "bytes") $traffic_bytes = $traffic;
if ($x == "kb") $traffic_bytes = bcmul($traffic,1024);
if ($x == "mb") $traffic_bytes = bcmul($traffic,1048576);

	//
	// Ok, the traffic has been modified and submitted, let's update
	//
	if( ( $mode == 'save' && isset( $HTTP_POST_VARS['submit'] ) ) )
	{

		$traffic = ( !empty($HTTP_POST_VARS['traffic']) ) ? trim(strip_tags( $HTTP_POST_VARS['traffic'] ) ) : '';
	}

#
#-----[ REPLACE WITH ]------------------------------------------
#
$traffic = ( !empty($HTTP_POST_VARS['traffic']) ) ? trim(strip_tags( $HTTP_POST_VARS['traffic'] ) ) : '';
$x = ( !empty($HTTP_POST_VARS['x']) ) ? trim(strip_tags( $HTTP_POST_VARS['x'] ) ) : '';
$function = ( !empty($HTTP_POST_VARS['function']) ) ? trim(strip_tags( $HTTP_POST_VARS['function'] ) ) : '';

if ($x == "bytes") $traffic_bytes = $traffic;
if ($x == "kb") $traffic_bytes = bcmul($traffic,1024);
if ($x == "mb") $traffic_bytes = bcmul($traffic,1048576);

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_dl_traffic_single_user.php

#
#-----[ FIND ]------------------------------------------
#
	if ($x == "bytes") $traffic_bytes = $user_traffic;

#
#-----[ BEFORE, ADD ]------------------------------------------
#
	$x = ( !empty($HTTP_POST_VARS['x']) ) ? trim(strip_tags( $HTTP_POST_VARS['x'] ) ) : '';
	$function = ( !empty($HTTP_POST_VARS['function']) ) ? trim(strip_tags( $HTTP_POST_VARS['function'] ) ) : '';


#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Damit hatte ich eigentlich alle Angreifer ausgesperrt.
Kann mir jemand sagen, ob das reicht?
Ansonsten muss ich mir was anderes für meine Downloads suchen :(

Verfasst: 10.05.2005 09:45
von -Jo-
Ich dachte, es sei gar nicht Hotschi´s MOD, der angreifbar sei...
albe hat geschrieben:Hallo,

der Fall hat sich geklärt. Es handelt sich nicht um einen Bug in Hotchis Download Mod, sondern um eine alte Version des Attachment Mods.

Es gibt nämlich 2 Dateien die ähnlich lauten: download.php und downloads.php

Ich habe (hatte) noch eine alte Version des Attachment Mods laufen, was ich nun korrigiert habe. Durch die alte Version des Attachment-Mods konnte der Hacker Zugriff auf mein Passwort bekommen.


http://www.phpbb.de/viewtopic.php?t=85972


Gruß,
Jo.

Verfasst: 10.05.2005 09:51
von oxpus
Beide Mods!
Ohne meinen Fix konnte ich auch problemlos im Download Mod alle Userdaten auslesen. Mit dem Fix nicht mehr.
Nur bin ich mittlerweile unsicher, ob mein Fix 100%ig ausreicht...

Verfasst: 10.05.2005 09:57
von -Jo-
Man könnte ja denjenigen bitten, der albe´s Admin-Passwort gekmackt hat, das Ganze zu testen. Die email-Adresse hat er ja... :roll: