-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
63 lines (41 loc) · 1.23 KB
/
Copy pathindex.php
File metadata and controls
63 lines (41 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
if ( !isset( $_REQUEST['code'] ) ){
require_once 'server_list.php';
include 'page.php';
exit;
}
if ( isset( $_REQUEST['server'] ) ) {
require_once 'server_list.php';
$url = $serverList[ $_REQUEST['server'] ]['url'];
redirectServer ( $url, $_REQUEST['code'] );
} else {
runCode ( rawurldecode($_REQUEST['code']) );
}
function redirectServer ( $url, $code) {
$code = 'code=' . $code ;
$curl = curl_init( $url );
curl_setopt( $curl, CURLOPT_POST, 1);
curl_setopt( $curl, CURLOPT_POSTFIELDS, $code);
curl_setopt( $curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $curl, CURLOPT_HEADER, 0);
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1);
echo curl_exec( $curl );
}
function runCode ( $code ) {
if ( !$tempFile = fopen("code.php", "w") ) {
echo "No se puede abrir el archivo";
exit;
}
if ( fwrite($tempFile, $code) === FALSE) {
echo "No se puede escribir en el archivo";
exit;
}
fclose($tempFile);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
unset($_REQUEST);
unset($_POST);
unset($code);
require_once 'code.php';
}