Compare commits
168 Commits
v1
..
d0de27c4a2
| Author | SHA1 | Date | |
|---|---|---|---|
| d0de27c4a2 | |||
| 6d4c579198 | |||
| 02687a7b2c | |||
| ad63f0691b | |||
| 13f42cad36 | |||
| eeba9d613b | |||
| dba34f39eb | |||
| 0e24595170 | |||
| efed32d11d | |||
| ae0abc39cf | |||
| a981059c73 | |||
| c2d2a2455d | |||
| dd16294e8d | |||
| 6f0cc6e9bd | |||
| b4016685a0 | |||
| f39c328d06 | |||
| cbbf09677e | |||
| 2b1fd671da | |||
| b445d08ce1 | |||
| e2c1c6604e | |||
| a593148c38 | |||
| d45b05941f | |||
| e423273752 | |||
| 0c72ceb620 | |||
| dc8fa57c0f | |||
| 53679e2098 | |||
| 8cd0ba066f | |||
| 602c1fc7f3 | |||
| 06eb33187b | |||
| 43d2df7850 | |||
| 9d7f526080 | |||
| 80dc329353 | |||
| 81652e25c9 | |||
| 4e14da1860 | |||
| 8e5f010da0 | |||
| df4648e12a | |||
| 154d731e55 | |||
| 2ef0421078 | |||
| f2acc56ef7 | |||
| 1d5bb5446d | |||
| 7790369ac1 | |||
| bfb7788df0 | |||
| c174b3a142 | |||
| 1a0bb6abf5 | |||
| c01cfb631b | |||
| f1bb88abec | |||
| f2af893303 | |||
| 8865da906d | |||
| f05edd0fc7 | |||
| 2eda5ca9c9 | |||
| 68a98fb5a5 | |||
| 7bddbd3e10 | |||
| 0b59c94f52 | |||
| bd8e988444 | |||
| cadcd37408 | |||
| d8bc7d99fb | |||
| 458c04afa1 | |||
| f001e1b61d | |||
| db6643b8bb | |||
| a7c67292ed | |||
| dfd89a5add | |||
| c6b8005958 | |||
| 705904fbfa | |||
| af6dc0a76b | |||
| 321935e7a8 | |||
| baef7123b8 | |||
| f14062fda5 | |||
| b55df2e880 | |||
| 5882baf8ae | |||
| dba9e2e9b7 | |||
| 4928b346b3 | |||
| 0c736158aa | |||
| 17a628cc11 | |||
| b6900bc76a | |||
| c3ed9f9fc2 | |||
| a773e8b8d9 | |||
| 54116d27d0 | |||
| 887e024f27 | |||
| 9f06bd0b66 | |||
| 63dbcb407f | |||
| e7b462c033 | |||
| d39798ea4e | |||
| 88280ac41d | |||
| 8c4dda99b5 | |||
| 22de01a01b | |||
| 1832864505 | |||
| 59d0695d1b | |||
| 4b3634dc67 | |||
| b3b9db4aa7 | |||
| 3b90e7f6cc | |||
| 290932a421 | |||
| 9683dd2283 | |||
| df5c7e8497 | |||
| 5e0985e7d6 | |||
| ff18e2352c | |||
| 7aeb817c4c | |||
| 7c4d32c83f | |||
| 4ccd659d63 | |||
| c2b40b5c71 | |||
| 6fc85431af | |||
| 18775fb8b1 | |||
| 9f2826d522 | |||
| 653bb604f5 | |||
| 6c33080785 | |||
| a1aeefee47 | |||
| 5e76b92b96 | |||
| ec917b4602 | |||
| 260c8f073a | |||
| 570e8f2252 | |||
| cd6f64679b | |||
| 6422830783 | |||
| 7ef62104f0 | |||
| 386d0fc65d | |||
| 9a525b6ffe | |||
| 6a3589b988 | |||
| 2c771c0766 | |||
| 1befb0017c | |||
| 95d509e1b1 | |||
| f8f1183fe7 | |||
| 9cb008785c | |||
| 2337fe1e60 | |||
| 1f2ab88641 | |||
| 641f214899 | |||
| 89a7613f9e | |||
| fdf15e5a7d | |||
| 47c0bbdb4c | |||
| db216baf46 | |||
| cf5dcf24a7 | |||
| 2f7eebdaf1 | |||
| ad79495608 | |||
| 76e1832c28 | |||
| f7629028f6 | |||
| f5a0cffc05 | |||
| bcf6ddff0d | |||
| df6f5154e2 | |||
| efff220fe3 | |||
| cb0a4d94a5 | |||
| 48113dc7cc | |||
| b197af448a | |||
| 97a4c5801b | |||
| 8a9b822cf6 | |||
| f413212db9 | |||
| 01f8ee3ea0 | |||
| 664bee1249 | |||
| bcb63b3d0f | |||
| 3c9978569b | |||
| eae12a8e4e | |||
| ce4f8dda1a | |||
| b3cffaed35 | |||
| a6ba7c4b23 | |||
| 865a8efb62 | |||
| 3a594acb48 | |||
| b4f75a5984 | |||
| 4e9dd60477 | |||
| 20e6b22d0d | |||
| 3dd9e39f5c | |||
| 7062b94aaa | |||
| d5dd51921c | |||
| b02c89973c | |||
| 0d56163339 | |||
| 6319d411c5 | |||
| 6dd728ce0d | |||
| 1d8457d020 | |||
| 85fab8e41b | |||
| bef547fae0 | |||
| 42e16d3ef8 | |||
| f44e1d8267 | |||
| 34a4058ba4 |
+3
-27
@@ -1,27 +1,3 @@
|
|||||||
# ---> CakePHP
|
scans/
|
||||||
# CakePHP 3
|
script-args.ini
|
||||||
|
test.php
|
||||||
/vendor/*
|
|
||||||
/config/app.php
|
|
||||||
|
|
||||||
/tmp/cache/models/*
|
|
||||||
!/tmp/cache/models/empty
|
|
||||||
/tmp/cache/persistent/*
|
|
||||||
!/tmp/cache/persistent/empty
|
|
||||||
/tmp/cache/views/*
|
|
||||||
!/tmp/cache/views/empty
|
|
||||||
/tmp/sessions/*
|
|
||||||
!/tmp/sessions/empty
|
|
||||||
/tmp/tests/*
|
|
||||||
!/tmp/tests/empty
|
|
||||||
|
|
||||||
/logs/*
|
|
||||||
!/logs/empty
|
|
||||||
|
|
||||||
# CakePHP 2
|
|
||||||
|
|
||||||
/app/tmp/*
|
|
||||||
/app/Config/core.php
|
|
||||||
/app/Config/database.php
|
|
||||||
/vendors/*
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
|
||||||
Version 2, December 2004
|
|
||||||
|
|
||||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
|
|
||||||
|
|
||||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
|
||||||
@@ -1,3 +1,19 @@
|
|||||||
# LanScan
|
# nmap-webui
|
||||||
|
A simple web interface for Nmap for network discovery and monitoring
|
||||||
|
|
||||||
Web UI for nmap
|
## Dependencies
|
||||||
|
|
||||||
|
As most of the `nmap` features requires to be `root`, you will have to run this command to avoid the need to specify the password when the interface will invocate `nmap`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Authorize nmap to run as root without password
|
||||||
|
echo "$USER ALL = NOPASSWD: $(which nmap)" | sudo tee -a /etc/sudoers.d/nmap
|
||||||
|
```
|
||||||
|
|
||||||
|
Allow web server to save scans:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir scans
|
||||||
|
chown www-data scans
|
||||||
|
chmod 750 scans
|
||||||
|
```
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
$port = (($_SERVER['REQUEST_SCHEME'] == "http" && $_SERVER['SERVER_PORT'] == 80) || ($_SERVER['REQUEST_SCHEME'] == "https" && $_SERVER['SERVER_PORT'] == 443)) ? "" : ":{$_SERVER['SERVER_PORT']}";
|
||||||
|
$BASEDIR = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}$port" . dirname($_SERVER['SCRIPT_NAME']);
|
||||||
|
$SCANSDIR = "scans";
|
||||||
|
$STYLESHEETSDIR = "stylesheets";
|
||||||
|
|
||||||
|
$lanScanCmd = "sudo nmap -PSmicrosoft-ds -F -T5 --datadir . --script http-info,smb-shares-size --script-args-file script-args.ini -oX - --stylesheet $BASEDIR/$STYLESHEETSDIR/lanScan.xsl";
|
||||||
|
$hostScanCmd = "sudo nmap -A -T5 --datadir . --script http-info,smb-shares-size --script-args-file script-args.ini -oX - --stylesheet $BASEDIR/$STYLESHEETSDIR/hostScan.xsl";
|
||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 9.3 KiB |
@@ -0,0 +1,104 @@
|
|||||||
|
<?php include_once "config.php"; ?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>lanScan</title>
|
||||||
|
<link rel="icon" href="favicon.ico" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.3/dist/semantic.min.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background-image: url(bg.jpg);
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
body > .grid {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
margin-right: 0 !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="ui middle aligned center aligned grid inverted">
|
||||||
|
<div class="column" style="max-width: 450px;">
|
||||||
|
<h2 class="ui inverted teal fluid image header logo">
|
||||||
|
lan<?php include 'logo.svg'; ?>can
|
||||||
|
</h2>
|
||||||
|
<form id="scanForm" class="ui large form initial inverted" action="scan.php" method="get">
|
||||||
|
<div class="ui left aligned stacked segment inverted">
|
||||||
|
<h4 class="ui header">Découvrir ou superviser un réseau</h4>
|
||||||
|
<div class="inverted field">
|
||||||
|
<select id="lanSelect" name="lan" class="search clearable selection dropdown">
|
||||||
|
<option value=""><?= $_SERVER['REMOTE_ADDR']; ?>/24</option>
|
||||||
|
<?php
|
||||||
|
if (file_exists($SCANSDIR)) {
|
||||||
|
foreach (scandir($SCANSDIR) as $filename) {
|
||||||
|
if (substr($filename, -4) === '.xml') {
|
||||||
|
$name = substr($filename, 0, -4);
|
||||||
|
$name = str_replace("!", "/", $name);
|
||||||
|
echo " <option value='$name'>$name</option>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="ui error message"></div>
|
||||||
|
<button type="submit" class="ui fluid large teal labeled icon submit button">
|
||||||
|
<i class="satellite dish icon"></i>Scanner
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<a href="options.php">Options avancées</a>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/semantic-ui/dist/semantic.min.js"></script>
|
||||||
|
<script>
|
||||||
|
$('#lanSelect').dropdown({allowAdditions: true, clearable: true})
|
||||||
|
|
||||||
|
$('#scanForm').form({
|
||||||
|
fields: {
|
||||||
|
lan: {
|
||||||
|
identifier: 'lanSelect',
|
||||||
|
rules: [{
|
||||||
|
type: 'regExp',
|
||||||
|
value: /[a-zA-Z0-9._\/ \-]+/,
|
||||||
|
prompt: "Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc.<br/>Exemples : <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.0-255.0-255.1-254"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
scanForm.onsubmit = function(event) {
|
||||||
|
if (this.checkValidity()) {
|
||||||
|
scanForm.classList.add("loading")
|
||||||
|
$.toast({
|
||||||
|
title : 'Scan en cours...',
|
||||||
|
message : 'Merci de patienter',
|
||||||
|
class : 'info',
|
||||||
|
showIcon : 'satellite dish',
|
||||||
|
displayTime: 0,
|
||||||
|
closeIcon : true,
|
||||||
|
position : 'bottom right',
|
||||||
|
})
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
event.preventDefault()
|
||||||
|
this.reportValidity()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
<svg class="image logo" version="1.1" id="Layer_1" x="0px" y="0px"
|
||||||
|
viewBox="0 0 24 24" xml:space="preserve" width="40" height="40" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<defs id="defs206" />
|
||||||
|
<g id="g998" transform="matrix(0,0.04687491,-0.04687491,0,24,2.2682373e-5)">
|
||||||
|
<g id="g147">
|
||||||
|
<g id="g145">
|
||||||
|
<path
|
||||||
|
d="m 322.065,92.046 c -46.24,0 -83.851,37.619 -83.851,83.857 v 168.712 c 0,25.224 -21.148,45.745 -46.372,45.745 -25.224,0 -46.372,-20.521 -46.372,-45.745 V 199.464 h -38.114 v 145.151 c 0,46.24 38.246,83.859 84.486,83.859 46.24,0 84.486,-37.619 84.486,-83.859 V 175.903 c 0,-25.223 20.514,-45.743 45.737,-45.743 25.223,0 45.737,20.521 45.737,45.743 v 134.092 h 38.114 V 175.903 c 0,-46.239 -37.611,-83.857 -83.851,-83.857 z"
|
||||||
|
id="path143" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g id="g153">
|
||||||
|
<g id="g151">
|
||||||
|
<path
|
||||||
|
d="M 144.198,0 H 108.625 C 98.101,0 89.568,8.746 89.568,19.271 c 0,1.157 0.121,2.328 0.318,3.598 h 73.052 c 0.197,-1.27 0.318,-2.441 0.318,-3.598 C 163.256,8.746 154.723,0 144.198,0 Z"
|
||||||
|
id="path149" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g id="g159">
|
||||||
|
<g id="g157">
|
||||||
|
<path
|
||||||
|
d="m 420.183,486.591 h -71.731 c -0.626,2.541 -0.978,4.077 -0.978,6.176 0,10.525 8.532,19.234 19.057,19.234 h 35.573 c 10.525,0 19.057,-8.709 19.057,-19.234 0,-2.098 -0.352,-3.635 -0.978,-6.176 z"
|
||||||
|
id="path155" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g id="g165">
|
||||||
|
<g id="g163">
|
||||||
|
<rect x="87.027" y="41.925999" width="80.040001" height="138.481" id="rect161" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g id="g171">
|
||||||
|
<g id="g169">
|
||||||
|
<rect x="344.93301" y="329.052" width="80.040001" height="138.481" id="rect167" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g id="g173"></g>
|
||||||
|
<g id="g175"></g>
|
||||||
|
<g id="g177"></g>
|
||||||
|
<g id="g179"></g>
|
||||||
|
<g id="g181"></g>
|
||||||
|
<g id="g183"></g>
|
||||||
|
<g id="g185"></g>
|
||||||
|
<g id="g187"></g>
|
||||||
|
<g id="g189"></g>
|
||||||
|
<g id="g191"></g>
|
||||||
|
<g id="g193"></g>
|
||||||
|
<g id="g195"></g>
|
||||||
|
<g id="g197"></g>
|
||||||
|
<g id="g199"></g>
|
||||||
|
<g id="g201"></g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$host = filter_input(INPUT_GET, 'v', FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) ?: filter_input(INPUT_GET, 'v', FILTER_VALIDATE_IP);
|
||||||
|
if (!$host) {
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$port = filter_input(INPUT_GET, 'p', FILTER_VALIDATE_INT);
|
||||||
|
if ($port) {
|
||||||
|
$host = "$host:$port";
|
||||||
|
}
|
||||||
|
|
||||||
|
header("Content-Disposition: attachment; filename=$host.rdp");
|
||||||
|
header('Content-Type: application/rdp');
|
||||||
|
echo "full address:s:$host\n";
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
include_once 'config.php';
|
||||||
|
|
||||||
|
$lan = filter_input(INPUT_GET, 'lan', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^[\da-zA-Z-. \/]+$/'], "flags" => FILTER_NULL_ON_FAILURE]);
|
||||||
|
if ($lan) {
|
||||||
|
$cmd = "$lanScanCmd $lan";
|
||||||
|
|
||||||
|
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
|
||||||
|
$filename = str_replace("/", "!", $lan);
|
||||||
|
$path = "$SCANSDIR/$filename.xml";
|
||||||
|
|
||||||
|
if (!file_exists($path)) $cmd .= " | tee '$path'";
|
||||||
|
|
||||||
|
header('Content-type: text/xml');
|
||||||
|
system("$cmd", $retcode);
|
||||||
|
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$host = filter_input(INPUT_GET, 'host', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^[\da-zA-Z-. \/]+$/'], "flags" => FILTER_NULL_ON_FAILURE]);
|
||||||
|
if ($host) {
|
||||||
|
$cmd = "$hostScanCmd $host";
|
||||||
|
|
||||||
|
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
|
||||||
|
$filename = str_replace("/", "!", $host);
|
||||||
|
$path = "$SCANSDIR/$filename.xml";
|
||||||
|
|
||||||
|
if (!file_exists($path)) $cmd .= " | tee '$path'";
|
||||||
|
|
||||||
|
header('Content-type: text/xml');
|
||||||
|
system("$cmd", $retcode);
|
||||||
|
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
include "index.php";
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE nmaprun>
|
||||||
|
<?xml-stylesheet href="https://adrien.malingrey.fr/dev/lanScan4/stylesheets/lanScan.xsl" type="text/xsl"?>
|
||||||
|
<!-- Nmap 7.93 scan initiated Tue Feb 4 03:30:34 2025 as: nmap -PSmicrosoft-ds -F -T5 -oX - --stylesheet https://adrien.malingrey.fr/dev/lanScan4/stylesheets/lanScan.xsl scanme.nmap.org -->
|
||||||
|
<nmaprun scanner="nmap" args="nmap -PSmicrosoft-ds -F -T5 -oX - --stylesheet https://adrien.malingrey.fr/dev/lanScan4/stylesheets/lanScan.xsl scanme.nmap.org" start="1738636234" startstr="Tue Feb 4 03:30:34 2025" version="7.93" xmloutputversion="1.05">
|
||||||
|
<scaninfo type="syn" protocol="tcp" numservices="100" services="7,9,13,21-23,25-26,37,53,79-81,88,106,110-111,113,119,135,139,143-144,179,199,389,427,443-445,465,513-515,543-544,548,554,587,631,646,873,990,993,995,1025-1029,1110,1433,1720,1723,1755,1900,2000-2001,2049,2121,2717,3000,3128,3306,3389,3986,4899,5000,5009,5051,5060,5101,5190,5357,5432,5631,5666,5800,5900,6000-6001,6646,7070,8000,8008-8009,8080-8081,8443,8888,9100,9999-10000,32768,49152-49157"/>
|
||||||
|
<verbose level="0"/>
|
||||||
|
<debugging level="0"/>
|
||||||
|
<hosthint><status state="up" reason="unknown-response" reason_ttl="0"/>
|
||||||
|
<address addr="45.33.32.156" addrtype="ipv4"/>
|
||||||
|
<hostnames>
|
||||||
|
<hostname name="scanme.nmap.org" type="user"/>
|
||||||
|
</hostnames>
|
||||||
|
</hosthint>
|
||||||
|
<host starttime="1738636234" endtime="1738636234"><status state="up" reason="reset" reason_ttl="48"/>
|
||||||
|
<address addr="45.33.32.156" addrtype="ipv4"/>
|
||||||
|
<hostnames>
|
||||||
|
<hostname name="scanme.nmap.org" type="user"/>
|
||||||
|
<hostname name="scanme.nmap.org" type="PTR"/>
|
||||||
|
</hostnames>
|
||||||
|
<ports><extraports state="closed" count="98">
|
||||||
|
<extrareasons reason="reset" count="98" proto="tcp" ports="7,9,13,21,23,25-26,37,53,79,81,88,106,110-111,113,119,135,139,143-144,179,199,389,427,443-445,465,513-515,543-544,548,554,587,631,646,873,990,993,995,1025-1029,1110,1433,1720,1723,1755,1900,2000-2001,2049,2121,2717,3000,3128,3306,3389,3986,4899,5000,5009,5051,5060,5101,5190,5357,5432,5631,5666,5800,5900,6000-6001,6646,7070,8000,8008-8009,8080-8081,8443,8888,9100,9999-10000,32768,49152-49157"/>
|
||||||
|
</extraports>
|
||||||
|
<port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="48"/><service name="ssh" method="table" conf="3"/></port>
|
||||||
|
<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="48"/><service name="http" method="table" conf="3"/></port>
|
||||||
|
</ports>
|
||||||
|
<times srtt="153298" rttvar="2254" to="162314"/>
|
||||||
|
</host>
|
||||||
|
<runstats><finished time="1738636234" timestr="Tue Feb 4 03:30:34 2025" summary="Nmap done at Tue Feb 4 03:30:34 2025; 1 IP address (1 host up) scanned in 1.05 seconds" elapsed="1.05" exit="success"/><hosts up="1" down="0" total="1"/>
|
||||||
|
</runstats>
|
||||||
|
</nmaprun>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
smbdomain = AUTH
|
||||||
|
smbuser = application.drieat
|
||||||
|
smbpassword = d+iFiWn4!cAzdr3KopiM>EA
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
# nmap-scripts
|
||||||
|
|
||||||
|
## http-info.nse
|
||||||
|
|
||||||
|
Return status, title and favicon URL of a webpage
|
||||||
|
|
||||||
|
```lua
|
||||||
|
@args http-get.path Path to get. Default /.
|
||||||
|
@usage nmap -phttp,https --script http-info.nse --script-args http-info.path=/ <host>
|
||||||
|
@output
|
||||||
|
80/tcp open http
|
||||||
|
| http-info:
|
||||||
|
| status-line: HTTP/1.1 200 OK\x0D
|
||||||
|
|
|
||||||
|
| title: Go ahead and ScanMe!
|
||||||
|
| favicon: http://scanme.nmap.org:80/shared/images/tiny-eyeicon.png
|
||||||
|
|_ status: 200
|
||||||
|
```
|
||||||
|
|
||||||
|
## smb-shares-size.nse
|
||||||
|
|
||||||
|
Return free and total size in octets of each SMB shares
|
||||||
|
|
||||||
|
```lua
|
||||||
|
@args See the documentation for the smbauth library.
|
||||||
|
@usage nmap -p137-139,445 --script smb-shares-size.nse --script-args-file smb-shares-size.ini <host>
|
||||||
|
@output
|
||||||
|
Host script results:
|
||||||
|
| smb-shares-size:
|
||||||
|
| data:
|
||||||
|
| FreeSize: 38495883264
|
||||||
|
| TotalSize: 500961574912
|
||||||
|
|_ IPC$: NT_STATUS_ACCESS_DENIED
|
||||||
|
```
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
local shortport = require "shortport"
|
||||||
|
|
||||||
|
description = [[
|
||||||
|
Return status, title and favicon URL of a webpage
|
||||||
|
]]
|
||||||
|
|
||||||
|
---
|
||||||
|
-- @args http-get.path Path to get. Default /.
|
||||||
|
--
|
||||||
|
-- @usage nmap -phttp,https --script http-info.nse --script-args http-info.path=/ <host>
|
||||||
|
--
|
||||||
|
-- @output
|
||||||
|
-- 80/tcp open http
|
||||||
|
-- | http-info:
|
||||||
|
-- | status-line: HTTP/1.1 200 OK\x0D
|
||||||
|
-- |
|
||||||
|
-- | title: Go ahead and ScanMe!
|
||||||
|
-- | favicon: http://scanme.nmap.org:80/shared/images/tiny-eyeicon.png
|
||||||
|
-- |_ status: 200
|
||||||
|
---
|
||||||
|
|
||||||
|
categories = {"discovery", "intrusive"}
|
||||||
|
author = "Adrien Malingrey"
|
||||||
|
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
|
||||||
|
|
||||||
|
portrule = shortport.http
|
||||||
|
|
||||||
|
local http = require "http"
|
||||||
|
local stdnse = require "stdnse"
|
||||||
|
|
||||||
|
action = function(host, port)
|
||||||
|
local scheme = ""
|
||||||
|
local hostaddress = (host.name ~= '' and host.name) or host.ip
|
||||||
|
local path = "/"
|
||||||
|
local favicon_relative_uri = "/favicon.ico"
|
||||||
|
local favicon
|
||||||
|
|
||||||
|
stdnse.debug1("port", port.service)
|
||||||
|
if (port.service == "ssl") then
|
||||||
|
scheme = "https"
|
||||||
|
else
|
||||||
|
scheme = port.service
|
||||||
|
end
|
||||||
|
stdnse.debug1("scheme", scheme)
|
||||||
|
|
||||||
|
if(stdnse.get_script_args('http-get.path')) then
|
||||||
|
path = stdnse.get_script_args('http-info.path')
|
||||||
|
end
|
||||||
|
|
||||||
|
stdnse.debug1("Try to download %s", path)
|
||||||
|
local answer = http.get(hostaddress, port, path)
|
||||||
|
|
||||||
|
local output = {status=answer.status, ["status-line"]=answer["status-line"]}
|
||||||
|
|
||||||
|
if (answer and answer.status == 200) then
|
||||||
|
stdnse.debug1("[SUCCESS] Load page %s", path)
|
||||||
|
-- Taken from http-title.nse by Diman Todorov
|
||||||
|
local title = string.match(answer.body, "<[Tt][Ii][Tt][Ll][Ee][^>]*>([^<]*)</[Tt][Ii][Tt][Ll][Ee]>")
|
||||||
|
if (title) then
|
||||||
|
output.title = title
|
||||||
|
end
|
||||||
|
stdnse.debug1("[INFO] Try favicon %s", favicon_relative_uri)
|
||||||
|
favicon_relative_uri = parseIcon(answer.body) or favicon_relative_uri
|
||||||
|
else
|
||||||
|
stdnse.debug1("[ERROR] Can't load page %s", path)
|
||||||
|
end
|
||||||
|
|
||||||
|
favicon = http.get(hostaddress, port, favicon_relative_uri)
|
||||||
|
|
||||||
|
if (favicon and favicon.status == 200) then
|
||||||
|
stdnse.debug1("[SUCCESS] Load favicon %s", favicon_relative_uri)
|
||||||
|
output.favicon = favicon_relative_uri
|
||||||
|
else
|
||||||
|
stdnse.debug1("[ERROR] Can't load favicon %s", favicon_relative_uri)
|
||||||
|
end
|
||||||
|
|
||||||
|
return output
|
||||||
|
end
|
||||||
|
|
||||||
|
--- function taken from http_favicon.nse by Vlatko Kosturjak
|
||||||
|
|
||||||
|
function parseIcon( body )
|
||||||
|
local _, i, j
|
||||||
|
local rel, href, word
|
||||||
|
|
||||||
|
-- Loop through link elements.
|
||||||
|
i = 0
|
||||||
|
while i do
|
||||||
|
_, i = string.find(body, "<%s*[Ll][Ii][Nn][Kk]%s", i + 1)
|
||||||
|
if not i then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
-- Loop through attributes.
|
||||||
|
j = i
|
||||||
|
while true do
|
||||||
|
local name, quote, value
|
||||||
|
_, j, name, quote, value = string.find(body, "^%s*(%w+)%s*=%s*([\"'])(.-)%2", j + 1)
|
||||||
|
if not j then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
if string.lower(name) == "rel" then
|
||||||
|
rel = value
|
||||||
|
elseif string.lower(name) == "href" then
|
||||||
|
href = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for word in string.gmatch(rel or "", "%S+") do
|
||||||
|
if string.lower(word) == "icon" then
|
||||||
|
return href
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,206 @@
|
|||||||
|
local shortport = require "shortport"
|
||||||
|
|
||||||
|
description = [[
|
||||||
|
Return free and total size in octets of each SMB shares
|
||||||
|
]]
|
||||||
|
|
||||||
|
---
|
||||||
|
-- @args See the documentation for the smbauth library.
|
||||||
|
--
|
||||||
|
-- @usage nmap -p137-139,445 --script smb-shares-size.nse --script-args-file smb-authentication.ini <host>
|
||||||
|
--
|
||||||
|
-- @output
|
||||||
|
-- Host script results:
|
||||||
|
-- | smb-shares-size:
|
||||||
|
-- | data:
|
||||||
|
-- | FreeSize: 38495883264
|
||||||
|
-- | TotalSize: 500961574912
|
||||||
|
-- |_ IPC$: NT_STATUS_ACCESS_DENIED
|
||||||
|
---
|
||||||
|
|
||||||
|
categories = {"discovery", "intrusive"}
|
||||||
|
author = "Adrien Malingrey"
|
||||||
|
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
|
||||||
|
|
||||||
|
portrule = shortport.service({"microsoft-ds", "netbios-ssn", "smb"})
|
||||||
|
|
||||||
|
local stdnse = require "stdnse"
|
||||||
|
local smb = require "smb"
|
||||||
|
local smb2 = require "smb2"
|
||||||
|
local msrpc = require "msrpc"
|
||||||
|
local bin = require "bin"
|
||||||
|
|
||||||
|
action = function(host)
|
||||||
|
local status, shares, extra
|
||||||
|
local response = stdnse.output_table()
|
||||||
|
|
||||||
|
-- Try and do this the good way, make a MSRPC call to get the shares
|
||||||
|
stdnse.debug1("SMB: Attempting to log into the system to enumerate shares")
|
||||||
|
status, shares = msrpc.enum_shares(host)
|
||||||
|
if(status == false) then
|
||||||
|
return stdnse.format_output(false, string.format("Couldn't enumerate shares: %s", shares))
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Get more information on each share
|
||||||
|
for i = 1, #shares, 1 do
|
||||||
|
local share = shares[i]
|
||||||
|
if (share ~= nil) then
|
||||||
|
local status, result = get_share_info(host, share)
|
||||||
|
if (status) then
|
||||||
|
response[share] = result
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return response
|
||||||
|
end
|
||||||
|
|
||||||
|
TRANS2_QUERY_FS_INFORMATION = 0x0003
|
||||||
|
SMB_QUERY_FS_SIZE_INFO = 0x0103
|
||||||
|
---Attempts to retrieve additional information about a share. Will fail unless we have
|
||||||
|
-- administrative access.
|
||||||
|
--
|
||||||
|
--@param host The host object.
|
||||||
|
--@return Status (true or false).
|
||||||
|
--@return A table of information about the share (if status is true) or an an error string (if
|
||||||
|
-- status is false).
|
||||||
|
function get_share_info(host, share)
|
||||||
|
local status, smbstate, err
|
||||||
|
local hostaddress = (host.name ~= '' and host.name) or host.ip
|
||||||
|
local path = "\\\\" .. hostaddress .. "\\" .. share
|
||||||
|
|
||||||
|
status, smbstate = smb.start(host)
|
||||||
|
status, err = smb.negotiate_protocol(smbstate, {})
|
||||||
|
status, err = smb.start_session(smbstate, {})
|
||||||
|
status, err = smb.tree_connect(smbstate, path, {})
|
||||||
|
|
||||||
|
stdnse.debug1("SMB: Getting information for share: %s", path)
|
||||||
|
|
||||||
|
local status, err = send_transaction2(smbstate, TRANS2_QUERY_FS_INFORMATION, bin.pack("<S", SMB_QUERY_FS_SIZE_INFO))
|
||||||
|
if ( not(status) ) then
|
||||||
|
status, err = smb.stop(smbstate)
|
||||||
|
return false, "Failed to send data to server: send_transaction2"
|
||||||
|
end
|
||||||
|
|
||||||
|
local status, response = receive_transaction2(smbstate)
|
||||||
|
if ( not(status) ) then
|
||||||
|
status, err = smb.stop(smbstate)
|
||||||
|
return false, response
|
||||||
|
end
|
||||||
|
|
||||||
|
local pos, totalAllocationUnits, totalFreeAllocationUnits, sectorsPerAllocationUnit, bytesPerSector = bin.unpack("<LLII", response.data)
|
||||||
|
|
||||||
|
status, err = smb.stop(smbstate)
|
||||||
|
|
||||||
|
return true, {
|
||||||
|
TotalSize = totalAllocationUnits * sectorsPerAllocationUnit * bytesPerSector,
|
||||||
|
FreeSize = totalFreeAllocationUnits * sectorsPerAllocationUnit * bytesPerSector
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Taken from smb lib
|
||||||
|
|
||||||
|
function send_transaction2(smbstate, sub_command, function_parameters, function_data, overrides)
|
||||||
|
overrides = overrides or {}
|
||||||
|
local header1, header2, header3, header4, command, status, flags, flags2, pid_high, signature, unused, pid, mid
|
||||||
|
local header, parameters, data
|
||||||
|
local parameter_offset = 0
|
||||||
|
local parameter_size = 0
|
||||||
|
local data_offset = 0
|
||||||
|
local data_size = 0
|
||||||
|
local total_word_count, total_data_count, reserved1, parameter_count, parameter_displacement, data_count, data_displacement, setup_count, reserved2
|
||||||
|
local response = {}
|
||||||
|
|
||||||
|
-- Header is 0x20 bytes long (not counting NetBIOS header).
|
||||||
|
header = smb.smb_encode_header(smbstate, smb.command_codes['SMB_COM_TRANSACTION2'], overrides) -- 0x32 = SMB_COM_TRANSACTION2
|
||||||
|
|
||||||
|
if(function_parameters) then
|
||||||
|
parameter_offset = 0x44
|
||||||
|
parameter_size = #function_parameters
|
||||||
|
data_offset = #function_parameters + 33 + 32
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Parameters are 0x20 bytes long.
|
||||||
|
parameters = bin.pack("<SSSSCCSISSSSSCCS",
|
||||||
|
parameter_size, -- Total parameter count.
|
||||||
|
data_size, -- Total data count.
|
||||||
|
0x000a, -- Max parameter count.
|
||||||
|
0x3984, -- Max data count.
|
||||||
|
0x00, -- Max setup count.
|
||||||
|
0x00, -- Reserved.
|
||||||
|
0x0000, -- Flags (0x0000 = 2-way transaction, don't disconnect TIDs).
|
||||||
|
0x00001388, -- Timeout (0x00000000 = return immediately).
|
||||||
|
0x0000, -- Reserved.
|
||||||
|
parameter_size, -- Parameter bytes.
|
||||||
|
parameter_offset, -- Parameter offset.
|
||||||
|
data_size, -- Data bytes.
|
||||||
|
data_offset, -- Data offset.
|
||||||
|
0x01, -- Setup Count
|
||||||
|
0x00, -- Reserved
|
||||||
|
sub_command -- Sub command
|
||||||
|
)
|
||||||
|
|
||||||
|
local data = "\0\0\0" .. (function_parameters or '')
|
||||||
|
.. (function_data or '')
|
||||||
|
|
||||||
|
-- Send the transaction request
|
||||||
|
stdnse.debug2("SMB: Sending SMB_COM_TRANSACTION2")
|
||||||
|
local result, err = smb.smb_send(smbstate, header, parameters, data, overrides)
|
||||||
|
if(result == false) then
|
||||||
|
stdnse.debug1("SMB: Try SMBv2 connexion")
|
||||||
|
local result, err = smb2.smb2_send(smbstate, header, parameters, data, overrides)
|
||||||
|
if(result == false) then
|
||||||
|
return false, err
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
function receive_transaction2(smbstate)
|
||||||
|
|
||||||
|
-- Read the result
|
||||||
|
local status, header, parameters, data = smb.smb_read(smbstate)
|
||||||
|
if(status ~= true) then
|
||||||
|
stdnse.debug1("SMB: Try SMBv2 connexion")
|
||||||
|
local status, header, parameters, data = smb2.smb2_read(smbstate)
|
||||||
|
if(status ~= true) then
|
||||||
|
return false, header
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Check if it worked
|
||||||
|
local pos, header1, header2, header3, header4, command, status, flags, flags2, pid_high, signature, unused, tid, pid, uid, mid = bin.unpack("<CCCCCICSSlSSSSS", header)
|
||||||
|
if(header1 == nil or mid == nil) then
|
||||||
|
return false, "SMB: ERROR: Server returned less data than it was supposed to (one or more fields are missing); aborting [29]"
|
||||||
|
end
|
||||||
|
if(status ~= 0) then
|
||||||
|
if(smb.status_names[status] == nil) then
|
||||||
|
return false, string.format("Unknown SMB error: 0x%08x\n", status)
|
||||||
|
else
|
||||||
|
return false, smb.status_names[status]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Parse the parameters
|
||||||
|
local pos, total_word_count, total_data_count, reserved1, parameter_count, parameter_offset, parameter_displacement, data_count, data_offset, data_displacement, setup_count, reserved2 = bin.unpack("<SSSSSSSSSCC", parameters)
|
||||||
|
if(total_word_count == nil or reserved2 == nil) then
|
||||||
|
return false, "SMB: ERROR: Server returned less data than it was supposed to (one or more fields are missing); aborting [30]"
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Convert the parameter/data offsets into something more useful (the offset into the data section)
|
||||||
|
-- - 0x20 for the header, - 0x01 for the length.
|
||||||
|
parameter_offset = parameter_offset - 0x20 - 0x01 - #parameters - 0x02;
|
||||||
|
-- - 0x20 for the header, - 0x01 for parameter length, the parameter length, and - 0x02 for the data length.
|
||||||
|
data_offset = data_offset - 0x20 - 0x01 - #parameters - 0x02;
|
||||||
|
|
||||||
|
-- I'm not sure I entirely understand why the '+1' is here, but I think it has to do with the string starting at '1' and not '0'.
|
||||||
|
local function_parameters = string.sub(data, parameter_offset + 1, parameter_offset + parameter_count)
|
||||||
|
local function_data = string.sub(data, data_offset + 1, data_offset + data_count)
|
||||||
|
|
||||||
|
local response = {}
|
||||||
|
response['parameters'] = function_parameters
|
||||||
|
response['data'] = function_data
|
||||||
|
|
||||||
|
return true, response
|
||||||
|
end
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
body {
|
||||||
|
background-color: #1b1c1d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
display: flex !important;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo svg {
|
||||||
|
width: 2.5em;
|
||||||
|
height: 2.5em;
|
||||||
|
fill: currentColor;
|
||||||
|
margin: -0.4em !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tagify {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 0.28571429rem;
|
||||||
|
--tags-focus-border-color: #85b7d9;
|
||||||
|
--placeholder-color: rgba(191, 191, 191, 0.87);
|
||||||
|
--placeholder-color-focus: rgba(115, 115, 115, 0.87);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui.table {
|
||||||
|
caption-side: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui.label {
|
||||||
|
margin: 0.14285714em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui.label > .detail {
|
||||||
|
margin-left: 0.3em;
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui.form .fields > .field {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui.ui.form .field .fields .field:not(:only-child) .ui.checkbox {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui.dropdown.label {
|
||||||
|
min-width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui.dropdown.label > .remove.icon {
|
||||||
|
right: 2.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toast-container .ui.header {
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
.share-size {
|
||||||
|
--free-ratio: calc(var(--free) / var(--total));
|
||||||
|
--used-percent: calc(100% - 100% * var(--free-ratio));
|
||||||
|
--color: hsl(calc(120 * var(--free-ratio)) 100% 50%);
|
||||||
|
background-image: linear-gradient(
|
||||||
|
to right,
|
||||||
|
var(--color) var(--used-percent),
|
||||||
|
transparent var(--used-percent),
|
||||||
|
transparent
|
||||||
|
) !important;
|
||||||
|
text-align: center !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mini.share-size {
|
||||||
|
font-size: 0.64285714rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui.card .table {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
-152
@@ -1,152 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<xsl:stylesheet
|
|
||||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
||||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
||||||
version="2.0">
|
|
||||||
<xsl:output method="html" encoding="UTF-8" />
|
|
||||||
<xsl:output indent="yes" />
|
|
||||||
<xsl:strip-space elements="*" />
|
|
||||||
|
|
||||||
<xsl:template match="nmaprun">
|
|
||||||
|
|
||||||
<html lang="fr">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<title><xsl:value-of select="./@args" /></title>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
<style>
|
|
||||||
.btn {
|
|
||||||
margin: 2px;
|
|
||||||
padding: 2px 6px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.badge {
|
|
||||||
margin: 0px;
|
|
||||||
padding: 2px 4px !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.1.3/css/bootstrap.min.css"/>
|
|
||||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs5/jq-3.6.0/dt-1.12.1/b-2.2.3/b-html5-2.2.3/b-print-2.2.3/cr-1.5.6/fc-4.1.0/fh-3.2.3/r-2.3.0/rr-1.2.8/sc-2.0.6/datatables.min.css"/>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<table id="scanResults" class="table table-striped table-hover compact caption-top" style="width:100%">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Adresse IP</th>
|
|
||||||
<th>Nom DNS</th>
|
|
||||||
<th>Services</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<xsl:for-each select="host[status/@state='up']">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of select="address/@addr" />
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of select="hostnames/hostname/@name" />
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<xsl:for-each select="ports/port[state/@state='open']">
|
|
||||||
<a target="_blank" style="text-transform:uppercase;" type="button" class="btn btn-success btn-sm">
|
|
||||||
<xsl:variable name="protocol">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="service/@name='http' or service/@name='https' or service/@name='http-alt' or @portid = 8006 or @portid = 9292 or @portid = 20618">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="service/@tunnel='ssl' or script[@id='ssl-cert'] or script[@id='ssl-date']">
|
|
||||||
<xsl:text>https://</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:text>http://</xsl:text>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:when test="service/@name='ftp' or service/@name='ssh' or service/@name='telnet'">
|
|
||||||
<xsl:value-of select="service/@name" />
|
|
||||||
<xsl:text>://</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:when test="service/@name = 'microsoft-ds' or service/@name = 'netbios-ssn'">
|
|
||||||
<xsl:text>file://///</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:variable>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$protocol != ''">
|
|
||||||
<xsl:attribute name="href">
|
|
||||||
<xsl:value-of select="$protocol" />
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="count(../../hostnames/hostname) > 0">
|
|
||||||
<xsl:value-of select="../../hostnames/hostname/@name" />
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:value-of select="../../address/@addr" />
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
<xsl:text>:</xsl:text>
|
|
||||||
<xsl:value-of select="@portid"/>
|
|
||||||
</xsl:attribute>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:attribute name="class">
|
|
||||||
btn btn-success btn-sm disabled
|
|
||||||
</xsl:attribute>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
<xsl:attribute name="title">
|
|
||||||
<xsl:for-each select="service/@*">
|
|
||||||
<xsl:value-of select="concat(name(), ': ', ., ', ')"/>
|
|
||||||
</xsl:for-each>
|
|
||||||
</xsl:attribute>
|
|
||||||
<span class="badge bg-secondary rounded-pill"><xsl:value-of select="@portid"/></span>
|
|
||||||
<xsl:value-of select="service/@name" />
|
|
||||||
</a>
|
|
||||||
</xsl:for-each>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</xsl:for-each>
|
|
||||||
</tbody>
|
|
||||||
<caption>
|
|
||||||
<pre class="mb-0" style="white-space:pre-wrap; word-wrap:break-word;">
|
|
||||||
<xsl:value-of select="/nmaprun/@args" />
|
|
||||||
</pre>
|
|
||||||
<time>
|
|
||||||
<xsl:value-of select="/nmaprun/@startstr" />
|
|
||||||
</time> - <time>
|
|
||||||
<xsl:value-of select="/nmaprun/runstats/finished/@timestr" />
|
|
||||||
</time><br />
|
|
||||||
<small>
|
|
||||||
<xsl:value-of select="/nmaprun/@scanner" /> v
|
|
||||||
<xsl:value-of select="/nmaprun/@version" />
|
|
||||||
</small>
|
|
||||||
</caption>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<script
|
|
||||||
src="https://code.jquery.com/jquery-3.6.0.min.js"
|
|
||||||
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
|
|
||||||
crossorigin="anonymous">
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
|
|
||||||
<script type="text/javascript" src="https://cdn.datatables.net/v/bs5/jq-3.6.0/dt-1.12.1/b-2.2.3/b-html5-2.2.3/b-print-2.2.3/cr-1.5.6/fc-4.1.0/fh-3.2.3/r-2.3.0/rr-1.2.8/sc-2.0.6/datatables.min.js"></script>
|
|
||||||
<script>
|
|
||||||
$(document).ready( function() {
|
|
||||||
$('#scanResults').DataTable({
|
|
||||||
fixedHeader: true,
|
|
||||||
lengthMenu: [
|
|
||||||
[256, 512, 1024, 2048, -1],
|
|
||||||
[256, 512, 1024, 2048, "All"]
|
|
||||||
],
|
|
||||||
scrollCollapse: true,
|
|
||||||
paging: false,
|
|
||||||
responsive: true,
|
|
||||||
});
|
|
||||||
} );
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
</xsl:template>
|
|
||||||
</xsl:stylesheet>
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.1">
|
||||||
|
|
||||||
|
<xsl:template match="nmaprun" mode="head">
|
||||||
|
<xsl:param name="base" />
|
||||||
|
<xsl:param name="targets" />
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta http-equiv="refresh" content="300" />
|
||||||
|
<title>lanScan - <xsl:value-of select="$targets" />
|
||||||
|
</title>
|
||||||
|
<base href="{$base}" />
|
||||||
|
<link rel="icon" href="favicon.ico" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.3/dist/semantic.min.css" />
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/@yaireo/tagify/dist/tagify.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="https://cdn.datatables.net/v/se/jszip-3.10.1/dt-2.1.8/b-3.1.2/b-html5-3.1.2/b-print-3.1.2/cr-2.0.4/fc-5.0.3/fh-4.0.1/r-3.0.3/datatables.min.css" rel="stylesheet" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||||
|
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.2/semantic.min.js"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/@yaireo/tagify"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/@yaireo/tagify/dist/tagify.polyfills.min.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
|
||||||
|
<script src="https://cdn.datatables.net/v/se/jszip-3.10.1/dt-2.1.8/b-3.1.2/b-html5-3.1.2/b-print-3.1.2/cr-2.0.4/fc-5.0.3/fh-4.0.1/r-3.0.3/datatables.min.js"></script>
|
||||||
|
<script>
|
||||||
|
DataTable.ext.type.detect.unshift(function (d) {
|
||||||
|
return /[\d]+\.[\d]+\.[\d]+\.[\d]+/.test(d)
|
||||||
|
? 'ipv4-address'
|
||||||
|
: null;
|
||||||
|
});
|
||||||
|
|
||||||
|
DataTable.ext.type.order['ipv4-address-pre'] = function (ipAddress) {
|
||||||
|
[a, b, c, d] = ipAddress.split(".").map(Number)
|
||||||
|
return 16777216*a + 65536*b + 256*c + d;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
||||||
@@ -0,0 +1,391 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.1">
|
||||||
|
|
||||||
|
<xsl:import href="head.xsl" />
|
||||||
|
<xsl:import href="nav.xsl" />
|
||||||
|
<xsl:import href="services.xsl" />
|
||||||
|
<xsl:import href="toast.xsl" />
|
||||||
|
|
||||||
|
<xsl:output method="html" encoding="UTF-8" />
|
||||||
|
<xsl:output indent="yes" />
|
||||||
|
<xsl:strip-space elements='*' />
|
||||||
|
|
||||||
|
<xsl:variable name="stylesheetURL"
|
||||||
|
select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href="'), '"')" />
|
||||||
|
<xsl:variable name="base" select="concat($stylesheetURL, '/../../')" />
|
||||||
|
|
||||||
|
<xsl:template match="nmaprun">
|
||||||
|
<xsl:variable name="targets" select="substring-after(@args, '.xsl ')" />
|
||||||
|
<xsl:variable
|
||||||
|
name="current" select="." />
|
||||||
|
<xsl:variable name="init"
|
||||||
|
select="document(concat($base, 'scans/', translate($targets,'/', '!'), '.xml'))/nmaprun" />
|
||||||
|
|
||||||
|
<html
|
||||||
|
lang="fr">
|
||||||
|
<xsl:apply-templates select="." mode="head">
|
||||||
|
<xsl:with-param name="base" select="$base" />
|
||||||
|
<xsl:with-param name="targets" select="$targets" />
|
||||||
|
</xsl:apply-templates>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<xsl:apply-templates select="." mode="nav">
|
||||||
|
</xsl:apply-templates>
|
||||||
|
|
||||||
|
<main class="ui main container inverted segment">
|
||||||
|
<xsl:apply-templates
|
||||||
|
select="$current/host | $init/host[not(address/@addr=$current/host/address/@addr)][not(status/@state='down')]">
|
||||||
|
<xsl:with-param name="init" select="$init" />
|
||||||
|
<xsl:with-param name="current" select="$current" />
|
||||||
|
</xsl:apply-templates>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$('.ui.tree.accordion').accordion()
|
||||||
|
$('.ui.dropdown').dropdown()
|
||||||
|
</script>
|
||||||
|
<xsl:apply-templates select="runstats">
|
||||||
|
<xsl:with-param name="init" select="$init" />
|
||||||
|
</xsl:apply-templates>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="host">
|
||||||
|
<xsl:param name="init" />
|
||||||
|
<xsl:param name="current" />
|
||||||
|
<xsl:variable name="addr"
|
||||||
|
select="address/@addr" />
|
||||||
|
<xsl:variable name="initHost"
|
||||||
|
select="$init/host[address/@addr=$addr]" />
|
||||||
|
<xsl:variable name="currentHost"
|
||||||
|
select="$current/host[address/@addr=$addr]" />
|
||||||
|
<xsl:variable name="hostAddress">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="hostnames/hostname/@name">
|
||||||
|
<xsl:value-of select="hostnames/hostname/@name" />
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="address/@addr" />
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:variable>
|
||||||
|
|
||||||
|
<h1>
|
||||||
|
<xsl:attribute name="class">
|
||||||
|
<xsl:text>ui inverted header </xsl:text>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$currentHost/status/@state='up'">green</xsl:when>
|
||||||
|
<xsl:otherwise>red</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="hostnames/hostname/@name">
|
||||||
|
<xsl:value-of select="hostnames/hostname/@name" />
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="address/@addr" />
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<table
|
||||||
|
class="ui inverted table" style="width: max-content">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<xsl:if test="address[@addrtype='ipv4']/@addr">
|
||||||
|
<th>Adresse IPv4</th>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="address[@addrtype='mac']/@addr">
|
||||||
|
<th>Adresse MAC</th>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="address/@vendor">
|
||||||
|
<th>Constructeur</th>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="os/osmatch/@name">
|
||||||
|
<th>OS</th>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="distance/@value">
|
||||||
|
<th>Distance</th>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="uptime/@lastboot">
|
||||||
|
<th>Dernier redémarrage</th>
|
||||||
|
</xsl:if>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<xsl:if test="address[@addrtype='ipv4']/@addr">
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="address[@addrtype='ipv4']/@addr" />
|
||||||
|
</td>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="address[@addrtype='mac']/@addr">
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="address[@addrtype='mac']/@addr" />
|
||||||
|
</td>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="address/@vendor">
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="address/@vendor" />
|
||||||
|
</td>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="os/osmatch/@name">
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="os/osmatch/@name" />
|
||||||
|
</td>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="distance/@value">
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="distance/@value" />
|
||||||
|
<xsl:text> rebond(s)</xsl:text>
|
||||||
|
</td>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="uptime/@lastboot">
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="uptime/@lastboot" />
|
||||||
|
</td>
|
||||||
|
</xsl:if>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<xsl:if
|
||||||
|
test="hostscript/script">
|
||||||
|
<div class="ui inverted tree accordion">
|
||||||
|
<div class="title">
|
||||||
|
<i class="dropdown icon"></i> Informations supplémentaires </div>
|
||||||
|
<div class="content">
|
||||||
|
<xsl:apply-templates select="hostscript/script" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</xsl:if>
|
||||||
|
|
||||||
|
<h2
|
||||||
|
class="ui header">Services</h2>
|
||||||
|
|
||||||
|
<div class="ui cards">
|
||||||
|
<xsl:apply-templates
|
||||||
|
select="$currentHost/ports/port | $initHost/ports/port[not(@portid=$currentHost/ports/port/@portid)][not(state/@state='closed')]">
|
||||||
|
<xsl:with-param name="initHost" select="$initHost" />
|
||||||
|
<xsl:with-param name="currentHost" select="$currentHost" />
|
||||||
|
<xsl:with-param name="hostAddress" select="$hostAddress" />
|
||||||
|
</xsl:apply-templates>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="port">
|
||||||
|
<xsl:param name="hostAddress" />
|
||||||
|
<xsl:param name="initHost" />
|
||||||
|
<xsl:param name="currentHost" />
|
||||||
|
<xsl:variable
|
||||||
|
name="portid" select="@portid" />
|
||||||
|
<xsl:variable name="initPort"
|
||||||
|
select="$initHost/ports/port[@portid=$portid]" />
|
||||||
|
<xsl:variable name="currentPort"
|
||||||
|
select="$currentHost/ports/port[@portid=$portid]" />
|
||||||
|
<xsl:variable name="color">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$currentPort/script[@id='http-info']/elem[@key='status']>=500">red</xsl:when>
|
||||||
|
<xsl:when test="$currentPort/script[@id='http-info']/elem[@key='status']>=400">orange</xsl:when>
|
||||||
|
<xsl:when test="$currentPort/script[@id='http-info']/elem[@key='status']>=200">green</xsl:when>
|
||||||
|
<xsl:when test="$currentPort/state/@state='open'">green</xsl:when>
|
||||||
|
<xsl:when test="$currentPort/state/@state='filtered'">orange</xsl:when>
|
||||||
|
<xsl:otherwise>red</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:variable>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="ui inverted card {$color}">
|
||||||
|
<div class="content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="ui {$color} ribbon label">
|
||||||
|
<div class="detail" style="text-transform: uppercase">
|
||||||
|
<xsl:value-of select="@protocol" />
|
||||||
|
<xsl:text>:</xsl:text>
|
||||||
|
</div>
|
||||||
|
<xsl:value-of select="@portid" />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<xsl:value-of select="service/@name" />
|
||||||
|
<xsl:if test="service/@tunnel">
|
||||||
|
<span>
|
||||||
|
<xsl:text>/</xsl:text>
|
||||||
|
<xsl:value-of select="service/@tunnel" />
|
||||||
|
</span>
|
||||||
|
</xsl:if>
|
||||||
|
</div>
|
||||||
|
<div class="meta">
|
||||||
|
<xsl:if test="service/@product">
|
||||||
|
<span>
|
||||||
|
<xsl:value-of select="service/@product" />
|
||||||
|
</span>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="service/@version">
|
||||||
|
<span>
|
||||||
|
<xsl:text>v</xsl:text>
|
||||||
|
<xsl:value-of select="service/@version" />
|
||||||
|
</span>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="service/@extrainfo">
|
||||||
|
<span>
|
||||||
|
<xsl:value-of select="service/@extrainfo" />
|
||||||
|
</span>
|
||||||
|
</xsl:if>
|
||||||
|
<div class="description">
|
||||||
|
<xsl:if test="script">
|
||||||
|
<div class="ui inverted tree accordion">
|
||||||
|
<div class="title">
|
||||||
|
<i class="dropdown icon"></i> Détails </div>
|
||||||
|
<div class="content">
|
||||||
|
<xsl:apply-templates select="script" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</xsl:if>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<xsl:if
|
||||||
|
test="service/@name='ftp' or service/@name='ssh' or service/@name='http' or service/@name='https' or service/@name='ms-wbt-server'">
|
||||||
|
<a class="ui {$color} button" target="_blank">
|
||||||
|
<xsl:attribute name="href">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="service/@name='ms-wbt-server'">
|
||||||
|
<xsl:text>rdp.php?v=</xsl:text>
|
||||||
|
<xsl:value-of select="$hostAddress" />
|
||||||
|
<xsl:text>&p=</xsl:text>
|
||||||
|
<xsl:value-of
|
||||||
|
select="@portid" />
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="service/@name='http' and service/@tunnel='ssl'">
|
||||||
|
<xsl:text>https</xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="service/@name" />
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:text>://</xsl:text>
|
||||||
|
<xsl:value-of
|
||||||
|
select="$hostAddress" />
|
||||||
|
<xsl:text>:</xsl:text>
|
||||||
|
<xsl:value-of select="@portid" />
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:attribute>
|
||||||
|
<i class="external alternate icon"></i>
|
||||||
|
<xsl:text>Ouvrir</xsl:text>
|
||||||
|
</a>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="$currentPort/script[@id='smb-shares-size']/table">
|
||||||
|
<div class="ui {$color} center aligned dropdown share-size button">
|
||||||
|
<xsl:attribute name="style">
|
||||||
|
<xsl:for-each select="$currentPort/script[@id='smb-shares-size']/table">
|
||||||
|
<xsl:sort select="elem[@key='FreeSize'] div elem[@key='TotalSize']"
|
||||||
|
order="ascending" />
|
||||||
|
<xsl:if test="position()=1">
|
||||||
|
<xsl:text>--free: </xsl:text>
|
||||||
|
<xsl:value-of select="elem[@key='FreeSize']" />
|
||||||
|
<xsl:text>; --total: </xsl:text>
|
||||||
|
<xsl:value-of
|
||||||
|
select="elem[@key='TotalSize']" />
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:attribute>
|
||||||
|
<i class="external alternate icon"></i>
|
||||||
|
<xsl:text>Ouvrir</xsl:text>
|
||||||
|
<i class="dropdown icon"></i>
|
||||||
|
<div class="menu">
|
||||||
|
<xsl:apply-templates select="$currentPort/script[@id='smb-shares-size']/table">
|
||||||
|
<xsl:with-param name="hostAddress" select="$hostAddress" />
|
||||||
|
</xsl:apply-templates>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</xsl:if>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="script">
|
||||||
|
<div class="ui inverted accordion">
|
||||||
|
<div class="title">
|
||||||
|
<i class="dropdown icon"></i>
|
||||||
|
<xsl:value-of select="@id" />
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="elem or table">
|
||||||
|
<xsl:if test="elem">
|
||||||
|
<table class="ui small compact inverted fixed definition table">
|
||||||
|
<tbody>
|
||||||
|
<xsl:apply-templates select="elem" />
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:apply-templates
|
||||||
|
select="table" />
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="@output" />
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="table">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="@key">
|
||||||
|
<div class="ui inverted accordion">
|
||||||
|
<div class="title">
|
||||||
|
<i class="dropdown icon"></i>
|
||||||
|
<xsl:value-of select="@key" />
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<xsl:if test="elem">
|
||||||
|
<table class="ui small compact inverted fixed definition table">
|
||||||
|
<tbody>
|
||||||
|
<xsl:apply-templates select="elem" />
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:apply-templates select="table" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="elem">
|
||||||
|
<table class="ui small compact inverted fixed definition table">
|
||||||
|
<tbody>
|
||||||
|
<xsl:apply-templates select="elem" />
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="elem">
|
||||||
|
<tr>
|
||||||
|
<td style="width: min-content">
|
||||||
|
<xsl:value-of select="@key" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="." />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="table">
|
||||||
|
<xsl:param name="hostAddress" />
|
||||||
|
<a class="item share-size"
|
||||||
|
href="file://///{$hostAddress}/{@key}" target="_blank" rel="noopener noreferrer"
|
||||||
|
style="--free: {elem[@key='FreeSize']}; --total: {elem[@key='TotalSize']}">
|
||||||
|
<xsl:value-of select="@key" />
|
||||||
|
</a>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<xsl:stylesheet
|
||||||
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
version="1.1">
|
||||||
|
|
||||||
|
<xsl:import href="head.xsl" />
|
||||||
|
<xsl:import href="nav.xsl" />
|
||||||
|
<xsl:import href="services.xsl" />
|
||||||
|
<xsl:import href="toast.xsl" />
|
||||||
|
|
||||||
|
<xsl:output method="html" encoding="UTF-8" />
|
||||||
|
<xsl:output indent="yes" />
|
||||||
|
<xsl:strip-space elements='*' />
|
||||||
|
|
||||||
|
<xsl:variable name="stylesheetURL"
|
||||||
|
select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href="'), '"')" />
|
||||||
|
<xsl:variable name="base" select="concat($stylesheetURL, '/../../')" />
|
||||||
|
|
||||||
|
<xsl:template match="nmaprun">
|
||||||
|
<xsl:variable name="targets" select="substring-after(@args, '.xsl ')" />
|
||||||
|
<xsl:variable
|
||||||
|
name="current" select="." />
|
||||||
|
<xsl:variable name="init"
|
||||||
|
select="document(concat($base, 'scans/', translate($targets,'/', '!'), '.xml'))/nmaprun" />
|
||||||
|
|
||||||
|
<html
|
||||||
|
lang="fr">
|
||||||
|
<xsl:apply-templates select="." mode="head">
|
||||||
|
<xsl:with-param name="base" select="$base" />
|
||||||
|
<xsl:with-param name="targets" select="$targets" />
|
||||||
|
</xsl:apply-templates>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<xsl:apply-templates select="." mode="nav">
|
||||||
|
</xsl:apply-templates>
|
||||||
|
|
||||||
|
<main class="ui main container inverted segment">
|
||||||
|
<h1>
|
||||||
|
<xsl:value-of select="$targets" />
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<table id="scanResultsTable" style="width:100%" role="grid"
|
||||||
|
class="ui sortable small compact stuck striped table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width: min-width">Etat</th>
|
||||||
|
<th>Adresse IP</th>
|
||||||
|
<th>Nom</th>
|
||||||
|
<th>Constructeur</th>
|
||||||
|
<th class="six wide">Services</th>
|
||||||
|
<th style="width: min-width"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<xsl:apply-templates
|
||||||
|
select="host | $init/host[not(address/@addr=$current/host/address/@addr)][not(status/@state='down')]">
|
||||||
|
<xsl:with-param name="init" select="$init" />
|
||||||
|
<xsl:with-param name="current" select="$current" />
|
||||||
|
</xsl:apply-templates>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var table = $('#scanResultsTable').DataTable({
|
||||||
|
buttons : ['copy', 'excel', 'pdf'],
|
||||||
|
fixedHeader: true,
|
||||||
|
lengthMenu : [
|
||||||
|
[256, 512, 1024, 2048, -1],
|
||||||
|
[256, 512, 1024, 2048, "All"]
|
||||||
|
],
|
||||||
|
responsive: true,
|
||||||
|
colReorder: true,
|
||||||
|
buttons : ['copy', 'excel', 'pdf']
|
||||||
|
})
|
||||||
|
table.order([1, 'asc']).draw()
|
||||||
|
|
||||||
|
$('.ui.dropdown').dropdown()
|
||||||
|
</script>
|
||||||
|
<xsl:apply-templates select="runstats">
|
||||||
|
<xsl:with-param name="init" select="$init" />
|
||||||
|
</xsl:apply-templates>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="host">
|
||||||
|
<xsl:param name="init" />
|
||||||
|
<xsl:param name="current" />
|
||||||
|
<xsl:variable name="addr"
|
||||||
|
select="address/@addr" />
|
||||||
|
<xsl:variable name="initHost"
|
||||||
|
select="$init/host[address/@addr=$addr]" />
|
||||||
|
<xsl:variable name="currentHost"
|
||||||
|
select="$current/host[address/@addr=$addr]" />
|
||||||
|
<xsl:variable name="hostAddress">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="hostnames/hostname/@name">
|
||||||
|
<xsl:value-of select="hostnames/hostname/@name" />
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="address/@addr" />
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:variable>
|
||||||
|
<tr>
|
||||||
|
<xsl:attribute name="class">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$currentHost/status/@state='up'">positive</xsl:when>
|
||||||
|
<xsl:otherwise>negative</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:attribute>
|
||||||
|
<td>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$currentHost">
|
||||||
|
<div>
|
||||||
|
<xsl:attribute name="class">
|
||||||
|
<xsl:text>ui mini circular label </xsl:text>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$currentHost/status/@state='up'">green</xsl:when>
|
||||||
|
<xsl:otherwise>red</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:value-of select="$currentHost/status/@state" />
|
||||||
|
</div>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise><div class="ui mini circular label red">down</div></xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="address/@addr" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<b>
|
||||||
|
<xsl:value-of select="substring-before(hostnames/hostname/@name, '.')" />
|
||||||
|
</b>
|
||||||
|
<xsl:if test="substring-after(hostnames/hostname/@name, '.')">
|
||||||
|
<wbr />.<xsl:value-of select="substring-after(hostnames/hostname/@name, '.')" />
|
||||||
|
</xsl:if>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:value-of select="address[@addrtype='mac']/@vendor" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<xsl:apply-templates
|
||||||
|
select="ports/port | $initHost/ports/port[not(state/@state='closed')][not(@portid=$currentHost/ports/port/@portid)]"
|
||||||
|
mode="service">
|
||||||
|
<xsl:with-param name="initHost" select="$initHost" />
|
||||||
|
<xsl:with-param name="currentHost" select="$currentHost" />
|
||||||
|
<xsl:with-param name="hostAddress" select="$hostAddress" />
|
||||||
|
<xsl:with-param name="class" select="'ui mini label'" />
|
||||||
|
<xsl:sort select="number(@portid)" order="ascending" />
|
||||||
|
</xsl:apply-templates>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a class="ui mini icon teal icon button" target="_blank" title="Scan intensif">
|
||||||
|
<xsl:attribute name="href">scan.php?host=<xsl:value-of select="$hostAddress" /></xsl:attribute>
|
||||||
|
<i class="search plus icon"></i>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<xsl:stylesheet
|
||||||
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
version="1.1">
|
||||||
|
|
||||||
|
<xsl:template match="nmaprun" mode="nav">
|
||||||
|
<nav class="ui inverted secondary menu">
|
||||||
|
<a href="." class="ui header button item logo">lan<svg class="logo" version="1.1" id="Layer_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px" viewBox="0 0 24 24" xml:space="preserve" width="40" height="40"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<defs id="defs206"></defs>
|
||||||
|
<g id="g998" transform="matrix(0,0.04687491,-0.04687491,0,24,2.2682373e-5)">
|
||||||
|
<g id="g147">
|
||||||
|
<g id="g145">
|
||||||
|
<path d="m 322.065,92.046 c -46.24,0 -83.851,37.619 -83.851,83.857 v 168.712 c 0,25.224 -21.148,45.745 -46.372,45.745 -25.224,0 -46.372,-20.521 -46.372,-45.745 V 199.464 h -38.114 v 145.151 c 0,46.24 38.246,83.859 84.486,83.859 46.24,0 84.486,-37.619 84.486,-83.859 V 175.903 c 0,-25.223 20.514,-45.743 45.737,-45.743 25.223,0 45.737,20.521 45.737,45.743 v 134.092 h 38.114 V 175.903 c 0,-46.239 -37.611,-83.857 -83.851,-83.857 z" id="path143"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g id="g153">
|
||||||
|
<g id="g151">
|
||||||
|
<path d="M 144.198,0 H 108.625 C 98.101,0 89.568,8.746 89.568,19.271 c 0,1.157 0.121,2.328 0.318,3.598 h 73.052 c 0.197,-1.27 0.318,-2.441 0.318,-3.598 C 163.256,8.746 154.723,0 144.198,0 Z" id="path149"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g id="g159">
|
||||||
|
<g id="g157">
|
||||||
|
<path d="m 420.183,486.591 h -71.731 c -0.626,2.541 -0.978,4.077 -0.978,6.176 0,10.525 8.532,19.234 19.057,19.234 h 35.573 c 10.525,0 19.057,-8.709 19.057,-19.234 0,-2.098 -0.352,-3.635 -0.978,-6.176 z" id="path155"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g id="g165">
|
||||||
|
<g id="g163">
|
||||||
|
<rect x="87.027" y="41.925999" width="80.040001" height="138.481" id="rect161"></rect>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g id="g171">
|
||||||
|
<g id="g169">
|
||||||
|
<rect x="344.93301" y="329.052" width="80.040001" height="138.481" id="rect167"></rect>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g id="g173"></g>
|
||||||
|
<g id="g175"></g>
|
||||||
|
<g id="g177"></g>
|
||||||
|
<g id="g179"></g>
|
||||||
|
<g id="g181"></g>
|
||||||
|
<g id="g183"></g>
|
||||||
|
<g id="g185"></g>
|
||||||
|
<g id="g187"></g>
|
||||||
|
<g id="g189"></g>
|
||||||
|
<g id="g191"></g>
|
||||||
|
<g id="g193"></g>
|
||||||
|
<g id="g195"></g>
|
||||||
|
<g id="g197"></g>
|
||||||
|
<g id="g199"></g>
|
||||||
|
<g id="g201"></g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
can</a>
|
||||||
|
<div class="right menu">
|
||||||
|
<form class="ui right aligned category search item" id="scanForm" action="scan.php"
|
||||||
|
method="get">
|
||||||
|
<div class="ui inverted icon input" id="targetsInputDiv">
|
||||||
|
<input name="lan" class="prompt" type="text" placeholder="Scanner un réseau"
|
||||||
|
pattern="[a-zA-Z0-9._\/ \-]+"
|
||||||
|
title="Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc.
|
||||||
|
Exemples: 192.168.1.0/24 scanme.nmap.org 10.0-255.0-255.1-254" />
|
||||||
|
<i class="satellite dish icon"></i>
|
||||||
|
</div>
|
||||||
|
<a class="button item" href="options.php" title="Actualiser">
|
||||||
|
<i class="settings icon"></i>
|
||||||
|
</a>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
scanForm.onsubmit = function(event) {
|
||||||
|
if (scanForm.checkValidity()) {
|
||||||
|
targetsInputDiv.classList.add('loading')
|
||||||
|
$.toast({
|
||||||
|
title : 'Scan en cours...',
|
||||||
|
message : 'Merci de patienter',
|
||||||
|
class : 'info',
|
||||||
|
showIcon : 'satellite dish',
|
||||||
|
displayTime: 0,
|
||||||
|
closeIcon : true,
|
||||||
|
position : 'bottom right',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,116 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<xsl:stylesheet
|
||||||
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
version="1.1">
|
||||||
|
|
||||||
|
<xsl:template match="port" mode="service">
|
||||||
|
<xsl:param name="hostAddress" />
|
||||||
|
<xsl:param name="initHost" />
|
||||||
|
<xsl:param name="currentHost" />
|
||||||
|
<xsl:param
|
||||||
|
name="class" />
|
||||||
|
<xsl:variable name="portid" select="@portid" />
|
||||||
|
<xsl:variable
|
||||||
|
name="initPort" select="$initHost/ports/port[@portid=$portid]" />
|
||||||
|
<xsl:variable
|
||||||
|
name="currentPort" select="$currentHost/ports/port[@portid=$portid]" />
|
||||||
|
|
||||||
|
<a
|
||||||
|
target="_blank">
|
||||||
|
<xsl:attribute name="class">
|
||||||
|
<xsl:value-of select="$class" />
|
||||||
|
<xsl:text> </xsl:text>
|
||||||
|
<xsl:if
|
||||||
|
test="$currentPort/script[@id='smb-shares-size']/table">dropdown button
|
||||||
|
share-size </xsl:if>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$currentPort/script[@id='http-info']/elem[@key='status']>=500">
|
||||||
|
red</xsl:when>
|
||||||
|
<xsl:when test="$currentPort/script[@id='http-info']/elem[@key='status']>=400">
|
||||||
|
orange</xsl:when>
|
||||||
|
<xsl:when test="$currentPort/script[@id='http-info']/elem[@key='status']>=200">
|
||||||
|
green</xsl:when>
|
||||||
|
<xsl:when test="$currentPort/state/@state='open'">green</xsl:when>
|
||||||
|
<xsl:when test="$currentPort/state/@state='filtered'">orange</xsl:when>
|
||||||
|
<xsl:otherwise>red</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:if test="$currentPort/script[@id='smb-shares-size']/table">
|
||||||
|
<xsl:attribute name="style">
|
||||||
|
<xsl:for-each select="$currentPort/script[@id='smb-shares-size']/table">
|
||||||
|
<xsl:sort select="elem[@key='FreeSize'] div elem[@key='TotalSize']"
|
||||||
|
order="ascending" />
|
||||||
|
<xsl:if test="position()=1">
|
||||||
|
<xsl:text>--free: </xsl:text>
|
||||||
|
<xsl:value-of select="elem[@key='FreeSize']" />
|
||||||
|
<xsl:text>; --total: </xsl:text>
|
||||||
|
<xsl:value-of
|
||||||
|
select="elem[@key='TotalSize']" />
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if
|
||||||
|
test="service/@name='ftp' or service/@name='ssh' or service/@name='http' or service/@name='https'">
|
||||||
|
<xsl:attribute name="href">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="service/@name='http' and service/@tunnel='ssl'">
|
||||||
|
<xsl:text>https</xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="service/@name" />
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:text>://</xsl:text>
|
||||||
|
<xsl:value-of
|
||||||
|
select="$hostAddress" />
|
||||||
|
<xsl:text>:</xsl:text>
|
||||||
|
<xsl:value-of select="@portid" />
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="service/@name='ms-wbt-server'">
|
||||||
|
<xsl:attribute name="href">
|
||||||
|
<xsl:text>rdp.php?v=</xsl:text>
|
||||||
|
<xsl:value-of select="$hostAddress" />
|
||||||
|
<xsl:text>&p=</xsl:text>
|
||||||
|
<xsl:value-of
|
||||||
|
select="@portid" />
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:attribute name="title">
|
||||||
|
<xsl:value-of select="@protocol" />:<xsl:value-of select="@portid" />
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="service/@name='unknown'">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="@protocol='tcp'">:</xsl:when>
|
||||||
|
<xsl:otherwise><xsl:value-of select="substring(@protocol, 1, 1)" />:</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:value-of
|
||||||
|
select="@portid" />
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="service/@name" />
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:if test="$currentPort/script[@id='smb-shares-size']/table">
|
||||||
|
<i class="dropdown icon"></i>
|
||||||
|
<div class="menu">
|
||||||
|
<xsl:apply-templates select="$currentPort/script[@id='smb-shares-size']/table">
|
||||||
|
<xsl:with-param name="hostAddress" select="$hostAddress" />
|
||||||
|
</xsl:apply-templates>
|
||||||
|
</div>
|
||||||
|
</xsl:if>
|
||||||
|
</a>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="table">
|
||||||
|
<xsl:param name="hostAddress" />
|
||||||
|
<a class="item share-size"
|
||||||
|
href="file://///{$hostAddress}/{@key}" target="_blank" rel="noopener noreferrer"
|
||||||
|
style="--free: {elem[@key='FreeSize']}; --total: {elem[@key='TotalSize']}">
|
||||||
|
<xsl:value-of select="@key" />
|
||||||
|
</a>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<xsl:stylesheet
|
||||||
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
version="1.1">
|
||||||
|
|
||||||
|
<xsl:template match="runstats">
|
||||||
|
<xsl:param name="init"/>
|
||||||
|
<script>
|
||||||
|
<xsl:if test="finished/@summary">
|
||||||
|
$.toast({
|
||||||
|
title : '<xsl:value-of select="finished/@exit"/>',
|
||||||
|
message : `<xsl:value-of select="finished/@summary"/>`,
|
||||||
|
showIcon : 'satellite dish',
|
||||||
|
displayTime: 0,
|
||||||
|
closeIcon : true,
|
||||||
|
position : 'bottom right',
|
||||||
|
})
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="finished/@errormsg">
|
||||||
|
$.toast({
|
||||||
|
title : '<xsl:value-of select="finished/@exit"/>',
|
||||||
|
message : `<xsl:value-of select="finished/@errormsg"/>`,
|
||||||
|
showIcon : 'exclamation triangle',
|
||||||
|
class : 'error',
|
||||||
|
displayTime: 0,
|
||||||
|
closeIcon : true,
|
||||||
|
position : 'bottom right',
|
||||||
|
})
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="$init/runstats/finished">
|
||||||
|
$.toast({
|
||||||
|
message : 'Comparaison avec les résultats du ' + new Date("<xsl:value-of select="$init/runstats/finished/@timestr"/>").toLocaleString(),
|
||||||
|
class : 'info',
|
||||||
|
showIcon : 'calendar',
|
||||||
|
displayTime: 0,
|
||||||
|
closeIcon : true,
|
||||||
|
position : 'bottom right',
|
||||||
|
})
|
||||||
|
</xsl:if>
|
||||||
|
</script>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
||||||
Reference in New Issue
Block a user