dimecres, gener 25

 

{ MaRtlnl:: Xarbotant l'armatrostre }: Constru�nt el nostre propi firewall smoothwall

Seguint amb{ MaRtlnl:: Xarbotant l'armatrostre }: Constru�nt el nostre propi firewall smoothwall diré que he afegit un parell de coses més. Primer, he instal·lat un dimoni identd per Windows XP També hi ha per Windows 95/98.
Un dimoni Ident retorna el nom d'usuari de l'equip.
Bé per a què funcioni anem a Services->content filter->Network i activem "User name ID method Ident". Un cop fet això, canviem el nostre script en perl per a què ens identifiqui a qualsevol ordinador pel nostre nom d'usuari:
#!/usr/bin/perl

$allow_html_code = 0;
&ReadEnvs;

$deniedurl = $in{'DENIEDURL'};
$reason = $in{'REASON'};
$user = $in{'USER'};
$ip = $in{'IP'};
$hash = $in{'HASH'};

print "Content-type: text/html\n\n";
print '<HTML><HEAD><TITLE>DansGuardian - Accés Denegat</TITLE></HEAD>';
print '<BODY>';
print '<CENTER>';
print '<TABLE WIDTH=700 BORDER=0 CELLPADDING=2 CELLSPACING=0><TR>';
print '<TD COLSPAN=2 HEIGHT=100 BGCOLOR=#fea700>';
print '<P ALIGN=CENTER><FONT FACE="arial, helvetica"><FONT SIZE=6><B>Accés denegat!</B> </FONT></FONT></P>';
print '</TD></TR><TR>';
print '<TD COLSPAN=2 HEIGHT=30 BGCOLOR=#fffacd> </TD>';
print '</TR><TR>';
print '<TD WIDTH=150 VALIGN=top align=center BGCOLOR=#b0c4de><img src="http://192.168.0.1:81/ui/assets/3.5/img/lock.gif">';
print '<br><br><br><FONT FACE="arial, helvetica"><b>La teva IP:</b>';
print "<br>$ip";
print '<br><br><br><br><br><br><br><br>';
print '<img src="http://192.168.0.1:81/ui/assets/3.5/img/smoothwall.promo.button.gif">';
print '<br><FONT FACE="arial, helvetica" size=-2>SmoothWall Express 2.0<br>amb DansGuardian i ClamAV</TD>';
print '<TD WIDTH=550 BGCOLOR=#ffffff>';
print "<br><P ALIGN=CENTER><FONT SIZE=4><FONT FACE=\"arial, helvetica\"><FONT COLOR=#000000>Em sap greu $user, però l'accés a:";
print "<BR><BR><A HREF=\"$deniedurl\">$deniedurl</A>";
print '<BR><BR><FONT SIZE=3>... ha estat denegat per aquest motiu:';
print "<BR><br><FONT COLOR=#ff0000><B>$reason</B>";

if ($user eq martini) {
print "<Br><br><br><a href=\"$deniedurl?GBYPASS=$hash\"><img src=\"http://192.168.0.1:81/ui/assets/3.5/img/on.gif\" border=0></a>";
print '<br><br><br></P>';
}
else {
print '<br><br><br></P>';
print '<P align=center>Per a més informació, contacteu amb l\'Òscar Martínez';
}
print '</TD></TR></TABLE>';
print '</CENTER>';
exit;

sub ReadEnvs {
local($cl, @clp, $pair, $name, $value);
if ( $ENV{'REQUEST_METHOD'} eq 'POST' ) {
read(STDIN, $cl, $ENV{'CONTENT_LENGTH'} );
}
else {
$cl = $ENV{'QUERY_STRING'};
}
@clp = split(/::/, $cl);
foreach $pair (@clp) {
($name, $value) = split(/==/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s///g;
if ($allow_html_code != 1) {
$value =~ s/<([^>]|\n)*>//g;
}
$in{$name} = $value;
}
}


També he instal·lat dos mods:
De protecció:
[2.0] Guardian - Reactive Firewall (v2.1)
Estètic:
[2.0] SmoothWall Information Display in GUI v.1.0

De moment, això serà tot...A veure si finalment faig quell article que vaig comentar anteriorment.

Etiquetes de comentaris: ,


Comentaris: Publica un comentari





<< Pàgina principal

Subscriure's a Missatges [Atom]