--- proxychains-3.1.orig/patches/proxychains_exclude-3.1.patch +++ proxychains-3.1/patches/proxychains_exclude-3.1.patch @@ -0,0 +1,119 @@ +--- proxychains-3.1.orig/proxychains/libproxychains.c 2006-03-16 05:16:59.000000000 +1300 ++++ proxychains-3.1/proxychains/libproxychains.c 2007-04-18 15:31:24.000000000 +1200 +@@ -42,6 +42,30 @@ + #define SOCKFAMILY(x) (satosin(x)->sin_family) + #define MAX_CHAIN 30*1024 + ++#ifdef PTRUE ++#undef PTRUE ++#endif ++#define PTRUE 1 ++ ++#ifdef PFALSE ++#undef PFALSE ++#endif ++#define PFALSE 0 ++ ++/* total number of available slots for subnets */ ++#define MAX_LOCAL_NETS 20 ++ ++/* structur for representing networks to be excluded */ ++typedef struct ++{ ++ int valid; ++ unsigned int subnetwork; ++ unsigned int subnetmask; ++} my_network; ++ ++my_network localnet[MAX_LOCAL_NETS]; /* array of sub nets */ ++ ++ + int tcp_read_time_out; + int tcp_connect_time_out; + chain_type proxychains_ct; +@@ -55,14 +79,15 @@ + static inline void get_chain_data( + proxy_data *pd, + unsigned int *proxy_count, +- chain_type *ct); ++ chain_type *ct, ++ my_network *subnets); + + static void init_lib() + { + // proxychains_write_log("ProxyChains-"VERSION +-// " (http://proxychains.sf.net)\n"); +- +- get_chain_data(proxychains_pd,&proxychains_proxy_count,&proxychains_ct); ++// " (http://proxychains.sf.net)\n"); ++ get_chain_data(proxychains_pd,&proxychains_proxy_count,&proxychains_ct,localnet); ++ + true_connect = (connect_t) dlsym(RTLD_NEXT, "connect"); + + if (!true_connect) { +@@ -140,11 +165,12 @@ + static inline void get_chain_data( + proxy_data *pd, + unsigned int *proxy_count, +- chain_type *ct) ++ chain_type *ct, ++ my_network *subnets) + { + + +- int count=0,port_n=0,list=0; ++ int count=0,port_n=0,list=0,subcount=0; + char buff[1024],type[1024],host[1024],user[1024]; + FILE* file; + +@@ -170,7 +196,11 @@ + if(buff[strspn(buff," ")]!='#') { + if(list) { + bzero(&pd[count], sizeof(proxy_data)); +- pd[count].ps=PLAY_STATE; ++ ++ bzero(&subnets[subcount], sizeof(my_network)); ++ ++ pd[count].ps=PLAY_STATE; ++ + port_n=0; + sscanf(buff,"%s %s %d %s %s", type,host,&port_n, + pd[count].user,pd[count].pass); +@@ -182,6 +212,12 @@ + pd[count].pt=SOCKS4_TYPE; + }else if(!strcmp(type,"socks5")) { + pd[count].pt=SOCKS5_TYPE; ++ } else if(!strcmp(type,"localnet")) { ++ subnets[subcount].subnetwork=inet_addr(host); ++ subnets[subcount].subnetmask=inet_addr(pd[count].user); ++ subnets[subcount].valid=PTRUE; ++ subnets[subcount + 1].valid=PFALSE; ++ subcount++; + }else continue; + + if( pd[count].ip && pd[count].ip!=-1 && port_n) +@@ -223,13 +259,23 @@ + int connect (int sock, const struct sockaddr *addr, unsigned int len) + { + int socktype=0,optlen=0,flags=0,ret=0; +- ++ int lnnum=0; + if(!init_l) + init_lib(); + optlen=sizeof(socktype); + getsockopt(sock,SOL_SOCKET,SO_TYPE,&socktype,&optlen); + if (! (SOCKFAMILY(*addr)==AF_INET && socktype==SOCK_STREAM)) + return true_connect(sock,addr,len); ++ ++ get_chain_data(proxychains_pd,&proxychains_proxy_count,&proxychains_ct,localnet); ++ for (lnnum = 0; localnet[lnnum].valid == PTRUE; lnnum++) ++ { ++ if (( satosin(*addr)->sin_addr.s_addr & localnet[lnnum].subnetmask) == localnet[lnnum].subnetwork) ++ { ++ return true_connect(sock,addr,len); ++ } ++ } ++ + flags=fcntl(sock, F_GETFL, 0); + if(flags & O_NONBLOCK) + fcntl(sock, F_SETFL, !O_NONBLOCK); --- proxychains-3.1.orig/patches/series +++ proxychains-3.1/patches/series @@ -0,0 +1 @@ +proxychains_exclude-3.1.patch --- proxychains-3.1.orig/debian/dirs +++ proxychains-3.1/debian/dirs @@ -0,0 +1,4 @@ +usr/bin +usr/lib +usr/share/doc/proxychains +usr/share/lintian/overrides --- proxychains-3.1.orig/debian/README.Debian +++ proxychains-3.1/debian/README.Debian @@ -0,0 +1,15 @@ +proxychains for Debian + + If you are upgrade from 1.x to 2.x, please notify that configure file was +changed, the ProxyList options are different. + +-- 1.x -- +DynamicChain +StrictChain +RandomChain +-- 2.0 -- +dynamic_chain +strict_chain +random_chain + + -- Rex Tsai , Tue, 20 Apr 2004 13:41:04 +0800 --- proxychains-3.1.orig/debian/docs +++ proxychains-3.1/debian/docs @@ -0,0 +1,4 @@ +AUTHORS +README +TODO +proxychains/docs/en/*.html --- proxychains-3.1.orig/debian/proxychains.1 +++ proxychains-3.1/debian/proxychains.1 @@ -0,0 +1,75 @@ +.TH "proxychains" "1" "2.0" "" "" +.SH "NAME" +.LP +ProxyChains \- redirect connections through proxy servers + +.SH "SYNTAX" +.LP +proxychains <\fIprogram\fP> +.SH "DESCRIPTION" +.LP +This program forces any tcp connection made by any given tcp client to follow through proxy (or proxy chain). It is a kind of proxifier. +.LP +It acts like sockscap / premeo / eborder driver (intercepts TCP calls). +.LP +This version (2.0) supports SOCKS4, SOCKS5 and HTTP CONNECT proxy servers. +Auth\-types: socks \- "user/pass" , http \- "basic". +.LP +When to use it ? + +1) When the only way to get "outside" from your LAN is through proxy server. + +2) When you are behind restrictive firewall which filters outgoing connections to some ports. + +3) When you want to use two (or more) proxies in chain: +.br +like: your_host <\-\-> proxy1 <\-\-> proxy2 <\-\-> target_host +.br + +4) When you want to "proxify" some programs with no proxy support built\-in (like telnet). + +5) When you dont want to pay for eBorder / premeo socks driver :) +.LP +Some cool features: +.br +* This program can mix different proxy types in the same chain + +like: your_host <\-\->socks5 <\-\-> http <\-\-> socks4 <\-\-> http <\-\-> target_host + +* Different chaining options supported + like: take random proxy from the list. + or : chain proxies in exact order + or : chain proxies in dynamic order (smart exclude dead proxies from chain) + +*You can use it with any TCP client application, even network scanners. yes, yes \- you can make portscan via proxy (or chained proxies) for example with Nmap scanner by fyodor (www.insecure.org/nmap). + +proxychains nmap \-sT \-PO \-p 80 \-iR (find some webservers through proxy) + +.LP +NOTE: to run suid/sgid programs(like ssh) through proxychains you have to be root +.SH "FILES" +.LP +proxychains looks for config file in following order: +.TP + ./proxychains.conf +.TP + $(HOME)/.proxychains/proxychains.conf +.TP + /etc/proxychains.conf +.LP +see more in /etc/proxychains.conf + +.SH "EXAMPLES" +.LP +To run this program the standard way type: +.LP +proxychains telnet targethost.com +.LP +in this example it will run telnet through proxy(or chained proxies) specified by proxychains.conf +.SH "COPYING" +proxychains is distributed under the GNU General Public License. (GPL 2.0 or greater). +.SH "AUTHORS" +.LP +Net Creature, Proxy Labs +.br + --- proxychains-3.1.orig/debian/proxychains.overrides +++ proxychains-3.1/debian/proxychains.overrides @@ -0,0 +1 @@ +proxychains: non-dev-pkg-with-shlib-symlink usr/lib/libproxychains.so.2.0.0 usr/lib/libproxychains.so --- proxychains-3.1.orig/debian/copyright +++ proxychains-3.1/debian/copyright @@ -0,0 +1,26 @@ +This package was debianized by Rex Tsai on +Mon, 17 Feb 2003 23:55:16 +0800. + +It was downloaded from http://proxychains.sourceforge.net + +Upstream Authors: Net Creature, Proxy Labs + +Copyright: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 dated June, 1991. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + --- proxychains-3.1.orig/debian/rules +++ proxychains-3.1/debian/rules @@ -0,0 +1,99 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This is the debhelper compatibility version to use. +export DH_COMPAT=4 +include /usr/share/quilt/quilt.make + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +Makefile: configure + dh_testdir + # Add here commands to configure the package. + + # avoid autotool + touch aclocal.m4 + touch ./Makefile.in ./config.h.in ./proxychains/docs/en/Makefile.in ./proxychains/docs/Makefile.in ./proxychains/Makefile.in ./proxychains.lsm.in ./stamp-h.in + touch configure + + ./configure --enable-debug \ + --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info + + +build: build-stamp + +build-stamp: patch Makefile + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + touch build-stamp + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) distclean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + $(MAKE) DESTDIR=$(CURDIR)/debian/proxychains install + + install -d $(CURDIR)/debian/aspell/usr/share/lintian/overrides + install --mode=644 $(CURDIR)/debian/proxychains.overrides \ + $(CURDIR)/debian/proxychains/usr/share/lintian/overrides/proxychains + + $(RM) -rfv $(CURDIR)/debian/proxychains/usr/lib/*la + $(RM) -rfv $(CURDIR)/debian/proxychains/usr/include + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installexamples + dh_installmenu + dh_installcron + dh_installman debian/proxychains.1 + dh_installinfo + dh_installchangelogs ChangeLog proxychains.lsm + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- proxychains-3.1.orig/debian/changelog +++ proxychains-3.1/debian/changelog @@ -0,0 +1,75 @@ +proxychains (3.1-0ubuntu1) jaunty; urgency=low + + * New upstream release. + * debian/patches/proxychains_exclude-3.1.patch: + - Solve a problem connecting to localhost + + -- Emilio López Sat, 24 Jan 2009 15:26:45 -0200 + +proxychains (2.1-5) unstable; urgency=low + + * applied patch from Klaus Ethgen + * Fix a small error in which proxy forbite a connection. + * Removing white spaces from sources. + * Change the behavior on initial connection errors. + * Add "."'s to this changelog. + * Release proxys marked as down when list gets to small. + * Add handling of broken Proxies. + * Improve the random number generator. + * Improve the handling of down proxies. + * Fix problem in socks5 connection. + * Allow to save good proxies. + * Adding statistic capability replacing saving of good proxies. + * Halt process and reread config if too less proxies are available. + * Also allow the target to have a value. + * fixed undefined symbol: __libc_connect. (Closes: #317801) + * spelling corrected, thanks to Rakesh 'arky' Ambati (Closes: #321376) + + -- Rex Tsai Sat, 6 Aug 2005 23:43:44 +0800 + +proxychains (2.1-4) unstable; urgency=low + + * removed automake from build-depends. upgrade autotools to automake-1.9 + and autoconf-2.59a-3. + * new release for debian pool (Closes: #259617, #282424, #303221) + + -- Rex Tsai Tue, 17 May 2005 16:21:46 +0800 + +proxychains (2.1-3) unstable; urgency=low + + * added automake into Build-Depends + + -- Rex Tsai Fri, 28 Jan 2005 02:26:29 +0800 + +proxychains (2.1-2) unstable; urgency=low + + * new release for debian pool (Closes: #259617, #282424) + + -- Rex Tsai Tue, 25 Jan 2005 00:49:52 +0800 + +proxychains (2.1-1) unstable; urgency=low + + * new upstream version. + + -- Rex Tsai Thu, 13 May 2004 08:43:43 +0800 + +proxychains (2.0-1) unstable; urgency=low + + * new upstream version. + * update standard version to 3.6.1 + * update man page. + * update control with my current email/pgp, and conffile file. + + -- Rex Tsai Tue, 20 Apr 2004 10:45:32 +0800 + +proxychains (1.8.2-1) unstable; urgency=low + + * new upstream version. + + -- Rex Tsai Mon, 12 Jan 2004 21:16:14 +0800 + +proxychains (1.8-1) unstable; urgency=low + + * Initial Release. + + -- Rex Tsai Sun, 23 Mar 2003 12:45:38 +0800 --- proxychains-3.1.orig/debian/proxychains.files +++ proxychains-3.1/debian/proxychains.files @@ -0,0 +1,3 @@ +etc/proxychains.conf +usr/bin/* +usr/lib/lib*so.* --- proxychains-3.1.orig/debian/control +++ proxychains-3.1/debian/control @@ -0,0 +1,28 @@ +Source: proxychains +Section: net +Priority: optional +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Rex Tsai +Uploaders: martin f. krafft +Build-Depends: debhelper (>> 4.0.0), quilt +Standards-Version: 3.6.2.1 + +Package: proxychains +Architecture: any +Depends: ${shlibs:Depends} +Description: proxy chains - redirect connections through proxy servers + This program forces any tcp connection made by any given tcp client + to follow through proxy (or proxy chain). It is a kind of proxifier. + It acts like sockscap / premeo / eborder driver ( intercepts TCP calls ) + . + This version supports SOCKS4, SOCKS5 and HTTP CONNECT proxy servers. + Different proxy types can be mixed in the same chain. + . + Features + * Access Internet from behind restrictive firewall. + * Source IP masquerade. + * SSH tunneling and forwarding. + * Dynamic LAN-to-LAN VPN channel. + * Servers and daemons friendly (works fine with sendmail MTA). + . + http://proxychains.sourceforge.net --- proxychains-3.1.orig/debian/.pc/.version +++ proxychains-3.1/debian/.pc/.version @@ -0,0 +1 @@ +2 --- proxychains-3.1.orig/debian/patches/proxychains_exclude-3.1.patch +++ proxychains-3.1/debian/patches/proxychains_exclude-3.1.patch @@ -0,0 +1,119 @@ +--- proxychains-3.1.orig/proxychains/libproxychains.c 2006-03-16 05:16:59.000000000 +1300 ++++ proxychains-3.1/proxychains/libproxychains.c 2007-04-18 15:31:24.000000000 +1200 +@@ -42,6 +42,30 @@ + #define SOCKFAMILY(x) (satosin(x)->sin_family) + #define MAX_CHAIN 30*1024 + ++#ifdef PTRUE ++#undef PTRUE ++#endif ++#define PTRUE 1 ++ ++#ifdef PFALSE ++#undef PFALSE ++#endif ++#define PFALSE 0 ++ ++/* total number of available slots for subnets */ ++#define MAX_LOCAL_NETS 20 ++ ++/* structur for representing networks to be excluded */ ++typedef struct ++{ ++ int valid; ++ unsigned int subnetwork; ++ unsigned int subnetmask; ++} my_network; ++ ++my_network localnet[MAX_LOCAL_NETS]; /* array of sub nets */ ++ ++ + int tcp_read_time_out; + int tcp_connect_time_out; + chain_type proxychains_ct; +@@ -55,14 +79,15 @@ + static inline void get_chain_data( + proxy_data *pd, + unsigned int *proxy_count, +- chain_type *ct); ++ chain_type *ct, ++ my_network *subnets); + + static void init_lib() + { + // proxychains_write_log("ProxyChains-"VERSION +-// " (http://proxychains.sf.net)\n"); +- +- get_chain_data(proxychains_pd,&proxychains_proxy_count,&proxychains_ct); ++// " (http://proxychains.sf.net)\n"); ++ get_chain_data(proxychains_pd,&proxychains_proxy_count,&proxychains_ct,localnet); ++ + true_connect = (connect_t) dlsym(RTLD_NEXT, "connect"); + + if (!true_connect) { +@@ -140,11 +165,12 @@ + static inline void get_chain_data( + proxy_data *pd, + unsigned int *proxy_count, +- chain_type *ct) ++ chain_type *ct, ++ my_network *subnets) + { + + +- int count=0,port_n=0,list=0; ++ int count=0,port_n=0,list=0,subcount=0; + char buff[1024],type[1024],host[1024],user[1024]; + FILE* file; + +@@ -170,7 +196,11 @@ + if(buff[strspn(buff," ")]!='#') { + if(list) { + bzero(&pd[count], sizeof(proxy_data)); +- pd[count].ps=PLAY_STATE; ++ ++ bzero(&subnets[subcount], sizeof(my_network)); ++ ++ pd[count].ps=PLAY_STATE; ++ + port_n=0; + sscanf(buff,"%s %s %d %s %s", type,host,&port_n, + pd[count].user,pd[count].pass); +@@ -182,6 +212,12 @@ + pd[count].pt=SOCKS4_TYPE; + }else if(!strcmp(type,"socks5")) { + pd[count].pt=SOCKS5_TYPE; ++ } else if(!strcmp(type,"localnet")) { ++ subnets[subcount].subnetwork=inet_addr(host); ++ subnets[subcount].subnetmask=inet_addr(pd[count].user); ++ subnets[subcount].valid=PTRUE; ++ subnets[subcount + 1].valid=PFALSE; ++ subcount++; + }else continue; + + if( pd[count].ip && pd[count].ip!=-1 && port_n) +@@ -223,13 +259,23 @@ + int connect (int sock, const struct sockaddr *addr, unsigned int len) + { + int socktype=0,optlen=0,flags=0,ret=0; +- ++ int lnnum=0; + if(!init_l) + init_lib(); + optlen=sizeof(socktype); + getsockopt(sock,SOL_SOCKET,SO_TYPE,&socktype,&optlen); + if (! (SOCKFAMILY(*addr)==AF_INET && socktype==SOCK_STREAM)) + return true_connect(sock,addr,len); ++ ++ get_chain_data(proxychains_pd,&proxychains_proxy_count,&proxychains_ct,localnet); ++ for (lnnum = 0; localnet[lnnum].valid == PTRUE; lnnum++) ++ { ++ if (( satosin(*addr)->sin_addr.s_addr & localnet[lnnum].subnetmask) == localnet[lnnum].subnetwork) ++ { ++ return true_connect(sock,addr,len); ++ } ++ } ++ + flags=fcntl(sock, F_GETFL, 0); + if(flags & O_NONBLOCK) + fcntl(sock, F_SETFL, !O_NONBLOCK); --- proxychains-3.1.orig/debian/patches/series +++ proxychains-3.1/debian/patches/series @@ -0,0 +1 @@ +proxychains_exclude-3.1.patch