Commit 007cb95f authored by Jason Frisvold's avatar Jason Frisvold
Browse files

- First reports page

- Initial raw details report
parent dc9521a2
......@@ -26,4 +26,57 @@
});
// Reports page
$app->get('/resultlist', $isauthenticated(), function () use ($app) {
global $smarty_data;
// Pull all data from the timers table
$result = $app->db->table('results')
->join('cloud', 'results.cloud_id', '=', 'cloud.id')
->join('target', 'results.target_id', '=', 'target.id')
->select('results.id', 'cloud.server_ip', 'target.address',
'target.cidr', 'results.xml_version', 'results.start_time',
'results.end_time', 'results.elapsed_time', 'results.exit_status',
'results.port_count', 'results.filename')
->orderBy('start_time', 'ASC')
->get();
foreach ($result as $position => $item) {
$result[$position]['start_time'] = strftime('%D %T', $item['start_time']);
$result[$position]['end_time'] = strftime('%D %T', $item['end_time']);
}
$smarty_data['results'] = $result;
prep_smarty($app);
$app->render('resultlist.tpl', $smarty_data);
});
$app->get('/resultlist/:id', $isauthenticated(), function ($id) use ($app) {
global $smarty_data;
// Pull all data from the timers table
$result = $app->db->table('results')
->join('cloud', 'results.cloud_id', '=', 'cloud.id')
->join('target', 'results.target_id', '=', 'target.id')
->select('results.id', 'cloud.server_ip', 'target.address',
'target.cidr', 'results.xml_version', 'results.start_time',
'results.end_time', 'results.elapsed_time', 'results.exit_status',
'results.port_count', 'results.filename')
->where('results.id', $id)
->first();
$result['start_time'] = strftime('%D %T', $result['start_time']);
$result['end_time'] = strftime('%D %T', $result['end_time']);
$smarty_data['result'] = $result;
prep_smarty($app);
$app->render('rawdetail.tpl', $smarty_data);
});
?>
\ No newline at end of file
......@@ -55,7 +55,7 @@
{/if}
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Reports <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="/report1">Report 1</a></li>
<li><a href="/resultlist">Raw Results List</a></li>
<li><a href="/report2">Report 2</a></li>
<li><a href="/report3">Report 3</a></li>
<li><a href="/report4">Report 4</a></li>
......
{--* Skynet - Automated "Cloud" Security Scanner *}
{--* Copyright (C) 2014-present Jason Frisvold <friz@godshell.com> *}
{--* *}
{--* This program is free software; you can redistribute it and/or modify *}
{--* it under the terms of the GNU General Public License as published by *}
{--* the Free Software Foundation; either version 2 of the License, or *}
{--* (at your option) any later version. *}
{--* *}
{--* This program is distributed in the hope that it will be useful, *}
{--* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
{--* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
{--* GNU General Public License for more details. *}
{--* *}
{--* You should have received a copy of the GNU General Public License *}
{--* along with this program; if not, write to the Free Software *}
{--* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA*}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='shortcut icon' type='image/x-icon' href='{$skynet_favicon}'>
{include file='head-css.tpl'}
<title>Skynet Automated Security Scanner</title>
</head>
<body>
{assign var=page value='report'}
{include file='header.tpl'}
<div class='container'>
<div class='page-header'>
<h1>Results for scan of {long2ip($result.address)}/{$result.cidr}</h1>
</div>
<p>{long2ip($result.server_ip)}</p>
<p>{$result.start_time}</p>
<p>{$result.end_time}</p>
<p>{printf('%.1f', $result.elapsed_time)}</p>
<p>{$result.xml_version}</p>
<p>{$result.exit_status}</p>
<p>{$result.port_count}</p>
<p>{$result.filename}</p>
{include file='footer.tpl'}
</body>
</html>
{--* Skynet - Automated "Cloud" Security Scanner *}
{--* Copyright (C) 2014-present Jason Frisvold <friz@godshell.com> *}
{--* *}
{--* This program is free software; you can redistribute it and/or modify *}
{--* it under the terms of the GNU General Public License as published by *}
{--* the Free Software Foundation; either version 2 of the License, or *}
{--* (at your option) any later version. *}
{--* *}
{--* This program is distributed in the hope that it will be useful, *}
{--* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
{--* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
{--* GNU General Public License for more details. *}
{--* *}
{--* You should have received a copy of the GNU General Public License *}
{--* along with this program; if not, write to the Free Software *}
{--* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA*}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='shortcut icon' type='image/x-icon' href='{$skynet_favicon}'>
{include file='head-css.tpl'}
<title>Skynet Automated Security Scanner</title>
</head>
<body>
{assign var=page value='report'}
{include file='header.tpl'}
<div class='container'>
<div class='page-header'>
<h1>Results</h1>
</div>
<div>
<table class='table table-striped'>
<tr>
<th>Server</th>
<th>Target</th>
<th>Start Time</th>
<th>End Time</th>
<th>Scan Time<br>(in seconds)</th>
<th>Exit Status</th>
<th>Port Count</th>
</tr>
{foreach from=$results item=row}
<tr>
<td><a href='/resultlist/{$row.id}'>{long2ip($row.server_ip)}</a></td>
<td>{long2ip($row.address)}/{$row.cidr}</td>
<td>{$row.start_time}</td>
<td>{$row.end_time}</td>
<td>{printf('%.1f', $row.elapsed_time)}</td>
<td>{$row.exit_status}</td>
<td>{$row.port_count}</td>
</tr>
{/foreach}
</table>
</div>
</div>
{include file='footer.tpl'}
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment