|
|
|||||||||||||||||||||||||||||||||||||||||||
![]() |
The included fixes are:
--- ftp-gw.c_ORIG Fri Feb 6 00:05:43 1998
From:
q += 3;
msg_int = auth_perm(confp,authuser,"ftp-gw",riaddr,tokav[0]);To: msg_int = auth_perm(confp,authuser,"ftp-gw",riaddr,tokav);
Apply this patch if out of band data is not correctly getting passed. --- tn-gw.old Sun Dec 10 21:40:49 2000
Smap can be made to fill it's spool with temporary files if it gets a SIGPIPE (broken pipe) because of improper TCP teardown by the client. Fix is by Tor Perkins <[email protected]> --- smap.c.org Tue Jan 13 14:56:14 1998
+static void
main(ac,av)
if(peername(0,rladdr,riaddr,sizeof(riaddr)))
{
You can download the patch here.
diff -r1.1 error.c
If you try an FTP URL with a port number (try ftp://localhost:666), you'll find that FWTK 2.1 overrides the user-specified port, forcing it to port 21. The reason it did that was because the http-gw.c code defaulted the port number to 80 for FTP URLs, and the (incorrect) workaround was to force it to 21 in all cases. The patch defaults to port 21, then allows the user to override with the URL. *** ftp.c 1998/09/24 14:53:52
1.1
! port = FTPPORT;
--- 281,289 ---- ! if( rem_port == 0){
------------------------------------------------------------------------------- *** http-gw.c 2000/09/08 15:24:21
1.3
Here is a diff for the smap.c code (note that this code has already been patched for Solaris 2 -- your milage may vary). I've tested it briefly, and everything seems okay. This will save a copy of each message to a directory called "backup" that is located directly under your regular "smap" spool directory, as specified in your netperm-table: smap, smapd: directory /var/spool/mqueue.smap would use /var/spool/mqueue.smap/backup as the back directory. This is necessary because this could also be your chroot environment. It uses the same filename as the temporary file. This is in the format "smaXXXXXX". I believe the code is as secure as the stuff TIS provides, since it's basically their code, just duplicated for the second file. You are probably going to have problems when the directory starts getting full. Here's some suggestions: 1) Run a daily/weekly cron job to move the files to off-line storage
To compile, include the flag -DDUPMAIL in the Makefile. -- Marc Mosko <[email protected]>
Then, just add something like this to the netperm-table: ftp-gw: permit-hosts 192.168.0.* -plug-to internal.ftp.domain.com A good use for this patch would be to mirror an internal FTP site onto
an external one. You might want to take a look at mirror.pl, available
at ftp://sunsite.doc.ic.ac.uk/packages/mirror.
From the mirror.pl README file:
--- ./lib/hnam.c.croall Thu Jul 16 15:35:31 1998
My source code has the following patches: FTP-GW: Files affected: ftp-gw.c
These patches are not tested fully. I have the code running in my machines plus about fifteen other fwtk-users are using it. I would appreciate any efforts to bring out the bugs from the patch. One request: Please send me a one liner with your email address and name before using this, so that I know somebody is using it. In case I find any bugs in it I shall send the files to you in future. --Gopu <[email protected]>
Sorry if this has been reported and/or done before, but I've got three small fixes/additions for FWTK 2.0 to share: 1- smapd & smail
2- opie and authsrv
The details and source are on our web site. Please see:
Mark Lentczner <[email protected]>
By default, FWTK 2.1 does not support the binding of its proxies to only certain IP addresses. It requires that these proxies be listening on all interfaces simultaneously. There are obvious security problems with this situation so this patch was developed to address it. The -daemon option has been modified so that the argument can now contain an IP address to bind to. If one isn't specified the previous "all interfaces" approach is defaulted. The specified name can be ip numbers (xxx.xxx.xxx.xxx) or a hostname that can be resolved by gethostbyname() on the firewall/service machine. The -name option has been added so that multiple proxy definitions can exist in the netperm-table for the relevant proxy. The proxies should function identically as unpatched if the extensions are not used in invocation. You can also download this from the FWTK IPBind web site: https://www.connetsys.com/products/ipbind/ William L. Hamlin <[email protected]>
- bzero( (char *)&sa.sin_addr,
sizeof(sa.sin_addr));
1.SSL encryption for SMAP.
SASL authentication is in use by more and more mail clients today. It essentially allows you to authenticate yourself to the mail server, before having it accept mail. When used in combination with the included anti-spam software, it can be an effective means of eliminating SPAM while allowing authorized users to send mail from anywhere on the Internet. The patches and documentation are available at: https://www.macgyver.org/software/smap-sasl.html.
We have also mirrored the latest (as of this writing) version of the patch
here.
The patch ftp-gw.patch adds a "data-port"
option to your netperm-table that will allow this to work. Add something
like the below to the netperm-table.
- sizelimit directive in netperm-table (giving the size in bytes, and 0 for no control) - separate syslog (including a global dest variable) in order to keep stats untouched and ease the summary of size limit exceeded - close the data connection by simulating an error You can also shut people down who keep getting files below the limit. The stopftp.cron script will add them to the netperm-table is their downloads go above the set amount in the log file. Bruno LEBAYLE ([email protected]) Netperm-table (e.g. for 10KB)
Header (before main)
Init (after reading timeout configuration option)
In cmd_user routine, after permit syslog
copyin and copyout routines, between read and write
From the author regarding his patch (ftp-pasv.tgz): This document is mostly relevant for folks who are using packet filters in conjunction with ftp-gw. When ftp-gw is actively proxy-ing, it acts like an ftp server on one side, and an ftp client on the other side. The proxy may choose to use PORT or PASV independently of what the real client host chooses. Let's look at some variations: 1) client
--PORT-> ftp-gw --PORT-> remote
2) client
--PORT-> ftp-gw --PASV-> remote
3) client
--PASV-> ftp-gw --PORT-> remote
4) client
--PASV-> ftp-gw --PASV-> remote
Scenarios 1 and 3 require that new inbound connections on ports 1024+ be allowed from the outside (remote side) of the proxy by the packet filters. Because this is undesirable, we can configure the proxy to always use PASV: ftp-gw: pasv true Now scenarios 2 and 4 are all that remain. Scenario 4 requires that new inbound connections on ports 1024+ be allowed from the inside (client side) of the proxy by the packet filters. Let's send a "502 Command not implemented" to these clients: ftp-gw: pasv true -portonly Most clients default to PORT. Any client that has been configured to use PASV will most likely fall back to PORT when it gets the 502. Now scenario 2 is our last remaining scenario. The good news about scenario 2 is that we can deny any incoming packet that does not have the ACK bit toggled and is coming in on a high port number. The bad news is that there are lots of high port numbers. Let's narrow down the possibilities: ftp-gw: data-port 62345 The proxy is initiating the data channel connection (sending that first
SYN packet); it is sending to a destination port that was sent to it over
the control channel. This is a kinda-random high port on the
We can now use a quite restrictive filtering scheme. We only allow inbound packets to one high port (62345) and then only if the ACK bit is toggled. This rule is good for all interfaces. CAVEAT: We're in trouble if the remote 502's us; we don't fall back... :^) HTTP-GW: The ftp proxy capabilities of http-gw are not needed if ftp-gw has the tranparency patch. Tor Perkins <[email protected]>
From the author (Jean-Christophe MONIER <[email protected]>): I've writting a small patch to extand syntax of the 'login' command
of the authmgr software.
- original : enter "login" and authmgr prompt you for Username: and
The last method allow you to login into authmgr from a script like a perl program for example. I use this in a perl script that allow me to put new users from a flat-text file. Here is the patch ----------- CUT HERE ------------------------------ --- /usr/src/fwtk/auth/authmgr.c
Tue Sep 5 13:04:34 2000
static Cmd ctab[] = {
logged_in = 0;
----------- CUT HERE ------------------------------
Here is the perl script I use :
----------- CUT HERE ------------------------------
open(IN, "$DATABASE");
# Add users from userfile (one user per line)
----------- CUT HERE ------------------------------
If you implement Squid, you might want to use Paul Duerr's http-gw ==> Squid forwarding patch. You can find it at http-pat.tar.gz or you can use squid-gw (em-gw) by Eberhard Mattes found below. You can also cache NNTP by using nntpcache, which is found at https://www.nntpcache.org/
You can use plug-gw as a ssh proxy between two distinct hosts or look at the ssh proxy listed in this FAQ if you want encrypted traffic between your client and the firewall. You can also tunnel ssh through SSL in http-gw by using the ssh-tunnel.pl script. Also look for the SSH proxy lower in this file.
The latest release is 0.3.0-pl18 and can be found here. Latest changes are: rel0_3_0_patch18: 29th August 2001 Change of default timeout down to 40 seconds in line with other UDP "firewall" products. Dropped debug timer to 10secs Disable LOGINSTANCES define by default to suppress excessive logging with debug disabled. See README for some details on the corresponding differences to syslogging - and the source to really understand... Updated README/Makefile with RedHat 6.2 settings Updated initscript for RedHat to include latest suggestions for an RH7 script from Michael St Laurent Updated acknowledgement/thanks to include Michael rel0_3_0_patch17: 3rd May 2000 seg fault found in parsehost()
- traced to
rel0_3_0_patch16: 18th November 1999 patch number updated in Makefile!
rel0_3_0_patch15: 09th November 1999 patch of recvfrom call checking
to allow a null UDP size packet to
For alpha testing, the proxy and wrapper can be obtained from in the contrib section of the FWTK ftp site: ftp://ftp.tis.com/pub/firewalls/toolkit/contrib/mbone-gw.tar.gz A more complete description of the proxy and wrapper are provided in a recent paper presented at the 1997 IEEE Symposium on Security and Privacy, "An MBone Proxy for an Application Gateway Firewall". This paper is available on line at https://www.tis.com/docs/research/network/mbone/mboneabs.html
------------------------------------------------------------------------------
The PGP sig for em-gw.tar.gz can be downloaded at em-gw.asc -- Eberhard Mattes <[email protected]>
You can download the proxy from irc-gw-1.0bpl2.tar.gz.
The proxy was written by ArkanoiD <[email protected]>
This is a good solution if you trust your internal network, but want encrypted packets on the Internet. The proxy is at ssh-gw.tar.gz. The proxy
was written by ArkanoiD <[email protected]>
pop3-gw v0.4alpha
This proxy implements pop3 protocol gateway with optional USER/PASS -> APOP auth protocol translation for outbound pop3 connections. It supports RFC-1939 pop3 commands only and does not work with AUTH type authentication (and who does?). Only outbound APOP is supported; that means you can't use it to authenticate to proxy itself (if you use plugged or transparent operation, you can, but..). Please note that messages pass over the internet unencrypted even if you use APOP. Use PGP to avoid that. setting up proxy
Compile the source and edit inetd.conf to point to the binary. Set up connection divertor if you use transparent operation. netperm-table general options: userid <uid>,groupid <gid> similar to fwtk {permit-|deny-}hosts similar to fwtk netperm-table hosts options: -dest <list> similar to fwtk -fallback permit fallback to insecure protocol -transparent tranparent operation -plug-to <server> plug to a pre-defined server (can be useful for inbound operation) -apop-only being used with -transparent or -plug-to,
disallow user/pass authentication on client side
-user <username-list> specify the list of users allowed to access proxy. "!" modifier is valid. -separator <separator-char> a character to replace @ as separator. (unimplemented)
setting up client side
For transparent operations no special client setup is required. BUGS
ToDo
For developers
Revision history
0.2alpha bugfix: fixed typo caused "userid" config parameter to
be ignored
0.3alpha added -user option 0.4alpha added -separator option - Netscape (HATE!) workaround.
Email
ident-spoofer v1.0beta
The program is not designed to provide information on services running on the host: it works with remote port numbers only. setting it up
{permit-|deny-}hosts <hostmask> - similar to fwtk
service name is a name or port number you connect to, like in: ident-spoofer: service smtp
root
and so on. BUGS
ToDo
Email
This file is README for rsh-gw, a proxy for rshd(8) protocol and fwtk-style firewalls. It makes (should do) usage of rsh and rsh-based services like rsync,rdist,cvs and so on possible across firewalls. WARNING: this proxy (due to nature of rsh protocol) does not support authentication techniques other than generic one which is based solely on rsh client and host system security. So it is at least not wise to use it to access "trusted" networks from "untrusted" ones. Once again: the primary purpose of the program is to allow "internal" users acess to [semi-]public rsh-based services. Another purpose is to run x-gw authomagically from script. If you got any interesting services running please send me your setup and log fragments - I need it for future documentation. setting up proxy
Compile the source and edit inetd.conf to point to the binary. If your system does not have rcmd(3) system call you can use a generic BSD implementation provided in this distribution for reference purposes. Set up connection divertor if you use transparent operation. netperm-table general options: {permit-|deny-}hosts similar to fwtk xforwarder similar to tn-gw/rlogin-gw netperm-table hosts options: - -dest <list> similar to fwtk - -transparent tranparent operation - -plug-to <server> plug to a pre-defined server - -user <username-list>
specify the list of users allowed
- -ausers <username-list>
specify the list of users treated
- -xok permit x-gw access - -extnd
turn extended permissions processing
setting up client side
For transparent operations no special client setup is required. "rsh firewall-host x" will just run x-gw on firewall. You can redirect stdout from this command to somewhere and use it as future reference to "remote" display. Example: eval `rsh myfirewall x|sed "s/display port/RDISPLAY/"`
BUGS
I think I should make it more portable. ToDo
For developers
Email
A dirty hack designed to eliminate sendmail (and other "smart" MTA's) on the firewall completely. Based on ssmtp program (i left the original name unchanged, although code differs much), see source comments for more information and original authors list. setting it up
smapd: sendmail
/usr/local/etc/ssmtp (or whatever your binary
ssmtp: relay mylocalnet.net
-via mymailhub.internal.net
ssmtp know nothing about MX'es and other things like that. It does SMTP _only_ and uses static routes defined in netperm-table to deliver mail. BUGS
Sendmail emulation is really bad, but we do not need anything better to work with smapd and scripts like /etc/daily. Code requires more audit to find possible buffer overrun vulnerabilities. ToDo
Email
sybase-gw v0.3beta
This file is README for sybase-gw, a proxy for TDS protocol 5.0 and fwtk-style firewalls. It should work and tested with Sybase 11. Another functionality it provides is creating encrypted tunnel between two firewalls for database applications. setting up proxy
Edit Makefile to add -DIPFILTER to c options and IPFILTER variable to point to IPFilter source if you use IPFilter tranparency. Compile the source and edit inetd.conf to point to the binary. Requires
libblowfish (available from ftp.funet.fi) and md5 library (if your system
does not have libmd5 you are probably running linux. try to
Set up connection divertor if you use transparent operation. netperm-table general options: {permit-|deny-}hosts similar to fwtk netperm-table hosts options: - -dest <list> similar to fwtk - -transparent tranparent operation - -plug-to <server> plug to a pre-defined server - -port <port> use this port number when connecting to server - -authuser <username> similar to fwtk - -user <username-list> specify the list of users allowed to access proxy. "!" modifier is valid. - -loguser log username when authenticating on database server - -client-encrypt <method> use encryption on client side, blowfish only is implemented for now - -client-md5key <any string> string hash will be encryption key - -server-encrypt <method> use encryption on server side, blowfish only is implemented for now - -server-md5key <any string> string hash will be encryption key - -extnd turn extended permissions processing on (see authsrv documentation) setting up client side
Use user@host syntax
For transparent operations no special client setup is required. BUGS
I think i should make it more portable. There are some possible problems if your compliler does not understand pack() #pragma. Packet check after authenitcation is embryonic. Protocol seems to be quite brain-dead so expect slowdowns or something. Encryption is far from being optimal. ToDo
Implement more encryption and hash functions. Think on 2-level authentication (if it is possible at all) Get protocol specs from Sybase (all the code is based on reverse engineering and non-reliable sources. it is much better than Gauntlet sybase proxy anyways ;) Anything else? For developers
Revision history
Email
ms-sql-gw v0.3beta
This file is README for ms-sql-gw, a proxy for TDS protocol 4.2 or 4.6 and fwtk-style firewalls. It should work with MS SQL 6 and 7 and older Sybase ( <10 ) versions. Another functionality it provides is creating encrypted tunnel between two firewalls for database applications. setting up proxy
Compile the source and edit inetd.conf to point to the binary. Requires
libblowfish (available from ftp.funet.fi) and md5 library (if your system
does not have libmd5 you are probably running linux. try to
Set up connection divertor if you use transparent operation. netperm-table general options: {permit-|deny-}hosts similar to fwtk netperm-table hosts options: - -dest <list> similar to fwtk - -transparent tranparent operation - -plug-to <server> plug to a pre-defined server - -port <port> use this port number when connecting to server - -authuser <username> similar to fwtk - -user <username-list> specify the list of users allowed to access proxy. "!" modifier is valid. - -loguser log username when authenticating on database server - -client-encrypt <method> use encryption on client side, blowfish only is implemented for now - -client-md5key <any string> string hash will be encryption key - -server-encrypt <method> use encryption on server side, blowfish only is implemented for now - -server-md5key <any string> string hash will be encryption key - -oob emulate client oob behavior - -sqlv6 specify protocol version - -tdsv42 " - -sqlv7 " - -tds46 " - -extnd turn extended permissions processing on (see authsrv documentation) setting up client side
For transparent operations no special client setup is required. BUGS
I think i should make it more portable. There are some possible problems if your compliler does not understand pack() #pragma. Packet check after authenitcation is embryonic. Protocol seems to be quite brain-dead so expect slowdowns or something. Encryption is far from being optimal. ToDo
Implement more encryption and hash functions. Think on 2-level authentication (if it is possible at all) Get protocol specs from Sybase (all the code is based on reverse engineering and non-reliable sources. it is much better than Gauntlet ms sql proxy anyways ;) Anything else? For developers
Revision history
Email
lp-gw v0.2alpha
This file is README for lp-gw, a proxy for line printer protocol and fwtk-style firewalls. It does (i hope) conform to rfc1179 strictly and can be used with lprNG clients and servers and even to enforce lprNG clients usage. setting up proxy
Compile the source and edit inetd.conf to point to the binary. netperm-table general options: {permit-|deny-}hosts similar to fwtk printer <user-queue> -printer <server-queue> -host <server> map "user-queue" on firewall to
if "user-queue" is "*", map all
netperm-table hosts options: -queue <list> list queues client is permitted to
-deny <list> specify the list of permitted
operations
-log <list> causes operation to be logged.
-lprng force client to use lprNG protocol.
setting up client side
Email
According to the author (Mark D. Roth <[email protected]>), the addon is a PAM module to do authsrv authentication which works under both RedHat Linux 6.1 and Solaris 7. This patch is pam_authsrv-20000512.tar.gz.
Extract it into fwtk/tools/server and read the included README for more
information.
This proxy for SOCKS4/5 connections was written by Yakov Kravets <[email protected]>. Note that it only supports TCP/IP connections. The patch is socks-gw.tar.gz. END OF PATCH PAGE |
If you would like to contribute patches to this page, either post them on the FWTK-users mailing list or e-mail them here.