PHC

Phc 1.1 (author:skyroam)
20050625

NAME

Phc - customizable proxy hunter - version 1.1

SYNOPSIS

phc

DESCRIPTION

This program validate "free proxy" (now http only) from a file named proxylist. Free proxies found are printed on screen and also available in a file named proxyout at the same time so that you can stop the runing program at any time.

HTTP PROXY GET ,HTTP PROXY CONNECT, or SOCKS5 PROXY CONNECT request will be sent to the testproxies (directly connection or via myproxy, a http or socks5 proxies with or without authentication) to start validation. Tt is useful to validate proxies through a tcp tunnel or not.

The route is:
phc -------- (myproxy) ------ testproxy ----- checksite

FILES

phc.conf
Configuration file for phc.
doc/phc.conf.example
An example of phc.conf and should be copied as phc.conf.
doc/proxylist
A file including proxies to be verified. One testproxy every line. The format is "proxyipv4ip:port@protocol.*",such as "127.0.0.1:8080@HTTPabc". String "protocol" can be "HTTP" or "SOCKS5" now. All chars after protocol are ignored.
proxyout
A file including validated free proxies.
scripts/createlist
script used to filter and create proxylist file from raw file
scripts/sortlist
script used to sort proxyout

Both phc.conf and proxylist are needed and searched in current dir.

In phc.conf, the line after "#!"(not "#! if...") must be customed before run this program. See CONFIGURATION SYNTAX below.

In proxylist, only the line with string "@HTTP" or "@http" will be read as proxies and host:port before "@" will be extracted without ignoring.

In proxyout, you can get free proxies with delay data. See this table for details:

method output format
HTTP_GET host:port@HTTP estab pget end
HTTP_CONNECT host:port@HTTP estab pcon get end
SOCKS5_CONNECT host:port@SOCKS5 estab pcon get end
estab
delay between sending connect (SOCKS5 connect command or HTTP CONNECT request or connect to testproxydirectly) and receiving established connection to remote testproxy (interact with myproxy if not in DIRECT mode).
pget
delay between sending HTTP "PROXY" GET request to testproxy and receving first byte of target.
get
delay between sending HTTP GET request to target and receving first byte reply of target.
end
delay between receving first byte and finding the key.
pcon
delay between sending connect command(SOCKS5 connect command or HTTP CONNECT request) to remote proxies and receving connection established from remote proxies.

I have written a document to describe the process in detail. It will be available on the project homepage in the future. Please "info phc" for a short but enough to use description on it.

CONFIGURATION SYNTAX

Line begin with "#" is read as comment. Configuration line begin with "var=value". There must be no whitespace between "var" and "=" or "value" and "=". Whitespace inside "value" or "var" is permitted and all chars including quote(if have) in var or value string is read without expanding. The line with misspelled "var" is read as comment too. Here is a list of "var" acceptable:

threads
The number of threads opened at the same time. This should be set according to ulimit. The number can't be more than 65535. Though nocache header is used, it is expected that less threads give more precise delay information to evaluate the proxies better.
mytype
The type of myproxy. 1 for HTTP_CONNECT proxy without authentication. 2 for SOCKS5_CONNECT proxy without authentication. 3 for HTTP_CONNECT_AUTH proxy, that is to say, a proxy with basic authentication. 4 for SOCKS5_CONNECT_AUTH proxy, that is to say, a proxy with username/password authentication. -1 for direct connection to testproxy without myproxy(Testing).

You must set myuser and mypass if let mytype=2.
myhost
The hostname or ip of myproxy(http or socks5 proxy) used as tunnel to connect to remote test proxies.
myport
Of the same proxy as above, but port opened.
myuser
The username of myproxy if basic authentication(HTTP) or username/password authentication(socks5) is needed.
mypass
The password of myproxy if basic authentication(HTTP) or username/password authentication(socks5) is needed.
checksite
The target will be used as request sent to proxies. The format must be http://host:port/path.
key
Tt will be searched in the string returned to validate the proxies.
httptestmethod
Methods used to validate free http testproxy.1 to find http CONNECT proxies. 0 to find the common http proxies.
socks5testmethod
Method used to validate free socks5 testproxy. Only 2 (SOCKS5_CONNECT) supported now. Don't change it.
user_agent
Identified as Browsers or others to "cheat" some proxies.
myconreplysize
The size of buffer used to receive reply after sending CONNECT request to myproxy
testconreplysize
The size of buffer used to receive reply after sending CONNECT request to testproxy
testtagreplysize
The size of buffer used to stored data from the target. Key was searched in this buffer.
rcvtimeo
Receiving timeouts in second
sndtimeo
Sending timeouts in second
logfilename
The filename stderr is redirected to. Use "." to leave stderr as it is.

NOTES

OS
This program is only tested on linux(gentoo , debian, fedora), OSF1 and SunOS. If it can't work on other os, please mail me.
WWW
Old:http://phc.sourceforge.net The project is moved to savannah now: http://www.nongnu.org/phc
COPYRIGHT
Phc and all the document, scripts and other files coming with the distribution are subject to the GNU General Public License (GPL). Please see the COPYING file in the top directory of the package for details.
AUTHOR
Phc is written from scratch by Jia Wang <skyroam@gmail.com>.
BUGS
You are welcome to this Bug Tracking System at project page: http://savannah.nongnu.org/bugs/?group=phc