| 1 |
CGI Bypass - New features in bypass v2 |
| 2 |
|
| 3 |
Bypass v2 improves security especially with cgi bypass. |
| 4 |
|
| 5 |
The older version is now refered to as version 1. |
| 6 |
|
| 7 |
In normal (non-CGI) bypass mode, e2g creates a hash of the url, bypasskey, client_ip, username and this is |
| 8 |
checked by e2g against current values when the bypass link is used. This ensures that the bypass link can |
| 9 |
only be used for the save url, by the same user and IP. |
| 10 |
|
| 11 |
However, in version 1, when in cgi mode the bypass hash is generated by the cgi, based on the parameters |
| 12 |
passed to it by the client browser, in a redirect from e2g. In this process it is possible for the user |
| 13 |
to modify or forge the parameters (url, ip etc) and get assess to a different site than that redirected |
| 14 |
from e2g. |
| 15 |
|
| 16 |
In version 2 CGI mode, e2g gernerates a hash in the same way as non-CGI use, and the CGI validates this |
| 17 |
by adding the cgikey to the e2ghash and then creates a new hash with the result. When e2g receives this |
| 18 |
it duplicates the whole hashing process, first the hash it would have generated and then resulting hash |
| 19 |
signed by the cgi. Only if this matches the received hash is the bypass allowed. Also in order for the |
| 20 |
cgi to check if details have been altered a separate 'CHECK' hash is generated by e2g - |
| 21 |
format md5(url + client_ip + user + cgikey). |
| 22 |
|
| 23 |
Configuration - all in e2guardianfN.conf |
| 24 |
|
| 25 |
For URL Bypass. |
| 26 |
|
| 27 |
Set:- |
| 28 |
|
| 29 |
accessdeniedaddress = 'http://YOURSERVER.YOURDOMAIN/cgi-bin/e2guardian.pl' |
| 30 |
bypassversion = 2 |
| 31 |
cgikey = 'your cgi key' |
| 32 |
|
| 33 |
cgibypass = 'on' |
| 34 |
bypasskey = '' # allow e2g to generate random key at start-up |
| 35 |
bypass = 900 # number of seconds bypass is valid |
| 36 |
|
| 37 |
For Infection URL bypass |
| 38 |
|
| 39 |
If not already set by URL bypass:- |
| 40 |
|
| 41 |
accessdeniedaddress = 'http://YOURSERVER.YOURDOMAIN/cgi-bin/e2guardian.pl' |
| 42 |
bypassversion = 2 |
| 43 |
cgikey = 'your cgi key' |
| 44 |
|
| 45 |
Then set:- |
| 46 |
|
| 47 |
cgiinfectionbypass = 'on' |
| 48 |
infectionbypasskey = '' # allow e2g to generate random key at start-up |
| 49 |
infectionbypass = 900 # number of seconds bypass is valid |
| 50 |
|
| 51 |
|
| 52 |
V2 CGI processing |
| 53 |
|
| 54 |
Your cgi program will be passed a number of parameters from e2g, giving DENIEDURL, REASON, USER, IP, |
| 55 |
FILTERGROUP, CATEGORIES, REASON, CHECK and either GBYPASS (url bypass) or GIBYPASS (infection bypass). |
| 56 |
|
| 57 |
Note that all parameters are sent URLencoded - if these are not decoded by your httpd server you will |
| 58 |
need to URLdecode these before processing. |
| 59 |
|
| 60 |
CHECK is a md5 hash of (DENIEDURL + IP + USER + cgikey) and will be the same as a similar hash |
| 61 |
generated withing the cgi, if the parameters match those generated by e2g. This can be used by |
| 62 |
the cgi to check that a user has not changed or forged any patameters. |
| 63 |
|
| 64 |
If the request is approved by the cgi, then the GBYPASS or GIBYPASS should be modified as follows |
| 65 |
and then a redirect sent back to the browser to DENIEDURL + the modified G[I]BYPASS parameter. |
| 66 |
Make sure you check for any existing parameters in DENIEDURL so that you add it prefixed with '?' |
| 67 |
or '&' as needed. |
| 68 |
|
| 69 |
Take the first 32 bytes of the G[I]BYPASS and make a new md5 hash based on this plus the cgikey. |
| 70 |
Replace the first 32 bytes with the new hash. |
| 71 |
|
| 72 |
First draft 2nd Jan 2019 - requires checking - Philip Pearce |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|