Fortigate Webfilter Bloklanan Siteye İzin İsteme

Fortigate üzerinde webfilter bloklama mesajı ile karşılaşan kullanıcılar, yasaklanan siteye giriş hakkını isteyebilirler. IT personelini email veya telefonla aramak yerine kullanıcıların önüne bir form çıkararak, siteye girme isteklerini form aracılığı ile ilgili IT personeline iletmek daha kullanışlı olacaktır.

İlk adım olarak Config -> Replacement Messages alanından Fortiguard Web Filtering başlığı altında Fortiguard Block Page satırını seçiyoruz. Aşağıdaki varsayılan olarak gelen sayfa belirecektir.

fweb1

Sağ tarafdaki html kod alanına aşağıdaki kodları yapıştırıyoruz.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <title>
      Web Filter Violation
    </title>
    <style type="text/css">
      html, body {
        margin: 0;
        padding: 0;
        font-family: Verdana, Arial, sans-serif;
        font-size: 10pt;
      }
      h1, h2 {
        height: 82px;
        text-indent: -999em;
        margin: 0;
        padding: 0;
        margin: 0;
      }
      div {
        margin: 0;
        padding: 0;
      }
      div.header {
        background: url(%%IMAGE:logo_v2_fnet%%) 0 0 repeat-x;
        height: 82px;
      }
      div.header h1 {
        background: url(%%IMAGE:logo_v2_fguard_wf%%) 0 0 no-repeat;
      }
      div.header h2 {
        background: url(%%IMAGE:logo_v2_fnet%%) 0 -82px no-repeat;
        width: 160px;
        float: right;
      }
      div.sidebar {
        width: 195px;
        height: 200px;
        float: left;
      }
      div.main {
        padding: 5px;
        margin-left: 195px;
      }
      div.buttons {
        margin-top: 30px;
        text-align: right;
      }
      h3 {
        margin: 36px 0;
        font-size: 16pt;
      }
      .blocked      h3 {
        color: #c00;
      }
      .authenticate h3 {
        color: #36c;
      }
      h2.fgd_icon {
        background: url(%%IMAGE:logo_v2_fnet%%) 0 -166px repeat-x;
        width: 90px;
        height: 92px;
        margin: 48px auto;
      }
      .blocked      h2.fgd_icon {
        background-position: 0 -166px;
      }
      .authenticate h2.fgd_icon {
        background-position: -89px -166px;
      }
      form {
        width: 300px;
        margin: 30px 0;
      }
      label {
        display: block;
        width: 300px;
        margin: 5px 0;
        line-height: 25px;
      }
      label input {
        width: 200px;
        border: 1px solid #7f9db9;
        height: 20px;
        float: right;
      }
    </style>
<script>
$(document).ready(function () {
var jSonKategoriler='{"1":{"name":"Potentially Liable","members":[{"id":83,"name":"Child Abuse"},{"id":5,"name":"Discrimination"},{"id":1,"name":"Drug Abuse"},{"id":6,"name":"Explicit Violence"},{"id":12,"name":"Extremist Groups"},{"id":3,"name":"Hacking"},{"id":4,"name":"Illegal or Unethical"},{"id":62,"name":"Plagiarism"},{"id":59,"name":"Proxy Avoidance"}]},"2":{"name":"Adult\/Mature Content","members":[{"id":7,"name":"Abortion"},{"id":9,"name":"Advocacy Organizations"},{"id":64,"name":"Alcohol"},{"id":2,"name":"Alternative Beliefs"},{"id":15,"name":"Dating"},{"id":11,"name":"Gambling"},{"id":66,"name":"Lingerie and Swimsuit"},{"id":57,"name":"Marijuana"},{"id":13,"name":"Nudity and Risque"},{"id":8,"name":"Other Adult Materials"},{"id":14,"name":"Pornography"},{"id":63,"name":"Sex Education"},{"id":67,"name":"Sports Hunting and War Games"},{"id":65,"name":"Tobacco"},{"id":16,"name":"Weapons (sales)"}]},"4":{"name":"Bandwidth Consuming","members":[{"id":24,"name":"File Sharing and Storage"},{"id":19,"name":"Freeware and Software Downloads"},{"id":75,"name":"Internet Radio and TV"},{"id":76,"name":"Internet Telephony"},{"id":72,"name":"Peer-to-peer File Sharing"},{"id":25,"name":"Streaming Media and Download"}]},"5":{"name":"Security Risk","members":[{"id":26,"name":"Malicious Websites"},{"id":61,"name":"Phishing"},{"id":86,"name":"Spam URLs"}]},"6":{"name":"General Interest - Personal","members":[{"id":17,"name":"Advertising"},{"id":29,"name":"Arts and Culture"},{"id":18,"name":"Brokerage and Trading"},{"id":77,"name":"Child Education"},{"id":82,"name":"Content Servers"},{"id":71,"name":"Digital Postcards"},{"id":85,"name":"Domain Parking"},{"id":54,"name":"Dynamic Content"},{"id":30,"name":"Education"},{"id":28,"name":"Entertainment"},{"id":58,"name":"Folklore"},{"id":20,"name":"Games"},{"id":40,"name":"Global Religion"},{"id":33,"name":"Health and Wellness"},{"id":69,"name":"Instant Messaging"},{"id":34,"name":"Job Search"},{"id":55,"name":"Meaningless Content"},{"id":35,"name":"Medicine"},{"id":36,"name":"News and Media"},{"id":70,"name":"Newsgroups and Message Boards"},{"id":87,"name":"Personal Privacy"},{"id":48,"name":"Personal Vehicles"},{"id":80,"name":"Personal Websites and Blogs"},{"id":38,"name":"Political Organizations"},{"id":78,"name":"Real Estate"},{"id":39,"name":"Reference"},{"id":79,"name":"Restaurant and Dining"},{"id":42,"name":"Shopping and Auction"},{"id":37,"name":"Social Networking"},{"id":44,"name":"Society and Lifestyles"},{"id":46,"name":"Sports"},{"id":47,"name":"Travel"},{"id":68,"name":"Web Chat"},{"id":23,"name":"Web-based Email"}]},"7":{"name":"General Interest - Business","members":[{"id":53,"name":"Armed Forces"},{"id":49,"name":"Business"},{"id":31,"name":"Finance and Banking"},{"id":43,"name":"General Organizations"},{"id":51,"name":"Government and Legal Organizations"},{"id":52,"name":"Information Technology"},{"id":50,"name":"Information and Computer Security"},{"id":41,"name":"Search Engines and Portals"},{"id":81,"name":"Secure Websites"},{"id":56,"name":"Web Hosting"},{"id":84,"name":"Web-based Applications"}]},"21":{"name":"Unrated","members":[{"id":192,"name":"Unrated"}]},"22":{"default_action":"","name":"Local Categories","members":[{"id":140,"name":"deneme"}]}}';
            var katselect=$("#selcat");
            $.each($.parseJSON(jSonKategoriler), function (key, cat) {
                var group = $('<optgroup>',{label:cat.name});

                $.each(cat.members,function(i,item) {
                    $("<option/>",{value:item.name,text:item.name})
                        .appendTo(group);
                });

                group.appendTo( katselect );
            });

});
</script>
  </head>
  <body class="blocked">
    <div class="header">
      <h2>
        Powered By Fortinet
      </h2>
      <h1>
        FortiGuard Web Filtering
      </h1>
    </div>
    <div class="sidebar">
      <h2 class="fgd_icon">
        blocked
      </h2>
    </div>
    <div class="main">
      <h3>
        Web Page Blocked!
      </h3>
      <div class="notice">
        <p>
          You have tried to access a web page which is in violation of your internet usage policy.
        </p>
        <p>
          URL: %%URL%%
          <br />
          Category: %%CATEGORY%%
        </p>
        <p>
          <form method="post" action="http://192.168.10.57/phpmail/index.php">
            <input type="hidden" name="url" value="%%URL%%">
            <input type="hidden" name="cat" value="%%CATEGORY%%">
            <p>
              Eğer bu site sizin için önemli ise lütfen siteye girme amacınızı belirtiniz..
            </p>
            <p>
              <b>
                Email Adresiniz :
              </b>
              <br>
              <input type="text" name="email" id="email" value="" size="65">
            </p>
            <p>
              <b>
                Mesajınız: 
              </b>
              <br>
              <textarea cols="50" rows="4" name="mesaj"></textarea>
            </p>
            <p>
              <b>
                Sitenin Olması Gereken Kategorisi: 
              </b>
              <br>
              <select id="selcat" name="selcat"></select>
            </p>
            <p>
              <input type="submit" name="submit" value="Gönder" />
            </p>
          </form>
        </p>
        </div>
      </div>
    </body>
  </html>

 

Görüntü şu şekilde olacaktır.

fweb2Formun action kısmında içerde bir webserverin mail gönderen sayfanın çalıştığı link verilmeli. Test amaçlı PHP kullanılmış olup kodlar şu şekilde;

Mail gonderiminde kullanılan class.phpmailer.php dosyasını https://github.com/PHPMailer/PHPMailer adresinden indirebilirsiniz.

<?php
header('Content-Type: text/html; charset=utf-8');
require("class.phpmailer.php"); 
  $mail = new PHPMailer();

$ip=$_SERVER["REMOTE_ADDR"];

$body = "<b>IP :</b> $ip<br />";
$body .= "<b>Email :</b>".$_POST["email"]."<br />";
$body .= "<b>Web Adresi :</b>".$_POST["url"]."<br />";
$body .= "<b>Kategori :</b>".$_POST["cat"]."<br />";
$body .= "<b>Mesaj :</b>".$_POST["mesaj"]."<br />";
$body .= "<b>İstenilen Kategori :</b>".$_POST["selcat"]."<br />";
$mail->Host     = "smtp.gmail.com";
$mail->SMTPAuth = true;     
$mail->Port = 587;
$mail->Username = "gmail_email_adresi";  
$mail->Password = "gmail_sifre"; 
$mail->SMTPDebug  =0; 
$mail->IsSMTP();
$mail->IsHTML(true);
$mail->LE      = "\r\n";
$mail->CharSet = "UTF-8";
$mail->From    = "gmail_email_adresi";
$mail->FromName= "$ad";

  
  $mail->AddAddress("gonderilecek_email_adresi");
  $mail->Subject = "Web Bloklama İzin İsteği";
  $mail->Body    = $body;
  if($mail->Send()){
    echo("Bilgileriniz yetkili kişilere gönderilmiştir.");
  }else{
    echo("Problem var. Lütfen daha sonra deneyiniz.");
  }
?>

Gelen mesaj şu şekilde;

IP : 192.168.10.57
Email : [email protected]
Web Adresi : www.vtunnel.com/
Kategori : Proxy Avoidance
Mesaj : Deneme
İstenilen Kategori : Gambling

 

 

60,046 total views, 1 views today