-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdtw.php
More file actions
executable file
·122 lines (107 loc) · 3.13 KB
/
dtw.php
File metadata and controls
executable file
·122 lines (107 loc) · 3.13 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
function getpage($url){
$url = @parse_url($url);
$temp = '';
if(!strstr(get_cfg_var("disable_functions") , 'fsockopen')){
$fp = @fsockopen($url['host'], 80, $errno, $errstr, 30);
if (!$fp) {
$http_code = '0';
echo "$errstr ($errno)<br />\n";
}else{
$out = "GET $url[path] HTTP/1.1\r\n";
$out .= "Host: $url[host]\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
$temp .= fgets($fp, 128);
}
fclose($fp);
$http_code = substr($temp,9,3);
$temp = explode("\r\n\r\n",$temp,2);
$temp = $temp[1];
}
}elseif(extension_loaded('curl') && !strstr(get_cfg_var("disable_functions") , 'curl_init')){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$temp = curl_exec ($ch);
$http_code = getpageinfo($ch, CURLINFO_HTTP_CODE);
curl_close ($ch);
}else{
$http_code = '0';
$temp = 'the hosting do not support curl or fsockopen() ';
}
if ($http_code >= 400) { //400 - 600都是服务器错误
return 'false';
echo $temp;
exit(0);
}else{
return $temp;
}
}
function match_links($document){
preg_match_all("'<\s*a\s.*?href\s*=\s*([\"\'])?(?(1)(.*?)\\1|([^\s\>]+))[^>]*>?(.*?)</a>'isx", $document, $links);
while(list($key, $val) = each($links[2])){
if(!empty($val))
$match[] = $val;
}
while(list($key, $val) = each($links[3])){
if(!empty($val))
$match[] = $val;
}
return array($match, $links[4]); //
}
// -----------------main--------------------//
$dtw_url = base64_decode('aHR0cDovL2Rvbmd0YWl3YW5nLmNvbS9sb2MvcGhvbWUucGhw');
header("Content-type: text/html; charset=GBK");
$dtw_url = base64_decode('aHR0cDovL2Rvbmd0YWl3YW5nLmNvbS9sb2MvcGhvbWUucGhw');
$dtw_temp = getpage($dtw_url);
if ($dtw_temp == 'false'){
echo $dtw_temp;
exit;
}
$dtw_temp_ip = explode('<div id="content_list_right1">', $dtw_temp);
$dtw_temp_ip = @$dtw_temp_ip[1] . @$dtw_temp_ip[2];
$dtw_temp_ip = str_replace('http://', 'https://', $dtw_temp_ip);
$dtw_ip = match_links($dtw_temp_ip);
$dtwip = '';
foreach (@$dtw_ip[0] as $key => $value){
$dtwip .= "\r\n<br />" . '<a href="' . $value . '">' . $value . '</a>';
}
$dtw_ip_n = count(@$dtw_ip[0]);
print
<html><head>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<script language="javascript" >
i=1
var autourl=new Array()
JS1;
for($i = 0 ; $i < $dtw_ip_n ; $i++){
$j = $i + 1;
$dtw_ip[0][$i] = str_replace("//", '\\', $dtw_ip[0][$i]);
$dtw_ip[0][$i] = str_replace("/", '', $dtw_ip[0][$i]);
$dtw_ip[0][$i] = str_replace('\\', '//', $dtw_ip[0][$i]);
echo "autourl[$j]=\"" . $dtw_ip[0][$i] . "\"\r\n";
}
print
function auto(url)
{
if(i)
{
i=0;
top.location=url
}}
function run()
{
for(var i=1;
i<autourl.length;i++)
document.write("<img src="+autourl[i]+" width=1 height=1 onerror=auto('"+autourl[i]+"')>")
}
run()
</script>
JS2;
echo '</head><title>选择服务器</title><body>'; // . $link;
echo '</h3>正在选择服务器,请稍等</h3>';
echo '<br /> <br />出现证书提示点“<b>是</b>”,可能连续点几次';
echo '</body></html>';
exit(0);
?>