NetVision-Technik

NetVision-Technik (http://www.netvision-technik.de/forum/index.php)
-   Security (http://www.netvision-technik.de/forum/forumdisplay.php?f=32)
-   -   suche Progi zum Testen der Tracker-Sicherheit (http://www.netvision-technik.de/forum/showthread.php?t=4406)

Zero111 22.11.2009 01:54

bei mir wars auch so.. die announce ging nemmer

ich denke weil auch die parameter die vom clienten kommen 'abgesichert' wurden und dabei zersäbelt wurden^^

P4N1C 22.11.2009 02:14

Jop,
da hats i-was zerschossen.
Also hängt das wahrscheinlich indirekt mitm Script zusammen.

razza 22.11.2009 03:23

jo funzt !!

tantetoni2 22.11.2009 08:54

das kann natürlich sein, ich nutze ja die php announce nicht haben ja den xbt laufen, in den fall müsste man die funktion in den php aufrufen wo man sie nutzen will. hab mal noch ein paar parameter hinzu gefügt

wenn $P === true $_POST wird abgesichert,
wenn $G === true $_GET wird abgesichert,
wenn $E === true $_ENV wird abgesichert,
wenn $C === true $_COOKIE wird abgesichert

beispiel
so wird nur $_POST und $_GET abgesichert
PHP-Code:

secure_vars(truetrue,false,false

PHP-Code:

function secure_vars($P true$G true$E true$C true)
{
  if(isset(
$_POST) && $P === true)
  {
    foreach (
$_POST as $var => $val)
    { 
      
$_POST[$var] = validate_var($val); 
    } 
  }
  if(isset(
$_GET) && $G === true)
  {
    foreach (
$_GET as $var => $val)
    { 
      
$_GET[$var] = validate_var($val); 
    } 
  }
  if(isset(
$_ENV) && $E === true)
  {
    foreach (
$_ENV as $var => $val
    { 
      
$_ENV[$var] = validate_var($val); 
    } 
  }
  if(isset(
$_COOKIE) && $C === true)
  {
    foreach (
$_COOKIE as $var => $val
    { 
      
$_COOKIE[$var] = validate_var($val); 
    } 
  }




--======================================--
--==
Beitrag erstellt: 09:54 um 09:47 ==--
--==
geantwortet auf Beitrag vom ==--
--== automatische Beitragszusammenführung ==--
--======================================--


tantetoni2 schrieb nach 7 Minuten und 5 Sekunden:

so und hier nochmal was um array rekursiev abzusichern da post wars auch array sein können

PHP-Code:

// rekursieve absicherung von array

function validate_array($arr)
{
  if(isset(
$arr) && is_array($arr))
  {
    foreach (
$arr as $var => $val)
    { 
      if(
is_array($val))$arr[$var] = validate_array($val);
      else 
$arr[$var] = validate_var($val); 
    } 
  }
  return 
$arr;


PHP-Code:

function secure_vars($P true$G true$E true$C true)
{
  if(isset(
$_POST) && $P === true)
  {
    foreach (
$_POST as $var => $val)
    { 
      if(
is_array($val)) $_POST[$var] = validate_array($val);
      else 
$_POST[$var] = validate_var($val); 
    } 
  }
  if(isset(
$_GET) && $G === true)
  {
    foreach (
$_GET as $var => $val)
    { 
      
$_GET[$var] = validate_var($val); 
    } 
  }
  if(isset(
$_ENV) && $E === true)
  {
    foreach (
$_ENV as $var => $val
    { 
      
$_ENV[$var] = validate_var($val); 
    } 
  }
  if(isset(
$_COOKIE) && $C === true)
  {
    foreach (
$_COOKIE as $var => $val
    { 
      
$_COOKIE[$var] = validate_var($val); 
    } 
  }



NaIch 22.11.2009 15:21

leider nein , wenn :

PHP-Code:

<?php

/*
// +--------------------------------------------------------------------------+
// | Project:    NVTracker - NetVision BitTorrent Tracker                     |
// +--------------------------------------------------------------------------+
// | This file is part of NVTracker. NVTracker is based on BTSource,          |
// | originally by RedBeard of TorrentBits, extensively modified by           |
// | Gartenzwerg.                                                             |
// |                                                                          |
// | NVTracker is free software; you can redistribute it and/or modify        |
// | it under the terms of the GNU General Public License as published by     |
// | the Free Software Foundation; either version 2 of the License, or        |
// | (at your option) any later version.                                      |
// |                                                                          |
// | NVTracker is distributed in the hope that it will be useful,             |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of           |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            |
// | GNU General Public License for more details.                             |
// |                                                                          |
// | You should have received a copy of the GNU General Public License        |
// | along with NVTracker; if not, write to the Free Software Foundation,     |
// | Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA            |
// +--------------------------------------------------------------------------+
// | Obige Zeilen dürfen nicht entfernt werden!    Do not remove above lines! |
// +--------------------------------------------------------------------------+
*/
// rekursieve absicherung von array

function validate_array($arr)
{
  if(isset(
$arr) && is_array($arr))
  {
    foreach (
$arr as $var => $val)
    { 
      if(
is_array($val))$arr[$var] = validate_array($val);
      else 
$arr[$var] = validate_var($val); 
    } 
  }
  return 
$arr;
}  
function 
secure_vars($P true$G true$E true$C true)
{
  if(isset(
$_POST) && $P === true)
  {
    foreach (
$_POST as $var => $val)
    { 
      if(
is_array($val)) $_POST[$var] = validate_array($val);
      else 
$_POST[$var] = validate_var($val); 
    } 
  }
  if(isset(
$_GET) && $G === true)
  {
    foreach (
$_GET as $var => $val)
    { 
      
$_GET[$var] = validate_var($val); 
    } 
  }
  if(isset(
$_ENV) && $E === true)
  {
    foreach (
$_ENV as $var => $val
    { 
      
$_ENV[$var] = validate_var($val); 
    } 
  }
  if(isset(
$_COOKIE) && $C === true)
  {
    foreach (
$_COOKIE as $var => $val
    { 
      
$_COOKIE[$var] = validate_var($val); 
    } 
  }
}  
secure_vars(truetrue,false,false)
function 
local_user()
{
    global 
$HTTP_SERVER_VARS;

    return 
$HTTP_SERVER_VARS["SERVER_ADDR"] == $HTTP_SERVER_VARS["REMOTE_ADDR"];

$agent $_SERVER['HTTP_USER_AGENT'];

if(
preg_match("/Chrome/i",$agent)) 
{
?>

<script type="text/javascript">
message="Du benutzt den Google Chrome von Google! Dieser ist auf dieser Seite wegen hohen Sicherheitsmängeln und Informations-Sammelwut gesperrt. Wir empfehlen den Browser Firefox zum Surfen!!!";
alert(unescape(message));
window.location.href='http://xxxxxxxxxxxxxxxxxx';
</script>

<?

header("Location: http://www.google.de");  // falls Javascript deaktiviert ärgern wir mal ihn ein bisschen und leiten ihn auf seinen Ursprung zurück
}
if (!file_exists("include/secrets.php") || !file_exists("include/config.php"))
    die("<html><head><title>FEHLER</title></head><body><p>Der Tracker wurde noch nicht konfiguriert.</p>
        <p><a href=\"inst/install.php\">Zum Installationsscript</a></p>

</body></html>");

require_once("include/secrets.php");
require_once("include/config.php");
require_once("include/cleanup.php");
require_once("include/shoutcast.php");
require_once('include/ctracker.php');
require_once('include/sicherheits.php');
$maxloginattempts = 4;

dann weisse seite

moment jetzt funzt soweit mal sehen was komt nächsten minuten,
hatte bei :

PHP-Code:

secure_vars(truetrue,false,false

; nicht dran


funzt so nicht richtig den die cleanup wenn ausführe macht sofort weisse seite

tantetoni2 22.11.2009 15:39

dann machs einfach nur in den php rein wo was abgesichert werden soll in der cleanup.php ist das ja sinnlos, aber trotzdem komisch das es da nicht funzt weil da ja keine der globalen vars genutz werden oder haste einfach die funktion validate_var vergessen mit reinzupacken

PHP-Code:

function validate_var($val

  if(isset(
$val)) 
  {  
    if(
is_numeric($val))      return floatval($val); 
    elseif(
is_bool($val))     return $val 
    elseif(
is_string($val))   return htmlspecialchars($val); 
    elseif(
is_null($val))     return null
    else                      return 
$val;
  } 
  else  return; 



razza 22.11.2009 15:43

kennt einer das tool Acunetix Web Vulnerability Scanner ?

Solstice 23.11.2009 09:11

Ja is ebendas genannte Tool das da Sicherheitslücken anzeigt in Scripten die gar nicht existieren.

Müll auf gut deutsch...

hat bei meiner seite alle fehler angezeigt die nicht existieren und eine extra offengelassene Lücke von mir hat es nicht entdeckt...

Schrott, müll, fake , Abschaum :big_lol:

razza 23.11.2009 14:00

da weiß ich ja bescheid ! grins

NaIch 24.11.2009 03:42

habe es jetzt so in der bit

PHP-Code:

<?php

/*
// +--------------------------------------------------------------------------+
// | Project:    NVTracker - NetVision BitTorrent Tracker                     |
// +--------------------------------------------------------------------------+
// | This file is part of NVTracker. NVTracker is based on BTSource,          |
// | originally by RedBeard of TorrentBits, extensively modified by           |
// | Gartenzwerg.                                                             |
// |                                                                          |
// | NVTracker is free software; you can redistribute it and/or modify        |
// | it under the terms of the GNU General Public License as published by     |
// | the Free Software Foundation; either version 2 of the License, or        |
// | (at your option) any later version.                                      |
// |                                                                          |
// | NVTracker is distributed in the hope that it will be useful,             |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of           |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            |
// | GNU General Public License for more details.                             |
// |                                                                          |
// | You should have received a copy of the GNU General Public License        |
// | along with NVTracker; if not, write to the Free Software Foundation,     |
// | Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA            |
// +--------------------------------------------------------------------------+
// | Obige Zeilen dürfen nicht entfernt werden!    Do not remove above lines! |
// +--------------------------------------------------------------------------+
*/
// rekursieve absicherung von array

function validate_array($arr)
{
  if(isset(
$arr) && is_array($arr))
  {
    foreach (
$arr as $var => $val)
    { 
      if(
is_array($val))$arr[$var] = validate_array($val);
      else 
$arr[$var] = validate_var($val); 
    } 
  }
  return 
$arr;
}  
function 
secure_vars($P true$G true$E true$C true)
{
  if(isset(
$_POST) && $P === true)
  {
    foreach (
$_POST as $var => $val)
    { 
      if(
is_array($val)) $_POST[$var] = validate_array($val);
      else 
$_POST[$var] = validate_var($val); 
    } 
  }
  if(isset(
$_GET) && $G === true)
  {
    foreach (
$_GET as $var => $val)
    { 
      
$_GET[$var] = validate_var($val); 
    } 
  }
  if(isset(
$_ENV) && $E === true)
  {
    foreach (
$_ENV as $var => $val
    { 
      
$_ENV[$var] = validate_var($val); 
    } 
  }
  if(isset(
$_COOKIE) && $C === true)
  {
    foreach (
$_COOKIE as $var => $val
    { 
      
$_COOKIE[$var] = validate_var($val); 
    } 
  }
}  
function 
validate_var($val

  if(isset(
$val)) 
  {  
    if(
is_numeric($val))      return floatval($val); 
    elseif(
is_bool($val))     return $val 
    elseif(
is_string($val))   return htmlspecialchars($val); 
    elseif(
is_null($val))     return null
    else                      return 
$val;
  } 
  else  return; 
}  
secure_vars(truetrue,false,false);
function 
local_user()
{
    global 
$HTTP_SERVER_VARS;

    return 
$HTTP_SERVER_VARS["SERVER_ADDR"] == $HTTP_SERVER_VARS["REMOTE_ADDR"];

$agent $_SERVER['HTTP_USER_AGENT'];

im moment noch alle ok bis auf das wenn jetzt manuellen cleanup ausführe kommt doppelt also so :

PHP-Code:

2009-11-24    04:37:52    Cleanup done    Cleanup erfolgreich abgeschlossen -- nächste Cleanup '2009-11-24 05:07:52'
2009-11-24    04:37:52        Von UserNamewurde ein manueller Cleanup durchgeführt nächster Cleanup '2009-11-24 05:07:52'
2009-11-24    04:37:38    Cleanup done    Cleanup erfolgreich abgeschlossen -- nächste Cleanup '2009-11-24 05:07:38'
2009-11-24    04:37:38        Von UserNamewurde ein manueller Cleanup durchgeführt nächster Cleanup '2009-11-24 05:07:38' 

und jetzt gerade werden alle torrents rot mit meldung zwischen 23-27 :

PHP-Code:

FehlerUngueltiger Wert fuer info_hash (27 - %C...........9BYo9.....%3B%
......%
26amp%3.....A

punkte sind normal zahlen und zeichen


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:42 Uhr.

Powered by vBulletin® Version 3.8.9 (Deutsch)
Copyright ©2000 - 2024, vBulletin Solutions, Inc.