NetVision-Technik

Zur?ck   NetVision-Technik > Forum > Server > Webserver > Security

Security Hier kommen alle Fragen und Lösungen zur Sicherheit und zu Fixes am Serversystem rein

Antwort
 
Themen-Optionen Ansicht
Alt 22.11.2009, 09:54   #1
tantetoni2
König
Punkte: 116.452, Level: 100 Punkte: 116.452, Level: 100 Punkte: 116.452, Level: 100
Levelaufstieg: 0% Levelaufstieg: 0% Levelaufstieg: 0%
Aktivität: 0% Aktivität: 0% Aktivität: 0%
Letzte Erfolge
Auszeichnungen
Artikel Benutzer besitzt 1x Hilfe Level 3
 
Benutzerbild von tantetoni2
 
Registriert seit: 15.10.2008
Beitr?ge: 1.923
Abgegebene Danke: 23
Erhielt 571 Danke für 38 Beiträge
Downloads: 8
Uploads: 0
Nachrichten: 4155
Renommee-Modifikator:
7258 tantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehentantetoni2 genießt hohes Ansehen
Standard

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

__________________

Ge?ndert von tantetoni2 (22.11.2009 um 14:00 Uhr)
tantetoni2 ist offline   Mit Zitat antworten Nach oben
Alt 22.11.2009, 16:21   #2
NaIch
Profi
Punkte: 15.393, Level: 80 Punkte: 15.393, Level: 80 Punkte: 15.393, Level: 80
Levelaufstieg: 9% Levelaufstieg: 9% Levelaufstieg: 9%
Aktivität: 0% Aktivität: 0% Aktivität: 0%
Letzte Erfolge
 
Benutzerbild von NaIch
 
Registriert seit: 13.06.2008
Ort: Zuhause
Beitr?ge: 928
Abgegebene Danke: 53
Erhielt 38 Danke für 11 Beiträge
Downloads: 37
Uploads: 0
Nachrichten: 52
Renommee-Modifikator:
985 NaIch ist einfach richtig nettNaIch ist einfach richtig nettNaIch ist einfach richtig nettNaIch ist einfach richtig nett
Standard

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

Ge?ndert von NaIch (22.11.2009 um 16:27 Uhr)
NaIch ist offline   Mit Zitat antworten Nach oben
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, G?ste: 1)
 
Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beitr?ge zu antworten.
Es ist Ihnen nicht erlaubt, Anh?nge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beitr?ge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu


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


Powered by vBulletin® Version 3.8.9 (Deutsch)
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Template-Modifikationen durch TMS