hi,
ok that looks good ur filter seems to work. Please try to get it work with http first. i remenber some problems with https. Maybe it doesnt work on https.
My Gui workin on no standard http port.
U edit sgerror.php and still get standard block page? hmm post ur sgerror.php.
Plz try to access
https://firewall-ip:port#/firewallblock.php from a client. Can u post ur firewall.php?
I will try to configure a test system tommorow with ur config. U are using Pfsense 1.2.3 with standard LAN WAN setup right?
Cya
EDIT:
Steps to get custom Page to work with transparent proxy with GUI on a http standard and nonstandard port
1. Install squid, Squidguard, Lightsquid Pakage
2. upload blacklist
3. configure squidguard default rule for blocking categories.
4. test filtering from a client, if standard block page appears u can go further otherwise u have to check config
5. modify /usr/local/www/sgerror.php
delete:
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# IE displayed self-page, if them size > 1024
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function get_error_page($er_code_id, $err_msg='') {
global $err_code;
global $cl;
$str = Array();
header("HTTP/1.1 " . $err_code[$er_code_id]);
$str[] = '<html>';
$str[] = '<body>';
$str[] = '<h3>Request denied by pfSense proxy: ' . $err_code[$er_code_id] . '</h3>';
if ($err_msg) $str[] = " Reason: $err_msg";
$str[] = '<hr size="1" noshade>';
if ($cl['a']) $str[] = " Client address: {$cl['a']}
";
if ($cl['n']) $str[] = " Client name: {$cl['n']}
";
if ($cl['i']) $str[] = " Client user: {$cl['i']}
";
if ($cl['s']) $str[] = " Client group: {$cl['s']}
";
if ($cl['t']) $str[] = " Target group: {$cl['t']}
";
if ($cl['u']) $str[] = " URL: {$cl['u']}
";
$str[] = '<hr size="1" noshade>';
$str[] = "</body>";
$str[] = "</html>";
return implode("\n", $str);
}
paste: (its simple html)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# IE displayed self-page, if them size > 1024
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function get_error_page($er_code_id, $err_msg='') {
global $err_code;
global $cl;
$str = Array();
header("HTTP/1.1 " . $err_code[$er_code_id]);
$str[] = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "
http://www.w3.org/TR/html4/strict.dtd">';
$str[] = '<html>';
$str[] = '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title></title></head>';
$str[] = '<body style="background-color:#FFFFFF; font-family:verdana, arial, sans serif;">';
$str[] = '<div style="width:70%; margin:20px auto;">';
$str[] = '<div style="padding:5px; background-color:#C0C0C0; text-align:right; font-weight:bold; font-family:verdana,arial,sans serif; color:#000000; font-size:60%;">';
if ($cl['n']) $str[] = "Client Name: {$cl['n']} | ";
if ($cl['a']) $str[] = "Client IP: {$cl['a']} | ";
if ($cl['i']) $str[] = "Client User: {$cl['i']} | ";
if ($cl['s']) $str[] = "Group: {$cl['s']} | ";
if ($cl['t']) $str[] = "Category: {$cl['t']} ";
$str[] = '</div><div style="background-color:#F4F4F4; text-align:center; padding:20px;">';
$str[] = '<div style="letter-spacing:0.5em; word-spacing:1em; padding:20px; background-color:#FF0000; text-align:center; color:#FFFFFF; font-size:200%; font-weight: bold;">Adresse gesperrt!</div>';
$str[] = '<div style="padding:20px; margin-top:20px; background-color:#E2E2E2; text-align:center; color:#000000; font-family:verdana, arial, sans serif; font-size:80%;">';
if ($err_msg) $str[] = '<p style="font-weight:bold; font-size:150%;">- '. $err_msg.' -</p>';
if ($cl['u']) $str[] = "<p>
URL: {$cl['u']}</p>";
$str[] = '<p>Aufgrund von Zugriffsbeschränkungen ist Ihre Anfrage nicht erlaubt.
Bitte kontaktieren Sie die IT-Abteilung, wenn Sie der Meinung sind, daß dies nicht korrekt ist.</p>';
$str[] = '<p><img style="padding-top:20px;display: block;margin: 0px auto" src="http://'. $_SERVER['HTTP_HOST'] .'/banner.png" alt="geblockt"></p></div></div>';
$str[] = '<div style="padding:5px; background-color:#C0C0C0; text-align:right; color:#FFFFFF; font-size:60%; font-family:verdana,arial,sans serif;">Web Filtering by <a style="color:#FFFFFF;">
PfSense[/url] and <a style="color:#FFFFFF;">
SquidGuard[/url]</div></div>';
$str[] = "</body>";
$str[] = "</html>";
return implode("\n", $str);
}
keep in mind to change picture path if u want to use images in block page
6. restart proxy and squidguard
Steps to get custom Page to work with transparent proxy with GUI on a https standard and nonstandard portredirection to the pfsense box itself fails.
1. u need to put errorpage on an external http server z.b debian with php installed.
2. create php script and use infos u get from squidguard variables
# %a=client_address
# %n=client_name
# %i=client_user
# %s=client_group
# %t=target_group
# %u=client_url"
3. change default rule to redirect to ext url
example:
http://extsource:port/block.php&a=%a&n=%n&i=%i&s=%s&t=%t&u=%uhope that helps.
Cya