Example #1
0
			</tr>
		</table>
	</div>
</form>
<!-- end of Asset form -->


<?php 
require_once 'classes/Scan.inc';
$scan = new Scan("");
if (GET('clearscan')) {
    Scan::del_scan($scan->nmap_completed_scan);
}
$lastscan = $scan->get_scan();
if (is_array($lastscan) && count($lastscan) > 0) {
    require_once 'scan_util.php';
    $_SESSION["_scan"] = $lastscan;
    scan2html($lastscan);
} else {
    echo "<!-- <p align=\"center\">";
    echo _("NOTE: This tool is a nmap frontend. In order to use all nmap functionality, you need root privileges.");
    echo "<br/>";
    echo _("For this purpose you can use suphp, or change group to the web-user and set suid to nmap binary (<strong>chgrp www-data /usr/bin/nmap ; chmod 4750 /usr/bin/nmap</strong>).");
    echo "</p> -->";
}
?>


	</body>
</html>
Example #2
0
* You may not use, modify or distribute this program under any other version
* of the GNU General Public License.
*
* This package 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 package; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
require_once 'scan_util.php';
Session::logcheck('environment-menu', 'ToolsScan');
$db = new ossim_db();
$conn = $db->connect();
$scan = new Scan();
$lastscan = $scan->get_results();
if (!empty($lastscan['scanned_ips'])) {
    scan2html($conn, $lastscan);
}
$db->close();
Example #3
0
     }
     $data['status'] = 'success';
     $data['data'] = $scan_status;
     break;
 case 'show_scan_report':
     if (file_exists($scan_report_file)) {
         require_once 'scan_util.php';
         $scan_report = file_get_contents($scan_report_file);
         $scan_report = unserialize($scan_report);
         $data['status'] = 'success';
         $data['data'] = NULL;
         if (!empty($scan_report['scanned_ips'])) {
             ob_start();
             //Database connection
             list($db, $conn) = Ossim_db::get_conn_db();
             scan2html($conn, $scan_report);
             $data['data'] = ob_get_contents();
             ob_end_clean();
         } else {
             @unlink($scan_report_file);
             $e_msg = _('Asset scan finished');
             Av_exception::throw_error(Av_exception::USER_ERROR, $e_msg);
         }
     }
     break;
 case 'download_scan_report':
     try {
         $av_scan = Av_scan::get_object_from_file($scan_file);
         $scan_report = $av_scan->download_scan_report();
         if (!empty($scan_report)) {
             $nmap_parser = new Nmap_parser();