-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy_test
More file actions
executable file
·35 lines (28 loc) · 782 Bytes
/
proxy_test
File metadata and controls
executable file
·35 lines (28 loc) · 782 Bytes
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
#!/usr/bin/env php
<?php
if(3 > $argc){
print "Usage $argv[0] \033[035mip \033[033mport [\033[032muser:pass\033[0m ] [\033[031mprobe site\033[0m default to https://google.com ]\n";
exit(0);
}
$c = curl_init(isset($argv[4]) ? $argv[4] : 'https://google.com');
curl_setopt_array($c, [
CURLOPT_PROXY => $argv[1],
CURLOPT_PROXYPORT => $argv[2],
CURLOPT_PROXYTYPE => CURLPROXY_HTTP,
CURLOPT_CONNECTTIMEOUT => 1,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true
]);
if(isset($argv[3])){
curl_setopt($c, CURLOPT_PROXYUSERPWD, $argv[3]);
}
curl_exec($c);
$info = curl_getinfo($c);
curl_close($c);
if(200 != $info['http_code'])
{
print "{$argv[1]}:{$argv[2]} \033[031mBAD\033[0m";
exit(1);
}
print "{$argv[1]}:{$argv[2]} \033[032mOK\033[0m";
exit(0);