25 lines
3.1 KiB
PHP
25 lines
3.1 KiB
PHP
<?php
|
|
include 'auth.php';
|
|
require_once __DIR__ . '/includes/config_manager.php';
|
|
$page_title='Phishing Search - BastionGuard WebUI'; $active_page='phishing.php';
|
|
$result=''; $classification='';
|
|
if($_SERVER['REQUEST_METHOD']==='POST'){
|
|
csrf_validate(); $a=$_POST['action']??'';
|
|
if($a==='analyze'){
|
|
$url=trim($_POST['url']??'');
|
|
$res=bg_phishing_remote_analyze($url);
|
|
$result=$res['output'] ?? '';
|
|
$classification=$res['classification'] ?? '';
|
|
} elseif($a==='update-blacklist'){
|
|
$res=bg_admin_helper(['update-phishing', bg_detect_desktop_user()], 900);
|
|
bg_flash(($res['code']??1)===0?'success':'warning',$res['output']?:'Phishing blacklist update completed.'); bg_redirect('phishing.php');
|
|
} elseif(in_array($a,['start','stop','restart'],true)){
|
|
$res=bg_service_action(['BastionGuard-phishing-scanner.service','BastionGuard-phishing.service','bastionguard-phishing.service'],$a);
|
|
bg_flash($res['code']===0?'success':'warning',$res['output']?:'Command executed.'); bg_redirect('phishing.php');
|
|
}
|
|
}
|
|
$st=bg_service_status(['BastionGuard-phishing-scanner.service','BastionGuard-phishing.service','bastionguard-phishing.service']);
|
|
include 'includes/header.php'; include 'includes/sidebar.php'; ?>
|
|
<div class="page-title"><div><h1>Phishing Scanner</h1><p>Uses the same logic as the source page: BastionGuard Security Intelligence query and HTML result parsing.</p></div><?= bg_status_badge($st['active']) ?></div>
|
|
<div class="row g-4"><div class="col-lg-5"><div class="card"><div class="card-body"><h5>Analyze URL</h5><p class="text-muted">Endpoint: <code>bastionguard.eu/bastionguard-security-intelligence/?q=...</code>, as in <code>src/phishing_search/PhishingPage.cpp</code>.</p><form method="post" class="input-group"><?php csrf_field(); ?><input type="hidden" name="action" value="analyze"><input class="form-control" name="url" placeholder="https://example.com"><button class="btn btn-primary">Analyze</button></form><hr><h6>Local anti-phishing service</h6><form method="post" class="d-flex gap-2 flex-wrap"><?php csrf_field(); ?><button class="btn btn-success" name="action" value="start">Start</button><button class="btn btn-outline-danger" name="action" value="stop">Stop</button><button class="btn btn-outline-primary" name="action" value="restart">Restart</button><button class="btn btn-outline-secondary" name="action" value="update-blacklist">Update blacklist</button></form></div></div></div><div class="col-lg-7"><div class="card"><div class="card-body"><h5>Analysis status</h5><?php if($classification): ?><p><span class="badge text-bg-primary"><?= bg_e($classification) ?></span></p><?php endif; ?><p class="text-muted mb-0">The operational whitelist/blacklist is managed by BastionGuard services and configuration files. This page replicates the desktop client “Phishing Search” function.</p></div></div></div><?php if($result): ?><div class="col-12"><div class="card"><div class="card-body"><h5>Analysis result</h5><?php bg_render_log($result); ?></div></div></div><?php endif; ?></div>
|
|
<?php include 'includes/footer.php'; ?>
|