NetVision-Technik

NetVision-Technik (http://www.netvision-technik.de/forum/index.php)
-   Off-Topic (http://www.netvision-technik.de/forum/forumdisplay.php?f=44)
-   -   Angriff auf diverse Tracker (http://www.netvision-technik.de/forum/showthread.php?t=6509)

Stifler 21.10.2011 12:51

Kleine Anregung wie ich dass mit erlaubten Files mache, läuft übrigens über den Mimetype!

HTML-Code:

CREATE TABLE IF NOT EXISTS `mime_types` (
  `id` int(11) NOT NULL auto_increment,
  `mimetype` varchar(255) NOT NULL default '',
  `name` varchar(255) NOT NULL default '',
  `modul` enum('gallery','downloads','usergallery','mailcenter','homepage','forum','contest','document','store','video','screenshot') default NULL,
  `tool` enum('mediaplayer','quicktime','realplayer','flash','divx') default NULL,
  `image` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=95 ;

INSERT INTO `mime_types` (`id`, `mimetype`, `name`, `modul`, `tool`, `image`) VALUES
(90, 'image/gif', 'GIF-Dateien', 'screenshot', '', 'gif'),
(91, 'image/jpeg', 'JPEG-Dateien', 'screenshot', '', 'jpg'),
(92, 'image/pjpeg', 'JPEG-Dateien', 'screenshot', '', 'jpg'),
(93, 'image/x-png', 'PNG-Dateien', 'screenshot', '', 'png');

Beispiel bei screenshots upload
PHP-Code:

foreach($_FILES as $key => $value) {

$file $value['name'];
$temp $value['tmp_name'];
$size $value['size'];
$type $value['type'];
$error $value['error'];

if(!
$error) {

if(
substr($key,0,strlen("file_")) == "file_" && substr($type,0,strlen("image")) == "image") {

$maxsize $screenshot_img_size*1024;

$file_ending explode(".",$file);
$file_ending[1] = strtolower(end($file_ending));

$mime_types mysql_query("SELECT * FROM mime_types WHERE modul='screenshot' AND mimetype='$type'");
$row_mt mysql_num_rows($mime_types);

if(
$row_mt == "0") {
print 
tplprint(tplload("templates/error/error31.html"),array(
"COMMUNITY_NAME" => $community_name,
"ADSERVER" => adserver("tracker"),
"NICK" => $nick,
"MENU" => navigation(),
"LOGO" => logo(),
"INFO" => info()));
exit();
}
elseif((
$mode && $size $maxsize) || $size == "0") {
print 
tplprint(tplload("templates/error/error32.html"),array(
"COMMUNITY_NAME" => $community_name,
"ADSERVER" => adserver("tracker"),
"NICK" => $nick,
"MAXSIZE" => $screenshot_img_size,
"MENU" => navigation(),
"LOGO" => logo(),
"INFO" => info()));
exit();
}

$query_filename mysql_query("SELECT * FROM screenshots WHERE modul='tracker' ORDER BY 'id' DESC");
$result_filename mysql_fetch_array($query_filename);

$file_ending_2 explode(".",$result_filename[filename]);
$file_ending_2[1] = strtolower($file_ending_2[1]);

$new_filename $file_ending_2[0]+1;

$filename $new_filename.".".$file_ending[1];

CreateImage($screenshot_img_width,$screenshot_img_height,$temp,"images/screenshots/tracker/thumbnails/".$filename,$border=0);
CreateImage($screenshot_img_width2,$screenshot_img_height2,$temp,"images/screenshots/tracker/".$filename,$border=0);

mysql_query("INSERT INTO screenshots (id,id_2,owner,filename,realname,modul) VALUES('','$id','$nick','$filename','$file','tracker')");

$k++;

}

}




Anzeige von "Welche MimeTypen sind erlaubt"

PHP-Code:

<?

$types = array(
// Application
'ai'     => 'application/postscript',
'bcpio' => 'application/x-bcpio',
'bin'   => 'application/octet-stream',
'ccad'  => 'application/clariscad',
'cdf'   => 'application/x-netcdf',
'class' => 'application/octet-stream',
'cpio'  => 'application/x-cpio',
'cpt'   => 'application/mac-compactpro',
'csh'   => 'application/x-csh',
'dcr'   => 'application/x-director',
'dir'   => 'application/x-director',
'dms'   => 'application/octet-stream',
'doc'   => 'application/msword',
'drw'   => 'application/drafting',
'dvi'   => 'application/x-dvi',
'dwg'   => 'application/acad',
'dxf'   => 'application/dxf',
'dxr'   => 'application/x-director',
'eps'   => 'application/postscript',
'exe'   => 'application/octet-stream',
'ez'    => 'application/andrew-inset',
'gtar'  => 'application/x-gtar',
'gz'    => array('application/x-gzip','application/gzip-compressed'),
'hdf'   => 'application/x-hdf',
'hqx'   => 'application/mac-binhex40',
'ips'   => 'application/x-ipscript',
'ipx'   => 'application/x-ipix',
'js'    => 'application/x-javascript',
'latex' => 'application/x-latex',
'lha'   => 'application/octet-stream',
'lsp'   => 'application/x-lisp',
'lzh'   => 'application/octet-stream',
'man'   => 'application/x-troff-man',
'me'    => 'application/x-troff-me',
'mif'   => 'application/vnd.mif',
'ms'    => 'application/x-troff-ms',
'nc'    => 'application/x-netcdf',
'oda'   => 'application/oda',
'pdf'   => 'application/pdf',
'pgn'   => 'application/x-chess-pgn',
'pot'   => 'application/mspowerpoint',
'pps'   => 'application/mspowerpoint',
'ppt'   => 'application/mspowerpoint',
'ppz'   => 'application/mspowerpoint',
'pre'   => 'application/x-freelance',
'prt'   => 'application/pro_eng',
'ps'    => 'application/postscript',
'rar'   => 'application/x-rar-compressed',
'roff'  => 'application/x-troff',
'scm'   => 'application/x-lotusscreencam',
'set'   => 'application/set',
'sh'    => 'application/x-sh',
'shar'  => 'application/x-shar',
'sit'   => 'application/x-stuffit',
'skd'   => 'application/x-koan',
'skm'   => 'application/x-koan',
'skp'   => 'application/x-koan',
'skt'   => 'application/x-koan',
'smi'   => 'application/smil',
'smil'  => 'application/smil',
'sol'   => 'application/solids',
'spl'   => 'application/x-futuresplash',
'src'   => 'application/x-wais-source',
'step'  => 'application/STEP',
'stl'   => 'application/SLA',
'stp'   => 'application/STEP',
'sv4cpio' => 'application/x-sv4cpio',
'sv4crc'  => 'application/x-sv4crc',
'swf'   => 'application/x-shockwave-flash',
't'     => 'application/x-troff',
'tar'   => 'application/x-tar',
'tcl'   => 'application/x-tcl',
'tex'   => 'application/x-tex',
'texi'  => 'application/x-texinfo',
'texinfo' => 'application/x-texinfo',
'tr'    => 'application/x-troff',
'tsp'   => 'application/dsptype',
'unv'   => 'application/i-deas',
'ustar' => 'application/x-ustar',
'vcd'   => 'application/x-cdlink',
'vda'   => 'application/vda',
'xlc'   => array('application/vnd.ms-excel', 'application/msexcel'),
'xll'   => array('application/vnd.ms-excel', 'application/msexcel'),
'xlm'   => array('application/vnd.ms-excel', 'application/msexcel'),
'xls'   => array('application/vnd.ms-excel', 'application/msexcel'),
'xlw'   => array('application/vnd.ms-excel', 'application/msexcel'),
'zip'   => array('application/zip', 'application/x-zip-compressed'),
// Audio
'aif'  => 'audio/x-aiff',
'aifc' => 'audio/x-aiff',
'aiff' => 'audio/x-aiff',
'au'   => 'audio/basic',
'kar'  => array('audio/midi','audio/x-midi'),
'mid'  => array('audio/midi','audio/x-midi'),
'midi' => array('audio/midi','audio/x-midi'),
'mp2'  => 'audio/mpeg',
'mp3'  => 'audio/mpeg',
'mpga' => 'audio/mpeg',
'ra'   => 'audio/x-realaudio',
'ram'  => 'audio/x-pn-realaudio',
'rm'   => 'audio/x-pn-realaudio',
'rpm'  => 'audio/x-pn-realaudio-plugin',
'snd'  => 'audio/basic',
'tsi'  => 'audio/TSP-audio',
'wav'  => 'audio/x-wav',
// Text
'asc'  => 'text/plain',
'c'    => 'text/plain',
'cc'   => 'text/plain',
'css'  => 'text/css',
'etx'  => 'text/x-setext',
'f'    => 'text/plain',
'f90'  => 'text/plain',
'h'    => 'text/plain',
'hh'   => 'text/plain',
'htm'  => 'text/html',
'html' => 'text/html',
'js'   => 'text/javascript',
'm'    => 'text/plain',
'rtf'  => 'text/rtf',
'rtx'  => 'text/richtext',
'sgm'  => 'text/sgml',
'sgml' => 'text/sgml',
'tsv'  => 'text/tab-separated-values',
'tpl'  => 'text/template',
'txt'  => 'text/plain',
'xml'  => 'text/xml',
// Video
'avi'   => array('video/x-msvideo', 'video/avi'),
'asf'    => 'video/x-ms-asf',
'divx'    => 'video/divx',
'fli'   => 'video/x-fli',
'mkv'    => 'video/divx',
'mov'   => 'video/quicktime',
'movie' => 'video/x-sgi-movie',
'mpe'   => 'video/mpeg',
'mpeg'  => 'video/mpeg',
'mpg'   => 'video/mpeg',
'qt'    => 'video/quicktime',
'viv'   => 'video/vnd.vivo',
'vivo'  => 'video/vnd.vivo',
'wmv'   => 'video/x-ms-wmv',
// Image
'gif'  => 'image/gif',
'ief'  => 'image/ief',
'jpe'  => array('image/jpeg', 'image/pjpeg'),
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg'  => array('image/jpeg', 'image/pjpeg'),
'pbm'  => 'image/x-portable-bitmap',
'pgm'  => 'image/x-portable-graymap',
'png'  => array('image/png', 'image/x-png'),
'pnm'  => 'image/x-portable-anymap',
'ppm'  => 'image/x-portable-pixmap',
'ras'  => 'image/cmu-raster',
'rgb'  => 'image/x-rgb',
'tif'  => 'image/tiff',
'tiff' => 'image/tiff',
'xbm'  => 'image/x-xbitmap',
'xpm'  => 'image/x-xpixmap',
'xwd'  => 'image/x-xwindowdump',
// X-Conference
'ice' => 'x-conference/x-cooltalk',
// Model
'iges' => 'model/iges',
'igs'  => 'model/iges',
'mesh' => 'model/mesh',
'msh'  => 'model/mesh',
'silo' => 'model/mesh',
'vrml' => 'model/vrml',
'wrl'  => 'model/vrml',
// WWW
'mime' => 'www/mime',
// Chemical
'pdb' => 'chemical/x-pdb',
'xyz' => 'chemical/x-pdb');

$modul = $_GET[request];

$mime_types = mysql_query("SELECT * FROM mime_types WHERE modul='$modul' ORDER BY 'mimetype' ASC");

while($result = mysql_fetch_array($mime_types)) {
unset($extensions);

$mimetype = $result[mimetype];
$name = $result[name];

foreach($types as $key => $value) {

if(is_array($value) && in_array($mimetype,$value)) $extensions[] = "*.".$key;
if(!is_array($value) && $mimetype == $value) $extensions[] = "*.".$key;

}

if(count($extensions) > 0) sort($extensions);

$output .= "<tr bgcolor=\"#FAFAFA\" valign=\"top\"><td>$mimetype</td><td>".@implode(" ", $extensions)."</td><td>$name</td></tr>";

}

print tplprint(tplload("templates/mimetypes.html",FALSE),array(
"COMMUNITY_NAME" => $community_name,
"OUTPUT" => $output));
exit();

?>


Castor 21.10.2011 12:59

Der Upload von .css, .php, .js etc. klappt bei uns nicht via Bitbucket/PicHoster.
Also muss es ne andere lücke geben.

Der Vogel war noch so frech das ganze in der Shout anzukündigen :confuse:

LG Castor

Stifler 21.10.2011 13:07

Weiß ja nicht wie der BitBucket und Filehoster oder was auch immer funktioniert aber wenn dass mit file=filename oder pic=bild.jpg geht und keine ordentlichen Vorkehrungen getroffen sind dass man sich net mit file=../../ rumbewegen kann dann ist das des Rätsels lösung

Ein Ansatz wäre bei bei den Bildern bei der Ausgabe mal mit

PHP-Code:

$is_image = @getImageSize($picture);

if(!
$is_image) {

exit;



zu checken ob es sich tatsächlich um ein Bild handelt.
Damit kann er sich zwar in den Verzeichnissen bewegen bekommt aber nur Bilder ausgegeben!

ike 21.10.2011 13:17

Was hat er denn überhaupt für Schaden angerichtet?

Zero111 21.10.2011 13:34

Noch eine ziemlich sichere Methode ist

PHP-Code:

$file basename($_GET['file']);

$content  file_get_contents("database/".$file); 

basename schneidet alles vor dem dateinamen ab

also aus /../../../xxx.php wird xxx.php :D so kann man eine deartige lücken nicht mehr ausnutzen

Junior 21.10.2011 14:33

PHP-Suhosin-Patch
 
hi,

ich ( DareDevil ) will hier keinen krieg vom zaum brechen aber beleidigen lassen muss ich mich auch nich ...... aber es gibt ein paar sachen da bin ich echt zu alt für und leute die meine kinder sein könnten auf dessen sprüche seh ich einfach drüber weg.

es ist absolut sicher ich hab diejenigen gefunden die die angriffe auf die tracker gestartet haben.

mittlerweile haben die auch schon wind davon bekommen und ihre reg geschlossen das ist aber kein problem die fühlen sich sicher ..... ok ich lass sie bis heute abend in dem glauben.

desweiteren waren wir weiter auf der suche nach möglichen lücken ( das zu dem thema wir sind zu blöde ) aber man muss lücken ersmal erkennen bevor man sie stopen kann oder wollt ihr sagen das BKA und die Nasa sind auch zu blöde ??? die wurden auch schon gehackt aber das is en anderes thema. hab selber 12 jahre berufserfahrung in einer behörde und mus merken das man nie auslernt.

hab nun folgende frage schaut euch mal bei googel das hier an weiss jetzt nich ob links hier erlaubt sind deswegen nur die info hier :

Querelen um PHP-Suhosin-Patch

Die Sicherheitserweiterung Suhosin für PHP führte auf manchen Systemen zu Abstürzen. Ein Patch der Debian-Maintainer beseitigte dieses Problem, öffnete aber ein potenzielles Sicherheitsloch. Jetzt tobt ein Streit darüber, wer da was falsch gemacht hat.

wäre dankbar wen ich eine info bekommen könnte ob wir da richtig mit liegen.

mfg
DD

Stinac 21.10.2011 14:58

dieses thema ist sowas von sinnlos gib doch deine IPs weiter von den mutmasslichen hackern was bringt dir das wen du trotzdem nix absicherst wird er dich immer wieder platt machen eig. nur zum lachen

SP4C3 21.10.2011 15:22

1. Die IPs sind stinknormale Dial-In Ips von Vodafone, Arcor und Wilhelm.tel.
Also sinds entweder drei Leute, oder die Ips sind reine zufallszahlen... Ändern sich eh bei ner NeuEinwahl, also warum son Aufriss über 3 32 Bit Zahlen machen??

2. phenom: Die Apachemodule können keine Lücken in deinen Webanwendungen korrigieren. Sie sind speziell gegen Dos und BruteForce angriffe...

3. Sorry aber wer blind ne Source verwendet, von der offensichtlich bekannt ist, dass sie löchrig wie ein Schweizer Käse ist, dann weis ich auch nix dazu zu sagen... Vor allem wenn der Ersteller selbst sagt "Findet die Lücken...".

4. Wer so naiv ist wie in drittens beschrieben: Schämt euch.

Mitnick 21.10.2011 16:12

Zitat:

Zitat von SP4C3 (Beitrag 72197)

2. phenom: Die Apachemodule können keine Lücken in deinen Webanwendungen korrigieren. Sie sind speziell gegen Dos und BruteForce angriffe...

Das ist so nicht richtig. Installiert euch ModSecurity mit ordentlichen rulesets.
Ganz wichtig ist auch das euere Trackersoftware nicht mittels "root" auf die db zugreift.

Per ModSecurity könnt ihr eventuelle hackversuche schnell erkennen und gegebenenfalls abwehren.

Thunder™ 21.10.2011 16:33

vielleicht solltest ihr nicht spekulieren und mit ModSecurity spielen sondern euch mit den phps beschäftigen und diese fixen...


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

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