rescan named scan

This commit is contained in:
Adrien MALINGREY 2025-02-05 21:09:14 +01:00
parent 72396e5071
commit 4e0a723ef0
12 changed files with 465 additions and 306 deletions

View File

@ -7,6 +7,6 @@ $STYLESHEETSDIR = "stylesheets";
$NMAP = "sudo nmap"; # nmap command, E.g. 'nmap', 'sudo nmap' for root privileges or '/usr/bin/nmap' if not in PATH $NMAP = "sudo nmap"; # nmap command, E.g. 'nmap', 'sudo nmap' for root privileges or '/usr/bin/nmap' if not in PATH
$DATADIR = "."; $DATADIR = ".";
$SCRIPTARGSFILE = "script-args.ini"; $SCRIPTARGSFILE = "script-args.ini";
$LANSCANOPTIONS = "-PSmicrosoft-ds -F -T5 --datadir '$DATADIR' --script http-info,smb-shares-size --script-args-file '$SCRIPTARGSFILE' -oX - --stylesheet $BASEDIR/$STYLESHEETSDIR/lanScan.xsl"; $LANSCANOPTIONS = "-PSmicrosoft-ds -F -T5 --datadir '$DATADIR' --script http-info,smb-shares-size --script-args-file '$SCRIPTARGSFILE'";
$HOSTSCANOPTIONS = "-A -T5 --datadir '$DATADIR' --script http-info,smb-shares-size --script-args-file '$SCRIPTARGSFILE' -oX - --stylesheet $BASEDIR/$STYLESHEETSDIR/hostScan.xsl"; $HOSTSCANOPTIONS = "-A -T5 --datadir '$DATADIR' --script http-info,smb-shares-size --script-args-file '$SCRIPTARGSFILE'";
$CUSTOMSCANOPTIONS = "--datadir '$DATADIR' --script-args-file '$SCRIPTARGSFILE' -oX - --stylesheet $BASEDIR/$STYLESHEETSDIR/lanScan.xsl"; $CUSTOMSCANOPTIONS = "--datadir '$DATADIR' --script-args-file '$SCRIPTARGSFILE'";

View File

@ -6,7 +6,8 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>lanScan</title> <title>lanScan</title>
<link rel="icon" href="favicon.ico" /> <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="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.3/dist/semantic.min.css" />
<link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="style.css" />
<style> <style>
body { body {
@ -26,9 +27,9 @@
<body> <body>
<div class="ui middle aligned center aligned inverted grid"> <div class="ui center aligned inverted grid">
<div class="column" style="max-width: 450px;"> <div class="column" style="max-width: 450px;">
<h2 class="ui inverted teal fluid image header logo"> <h2 class="ui inverted teal fluid image header logo" style="margin-top: 15vh">
lan<?php include 'logo.svg'; ?>can lan<?php include 'logo.svg'; ?>can
</h2> </h2>
@ -44,51 +45,61 @@
<div class="ui left aligned stacked segment inverted"> <div class="ui left aligned stacked segment inverted">
<h4 class="ui header">Découvrir ou superviser un réseau</h4> <h4 class="ui header">Découvrir ou superviser un réseau</h4>
<div class="inverted field"> <div class="inverted field">
<select id="lanSelect" name="lan" class="search clearable selection dropdown"> <div class="ui large input">
<option value=""><?= $_SERVER['REMOTE_ADDR']; ?>/24</option> <input id="nameInput" type="text" name="lan" placeholder="<?= $_SERVER['REMOTE_ADDR']; ?>"
<?php list="targetsList" pattern="[a-zA-Z0-9._\/ \-]+" required title="Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc.
if (file_exists($SCANSDIR)) { Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.0-255.0-255.1-254" />
foreach (scandir($SCANSDIR) as $filename) { </div>
if (substr($filename, -4) === '.xml') { </div>
$name = substr($filename, 0, -4); <div class="field">
$name = str_replace("!", "/", $name); <label for="nameInput">Enregistrer sous le nom (optionnel)</label>
echo " <option value='$name'>$name</option>\n"; <div class="ui small input">
} <input id="nameInput" type="text" name="name" placeholder="Réseau local"
} pattern='[^&lt;&gt;:&quot;\\\/\|@?]+' title="Caractères interdits : &lt;&gt;:&quot;\/|@?">
} </div>
?>
</select>
</div> </div>
<div class="ui error message"></div> <div class="ui error message"></div>
<button type="submit" class="ui fluid large teal labeled icon submit button"> <button type="submit" class="ui fluid large teal labeled icon submit button">
<i class="satellite dish icon"></i>Scanner <i class="satellite dish icon"></i>Scanner
</button> </button>
</div> <div class="ui divider"></div>
<a href="options.php">Options avancées</a> <a href="options.php">Options avancées</a>
</div>
</form> </form>
<?php if (file_exists($SCANSDIR)) { ?>
<div class="ui inverted segment">
<div class="ui inverted accordion">
<div class="title"><i class="dropdown icon"></i>Scans enregistrés</div>
<div class="content">
<table class="ui very basic inverted compact table">
<tbody>
<?php
foreach (scandir($SCANSDIR) as $filename) {
if (substr($filename, -4) == '.xml') {
$name = str_replace('!', '/', substr_replace($filename, '', -4));
echo "<tr><td class='selectable'><a href='$SCANSDIR/" . rawurlencode($filename) . "'>$name</a></td><td class='collapsing'><a href='rescan.php?name=$name' class='ui mini labelled button' onclick='rescan(this)'><i class='sync icon'></i>Rescanner</a></td></tr>\n";
}
}
?>
</tbody>
</table>
</div> </div>
</div> </div>
</div>
<?php } ?>
</div>
</div>
<datalist id='targetsList'>
<option value="<?= $_SERVER['REMOTE_ADDR']; ?>/24"></option>
<option value="<?= $_SERVER['SERVER_NAME']; ?>"></option>
</datalist>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.2/semantic.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.2/semantic.min.js"></script>
<script> <script>
$('#lanSelect').dropdown({ $('.ui.accordion').accordion()
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) { scanForm.onsubmit = function (event) {
if (this.checkValidity()) { if (this.checkValidity()) {
@ -108,6 +119,19 @@
this.reportValidity() this.reportValidity()
} }
} }
function rescan(link) {
link.getElementsByTagName('i')[0].className = 'loading spinner icon'
$.toast({
title : 'Scan en cours...',
message : 'Merci de patienter',
class : 'info',
showIcon : 'satellite dish',
displayTime: 0,
closeIcon : true,
position : 'bottom right',
})
}
</script> </script>
</body> </body>

View File

@ -26,9 +26,9 @@
<body> <body>
<div class="ui center aligned inverted grid"> <div class="ui middle aligned center aligned inverted grid">
<div class="column" style="max-width: 450px;"> <div class="column" style="max-width: 450px;">
<h2 class="ui inverted teal fluid image header logo" style="margin-top: 15vh"> <h2 class="ui inverted teal fluid image header logo">
lan<?php include 'logo.svg'; ?>can lan<?php include 'logo.svg'; ?>can
</h2> </h2>
@ -44,58 +44,52 @@
<div class="ui left aligned stacked segment inverted"> <div class="ui left aligned stacked segment inverted">
<h4 class="ui header">Découvrir ou superviser un réseau</h4> <h4 class="ui header">Découvrir ou superviser un réseau</h4>
<div class="inverted field"> <div class="inverted field">
<div class="ui large input"> <select id="lanSelect" name="lan" class="search clearable selection dropdown">
<input id="nameInput" type="text" name="lan" placeholder="<?= $_SERVER['REMOTE_ADDR']; ?>" list="targetsList" pattern="[a-zA-Z0-9._\/ \-]+" required <option value=""><?= $_SERVER['REMOTE_ADDR']; ?>/24</option>
title="Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc. <?php
Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.0-255.0-255.1-254" /> if (file_exists($SCANSDIR)) {
</div> foreach (scandir($SCANSDIR) as $filename) {
</div> if (substr($filename, -4) === '.xml') {
<div class="field"> $name = substr($filename, 0, -4);
<label for="nameInput">Enregistrer sous le nom (optionnel)</label> $name = str_replace("!", "/", $name);
<div class="ui small input"> echo " <option value='$name'>$name</option>\n";
<input id="nameInput" type="text" name="name" placeholder="Réseau local" pattern='[^&lt;&gt;:&quot;\\\/\|@?]+' }
title="Caractères interdits : &lt;&gt;:&quot;\/|@?"> }
</div> }
?>
</select>
</div> </div>
<div class="ui error message"></div> <div class="ui error message"></div>
<button type="submit" class="ui fluid large teal labeled icon submit button"> <button type="submit" class="ui fluid large teal labeled icon submit button">
<i class="satellite dish icon"></i>Scanner <i class="satellite dish icon"></i>Scanner
</button> </button>
<div class="ui divider"></div> </div>
<a href="options.php">Options avancées</a> <a href="options.php">Options avancées</a>
</div>
</form> </form>
<?php if (file_exists($SCANSDIR)) { ?>
<div class="ui inverted fluid card" style="margin-top: 10vh">
<div class="content">
<div class="header">Scans enregistrés</div>
</div>
<table class="ui very basic inverted table">
<tbody>
<?php
foreach (scandir($SCANSDIR) as $filename) {
if (substr($filename, -4) == '.xml') {
$name = str_replace('!', '/', substr_replace($filename, '', -4));
echo "<tr><td class='selectable'><a href='$SCANSDIR/" . rawurlencode($filename) . "'>$name</a></td><td><a href='rescan.php?name=$name' class='ui mini labelled button'><i class='sync icon'></i>Rescanner</a></td></tr>\n";
}
}
}
?>
</tbody>
</table>
</div> </div>
</div> </div>
</div>
<datalist id='targetsList'>
<option value="<?= $_SERVER['REMOTE_ADDR']; ?>/24"></option>
<option value="<?= $_SERVER['SERVER_NAME']; ?>"></option>
</datalist>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.2/semantic.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.2/semantic.min.js"></script>
<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) { scanForm.onsubmit = function(event) {
if (this.checkValidity()) { if (this.checkValidity()) {
scanForm.classList.add("loading") scanForm.classList.add("loading")

147
moi.xml Normal file
View File

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE nmaprun>
<?xml-stylesheet href="https://adrien.malingrey.fr/dev/lanScan4/stylesheets/lanScan.xsl?name=Chez moi&amp;" type="text/xsl"?>
<!-- Nmap 7.93 scan initiated Wed Feb 5 20:27:12 2025 as: nmap -PSmicrosoft-ds -F -T5 -&#45;datadir . -&#45;script http-info,smb-shares-size -&#45;script-args-file script-args.ini -&#45;stylesheet &quot;https://adrien.malingrey.fr/dev/lanScan4/stylesheets/lanScan.xsl?name=Chez moi&amp;&quot; -oX - 192.168.1.0/24 -->
<nmaprun scanner="nmap" args="nmap -PSmicrosoft-ds -F -T5 -&#45;datadir . -&#45;script http-info,smb-shares-size -&#45;script-args-file script-args.ini -&#45;stylesheet &quot;https://adrien.malingrey.fr/dev/lanScan4/stylesheets/lanScan.xsl?name=Chez moi&amp;&quot; -oX - 192.168.1.0/24" start="1738783632" startstr="Wed Feb 5 20:27:12 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="arp-response" reason_ttl="0"/>
<address addr="192.168.1.20" addrtype="ipv4"/>
<address addr="DA:08:9B:45:7C:FC" addrtype="mac"/>
<hostnames>
</hostnames>
</hosthint>
<hosthint><status state="up" reason="arp-response" reason_ttl="0"/>
<address addr="192.168.1.46" addrtype="ipv4"/>
<address addr="BE:80:98:8E:1D:16" addrtype="mac"/>
<hostnames>
</hostnames>
</hosthint>
<hosthint><status state="up" reason="arp-response" reason_ttl="0"/>
<address addr="192.168.1.69" addrtype="ipv4"/>
<address addr="28:DF:EB:55:22:A6" addrtype="mac" vendor="Intel Corporate"/>
<hostnames>
</hostnames>
</hosthint>
<hosthint><status state="up" reason="arp-response" reason_ttl="0"/>
<address addr="192.168.1.254" addrtype="ipv4"/>
<address addr="20:66:CF:18:E5:A2" addrtype="mac" vendor="Freebox SAS"/>
<hostnames>
</hostnames>
</hosthint>
<hosthint><status state="up" reason="arp-response" reason_ttl="0"/>
<address addr="192.168.1.98" addrtype="ipv4"/>
<address addr="E4:F0:42:AE:34:1E" addrtype="mac" vendor="Google"/>
<hostnames>
</hostnames>
</hosthint>
<host starttime="1738783635" endtime="1738783636"><status state="up" reason="arp-response" reason_ttl="0"/>
<address addr="192.168.1.20" addrtype="ipv4"/>
<address addr="DA:08:9B:45:7C:FC" addrtype="mac"/>
<hostnames>
</hostnames>
<ports><extraports state="closed" count="97">
<extrareasons reason="reset" count="97" proto="tcp" ports="7,9,13,21,23,25-26,37,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="64"/><service name="ssh" method="table" conf="3"/></port>
<port protocol="tcp" portid="53"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="domain" method="table" conf="3"/></port>
<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="http" method="table" conf="3"/><script id="http-info" output="&#xa; status-line: HTTP/1.1 200 OK&#xd;&#xa;&#xa; status: 200&#xa; title: Welcome page"><elem key="status-line">HTTP/1.1 200 OK&#xd;&#xa;</elem>
<elem key="status">200</elem>
<elem key="title">Welcome page</elem>
</script></port>
</ports>
<times srtt="186" rttvar="26" to="50000"/>
</host>
<host starttime="1738783635" endtime="1738783636"><status state="up" reason="arp-response" reason_ttl="0"/>
<address addr="192.168.1.46" addrtype="ipv4"/>
<address addr="BE:80:98:8E:1D:16" addrtype="mac"/>
<hostnames>
</hostnames>
<ports><extraports state="closed" count="100">
<extrareasons reason="reset" count="100" 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>
</ports>
<times srtt="10978" rttvar="8968" to="50000"/>
</host>
<host starttime="1738783635" endtime="1738783635"><status state="up" reason="arp-response" reason_ttl="0"/>
<address addr="192.168.1.69" addrtype="ipv4"/>
<address addr="28:DF:EB:55:22:A6" addrtype="mac" vendor="Intel Corporate"/>
<hostnames>
</hostnames>
<ports><extraports state="closed" count="100">
<extrareasons reason="reset" count="100" 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>
</ports>
<times srtt="4760" rttvar="809" to="50000"/>
</host>
<host starttime="1738783635" endtime="1738783636"><status state="up" reason="arp-response" reason_ttl="0"/>
<address addr="192.168.1.98" addrtype="ipv4"/>
<address addr="E4:F0:42:AE:34:1E" addrtype="mac" vendor="Google"/>
<hostnames>
</hostnames>
<ports><extraports state="closed" count="97">
<extrareasons reason="reset" count="97" 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,8080-8081,8888,9100,9999-10000,32768,49152-49157"/>
</extraports>
<port protocol="tcp" portid="8008"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="http" method="table" conf="3"/><script id="http-info" output="&#xa; status-line: HTTP/1.1 404 Not Found&#xd;&#xa;&#xa; status: 404"><elem key="status-line">HTTP/1.1 404 Not Found&#xd;&#xa;</elem>
<elem key="status">404</elem>
</script></port>
<port protocol="tcp" portid="8009"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="ajp13" method="table" conf="3"/></port>
<port protocol="tcp" portid="8443"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="https-alt" method="table" conf="3"/><script id="http-info" output="&#xa; status-line: HTTP/1.1 404 Not Found&#xd;&#xa;&#xa; status: 404"><elem key="status-line">HTTP/1.1 404 Not Found&#xd;&#xa;</elem>
<elem key="status">404</elem>
</script></port>
</ports>
<times srtt="5186" rttvar="720" to="50000"/>
</host>
<host starttime="1738783635" endtime="1738783636"><status state="up" reason="arp-response" reason_ttl="0"/>
<address addr="192.168.1.254" addrtype="ipv4"/>
<address addr="20:66:CF:18:E5:A2" addrtype="mac" vendor="Freebox SAS"/>
<hostnames>
<hostname name="mafreebox.freebox.fr" type="PTR"/>
</hostnames>
<ports><extraports state="closed" count="93">
<extrareasons reason="reset" count="93" proto="tcp" ports="7,9,13,22-23,25-26,37,79,81,88,106,110-111,113,119,135,139,143-144,179,199,389,427,444,465,513-515,543-544,548,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,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="21"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="ftp" method="table" conf="3"/></port>
<port protocol="tcp" portid="53"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="domain" method="table" conf="3"/></port>
<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="http" method="table" conf="3"/><script id="http-info" output="&#xa; status-line: HTTP/1.1 200 OK&#xd;&#xa;&#xa; status: 200&#xa; title: Freebox OS&#xa; favicon: /favicon.ico"><elem key="status-line">HTTP/1.1 200 OK&#xd;&#xa;</elem>
<elem key="status">200</elem>
<elem key="title">Freebox OS</elem>
<elem key="favicon">/favicon.ico</elem>
</script></port>
<port protocol="tcp" portid="443"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="https" method="table" conf="3"/><script id="http-info" output="&#xa; status-line: HTTP/1.1 200 OK&#xd;&#xa;&#xa; status: 200&#xa; title: Freebox OS&#xa; favicon: /favicon.ico"><elem key="status-line">HTTP/1.1 200 OK&#xd;&#xa;</elem>
<elem key="status">200</elem>
<elem key="title">Freebox OS</elem>
<elem key="favicon">/favicon.ico</elem>
</script></port>
<port protocol="tcp" portid="445"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="microsoft-ds" method="table" conf="3"/></port>
<port protocol="tcp" portid="554"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="rtsp" method="table" conf="3"/></port>
<port protocol="tcp" portid="5357"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="wsdapi" method="table" conf="3"/></port>
</ports>
<times srtt="98" rttvar="15" to="50000"/>
</host>
<host starttime="1738783636" endtime="1738783637"><status state="up" reason="localhost-response" reason_ttl="0"/>
<address addr="192.168.1.100" addrtype="ipv4"/>
<hostnames>
<hostname name="adrien.malingrey.fr" type="PTR"/>
</hostnames>
<ports><extraports state="closed" count="93">
<extrareasons reason="reset" count="93" proto="tcp" ports="7,9,13,21-23,26,37,79,81,88,106,110-111,113,119,135,139,144,179,199,389,427,444-445,465,513-515,543-544,548,554,631,646,873,990,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="25"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="smtp" method="table" conf="3"/></port>
<port protocol="tcp" portid="53"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="domain" method="table" conf="3"/></port>
<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="http" method="table" conf="3"/><script id="http-info" output="&#xa; status-line: HTTP/1.1 301 Moved Permanently&#xd;&#xa;&#xa; status: 301"><elem key="status-line">HTTP/1.1 301 Moved Permanently&#xd;&#xa;</elem>
<elem key="status">301</elem>
</script></port>
<port protocol="tcp" portid="143"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="imap" method="table" conf="3"/></port>
<port protocol="tcp" portid="443"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="https" method="table" conf="3"/><script id="http-info" output="&#xa; status-line: HTTP/1.1 302 Moved Temporarily&#xd;&#xa;&#xa; status: 302"><elem key="status-line">HTTP/1.1 302 Moved Temporarily&#xd;&#xa;</elem>
<elem key="status">302</elem>
</script></port>
<port protocol="tcp" portid="587"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="submission" method="table" conf="3"/></port>
<port protocol="tcp" portid="993"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="imaps" method="table" conf="3"/></port>
</ports>
<times srtt="16" rttvar="3" to="50000"/>
</host>
<runstats><finished time="1738783637" timestr="Wed Feb 5 20:27:17 2025" summary="Nmap done at Wed Feb 5 20:27:17 2025; 256 IP addresses (6 hosts up) scanned in 4.98 seconds" elapsed="4.98" exit="success"/><hosts up="6" down="250" total="256"/>
</runstats>
</nmaprun>

View File

@ -434,11 +434,11 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
<select id="initialRTTUnit" class="ui clearable dropdown label" <select id="initialRTTUnit" class="ui clearable dropdown label"
oninput="initialRTTHidden.value = initialRTTNumber.value? initialRTTNumber.value+initialRTTUnit.value: ''"> oninput="initialRTTHidden.value = initialRTTNumber.value? initialRTTNumber.value+initialRTTUnit.value: ''">
<option value="">ms</option> <option value="">ms</option>
<option value="s" <?= substr($options["--initial-rtt-timeout"] ?? "", -1) == "s" ? "selected" : "" ?>> <option value="s"
secondes</option> secondes</option>
<option value="m" <?= substr($options["--initial-rtt-timeout"] ?? "", -1) == "m" ? "selected" : "" ?>> <option value="m"
minutes</option> minutes</option>
<option value="h" <?= substr($options["--initial-rtt-timeout"] ?? "", -1) == "h" ? "selected" : "" ?>> <option value="h"
heures</option> heures</option>
</select> </select>
</div> </div>
@ -453,13 +453,13 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
<select id="minRTTUnit" class="ui clearable dropdown label" <select id="minRTTUnit" class="ui clearable dropdown label"
oninput="minRTTHidden.value = minRTTNumber.value? minRTTNumber.value+minRTTUnit.value: ''"> oninput="minRTTHidden.value = minRTTNumber.value? minRTTNumber.value+minRTTUnit.value: ''">
<option value="">ms</option> <option value="">ms</option>
<option value="s" <?= substr($options["--min-rtt-timeout"] ?? "", -1) == "s" ? "selected" : "" ?>> <option value="s"
secondes secondes
</option> </option>
<option value="m" <?= substr($options["--min-rtt-timeout"] ?? "", -1) == "m" ? "selected" : "" ?>> <option value="m"
minutes minutes
</option> </option>
<option value="h" <?= substr($options["--min-rtt-timeout"] ?? "", -1) == "h" ? "selected" : "" ?>> <option value="h"
heures heures
</option> </option>
</select> </select>
@ -475,13 +475,13 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
<select id="maxRTTUnit" class="ui clearable dropdown label" <select id="maxRTTUnit" class="ui clearable dropdown label"
oninput="maxRTTHidden.value = maxRTTNumber.value? maxRTTNumber.value+maxRTTUnit.value: ''"> oninput="maxRTTHidden.value = maxRTTNumber.value? maxRTTNumber.value+maxRTTUnit.value: ''">
<option value="">ms</option> <option value="">ms</option>
<option value="s" <?= substr($options["--max-rtt-timeout"] ?? "", -1) == "s" ? "selected" : "" ?>> <option value="s"
secondes secondes
</option> </option>
<option value="m" <?= substr($options["--max-rtt-timeout"] ?? "", -1) == "m" ? "selected" : "" ?>> <option value="m"
minutes minutes
</option> </option>
<option value="h" <?= substr($options["--max-rtt-timeout"] ?? "", -1) == "h" ? "selected" : "" ?>> <option value="h"
heures heures
</option> </option>
</select> </select>
@ -506,11 +506,11 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
<select id="hostTimoutUnit" class="ui clearable dropdown label" <select id="hostTimoutUnit" class="ui clearable dropdown label"
oninput="hostTimoutHidden.value = hostTimoutNumber.value? hostTimoutNumber.value+hostTimoutUnit.value: ''"> oninput="hostTimoutHidden.value = hostTimoutNumber.value? hostTimoutNumber.value+hostTimoutUnit.value: ''">
<option value="">ms</option> <option value="">ms</option>
<option value="s" <?= substr($options["--host-timeout"] ?? "", -1) == "s" ? "selected" : "" ?>>secondes <option value="s"secondes
</option> </option>
<option value="m" <?= substr($options["--host-timeout"] ?? "", -1) == "m" ? "selected" : "" ?>>minutes <option value="m"minutes
</option> </option>
<option value="h" <?= substr($options["--host-timeout"] ?? "", -1) == "h" ? "selected" : "" ?>>heures <option value="h"heures
</option> </option>
</select> </select>
</div> </div>
@ -527,11 +527,11 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
<select id="scanDelayUnit" class="ui clearable dropdown label" <select id="scanDelayUnit" class="ui clearable dropdown label"
oninput="scanDelayHidden.value = scanDelayNumber.value? scanDelayNumber.value+scanDelayUnit.value: ''"> oninput="scanDelayHidden.value = scanDelayNumber.value? scanDelayNumber.value+scanDelayUnit.value: ''">
<option value="">ms</option> <option value="">ms</option>
<option value="s" <?= substr($options["--scan-delay"] ?? "", -1) == "s" ? "selected" : "" ?>>secondes <option value="s"secondes
</option> </option>
<option value="m" <?= substr($options["--scan-delay"] ?? "", -1) == "m" ? "selected" : "" ?>>minutes <option value="m"minutes
</option> </option>
<option value="h" <?= substr($options["--scan-delay"] ?? "", -1) == "h" ? "selected" : "" ?>>heures <option value="h"heures
</option> </option>
</select> </select>
</div> </div>
@ -546,13 +546,13 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
<select id="maxRTTUnit" class="ui clearable dropdown label" <select id="maxRTTUnit" class="ui clearable dropdown label"
oninput="maxRTTHidden.value = maxScanDelay.value? maxScanDelay.value+maxRTTUnit.value: ''"> oninput="maxRTTHidden.value = maxScanDelay.value? maxScanDelay.value+maxRTTUnit.value: ''">
<option value="">ms</option> <option value="">ms</option>
<option value="s" <?= substr($options["--max-scan-delay"] ?? "", -1) == "s" ? "selected" : "" ?>> <option value="s"
secondes secondes
</option> </option>
<option value="m" <?= substr($options["--max-scan-delay"] ?? "", -1) == "m" ? "selected" : "" ?>> <option value="m"
minutes minutes
</option> </option>
<option value="h" <?= substr($options["--max-scan-delay"] ?? "", -1) == "h" ? "selected" : "" ?>>heures <option value="h"heures
</option> </option>
</select> </select>
</div> </div>

View File

@ -10,7 +10,7 @@ $fileNameRegex = '/^[^<>:\/|?]+$/';
$name = filter_input(INPUT_GET, 'name', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $fileNameRegex], "flags" => FILTER_NULL_ON_FAILURE]); $name = filter_input(INPUT_GET, 'name', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $fileNameRegex], "flags" => FILTER_NULL_ON_FAILURE]);
if (!$name) { if (!$name) {
die("Paramètre manquant : name"); die("Paramètre manquant ou incorrect : name");
} }
$path = "$SCANSDIR/$name.xml"; $path = "$SCANSDIR/$name.xml";

View File

@ -9,13 +9,13 @@ $name = filter_input(INPUT_GET, 'name', FILTER_VALIDATE_REGEXP, ['options' => ['
$lan = filter_input(INPUT_GET, 'lan', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]); $lan = filter_input(INPUT_GET, 'lan', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
if ($lan) { if ($lan) {
$cmd = "$NMAP $LANSCANOPTIONS $lan"; $cmd = "$NMAP $LANSCANOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/lanScan.xsl?name=$name&' -oX - $lan";
$filename = str_replace("/", "!", $lan); $filename = str_replace("/", "!", $lan);
} }
$host = filter_input(INPUT_GET, 'host', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]); $host = filter_input(INPUT_GET, 'host', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
if ($host) { if ($host) {
$cmd = "$NMAP $HOSTSCANOPTIONS $host"; $cmd = "$NMAP $HOSTSCANOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/hostScan.xsl?name=$name&' -oX - $host";
$filename = str_replace("/", "!", $host); $filename = str_replace("/", "!", $host);
} }
@ -145,7 +145,7 @@ if ($targets) {
} }
} }
$cmd = "$NMAP$options $CUSTOMSCANOPTIONS $targets"; $cmd = "$NMAP$options $CUSTOMSCANOPTIONS --stylesheet $BASEDIR/$STYLESHEETSDIR/lanScan.xsl?name=$name&' -oX - $targets";
$filename = str_replace("/", "!", $targets); $filename = str_replace("/", "!", $targets);
} }
@ -153,8 +153,8 @@ if ($cmd) {
if ($name) { if ($name) {
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR); if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
$path = "$SCANSDIR/" . escapeshellarg($name) . ".xml"; $path = "$SCANSDIR/$name.xml";
$cmd .= " | tee '$path'"; $cmd .= " | tee " .escapeshellarg($path);
} }
header('Content-type: text/xml'); header('Content-type: text/xml');

View File

@ -1,31 +0,0 @@
<?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 - -&#45;stylesheet https://adrien.malingrey.fr/dev/lanScan4/stylesheets/lanScan.xsl scanme.nmap.org -->
<nmaprun scanner="nmap" args="nmap -PSmicrosoft-ds -F -T5 -oX - -&#45;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>

View File

@ -4,12 +4,22 @@
<xsl:template match="nmaprun" mode="head"> <xsl:template match="nmaprun" mode="head">
<xsl:param name="base" /> <xsl:param name="base" />
<xsl:param name="name" />
<xsl:param name="targets" /> <xsl:param name="targets" />
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="refresh" content="300" /> <meta http-equiv="refresh" content="300" />
<title>lanScan - <xsl:value-of select="$targets" /> <title>
<xsl:text>lanScan - </xsl:text>
<xsl:choose>
<xsl:when test="$name">
<xsl:value-of select="$name" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$targets" />
</xsl:otherwise>
</xsl:choose>
</title> </title>
<base href="{$base}" /> <base href="{$base}" />
<link rel="icon" href="favicon.ico" /> <link rel="icon" href="favicon.ico" />

View File

@ -11,17 +11,19 @@
<xsl:output indent="yes" /> <xsl:output indent="yes" />
<xsl:strip-space elements='*' /> <xsl:strip-space elements='*' />
<xsl:variable name="stylesheetURL" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href=&quot;'), '&quot;')" /> <xsl:variable name="stylesheetURL" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href=&quot;'), '?')" />
<xsl:variable name="base" select="concat($stylesheetURL, '/../../')" /> <xsl:variable name="base" select="concat($stylesheetURL, '/../../')" />
<xsl:variable name="name" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'name='), '&amp;')" />
<xsl:template match="nmaprun"> <xsl:template match="nmaprun">
<xsl:variable name="targets" select="substring-after(@args, '.xsl ')" /> <xsl:variable name="targets" select="substring-after(@args, '-oX - ')" />
<xsl:variable name="current" select="." /> <xsl:variable name="current" select="." />
<xsl:variable name="init" select="document(concat($base, 'scans/', translate($targets,'/', '!'), '.xml'))/nmaprun" /> <xsl:variable name="init" select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
<html lang="fr"> <html lang="fr">
<xsl:apply-templates select="." mode="head"> <xsl:apply-templates select="." mode="head">
<xsl:with-param name="base" select="$base" /> <xsl:with-param name="base" select="$base" />
<xsl:with-param name="name" select="$name" />
<xsl:with-param name="targets" select="$targets" /> <xsl:with-param name="targets" select="$targets" />
</xsl:apply-templates> </xsl:apply-templates>

View File

@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.1">
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="1.1">
<xsl:import href="head.xsl" /> <xsl:import href="head.xsl" />
<xsl:import href="nav.xsl" /> <xsl:import href="nav.xsl" />
@ -13,21 +11,19 @@
<xsl:output indent="yes" /> <xsl:output indent="yes" />
<xsl:strip-space elements='*' /> <xsl:strip-space elements='*' />
<xsl:variable name="stylesheetURL" <xsl:variable name="stylesheetURL" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href=&quot;'), '?')" />
select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href=&quot;'), '&quot;')" />
<xsl:variable name="base" select="concat($stylesheetURL, '/../../')" /> <xsl:variable name="base" select="concat($stylesheetURL, '/../../')" />
<xsl:variable name="name" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'name='), '&amp;')" />
<xsl:template match="nmaprun"> <xsl:template match="nmaprun">
<xsl:variable name="targets" select="substring-after(@args, '.xsl ')" /> <xsl:variable name="targets" select="substring-after(@args, '-oX - ')" />
<xsl:variable <xsl:variable name="current" select="." />
name="current" select="." /> <xsl:variable name="init" select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
<xsl:variable name="init"
select="document(concat($base, 'scans/', translate($targets,'/', '!'), '.xml'))/nmaprun" />
<html <html lang="fr">
lang="fr">
<xsl:apply-templates select="." mode="head"> <xsl:apply-templates select="." mode="head">
<xsl:with-param name="base" select="$base" /> <xsl:with-param name="base" select="$base" />
<xsl:with-param name="name" select="$name" />
<xsl:with-param name="targets" select="$targets" /> <xsl:with-param name="targets" select="$targets" />
</xsl:apply-templates> </xsl:apply-templates>
@ -36,12 +32,21 @@
</xsl:apply-templates> </xsl:apply-templates>
<main class="ui main container inverted segment"> <main class="ui main container inverted segment">
<h1> <h1 class="ui header">
<xsl:choose>
<xsl:when test="$name">
<xsl:value-of select="$name" />
<div class="sub header">
<xsl:value-of select="$targets" /> <xsl:value-of select="$targets" />
</div>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$targets" />
</xsl:otherwise>
</xsl:choose>
</h1> </h1>
<table id="scanResultsTable" style="width:100%" role="grid" <table id="scanResultsTable" style="width:100%" role="grid" class="ui sortable small compact stuck striped table">
class="ui sortable small compact stuck striped table">
<thead> <thead>
<tr> <tr>
<th style="width: min-width">Etat</th> <th style="width: min-width">Etat</th>
@ -53,8 +58,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<xsl:apply-templates <xsl:apply-templates select="host | $init/host[not(address/@addr=$current/host/address/@addr)][not(status/@state='down')]">
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="init" select="$init" />
<xsl:with-param name="current" select="$current" /> <xsl:with-param name="current" select="$current" />
</xsl:apply-templates> </xsl:apply-templates>
@ -90,12 +94,9 @@ $('.ui.dropdown').dropdown()
<xsl:template match="host"> <xsl:template match="host">
<xsl:param name="init" /> <xsl:param name="init" />
<xsl:param name="current" /> <xsl:param name="current" />
<xsl:variable name="addr" <xsl:variable name="addr" select="address/@addr" />
select="address/@addr" /> <xsl:variable name="initHost" select="$init/host[address/@addr=$addr]" />
<xsl:variable name="initHost" <xsl:variable name="currentHost" select="$current/host[address/@addr=$addr]" />
select="$init/host[address/@addr=$addr]" />
<xsl:variable name="currentHost"
select="$current/host[address/@addr=$addr]" />
<xsl:variable name="hostAddress"> <xsl:variable name="hostAddress">
<xsl:choose> <xsl:choose>
<xsl:when test="hostnames/hostname/@name"> <xsl:when test="hostnames/hostname/@name">
@ -127,7 +128,9 @@ $('.ui.dropdown').dropdown()
<xsl:value-of select="$currentHost/status/@state" /> <xsl:value-of select="$currentHost/status/@state" />
</div> </div>
</xsl:when> </xsl:when>
<xsl:otherwise><div class="ui mini circular label red">down</div></xsl:otherwise> <xsl:otherwise>
<div class="ui mini circular label red">down</div>
</xsl:otherwise>
</xsl:choose> </xsl:choose>
</td> </td>
<td> <td>
@ -138,16 +141,15 @@ $('.ui.dropdown').dropdown()
<xsl:value-of select="substring-before(hostnames/hostname/@name, '.')" /> <xsl:value-of select="substring-before(hostnames/hostname/@name, '.')" />
</b> </b>
<xsl:if test="substring-after(hostnames/hostname/@name, '.')"> <xsl:if test="substring-after(hostnames/hostname/@name, '.')">
<wbr />.<xsl:value-of select="substring-after(hostnames/hostname/@name, '.')" /> <wbr />
. <xsl:value-of select="substring-after(hostnames/hostname/@name, '.')" />
</xsl:if> </xsl:if>
</td> </td>
<td> <td>
<xsl:value-of select="address[@addrtype='mac']/@vendor" /> <xsl:value-of select="address[@addrtype='mac']/@vendor" />
</td> </td>
<td> <td>
<xsl:apply-templates <xsl:apply-templates select="ports/port | $initHost/ports/port[not(state/@state='closed')][not(@portid=$currentHost/ports/port/@portid)]" mode="service">
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="initHost" select="$initHost" />
<xsl:with-param name="currentHost" select="$currentHost" /> <xsl:with-param name="currentHost" select="$currentHost" />
<xsl:with-param name="hostAddress" select="$hostAddress" /> <xsl:with-param name="hostAddress" select="$hostAddress" />
@ -157,7 +159,8 @@ $('.ui.dropdown').dropdown()
</td> </td>
<td> <td>
<a class="ui mini icon teal icon button" target="_blank" title="Scan intensif"> <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> <xsl:attribute name="href">scan.php?host=<xsl:value-of select="$hostAddress" />
</xsl:attribute>
<i class="search plus icon"></i> <i class="search plus icon"></i>
</a> </a>
</td> </td>

View File

@ -1,14 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.1">
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="1.1">
<xsl:template match="nmaprun" mode="nav"> <xsl:template match="nmaprun" mode="nav">
<nav class="ui inverted secondary menu"> <nav class="ui inverted secondary menu">
<a href="." class="ui header button item logo">lan<svg class="logo" version="1.1" id="Layer_1" <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"
x="0px"
y="0px" viewBox="0 0 24 24" xml:space="preserve" width="40" height="40"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"> xmlns:svg="http://www.w3.org/2000/svg">
<defs id="defs206"></defs> <defs id="defs206"></defs>
@ -57,18 +53,20 @@
</svg> </svg>
can</a> can</a>
<div class="right menu"> <div class="right menu">
<form class="ui right aligned category search item" id="scanForm" action="scan.php" <form class="ui right aligned category search item" id="scanForm" action="scan.php" method="get">
method="get">
<div class="ui inverted icon input" id="targetsInputDiv"> <div class="ui inverted icon input" id="targetsInputDiv">
<input name="lan" class="prompt" type="text" placeholder="Scanner un réseau" <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.
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" /> Exemples: 192.168.1.0/24 scanme.nmap.org 10.0-255.0-255.1-254" />
<i class="satellite dish icon"></i> <i class="satellite dish icon"></i>
</div> </div>
<a class="button item" href="options.php" title="Actualiser"> <a class="button item" href="options.php" title="Options avancées">
<i class="settings icon"></i> <i class="settings icon"></i>
</a> </a>
<xsl:if test="$name">
<a class="button item" id="refreshLink" href="rescan.php?name={$name}" title="Actualiser">
<i class='sync icon'></i>
</a>
</xsl:if>
</form> </form>
</div> </div>
</nav> </nav>
@ -87,6 +85,18 @@ scanForm.onsubmit = function(event) {
position : 'bottom right', position : 'bottom right',
}) })
} }
}
refreshLink.onclick = function(event) {
refreshLink.getElementsByTagName('i')[0].className = 'loading spinner icon'
$.toast({
title : 'Scan en cours...',
message : 'Merci de patienter',
class : 'info',
showIcon : 'satellite dish',
displayTime: 0,
closeIcon : true,
position : 'bottom right',
})
} }
</script> </script>
</xsl:template> </xsl:template>